From faa4f979922520a91f09d745355d6eb543cce0ba Mon Sep 17 00:00:00 2001 From: ThisTestUser Date: Sun, 28 May 2023 11:50:57 -0400 Subject: [PATCH 01/54] AutoLeave totem check --- .../net/wurstclient/hacks/AutoLeaveHack.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java index 3bbf60b4..69bc50ff 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java @@ -7,6 +7,9 @@ */ package net.wurstclient.hacks; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.wurstclient.Category; @@ -36,6 +39,12 @@ public final class AutoLeaveHack extends Hack implements UpdateListener + "Bypasses both CombatLog and NoCheat+.", Mode.values(), Mode.QUIT); + private final SliderSetting totems = new SliderSetting("Totems", + "Effectively disables AutoLeave until the number of totems you have is at or below this value.\n" + + "Drag the slider to the right to turn off this feature.", + 11, 0, 11, 1, ValueDisplay.INTEGER.withSuffix(" totems") + .withLabel(11, "unlimited")); + public AutoLeaveHack() { super("AutoLeave"); @@ -43,6 +52,7 @@ public final class AutoLeaveHack extends Hack implements UpdateListener setCategory(Category.COMBAT); addSetting(health); addSetting(mode); + addSetting(totems); } @Override @@ -79,6 +89,10 @@ public final class AutoLeaveHack extends Hack implements UpdateListener if(MC.player.getHealth() > health.getValueF() * 2F) return; + // check totems + if(totems.getValueI() != 11 && countTotems(MC.player.getInventory()) > totems.getValueI()) + return; + // leave server switch(mode.getSelected()) { @@ -106,6 +120,21 @@ public final class AutoLeaveHack extends Hack implements UpdateListener setEnabled(false); } + private int countTotems(PlayerInventory inventory) + { + int totems = 0; + + for(int slot = 0; slot <= 36; slot++) + if(inventory.getStack(slot).getItem() == Items.TOTEM_OF_UNDYING) + totems++; + + ItemStack offhandStack = inventory.getStack(40); + if(offhandStack.getItem() == Items.TOTEM_OF_UNDYING) + totems++; + + return totems; + } + public static enum Mode { QUIT("Quit"), From 8257cc7f532af1e447242331bf729a3fa240c608 Mon Sep 17 00:00:00 2001 From: ThisTestUser Date: Tue, 2 Jan 2024 11:52:51 -0500 Subject: [PATCH 02/54] Cleanup --- .../java/net/wurstclient/hacks/AutoLeaveHack.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java index 298d5ca9..8cb22ba2 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java @@ -44,12 +44,12 @@ public final class AutoLeaveHack extends Hack implements UpdateListener "Disable AutoReconnect", "Automatically turns off AutoReconnect when" + " AutoLeave makes you leave the server.", true); - - private final SliderSetting totems = new SliderSetting("Totems", + + private final SliderSetting totems = new SliderSetting("Totems", "Effectively disables AutoLeave until the number of totems you have is at or below this value.\n" + "Drag the slider to the right to turn off this feature.", - 11, 0, 11, 1, ValueDisplay.INTEGER.withSuffix(" totems") - .withLabel(11, "unlimited")); + 11, 0, 11, 1, + ValueDisplay.INTEGER.withSuffix(" totems").withLabel(11, "unlimited")); public AutoLeaveHack() { @@ -58,7 +58,7 @@ public final class AutoLeaveHack extends Hack implements UpdateListener addSetting(health); addSetting(mode); addSetting(disableAutoReconnect); - addSetting(totems); + addSetting(totems); } @Override @@ -97,7 +97,8 @@ public final class AutoLeaveHack extends Hack implements UpdateListener return; // check totems - if(totems.getValueI() != 11 && countTotems(MC.player.getInventory()) > totems.getValueI()) + if(totems.getValueI() != 11 + && countTotems(MC.player.getInventory()) > totems.getValueI()) return; // leave server @@ -137,7 +138,7 @@ public final class AutoLeaveHack extends Hack implements UpdateListener for(int slot = 0; slot <= 36; slot++) if(inventory.getStack(slot).getItem() == Items.TOTEM_OF_UNDYING) totems++; - + ItemStack offhandStack = inventory.getStack(40); if(offhandStack.getItem() == Items.TOTEM_OF_UNDYING) totems++; From 6474a89e9792925a3e0b095a91c6d8e118de8da4 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 20 May 2024 11:51:09 +0200 Subject: [PATCH 03/54] Use getOffHandStack() method for slot 40 --- .../java/net/wurstclient/hacks/AutoLeaveHack.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java index 0e00d143..a94837aa 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java @@ -7,8 +7,8 @@ */ package net.wurstclient.hacks; +import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.entity.player.PlayerInventory; -import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; @@ -97,8 +97,7 @@ public final class AutoLeaveHack extends Hack implements UpdateListener return; // check totems - if(totems.getValueI() != 11 - && countTotems(MC.player.getInventory()) > totems.getValueI()) + if(totems.getValueI() < 11 && countTotems() > totems.getValueI()) return; // leave server @@ -131,16 +130,17 @@ public final class AutoLeaveHack extends Hack implements UpdateListener WURST.getHax().autoReconnectHack.setEnabled(false); } - private int countTotems(PlayerInventory inventory) + private int countTotems() { + ClientPlayerEntity player = MC.player; + PlayerInventory inventory = player.getInventory(); int totems = 0; for(int slot = 0; slot <= 36; slot++) - if(inventory.getStack(slot).getItem() == Items.TOTEM_OF_UNDYING) + if(inventory.getStack(slot).isOf(Items.TOTEM_OF_UNDYING)) totems++; - ItemStack offhandStack = inventory.getStack(40); - if(offhandStack.getItem() == Items.TOTEM_OF_UNDYING) + if(player.getOffHandStack().isOf(Items.TOTEM_OF_UNDYING)) totems++; return totems; From 138faa47445c8bc1bac5b6ee8824bda6f3ef1c4b Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 20 May 2024 12:59:12 +0200 Subject: [PATCH 04/54] Update AutoLeave --- .../net/wurstclient/hacks/AutoLeaveHack.java | 64 +++++++------------ 1 file changed, 23 insertions(+), 41 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java index a94837aa..8d9d896a 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java @@ -11,7 +11,6 @@ import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.Items; import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; -import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.UpdateListener; @@ -32,11 +31,12 @@ public final class AutoLeaveHack extends Hack implements UpdateListener public final EnumSetting mode = new EnumSetting<>("Mode", "\u00a7lQuit\u00a7r mode just quits the game normally.\n" + "Bypasses NoCheat+ but not CombatLog.\n\n" - + "\u00a7lChars\u00a7r mode sends a special chat message that causes the server to kick you.\n" + + "\u00a7lChars\u00a7r mode sends a special chat message that" + + " causes the server to kick you.\n" + "Bypasses NoCheat+ and some versions of CombatLog.\n\n" - + "\u00a7lTP\u00a7r mode teleports you to an invalid location, causing the server to kick you.\n" - + "Bypasses CombatLog, but not NoCheat+.\n\n" - + "\u00a7lSelfHurt\u00a7r mode sends the packet for attacking another player, but with yourself as both the attacker and the target. This causes the server to kick you.\n" + + "\u00a7lSelfHurt\u00a7r mode sends the packet for attacking" + + " another player, but with yourself as both the attacker and the" + + " target, causing the server to kick you.\n" + "Bypasses both CombatLog and NoCheat+.", Mode.values(), Mode.QUIT); @@ -46,10 +46,11 @@ public final class AutoLeaveHack extends Hack implements UpdateListener true); private final SliderSetting totems = new SliderSetting("Totems", - "Effectively disables AutoLeave until the number of totems you have is at or below this value.\n" - + "Drag the slider to the right to turn off this feature.", - 11, 0, 11, 1, - ValueDisplay.INTEGER.withSuffix(" totems").withLabel(11, "unlimited")); + "Won't leave the server until the number of totems you have reaches" + + " this value or falls below it.\n\n" + + "11 = always able to leave", + 11, 0, 11, 1, ValueDisplay.INTEGER.withSuffix(" totems") + .withLabel(1, "1 totem").withLabel(11, "ignore")); public AutoLeaveHack() { @@ -64,6 +65,9 @@ public final class AutoLeaveHack extends Hack implements UpdateListener @Override public String getRenderName() { + if(MC.player.getAbilities().creativeMode) + return getName() + " (paused)"; + return getName() + " [" + mode.getSelected() + "]"; } @@ -86,11 +90,6 @@ public final class AutoLeaveHack extends Hack implements UpdateListener if(MC.player.getAbilities().creativeMode) return; - // check for other players - if(MC.isInSingleplayer() - && MC.player.networkHandler.getPlayerList().size() == 1) - return; - // check health float currentHealth = MC.player.getHealth(); if(currentHealth <= 0F || currentHealth > health.getValueF() * 2F) @@ -101,27 +100,7 @@ public final class AutoLeaveHack extends Hack implements UpdateListener return; // leave server - switch(mode.getSelected()) - { - case QUIT: - MC.world.disconnect(); - break; - - case CHARS: - MC.getNetworkHandler().sendChatMessage("\u00a7"); - break; - - case TELEPORT: - MC.player.networkHandler - .sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(3.1e7, - 100, 3.1e7, false)); - break; - - case SELFHURT: - MC.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket - .attack(MC.player, MC.player.isSneaking())); - break; - } + mode.getSelected().leave.run(); // disable setEnabled(false); @@ -148,19 +127,22 @@ public final class AutoLeaveHack extends Hack implements UpdateListener public static enum Mode { - QUIT("Quit"), + QUIT("Quit", () -> MC.world.disconnect()), - CHARS("Chars"), + CHARS("Chars", () -> MC.getNetworkHandler().sendChatMessage("\u00a7")), - TELEPORT("TP"), - - SELFHURT("SelfHurt"); + SELFHURT("SelfHurt", + () -> MC.getNetworkHandler() + .sendPacket(PlayerInteractEntityC2SPacket.attack(MC.player, + MC.player.isSneaking()))); private final String name; + private final Runnable leave; - private Mode(String name) + private Mode(String name, Runnable leave) { this.name = name; + this.leave = leave; } @Override From 97be44afe4f0db69873c0b503ad38c0b8c0ce529 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 20 May 2024 13:50:38 +0200 Subject: [PATCH 05/54] Update AutoTotem --- .../net/wurstclient/hacks/AutoTotemHack.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java index 03364709..64fc2b15 100644 --- a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java @@ -32,10 +32,10 @@ public final class AutoTotemHack extends Hack implements UpdateListener ValueDisplay.INTEGER); private final SliderSetting health = new SliderSetting("Health", - "Effectively disables AutoTotem until your health reaches this value or falls below it.\n" - + "0 = always active", - 0, 0, 10, 0.5, - ValueDisplay.DECIMAL.withSuffix(" hearts").withLabel(0, "ignore")); + "Won't equip a totem until your health reaches this value or falls" + + " below it.\n" + "0 = always active", + 0, 0, 10, 0.5, ValueDisplay.DECIMAL.withSuffix(" hearts") + .withLabel(1, "1 heart").withLabel(0, "ignore")); private int nextTickSlot; private int totems; @@ -57,14 +57,10 @@ public final class AutoTotemHack extends Hack implements UpdateListener if(!showCounter.isChecked()) return getName(); - switch(totems) - { - case 1: + if(totems == 1) return getName() + " [1 totem]"; - - default: - return getName() + " [" + totems + " totems]"; - } + + return getName() + " [" + totems + " totems]"; } @Override From 0a4489e56eee14e653b7565b1bf2e47ab7fd0e4f Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 20 May 2024 14:14:55 +0200 Subject: [PATCH 06/54] Further refactor AutoTotemHack --- .../net/wurstclient/hacks/AutoTotemHack.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java index 64fc2b15..38b23519 100644 --- a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java @@ -84,11 +84,9 @@ public final class AutoTotemHack extends Hack implements UpdateListener { finishMovingTotem(); - PlayerInventory inventory = MC.player.getInventory(); - int nextTotemSlot = searchForTotems(inventory); + int nextTotemSlot = searchForTotems(); - ItemStack offhandStack = inventory.getStack(40); - if(isTotem(offhandStack)) + if(isTotem(MC.player.getOffHandStack())) { totems++; wasTotemInOffhand = true; @@ -101,36 +99,37 @@ public final class AutoTotemHack extends Hack implements UpdateListener wasTotemInOffhand = false; } + if(nextTotemSlot == -1) + return; + float healthF = health.getValueF(); if(healthF > 0 && MC.player.getHealth() > healthF * 2F) return; + // don't move items while a container is open if(MC.currentScreen instanceof HandledScreen && !(MC.currentScreen instanceof AbstractInventoryScreen)) return; - if(nextTotemSlot == -1) - return; - if(timer > 0) { timer--; return; } - moveTotem(nextTotemSlot, offhandStack); + moveToOffhand(nextTotemSlot); } - private void moveTotem(int nextTotemSlot, ItemStack offhandStack) + private void moveToOffhand(int itemSlot) { - boolean offhandEmpty = offhandStack.isEmpty(); + boolean offhandEmpty = MC.player.getOffHandStack().isEmpty(); IClientPlayerInteractionManager im = IMC.getInteractionManager(); - im.windowClick_PICKUP(nextTotemSlot); + im.windowClick_PICKUP(itemSlot); im.windowClick_PICKUP(45); if(!offhandEmpty) - nextTickSlot = nextTotemSlot; + nextTickSlot = itemSlot; } private void finishMovingTotem() @@ -143,10 +142,11 @@ public final class AutoTotemHack extends Hack implements UpdateListener nextTickSlot = -1; } - private int searchForTotems(PlayerInventory inventory) + private int searchForTotems() { - totems = 0; + PlayerInventory inventory = MC.player.getInventory(); int nextTotemSlot = -1; + totems = 0; for(int slot = 0; slot <= 36; slot++) { From 05004d6b637a4752d255586bbeab70b334f530ed Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 20 May 2024 14:26:34 +0200 Subject: [PATCH 07/54] Make InventoryUtils.toNetworkSlot() public --- .../net/wurstclient/hacks/AutoTotemHack.java | 3 ++- .../net/wurstclient/hacks/RestockHack.java | 23 ++++--------------- .../net/wurstclient/util/InventoryUtils.java | 2 +- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java index 38b23519..e27ec6d2 100644 --- a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java @@ -20,6 +20,7 @@ import net.wurstclient.mixinterface.IClientPlayerInteractionManager; import net.wurstclient.settings.CheckboxSetting; import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; +import net.wurstclient.util.InventoryUtils; @SearchTags({"auto totem", "offhand", "off-hand"}) public final class AutoTotemHack extends Hack implements UpdateListener @@ -156,7 +157,7 @@ public final class AutoTotemHack extends Hack implements UpdateListener totems++; if(nextTotemSlot == -1) - nextTotemSlot = slot < 9 ? slot + 36 : slot; + nextTotemSlot = InventoryUtils.toNetworkSlot(slot); } return nextTotemSlot; diff --git a/src/main/java/net/wurstclient/hacks/RestockHack.java b/src/main/java/net/wurstclient/hacks/RestockHack.java index 44604420..1cae02c7 100644 --- a/src/main/java/net/wurstclient/hacks/RestockHack.java +++ b/src/main/java/net/wurstclient/hacks/RestockHack.java @@ -25,6 +25,7 @@ import net.wurstclient.mixinterface.IClientPlayerInteractionManager; import net.wurstclient.settings.ItemListSetting; import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; +import net.wurstclient.util.InventoryUtils; @SearchTags({"AutoRestock", "auto-restock", "auto restock"}) public final class RestockHack extends Hack implements UpdateListener @@ -106,10 +107,10 @@ public final class RestockHack extends Hack implements UpdateListener searchSlotsWithItem(itemName, hotbarSlot); for(int itemIndex : searchResult) { - int pickupIndex = dataSlotToNetworkSlot(itemIndex); + int pickupIndex = InventoryUtils.toNetworkSlot(itemIndex); im.windowClick_PICKUP(pickupIndex); - im.windowClick_PICKUP(dataSlotToNetworkSlot(hotbarSlot)); + im.windowClick_PICKUP(InventoryUtils.toNetworkSlot(hotbarSlot)); if(!MC.player.playerScreenHandler.getCursorStack().isEmpty()) im.windowClick_PICKUP(pickupIndex); @@ -135,7 +136,7 @@ public final class RestockHack extends Hack implements UpdateListener if(stack.isEmpty() || !stack.isDamageable()) { IMC.getInteractionManager().windowClick_SWAP(i, - dataSlotToNetworkSlot(hotbarSlot)); + InventoryUtils.toNetworkSlot(hotbarSlot)); break; } } @@ -147,22 +148,6 @@ public final class RestockHack extends Hack implements UpdateListener .getValueI(); } - private int dataSlotToNetworkSlot(int index) - { - // hotbar - if(index >= 0 && index <= 8) - return index + 36; - - // main inventory - if(index >= 9 && index <= 35) - return index; - - if(index == OFFHAND_ID) - return OFFHAND_PKT_ID; - - throw new IllegalArgumentException("unimplemented data slot"); - } - private List searchSlotsWithItem(String itemName, int slotToSkip) { List slots = new ArrayList<>(); diff --git a/src/main/java/net/wurstclient/util/InventoryUtils.java b/src/main/java/net/wurstclient/util/InventoryUtils.java index 1f290c62..b221eafe 100644 --- a/src/main/java/net/wurstclient/util/InventoryUtils.java +++ b/src/main/java/net/wurstclient/util/InventoryUtils.java @@ -172,7 +172,7 @@ public enum InventoryUtils return true; } - private static int toNetworkSlot(int slot) + public static int toNetworkSlot(int slot) { // hotbar if(slot >= 0 && slot < 9) From d619c2aa502bcfef31b9e8f6ebdb3eabea876a60 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 20 May 2024 14:48:23 +0200 Subject: [PATCH 08/54] Allow AutoTotem to take totems from armor slots --- src/main/java/net/wurstclient/hacks/AutoTotemHack.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java index e27ec6d2..a8e47872 100644 --- a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java @@ -149,7 +149,7 @@ public final class AutoTotemHack extends Hack implements UpdateListener int nextTotemSlot = -1; totems = 0; - for(int slot = 0; slot <= 36; slot++) + for(int slot = 0; slot <= 40; slot++) { if(!isTotem(inventory.getStack(slot))) continue; From d11b0d67b58f59e8c3ff592dcf0ea927e469eb6f Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 20 May 2024 15:19:38 +0200 Subject: [PATCH 09/54] Add count method to InventoryUtils --- .../net/wurstclient/util/InventoryUtils.java | 60 +++++++++++++++++-- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/wurstclient/util/InventoryUtils.java b/src/main/java/net/wurstclient/util/InventoryUtils.java index b221eafe..a067f0a3 100644 --- a/src/main/java/net/wurstclient/util/InventoryUtils.java +++ b/src/main/java/net/wurstclient/util/InventoryUtils.java @@ -67,6 +67,59 @@ public enum InventoryUtils */ public static int indexOf(Predicate predicate, int maxInvSlot, boolean includeOffhand) + { + return getMatchingSlots(predicate, maxInvSlot, includeOffhand) + .findFirst().orElse(-1); + } + + public static int count(Item item) + { + return count(stack -> stack.isOf(item), 36, false); + } + + public static int count(Item item, int maxInvSlot) + { + return count(stack -> stack.isOf(item), maxInvSlot, false); + } + + public static int count(Item item, int maxInvSlot, boolean includeOffhand) + { + return count(stack -> stack.isOf(item), maxInvSlot, includeOffhand); + } + + public static int count(Predicate predicate) + { + return count(predicate, 36, false); + } + + public static int count(Predicate predicate, int maxInvSlot) + { + return count(predicate, maxInvSlot, false); + } + + /** + * Counts the number of items in the player's inventory that match the given + * predicate, searching from slot 0 to {@code maxInvSlot-1}. + * + * @param predicate + * checks if an item should be counted + * @param maxInvSlot + * the maximum slot to search (exclusive), usually 9 for the + * hotbar or 36 for the whole inventory + * @param includeOffhand + * also search the offhand (slot 40), even if maxInvSlot is lower + * @return + * the number of matching items in the player's inventory + */ + public static int count(Predicate predicate, int maxInvSlot, + boolean includeOffhand) + { + return (int)getMatchingSlots(predicate, maxInvSlot, includeOffhand) + .count(); + } + + private static IntStream getMatchingSlots(Predicate predicate, + int maxInvSlot, boolean includeOffhand) { PlayerInventory inventory = MC.player.getInventory(); @@ -75,11 +128,8 @@ public enum InventoryUtils if(includeOffhand) stream = IntStream.concat(stream, IntStream.of(40)); - // find the slot of the item we want - int slot = stream.filter(i -> predicate.test(inventory.getStack(i))) - .findFirst().orElse(-1); - - return slot; + // filter out the slots we don't want + return stream.filter(i -> predicate.test(inventory.getStack(i))); } public static boolean selectItem(Item item) From 4823747f8098a9bfe487b042a91f17e65b92814f Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 20 May 2024 15:24:27 +0200 Subject: [PATCH 10/54] Simplify totem counting with InventoryUtils --- .../net/wurstclient/hacks/AutoLeaveHack.java | 22 +++-------------- .../net/wurstclient/hacks/AutoTotemHack.java | 24 +++++-------------- 2 files changed, 9 insertions(+), 37 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java index 8d9d896a..b400ae28 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java @@ -7,8 +7,6 @@ */ package net.wurstclient.hacks; -import net.minecraft.client.network.ClientPlayerEntity; -import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.Items; import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; import net.wurstclient.Category; @@ -19,6 +17,7 @@ import net.wurstclient.settings.CheckboxSetting; import net.wurstclient.settings.EnumSetting; import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; +import net.wurstclient.util.InventoryUtils; @SearchTags({"auto leave", "AutoDisconnect", "auto disconnect", "AutoQuit", "auto quit"}) @@ -96,7 +95,8 @@ public final class AutoLeaveHack extends Hack implements UpdateListener return; // check totems - if(totems.getValueI() < 11 && countTotems() > totems.getValueI()) + if(totems.getValueI() < 11 && InventoryUtils + .count(Items.TOTEM_OF_UNDYING, 40, true) > totems.getValueI()) return; // leave server @@ -109,22 +109,6 @@ public final class AutoLeaveHack extends Hack implements UpdateListener WURST.getHax().autoReconnectHack.setEnabled(false); } - private int countTotems() - { - ClientPlayerEntity player = MC.player; - PlayerInventory inventory = player.getInventory(); - int totems = 0; - - for(int slot = 0; slot <= 36; slot++) - if(inventory.getStack(slot).isOf(Items.TOTEM_OF_UNDYING)) - totems++; - - if(player.getOffHandStack().isOf(Items.TOTEM_OF_UNDYING)) - totems++; - - return totems; - } - public static enum Mode { QUIT("Quit", () -> MC.world.disconnect()), diff --git a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java index a8e47872..139294a5 100644 --- a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java @@ -9,7 +9,6 @@ package net.wurstclient.hacks; import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen; import net.minecraft.client.gui.screen.ingame.HandledScreen; -import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.wurstclient.Category; @@ -89,7 +88,6 @@ public final class AutoTotemHack extends Hack implements UpdateListener if(isTotem(MC.player.getOffHandStack())) { - totems++; wasTotemInOffhand = true; return; } @@ -145,26 +143,16 @@ public final class AutoTotemHack extends Hack implements UpdateListener private int searchForTotems() { - PlayerInventory inventory = MC.player.getInventory(); - int nextTotemSlot = -1; - totems = 0; + totems = InventoryUtils.count(this::isTotem, 40, true); + if(totems <= 0) + return -1; - for(int slot = 0; slot <= 40; slot++) - { - if(!isTotem(inventory.getStack(slot))) - continue; - - totems++; - - if(nextTotemSlot == -1) - nextTotemSlot = InventoryUtils.toNetworkSlot(slot); - } - - return nextTotemSlot; + int totemSlot = InventoryUtils.indexOf(this::isTotem, 40); + return InventoryUtils.toNetworkSlot(totemSlot); } private boolean isTotem(ItemStack stack) { - return stack.getItem() == Items.TOTEM_OF_UNDYING; + return stack.isOf(Items.TOTEM_OF_UNDYING); } } From 8406313de24760bdacbb5e08ffe27b52237c96a9 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 20 May 2024 15:46:17 +0200 Subject: [PATCH 11/54] Remove trailing ".0" in decimal slider values --- src/main/java/net/wurstclient/settings/SliderSetting.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/wurstclient/settings/SliderSetting.java b/src/main/java/net/wurstclient/settings/SliderSetting.java index 7c8b486d..a9ff5c5c 100644 --- a/src/main/java/net/wurstclient/settings/SliderSetting.java +++ b/src/main/java/net/wurstclient/settings/SliderSetting.java @@ -303,8 +303,10 @@ public class SliderSetting extends Setting implements SliderLock { public static final ValueDisplay INTEGER = v -> (int)v + ""; - public static final ValueDisplay DECIMAL = - v -> Math.round(v * 1e6) / 1e6 + ""; + public static final ValueDisplay DECIMAL = v -> { + String s = Math.round(v * 1e6) / 1e6 + ""; + return s.endsWith(".0") ? s.substring(0, s.length() - 2) : s; + }; public static final ValueDisplay PERCENTAGE = v -> (int)(Math.round(v * 1e8) / 1e6) + "%"; From 9337710ac352085aa7fc4556cdb0f0bf3a6cd4a2 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 21 May 2024 21:43:26 +0200 Subject: [PATCH 12/54] Fix AutoMineHack Closes #151 Closes #989 --- .../net/wurstclient/hacks/AutoMineHack.java | 75 ++++++++++--------- 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoMineHack.java b/src/main/java/net/wurstclient/hacks/AutoMineHack.java index f8669239..a2131a0f 100644 --- a/src/main/java/net/wurstclient/hacks/AutoMineHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoMineHack.java @@ -7,22 +7,21 @@ */ package net.wurstclient.hacks; -import java.util.Arrays; - +import net.minecraft.block.BlockState; +import net.minecraft.client.network.ClientPlayerInteractionManager; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; -import net.wurstclient.util.BlockBreaker; +import net.wurstclient.mixinterface.IKeyBinding; @SearchTags({"auto mine", "AutoBreak", "auto break"}) public final class AutoMineHack extends Hack implements UpdateListener { - private BlockPos currentBlock; - public AutoMineHack() { super("AutoMine"); @@ -45,46 +44,54 @@ public final class AutoMineHack extends Hack implements UpdateListener protected void onDisable() { EVENTS.remove(UpdateListener.class, this); - stopMiningAndResetProgress(); + IKeyBinding.get(MC.options.attackKey).resetPressedState(); + MC.interactionManager.cancelBlockBreaking(); } @Override public void onUpdate() { - setCurrentBlockFromHitResult(); + ClientPlayerInteractionManager im = MC.interactionManager; - if(currentBlock != null) - breakCurrentBlock(); - } - - private void setCurrentBlockFromHitResult() - { - if(MC.crosshairTarget == null || MC.crosshairTarget.getPos() == null - || MC.crosshairTarget.getType() != HitResult.Type.BLOCK - || !(MC.crosshairTarget instanceof BlockHitResult)) + if(MC.attackCooldown > 0) { - stopMiningAndResetProgress(); + im.cancelBlockBreaking(); return; } - currentBlock = ((BlockHitResult)MC.crosshairTarget).getBlockPos(); - } - - private void breakCurrentBlock() - { - if(MC.player.getAbilities().creativeMode) - BlockBreaker.breakBlocksWithPacketSpam(Arrays.asList(currentBlock)); - else - BlockBreaker.breakOneBlock(currentBlock); - } - - private void stopMiningAndResetProgress() - { - if(currentBlock == null) + if(MC.player.isRiding()) + { + im.cancelBlockBreaking(); + return; + } + + HitResult hitResult = MC.crosshairTarget; + if(hitResult == null || hitResult.getType() != HitResult.Type.BLOCK + || !(hitResult instanceof BlockHitResult bHitResult)) + { + im.cancelBlockBreaking(); + return; + } + + BlockPos pos = bHitResult.getBlockPos(); + BlockState state = MC.world.getBlockState(pos); + Direction side = bHitResult.getSide(); + if(state.isAir()) + { + im.cancelBlockBreaking(); + return; + } + + WURST.getHax().autoToolHack.equipIfEnabled(pos); + + if(MC.player.isUsingItem()) + // This case doesn't cancel block breaking in vanilla Minecraft. return; - MC.interactionManager.breakingBlock = true; - MC.interactionManager.cancelBlockBreaking(); - currentBlock = null; + if(im.updateBlockBreakingProgress(pos, side)) + { + MC.particleManager.addBlockBreakingParticles(pos, side); + MC.options.attackKey.setPressed(true); + } } } From 7b0f7751de133692a32e24f4a7454fd0af24fae8 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 22 May 2024 10:32:02 +0200 Subject: [PATCH 13/54] Wrap long description text in AutoToolHack --- src/main/java/net/wurstclient/hacks/AutoToolHack.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoToolHack.java b/src/main/java/net/wurstclient/hacks/AutoToolHack.java index f3203071..1271e6eb 100644 --- a/src/main/java/net/wurstclient/hacks/AutoToolHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoToolHack.java @@ -33,17 +33,19 @@ public final class AutoToolHack extends Hack "Uses swords to break leaves, cobwebs, etc.", false); private final CheckboxSetting useHands = new CheckboxSetting("Use hands", - "Uses an empty hand or a non-damageable item when no applicable tool is found.", + "Uses an empty hand or a non-damageable item when no applicable tool is" + + " found.", true); private final SliderSetting repairMode = new SliderSetting("Repair mode", - "Prevents tools from being used when their durability reaches the given threshold, so you can repair them before they break.\n" + "Prevents tools from being used when their durability reaches the given" + + " threshold, so you can repair them before they break.\n" + "Can be adjusted from 0 (off) to 100.", 0, 0, 100, 1, ValueDisplay.INTEGER.withLabel(0, "off")); private final CheckboxSetting switchBack = new CheckboxSetting( - "Switch back", - "After using a tool, automatically switches back to the previously selected slot.", + "Switch back", "After using a tool, automatically switches back to the" + + " previously selected slot.", true); private int prevSelectedSlot; From bddce67407596850a330c9886916f4fc295930b0 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 22 May 2024 10:35:28 +0200 Subject: [PATCH 14/54] Fix AutoTool Switch back sometimes making it mine with the wrong tool --- src/main/java/net/wurstclient/hacks/AutoToolHack.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/wurstclient/hacks/AutoToolHack.java b/src/main/java/net/wurstclient/hacks/AutoToolHack.java index 1271e6eb..fa21cc0d 100644 --- a/src/main/java/net/wurstclient/hacks/AutoToolHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoToolHack.java @@ -14,6 +14,7 @@ import net.minecraft.enchantment.Enchantments; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; import net.minecraft.item.SwordItem; +import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.wurstclient.Category; import net.wurstclient.SearchTags; @@ -96,6 +97,10 @@ public final class AutoToolHack extends Hack if(prevSelectedSlot == -1 || MC.interactionManager.isBreakingBlock()) return; + HitResult hitResult = MC.crosshairTarget; + if(hitResult != null && hitResult.getType() == HitResult.Type.BLOCK) + return; + if(switchBack.isChecked()) MC.player.getInventory().selectedSlot = prevSelectedSlot; From deeb81e618a8a2de5a43f90d770296ad2030d784 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 22 May 2024 12:50:13 +0200 Subject: [PATCH 15/54] Make repair mode more reliable --- .../net/wurstclient/hacks/AutoToolHack.java | 62 +++++++++++++++---- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoToolHack.java b/src/main/java/net/wurstclient/hacks/AutoToolHack.java index fa21cc0d..4b02430e 100644 --- a/src/main/java/net/wurstclient/hacks/AutoToolHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoToolHack.java @@ -7,6 +7,9 @@ */ package net.wurstclient.hacks; +import java.util.OptionalInt; +import java.util.stream.IntStream; + import net.minecraft.block.BlockState; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.enchantment.EnchantmentHelper; @@ -21,10 +24,12 @@ import net.wurstclient.SearchTags; import net.wurstclient.events.BlockBreakingProgressListener; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; +import net.wurstclient.mixinterface.IClientPlayerInteractionManager; import net.wurstclient.settings.CheckboxSetting; import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; import net.wurstclient.util.BlockUtils; +import net.wurstclient.util.InventoryUtils; @SearchTags({"auto tool", "AutoSwitch", "auto switch"}) public final class AutoToolHack extends Hack @@ -123,20 +128,15 @@ public final class AutoToolHack extends Hack if(player.getAbilities().creativeMode) return; + ItemStack heldItem = player.getMainHandStack(); + boolean heldItemDamageable = isDamageable(heldItem); + if(heldItemDamageable && isTooDamaged(heldItem, repairMode)) + putAwayDamagedTool(); + int bestSlot = getBestSlot(pos, useSwords, repairMode); if(bestSlot == -1) { - ItemStack heldItem = player.getMainHandStack(); - if(!isDamageable(heldItem)) - return; - - if(isTooDamaged(heldItem, repairMode)) - { - selectFallbackSlot(); - return; - } - - if(useHands && isWrongTool(heldItem, pos)) + if(useHands && heldItemDamageable && isWrongTool(heldItem, pos)) selectFallbackSlot(); return; @@ -206,6 +206,46 @@ public final class AutoToolHack extends Hack return stack.getMaxDamage() - stack.getDamage() <= repairMode; } + private void putAwayDamagedTool() + { + PlayerInventory inv = MC.player.getInventory(); + int selectedSlot = inv.selectedSlot; + IClientPlayerInteractionManager im = IMC.getInteractionManager(); + + // If there's an empty slot in the main inventory, + // shift-click the damaged item out of the hotbar + OptionalInt emptySlot = IntStream.range(9, 36) + .filter(i -> !inv.getStack(i).isEmpty()).findFirst(); + if(emptySlot.isPresent()) + { + im.windowClick_QUICK_MOVE( + InventoryUtils.toNetworkSlot(selectedSlot)); + return; + } + + // Failing that, swap with a non-damageable item + OptionalInt nonDamageableSlot = IntStream.range(9, 36) + .filter(i -> !isDamageable(inv.getStack(i))).findFirst(); + if(nonDamageableSlot.isPresent()) + { + im.windowClick_SWAP(nonDamageableSlot.getAsInt(), selectedSlot); + return; + } + + // Failing that, swap with a less damaged item + OptionalInt notTooDamagedSlot = IntStream.range(9, 36) + .filter(i -> !isTooDamaged(inv.getStack(i), 0)).findFirst(); + if(notTooDamagedSlot.isPresent()) + { + im.windowClick_SWAP(notTooDamagedSlot.getAsInt(), selectedSlot); + return; + } + + // Failing all of the above (whole inventory full of damaged tools), + // just swap with the top-left slot + im.windowClick_SWAP(0, selectedSlot); + } + private boolean isWrongTool(ItemStack heldItem, BlockPos pos) { BlockState state = BlockUtils.getState(pos); From 91dc8b4c7813431596d005ad885737dbe6ff6df1 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 22 May 2024 12:53:31 +0200 Subject: [PATCH 16/54] Clarify unit of repair mode slider --- src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java | 2 +- src/main/java/net/wurstclient/hacks/AutoToolHack.java | 2 +- src/main/java/net/wurstclient/hacks/RestockHack.java | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java index 46278bdf..01db6fb5 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java @@ -112,7 +112,7 @@ public final class AutoLibrarianHack extends Hack private final SliderSetting repairMode = new SliderSetting("Repair mode", "Prevents AutoLibrarian from using your axe when its durability reaches" + " the given threshold, so you can repair it before it breaks.\n" - + "Can be adjusted from 0 (off) to 100.", + + "Can be adjusted from 0 (off) to 100 remaining uses.", 1, 0, 100, 1, ValueDisplay.INTEGER.withLabel(0, "off")); private final OverlayRenderer overlay = new OverlayRenderer(); diff --git a/src/main/java/net/wurstclient/hacks/AutoToolHack.java b/src/main/java/net/wurstclient/hacks/AutoToolHack.java index 4b02430e..0f6ad4ca 100644 --- a/src/main/java/net/wurstclient/hacks/AutoToolHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoToolHack.java @@ -46,7 +46,7 @@ public final class AutoToolHack extends Hack private final SliderSetting repairMode = new SliderSetting("Repair mode", "Prevents tools from being used when their durability reaches the given" + " threshold, so you can repair them before they break.\n" - + "Can be adjusted from 0 (off) to 100.", + + "Can be adjusted from 0 (off) to 100 remaining uses.", 0, 0, 100, 1, ValueDisplay.INTEGER.withLabel(0, "off")); private final CheckboxSetting switchBack = new CheckboxSetting( diff --git a/src/main/java/net/wurstclient/hacks/RestockHack.java b/src/main/java/net/wurstclient/hacks/RestockHack.java index 1cae02c7..ed5ebac5 100644 --- a/src/main/java/net/wurstclient/hacks/RestockHack.java +++ b/src/main/java/net/wurstclient/hacks/RestockHack.java @@ -51,8 +51,9 @@ public final class RestockHack extends Hack implements UpdateListener private final SliderSetting repairMode = new SliderSetting( "Tools repair mode", - "Swaps out tools when their durability reaches the given threshold, so you can repair them before they break.\n" - + "Can be adjusted from 0 (off) to 100.", + "Swaps out tools when their durability reaches the given threshold, so" + + " you can repair them before they break.\n" + + "Can be adjusted from 0 (off) to 100 remaining uses.", 0, 0, 100, 1, ValueDisplay.INTEGER.withLabel(0, "off")); public RestockHack() From 633c9d0aee7250a933f847cc6186b1ab9f5f5dee Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 22 May 2024 13:11:15 +0200 Subject: [PATCH 17/54] Disable AutoTool's "Switch back" checkbox by default --- src/main/java/net/wurstclient/hacks/AutoToolHack.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoToolHack.java b/src/main/java/net/wurstclient/hacks/AutoToolHack.java index 0f6ad4ca..6ac0eff4 100644 --- a/src/main/java/net/wurstclient/hacks/AutoToolHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoToolHack.java @@ -52,7 +52,7 @@ public final class AutoToolHack extends Hack private final CheckboxSetting switchBack = new CheckboxSetting( "Switch back", "After using a tool, automatically switches back to the" + " previously selected slot.", - true); + false); private int prevSelectedSlot; From e178cab6ab5ac99063287d4cad9146eeedae3d3c Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 23 May 2024 09:53:10 +0200 Subject: [PATCH 18/54] Refactor private AutoTool methods to take BlockState instead of BlockPos --- src/main/java/net/wurstclient/hacks/AutoToolHack.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoToolHack.java b/src/main/java/net/wurstclient/hacks/AutoToolHack.java index 6ac0eff4..454c776f 100644 --- a/src/main/java/net/wurstclient/hacks/AutoToolHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoToolHack.java @@ -133,10 +133,11 @@ public final class AutoToolHack extends Hack if(heldItemDamageable && isTooDamaged(heldItem, repairMode)) putAwayDamagedTool(); - int bestSlot = getBestSlot(pos, useSwords, repairMode); + BlockState state = BlockUtils.getState(pos); + int bestSlot = getBestSlot(state, useSwords, repairMode); if(bestSlot == -1) { - if(useHands && heldItemDamageable && isWrongTool(heldItem, pos)) + if(useHands && heldItemDamageable && isWrongTool(heldItem, state)) selectFallbackSlot(); return; @@ -145,13 +146,12 @@ public final class AutoToolHack extends Hack player.getInventory().selectedSlot = bestSlot; } - private int getBestSlot(BlockPos pos, boolean useSwords, int repairMode) + private int getBestSlot(BlockState state, boolean useSwords, int repairMode) { ClientPlayerEntity player = MC.player; PlayerInventory inventory = player.getInventory(); ItemStack heldItem = MC.player.getMainHandStack(); - BlockState state = BlockUtils.getState(pos); float bestSpeed = getMiningSpeed(heldItem, state); if(isTooDamaged(heldItem, repairMode)) bestSpeed = 1; @@ -246,9 +246,8 @@ public final class AutoToolHack extends Hack im.windowClick_SWAP(0, selectedSlot); } - private boolean isWrongTool(ItemStack heldItem, BlockPos pos) + private boolean isWrongTool(ItemStack heldItem, BlockState state) { - BlockState state = BlockUtils.getState(pos); return getMiningSpeed(heldItem, state) <= 1; } From b0111c744e6692553a4ab44933ab64ccf453a26c Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 23 May 2024 21:52:34 +0200 Subject: [PATCH 19/54] Fix isTooDamaged() check in putAwayDamagedTool() --- src/main/java/net/wurstclient/hacks/AutoToolHack.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoToolHack.java b/src/main/java/net/wurstclient/hacks/AutoToolHack.java index 454c776f..5897a0fc 100644 --- a/src/main/java/net/wurstclient/hacks/AutoToolHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoToolHack.java @@ -131,7 +131,7 @@ public final class AutoToolHack extends Hack ItemStack heldItem = player.getMainHandStack(); boolean heldItemDamageable = isDamageable(heldItem); if(heldItemDamageable && isTooDamaged(heldItem, repairMode)) - putAwayDamagedTool(); + putAwayDamagedTool(repairMode); BlockState state = BlockUtils.getState(pos); int bestSlot = getBestSlot(state, useSwords, repairMode); @@ -206,7 +206,7 @@ public final class AutoToolHack extends Hack return stack.getMaxDamage() - stack.getDamage() <= repairMode; } - private void putAwayDamagedTool() + private void putAwayDamagedTool(int repairMode) { PlayerInventory inv = MC.player.getInventory(); int selectedSlot = inv.selectedSlot; @@ -234,7 +234,8 @@ public final class AutoToolHack extends Hack // Failing that, swap with a less damaged item OptionalInt notTooDamagedSlot = IntStream.range(9, 36) - .filter(i -> !isTooDamaged(inv.getStack(i), 0)).findFirst(); + .filter(i -> !isTooDamaged(inv.getStack(i), repairMode)) + .findFirst(); if(notTooDamagedSlot.isPresent()) { im.windowClick_SWAP(notTooDamagedSlot.getAsInt(), selectedSlot); From 1edb92132aec92db96549606910fc9013da34065 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 23 May 2024 21:53:02 +0200 Subject: [PATCH 20/54] Change version to 7.43pre1 --- gradle.properties | 2 +- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 67ae41bf..d21f9aa0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ loader_version=0.15.11 fabric_version=0.98.0+1.20.6 # Mod Properties -mod_version = v7.42-MC1.20.6 +mod_version = v7.43pre1-MC1.20.6 maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 4c083f3b..98caf5fb 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -58,7 +58,7 @@ public enum WurstClient public static MinecraftClient MC; public static IMinecraftClient IMC; - public static final String VERSION = "7.42"; + public static final String VERSION = "7.43pre1"; public static final String MC_VERSION = "1.20.6"; private WurstAnalytics analytics; From 1beb99a33c82c680ce9ba0de35d27b090e0df49d Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 24 May 2024 07:56:55 +0200 Subject: [PATCH 21/54] Remove unnecessary MC.player.getInventory() --- .../net/wurstclient/hacks/autofish/AutoFishRodSelector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/wurstclient/hacks/autofish/AutoFishRodSelector.java b/src/main/java/net/wurstclient/hacks/autofish/AutoFishRodSelector.java index d3544547..7ab72174 100644 --- a/src/main/java/net/wurstclient/hacks/autofish/AutoFishRodSelector.java +++ b/src/main/java/net/wurstclient/hacks/autofish/AutoFishRodSelector.java @@ -115,7 +115,7 @@ public final class AutoFishRodSelector } // check if selected rod is still the best one - if(MC.player.getInventory().selectedSlot == bestRodSlot) + if(selectedSlot == bestRodSlot) return true; // change selected rod and wait until the next tick From 4c121f055522a597d3387965fe0df71654e0105d Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 24 May 2024 09:09:31 +0200 Subject: [PATCH 22/54] Add isUnbreakable() helper method --- src/main/java/net/wurstclient/hacks/FastBreakHack.java | 3 ++- src/main/java/net/wurstclient/util/BlockUtils.java | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/wurstclient/hacks/FastBreakHack.java b/src/main/java/net/wurstclient/hacks/FastBreakHack.java index 290fb2b6..cbed9298 100644 --- a/src/main/java/net/wurstclient/hacks/FastBreakHack.java +++ b/src/main/java/net/wurstclient/hacks/FastBreakHack.java @@ -21,6 +21,7 @@ import net.wurstclient.hack.Hack; import net.wurstclient.settings.CheckboxSetting; import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; +import net.wurstclient.util.BlockUtils; @SearchTags({"FastMine", "SpeedMine", "SpeedyGonzales", "fast break", "fast mine", "speed mine", "speedy gonzales", "NoBreakDelay", @@ -101,7 +102,7 @@ public final class FastBreakHack extends Hack } // Ignore unbreakable blocks to avoid slowdown issue - if(MC.world.getBlockState(blockPos).getBlock().getHardness() < 0) + if(BlockUtils.isUnbreakable(blockPos)) return; if(!fastBreakBlock) diff --git a/src/main/java/net/wurstclient/util/BlockUtils.java b/src/main/java/net/wurstclient/util/BlockUtils.java index 7c96963d..7b0cfb6a 100644 --- a/src/main/java/net/wurstclient/util/BlockUtils.java +++ b/src/main/java/net/wurstclient/util/BlockUtils.java @@ -112,6 +112,11 @@ public enum BlockUtils return getState(pos).calcBlockBreakingDelta(MC.player, MC.world, pos); } + public static boolean isUnbreakable(BlockPos pos) + { + return getBlock(pos).getHardness() < 0; + } + private static VoxelShape getOutlineShape(BlockPos pos) { return getState(pos).getOutlineShape(MC.world, pos); From db4ffba1c2980048436cd3e1100175a3dd754284 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 24 May 2024 09:10:22 +0200 Subject: [PATCH 23/54] Fix Excavator trying to break bedrock in survival mode Fixes #675 --- .../java/net/wurstclient/hacks/ExcavatorHack.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java index 752428cf..5c5c77cd 100644 --- a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java +++ b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java @@ -487,10 +487,8 @@ public final class ExcavatorHack extends Hack // find closest valid block for(BlockPos pos : blocks) { - boolean successful; - // break block - successful = BlockBreaker.breakOneBlock(pos); + boolean successful = BlockBreaker.breakOneBlock(pos); // set currentBlock if successful if(successful) @@ -506,9 +504,11 @@ public final class ExcavatorHack extends Hack } // get remaining blocks - Predicate pClickable = BlockUtils::canBeClicked; + Predicate pBreakable = MC.player.isCreative() + ? BlockUtils::canBeClicked : pos -> BlockUtils.canBeClicked(pos) + && !BlockUtils.isUnbreakable(pos); area.remainingBlocks = - (int)area.blocksList.parallelStream().filter(pClickable).count(); + (int)area.blocksList.parallelStream().filter(pBreakable).count(); if(area.remainingBlocks == 0) { @@ -523,7 +523,7 @@ public final class ExcavatorHack extends Hack Comparator cAltitude = Comparator.comparingInt(pos -> -pos.getY()); BlockPos closestBlock = - area.blocksList.parallelStream().filter(pClickable) + area.blocksList.parallelStream().filter(pBreakable) .min(cAltitude.thenComparing(cDistance)).get(); pathFinder = new ExcavatorPathFinder(closestBlock); From b1d2480aebeefef62101bf0845e36719fc289c65 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 24 May 2024 09:34:49 +0200 Subject: [PATCH 24/54] Fix Excavator conflicting with AutoEat Fixes #316 --- src/main/java/net/wurstclient/hacks/ExcavatorHack.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java index 5c5c77cd..f61a841a 100644 --- a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java +++ b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java @@ -455,6 +455,10 @@ public final class ExcavatorHack extends Hack private void excavate() { + // wait for AutoEat to finish eating + if(WURST.getHax().autoEatHack.isEating()) + return; + boolean legit = mode.getSelected() == Mode.LEGIT; currentBlock = null; From daebd4bd37acc941aa9baa2244380e9aaff615fe Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 24 May 2024 10:28:20 +0200 Subject: [PATCH 25/54] Refactor ExcavatorHack --- .../net/wurstclient/hacks/ExcavatorHack.java | 80 ++++++++----------- 1 file changed, 34 insertions(+), 46 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java index f61a841a..8edb7296 100644 --- a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java +++ b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java @@ -70,7 +70,6 @@ public final class ExcavatorHack extends Hack public ExcavatorHack() { super("Excavator"); - setCategory(Category.BLOCKS); addSetting(range); addSetting(mode); @@ -82,10 +81,13 @@ public final class ExcavatorHack extends Hack String name = getName(); if(step == Step.EXCAVATE && area != null) - name += " " - + (int)((float)(area.blocksList.size() - area.remainingBlocks) - / (float)area.blocksList.size() * 100) - + "%"; + { + int totalBlocks = area.blocksList.size(); + double brokenBlocks = totalBlocks - area.remainingBlocks; + double progress = brokenBlocks / totalBlocks; + int percentage = (int)(progress * 100); + name += " " + percentage + "%"; + } return name; } @@ -347,10 +349,9 @@ public final class ExcavatorHack extends Hack else message = step.message; - TextRenderer tr = MC.textRenderer; - // translate to center Window sr = MC.getWindow(); + TextRenderer tr = MC.textRenderer; int msgWidth = tr.getWidth(message); matrixStack.translate(sr.getScaledWidth() / 2 - msgWidth / 2, sr.getScaledHeight() / 2 + 1, 0); @@ -459,14 +460,19 @@ public final class ExcavatorHack extends Hack if(WURST.getHax().autoEatHack.isEating()) return; - boolean legit = mode.getSelected() == Mode.LEGIT; - currentBlock = null; + // prioritize the closest block from the top layer + Vec3d eyesVec = RotationUtils.getEyesPos(); + Comparator cNextTargetBlock = + Comparator.comparingInt(BlockPos::getY).reversed() + .thenComparingDouble(pos -> pos.getSquaredDistance(eyesVec)); // get valid blocks - Iterable validBlocks = getValidBlocks(range.getValue(), - pos -> area.blocksSet.contains(pos)); + ArrayList validBlocks = getValidBlocks(); + validBlocks.sort(cNextTargetBlock); + currentBlock = null; // nuke all + boolean legit = mode.getSelected() == Mode.LEGIT; if(MC.player.getAbilities().creativeMode && !legit) { MC.interactionManager.cancelBlockBreaking(); @@ -483,23 +489,14 @@ public final class ExcavatorHack extends Hack }else { - ArrayList blocks = new ArrayList<>(); + // break next block for(BlockPos pos : validBlocks) - blocks.add(pos); - blocks.sort(Comparator.comparingInt((BlockPos pos) -> -pos.getY())); - - // find closest valid block - for(BlockPos pos : blocks) { - // break block - boolean successful = BlockBreaker.breakOneBlock(pos); + if(!BlockBreaker.breakOneBlock(pos)) + continue; - // set currentBlock if successful - if(successful) - { - currentBlock = pos; - break; - } + currentBlock = pos; + break; } // reset if no block was found @@ -522,13 +519,8 @@ public final class ExcavatorHack extends Hack if(pathFinder == null) { - Comparator cDistance = Comparator.comparingDouble( - pos -> MC.player.squaredDistanceTo(Vec3d.ofCenter(pos))); - Comparator cAltitude = - Comparator.comparingInt(pos -> -pos.getY()); - BlockPos closestBlock = - area.blocksList.parallelStream().filter(pBreakable) - .min(cAltitude.thenComparing(cDistance)).get(); + BlockPos closestBlock = area.blocksList.parallelStream() + .filter(pBreakable).min(cNextTargetBlock).get(); pathFinder = new ExcavatorPathFinder(closestBlock); } @@ -568,22 +560,18 @@ public final class ExcavatorHack extends Hack } } - private ArrayList getValidBlocks(double range, - Predicate validator) + private ArrayList getValidBlocks() { - Vec3d eyesVec = RotationUtils.getEyesPos().subtract(0.5, 0.5, 0.5); - double rangeSq = Math.pow(range + 0.5, 2); - int rangeI = (int)Math.ceil(range); + Vec3d eyesVec = RotationUtils.getEyesPos(); + BlockPos eyesBlock = BlockPos.ofFloored(eyesVec); + double rangeSq = Math.pow(range.getValue() + 0.5, 2); + int blockRange = range.getValueCeil(); - BlockPos center = BlockPos.ofFloored(RotationUtils.getEyesPos()); - BlockPos min = center.add(-rangeI, -rangeI, -rangeI); - BlockPos max = center.add(rangeI, rangeI, rangeI); - - return BlockUtils.getAllInBox(min, max).stream() - .filter(pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos)) <= rangeSq) - .filter(BlockUtils::canBeClicked).filter(validator) - .sorted(Comparator.comparingDouble( - pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos)))) + return BlockUtils.getAllInBoxStream(eyesBlock, blockRange) + .filter(pos -> pos.getSquaredDistance(eyesVec) <= rangeSq) + .filter(BlockUtils::canBeClicked).filter(area.blocksSet::contains) + .sorted(Comparator + .comparingDouble(pos -> pos.getSquaredDistance(eyesVec))) .collect(Collectors.toCollection(ArrayList::new)); } From ec68d44538ef3728216021f0962a5e1b5556a1e2 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 24 May 2024 10:39:09 +0200 Subject: [PATCH 26/54] Fix Excavator still sometimes getting stuck on unbreakable blocks --- src/main/java/net/wurstclient/hacks/ExcavatorHack.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java index 8edb7296..bb266e5e 100644 --- a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java +++ b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java @@ -569,7 +569,8 @@ public final class ExcavatorHack extends Hack return BlockUtils.getAllInBoxStream(eyesBlock, blockRange) .filter(pos -> pos.getSquaredDistance(eyesVec) <= rangeSq) - .filter(BlockUtils::canBeClicked).filter(area.blocksSet::contains) + .filter(area.blocksSet::contains).filter(BlockUtils::canBeClicked) + .filter(pos -> !BlockUtils.isUnbreakable(pos)) .sorted(Comparator .comparingDouble(pos -> pos.getSquaredDistance(eyesVec))) .collect(Collectors.toCollection(ArrayList::new)); From 02f2fb043c5f6a096d6248d08fc007f78d427224 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 24 May 2024 10:45:08 +0200 Subject: [PATCH 27/54] Fix Excavator mining slowly with AutoTool --- src/main/java/net/wurstclient/hacks/ExcavatorHack.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java index bb266e5e..33443bbd 100644 --- a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java +++ b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java @@ -492,6 +492,7 @@ public final class ExcavatorHack extends Hack // break next block for(BlockPos pos : validBlocks) { + WURST.getHax().autoToolHack.equipIfEnabled(pos); if(!BlockBreaker.breakOneBlock(pos)) continue; From 36de1e7c6875e6d248ce7d50d400a6f29cb261be Mon Sep 17 00:00:00 2001 From: Starmoe Date: Sat, 25 May 2024 19:20:31 +0800 Subject: [PATCH 28/54] Update zh_cn.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加并优化部分翻译/Add and optimize some translations --- src/main/resources/assets/wurst/lang/zh_cn.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/wurst/lang/zh_cn.json b/src/main/resources/assets/wurst/lang/zh_cn.json index 4d51fe9e..c887ebeb 100644 --- a/src/main/resources/assets/wurst/lang/zh_cn.json +++ b/src/main/resources/assets/wurst/lang/zh_cn.json @@ -1,9 +1,11 @@ { + "description.wurst.hack.aimassist": "帮助您瞄准附近的实体。", "description.wurst.hack.airplace": "允许您在空中放置方块。", "description.wurst.hack.anchoraura": "自动放置(可选),充能,引爆重生锚并击杀你附近的实体。", "description.wurst.hack.antiafk": "随机走动,用于避免服务器挂机检测。", "description.wurst.hack.antiblind": "防止失明和黑暗效果。\n与 OptiFine 不兼容。", "description.wurst.hack.anticactus": "保护你免受仙人掌伤害。", + "description.wurst.hack.antientitypush": "保护你不会被玩家和其他生物推挤。", "description.wurst.hack.antihunger": "在你走路时减缓你的饥饿状态。", "description.wurst.hack.antiknockback": "保护你不被其他生物或玩家推动和用剑击退。", "description.wurst.hack.antispam": "将重复的刷屏改为计数器显示。", @@ -14,8 +16,10 @@ "description.wurst.setting.arrowdmg.trident_yeet_mode": "打开之后,三叉戟将飞得更远。似乎不影响伤害以及“激流”魔咒。\n\n§c§l警告:§r打开这个选项之后你很容易弄丢你的三叉戟!", "description.wurst.hack.autoarmor": "自动管理你的盔甲。", "description.wurst.hack.autobuild": "自动建筑东西。\n放一个方块就开始自动建造。", + "description.wurst.hack.autocomplete": "使用大型语言模型自动完成您的聊天消息。 需要具有 API 访问权限的 OpenAI 帐户或与 OpenAI 兼容的任何其他语言模型 API。", "description.wurst.hack.autodrop": "自动丢弃你不想要的物品(可以预设)。", "description.wurst.hack.autoleave": "血量过低时自动离开服务器。", + "description.wurst.hack.autolibrarian": "自动训练村民成为图书管理员,出售特定的附魔书。 通过这个技术,您可以立即建立一个完整的村民交易所。", "description.wurst.hack.autoeat": "当必要的时候将会自动进食(可以预设)。", "description.wurst.setting.autoeat.target_hunger": "在不浪费任何饥饿值的前提下,尝试将饥饿条保持在此水准之上。", "description.wurst.setting.autoeat.min_hunger": "即便浪费一些补充的饥饿值,也总是将饥饿条保持在此水准之上。\n6.5 - 不会导致任何原版食物所补充饥饿值的浪费。\n10.0 - 完全忽视饥饿值的浪费,总是将饥饿条补满。", @@ -42,6 +46,7 @@ "description.wurst.hack.autotool": "破坏方块时自动切换成快捷栏中最优的破坏工具。", "description.wurst.hack.autototem": "自动将不死图腾移动到副手上。", "description.wurst.hack.autowalk": "使你自动走路而无需按住W键。", + "description.wurst.hack.barrieresp": "允许你看到附近的屏障方块。", "description.wurst.hack.basefinder": "通过寻找人为建造的方块来寻找玩家的基地。\n假如方块被找到将以所选的颜色高亮。\n建议用于寻找帮派基地。", "description.wurst.hack.blink": "暂停所有动作更新,并在关闭时继续。", "description.wurst.hack.boatfly": "允许你使用船只和其他载具飞行。\n按冲刺键可以更快地下降。", @@ -110,10 +115,12 @@ "description.wurst.hack.nocomcrash": "利用 Nocom 漏洞使服务器卡顿或崩溃。\n经测试可在 Vanilla、Spigot 和 Fabric 上工作,Paper 和一些拥有特定反作弊的服务器无法使用。", "description.wurst.hack.nofall": "使你免受摔落伤害。", "description.wurst.hack.nofireoverlay": "关闭第一人称视角下着火时的火焰贴图。\n\n§c§l警告:§r这可能会导致你因不知道身上有火而烧伤致死。", + "description.wurst.hack.nofog": "移除世界天边交界处的迷雾。", "description.wurst.hack.nohurtcam": "关闭因受伤而产生视野摇晃效果。", "description.wurst.hack.nolevitation": "禁用被潜影贝击中时获得的漂浮效果。\n\n§c§l警告:§r 如果您已经处于漂浮状态下,启用此功能将会使您从高空坠落!", "description.wurst.hack.nooverlay": "关闭因在水或岩浆中的视野阻挡。", "description.wurst.hack.nopumpkin": "关闭南瓜头的视野阻挡。", + "description.wurst.hack.noshieldoverlay": "降低盾牌使其覆盖更少的屏幕。", "description.wurst.hack.noslowdown": "取消在蜂蜜、灵魂沙上或使用物品时产生的减速效果。", "description.wurst.hack.noweather": "允许你更改本地客户端的天气,时间和月相(仅在本地生效,与服务器无关)。", "description.wurst.hack.noweb": "使你不会因为蜘蛛网而减速。", @@ -124,6 +131,7 @@ "description.wurst.hack.panic": "瞬间关闭所有的作弊功能。\n请小心使用!", "description.wurst.hack.parkour": "当你到达方块边缘时自动跳起。\n适用于跑酷或部分需要跑跳的场景。", "description.wurst.hack.playeresp": "高亮透视附近的玩家。\n你的好友会显示蓝色框框。", + "description.wurst.hack.portalesp": "高亮附近的传送门。", "description.wurst.hack.portalgui": "允许你在传送门内打开 GUI。", "description.wurst.hack.potionsaver": "当你站着不动时冻结所有的药水效果时间。", "description.wurst.hack.prophuntesp": "在躲猫猫小游戏中知道哪些是人扮的方块。\n用于 Mineplex 服务器的 Prophunt(躲猫猫),其他服务器未必奏效。", @@ -173,7 +181,7 @@ "gui.wurst.altmanager.folder_error.title": "无法创建 “.Wurst encryption” 文件夹!", "gui.wurst.altmanager.folder_error.message": "你也许不小心禁止了 Wurst 访问这个目录,\n因此 AltManager 无法加解密你的备用账户列表。\n你仍然可以使用 AltManager,但你新建的备用账户将不会被保存。\n\n完整错误信息如下:\n%s", "gui.wurst.altmanager.empty.title": "你的备用账户列表为空。", - "gui.wurst.altmanager.empty.message": "你希望 Wurst 生成一些離線帳戶嗎?", + "gui.wurst.altmanager.empty.message": "你希望 Wurst 生成一些离线账户吗?", "gui.wurst.nochatreports.unsafe_server.title": "§4§l警告:§r 不安全的服务器", "gui.wurst.nochatreports.unsafe_server.message": "此伺服器需要启用聊天签名,这会使您的帐户面临欺诈性聊天报告的风险。\n\n如果您取消阻止聊天签名然后重新连接,则可以加入此服务器。如果这样做,请考虑根本不使用聊天。或者使用您不介意丢失的替代帐户进行游戏。\n\n如果这是您的伺服器,您可以通过在 server.properties 中将“enforce-secure-profile”设置为 false 来解决此问题。在典型的 Mojang 方法中,这种设置与听起来相反。", "toast.wurst.nochatreports.unsafe_server.title": "聊天消息可以被报告", @@ -185,4 +193,4 @@ "gui.wurst.generic.allcaps_blocked": "黑名单", "gui.wurst.generic.allcaps_allowed": "已允许", "key.wurst.zoom": "缩放" -} \ No newline at end of file +} From ff9d918a42dcb053d518dfd4b32b3302403b1423 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sun, 26 May 2024 12:23:12 +0200 Subject: [PATCH 29/54] Fix NPE in MicrosoftLoginManager --- .../wurstclient/altmanager/MicrosoftLoginManager.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java b/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java index 8179146c..2d4acab1 100644 --- a/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java +++ b/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java @@ -20,7 +20,9 @@ import java.net.URLConnection; import java.net.URLDecoder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Optional; import java.util.UUID; @@ -153,7 +155,13 @@ public enum MicrosoftLoginManager System.out.println("Getting login cookies..."); cookie = ""; - for(String c : connection.getHeaderFields().get("Set-Cookie")) + List cookies = + connection.getHeaderFields().get("Set-Cookie"); + + if(cookies == null) + cookies = Collections.emptyList(); + + for(String c : cookies) { String cookieTrimmed = c.substring(0, c.indexOf(";") + 1); cookie += cookieTrimmed; From 4e3e1b4ba78e111d724f1e807becc22e58d3e028 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sun, 26 May 2024 12:35:55 +0200 Subject: [PATCH 30/54] Add @Unique annotations to PlayerSkinProviderMixin --- .../java/net/wurstclient/mixin/PlayerSkinProviderMixin.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java b/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java index 49456f00..281fdfd2 100644 --- a/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java +++ b/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java @@ -14,6 +14,7 @@ import java.util.concurrent.CompletableFuture; import java.util.regex.Pattern; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.ModifyVariable; @@ -31,7 +32,10 @@ import net.wurstclient.util.json.WsonObject; @Mixin(PlayerSkinProvider.class) public abstract class PlayerSkinProviderMixin { + @Unique private static HashMap capes; + + @Unique private MinecraftProfileTexture currentCape; @Inject(at = @At("HEAD"), @@ -79,6 +83,7 @@ public abstract class PlayerSkinProviderMixin return result; } + @Unique private void setupWurstCapes() { try From b634d047fdc484397bdf2acd6125984178452942 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sun, 26 May 2024 12:46:34 +0200 Subject: [PATCH 31/54] Fix endless retry-loop if downloading Wurst capes list fails Fixes #1000 --- .../net/wurstclient/mixin/PlayerSkinProviderMixin.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java b/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java index 281fdfd2..8227db68 100644 --- a/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java +++ b/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java @@ -88,15 +88,16 @@ public abstract class PlayerSkinProviderMixin { try { + // assign map first to prevent endless retries if download fails + capes = new HashMap<>(); + Pattern uuidPattern = Pattern.compile( + "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"); + // download cape list from wurstclient.net WsonObject rawCapes = JsonUtils.parseURLToObject( "https://www.wurstclient.net/api/v1/capes.json"); - Pattern uuidPattern = Pattern.compile( - "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"); - // convert names to offline UUIDs - capes = new HashMap<>(); for(Entry entry : rawCapes.getAllStrings() .entrySet()) { From a7b0d718f1d9dc12ef6877d5684444ee65a8aa27 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 27 May 2024 13:41:27 +0200 Subject: [PATCH 32/54] Mark GameRendererMixin.cancelNextBobView as @Unique --- src/main/java/net/wurstclient/mixin/GameRendererMixin.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/net/wurstclient/mixin/GameRendererMixin.java b/src/main/java/net/wurstclient/mixin/GameRendererMixin.java index 172024d8..540f3dc3 100644 --- a/src/main/java/net/wurstclient/mixin/GameRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/GameRendererMixin.java @@ -10,6 +10,7 @@ package net.wurstclient.mixin; import org.joml.Matrix4f; import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -34,6 +35,7 @@ import net.wurstclient.hacks.FullbrightHack; @Mixin(GameRenderer.class) public abstract class GameRendererMixin implements AutoCloseable { + @Unique private boolean cancelNextBobView; /** From c3312772108cf6cd4eb3063a10c60b630b8d15f7 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 28 May 2024 14:15:29 +0200 Subject: [PATCH 33/54] Fix TriggerBot detection Fixes #997 --- .../events/HandleInputListener.java | 49 +++++++++++++++++++ .../net/wurstclient/hacks/TriggerBotHack.java | 24 ++++++--- .../mixin/MinecraftClientMixin.java | 7 +++ .../settings/AttackSpeedSliderSetting.java | 36 ++++++++++++-- 4 files changed, 104 insertions(+), 12 deletions(-) create mode 100644 src/main/java/net/wurstclient/events/HandleInputListener.java diff --git a/src/main/java/net/wurstclient/events/HandleInputListener.java b/src/main/java/net/wurstclient/events/HandleInputListener.java new file mode 100644 index 00000000..bc0955ac --- /dev/null +++ b/src/main/java/net/wurstclient/events/HandleInputListener.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.events; + +import java.util.ArrayList; + +import net.minecraft.client.MinecraftClient; +import net.wurstclient.event.Event; +import net.wurstclient.event.Listener; + +/** + * Fired at the beginning of {@link MinecraftClient#handleInputEvents()}. + * This is the ideal time to simulate mouse and keyboard input. + */ +public interface HandleInputListener extends Listener +{ + /** + * Fired at the beginning of {@link MinecraftClient#handleInputEvents()}. + * This is the ideal time to simulate mouse and keyboard input. + */ + public void onHandleInput(); + + /** + * Fired at the beginning of {@link MinecraftClient#handleInputEvents()}. + * This is the ideal time to simulate mouse and keyboard input. + */ + public static class HandleInputEvent extends Event + { + public static final HandleInputEvent INSTANCE = new HandleInputEvent(); + + @Override + public void fire(ArrayList listeners) + { + for(HandleInputListener listener : listeners) + listener.onHandleInput(); + } + + @Override + public Class getListenerType() + { + return HandleInputListener.class; + } + } +} diff --git a/src/main/java/net/wurstclient/hacks/TriggerBotHack.java b/src/main/java/net/wurstclient/hacks/TriggerBotHack.java index 7cb096a5..2c3b66e9 100644 --- a/src/main/java/net/wurstclient/hacks/TriggerBotHack.java +++ b/src/main/java/net/wurstclient/hacks/TriggerBotHack.java @@ -14,7 +14,7 @@ import net.minecraft.util.Hand; import net.minecraft.util.hit.EntityHitResult; import net.wurstclient.Category; import net.wurstclient.SearchTags; -import net.wurstclient.events.PostMotionListener; +import net.wurstclient.events.HandleInputListener; import net.wurstclient.events.PreMotionListener; import net.wurstclient.hack.Hack; import net.wurstclient.mixinterface.IKeyBinding; @@ -30,7 +30,7 @@ import net.wurstclient.util.EntityUtils; @SearchTags({"trigger bot", "AutoAttack", "auto attack", "AutoClicker", "auto clicker"}) public final class TriggerBotHack extends Hack - implements PreMotionListener, PostMotionListener + implements PreMotionListener, HandleInputListener { private final SliderSetting range = new SliderSetting("Range", 4.25, 1, 6, 0.05, ValueDisplay.DECIMAL); @@ -38,6 +38,15 @@ public final class TriggerBotHack extends Hack private final AttackSpeedSliderSetting speed = new AttackSpeedSliderSetting(); + private final SliderSetting speedRandMS = + new SliderSetting("Speed randomization", + "Helps you bypass anti-cheat plugins by varying the delay between" + + " attacks.\n\n" + "\u00b1100ms is recommended for Vulcan.\n\n" + + "0 (off) is fine for NoCheat+, AAC, Grim, Verus, Spartan, and" + + " vanilla servers.", + 100, 0, 1000, 50, ValueDisplay.INTEGER.withPrefix("\u00b1") + .withSuffix("ms").withLabel(0, "off")); + private final SwingHandSetting swingHand = new SwingHandSetting( "How TriggerBot should swing your hand when attacking.\n\n" + "This setting will be ignored if \"Simulate mouse click\" is" @@ -75,6 +84,7 @@ public final class TriggerBotHack extends Hack addSetting(range); addSetting(speed); + addSetting(speedRandMS); addSetting(swingHand); addSetting(attackWhileBlocking); addSetting(simulateMouseClick); @@ -95,9 +105,9 @@ public final class TriggerBotHack extends Hack WURST.getHax().protectHack.setEnabled(false); WURST.getHax().tpAuraHack.setEnabled(false); - speed.resetTimer(); + speed.resetTimer(speedRandMS.getValue()); EVENTS.add(PreMotionListener.class, this); - EVENTS.add(PostMotionListener.class, this); + EVENTS.add(HandleInputListener.class, this); } @Override @@ -110,7 +120,7 @@ public final class TriggerBotHack extends Hack } EVENTS.remove(PreMotionListener.class, this); - EVENTS.remove(PostMotionListener.class, this); + EVENTS.remove(HandleInputListener.class, this); } @Override @@ -124,7 +134,7 @@ public final class TriggerBotHack extends Hack } @Override - public void onPostMotion() + public void onHandleInput() { speed.updateTimer(); if(!speed.isTimeToAttack()) @@ -160,7 +170,7 @@ public final class TriggerBotHack extends Hack swingHand.swing(Hand.MAIN_HAND); } - speed.resetTimer(); + speed.resetTimer(speedRandMS.getValue()); } private boolean isCorrectEntity(Entity entity) diff --git a/src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java b/src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java index 20f8eb02..f062a860 100644 --- a/src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java +++ b/src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java @@ -34,6 +34,7 @@ import net.minecraft.util.hit.HitResult; import net.minecraft.util.thread.ReentrantThreadExecutor; import net.wurstclient.WurstClient; import net.wurstclient.event.EventManager; +import net.wurstclient.events.HandleInputListener.HandleInputEvent; import net.wurstclient.events.LeftClickListener.LeftClickEvent; import net.wurstclient.events.RightClickListener.RightClickEvent; import net.wurstclient.mixinterface.IClientPlayerEntity; @@ -64,6 +65,12 @@ public abstract class MinecraftClientMixin super(name); } + @Inject(at = @At("HEAD"), method = "handleInputEvents()V") + private void onHandleInputEvents(CallbackInfo ci) + { + EventManager.fire(HandleInputEvent.INSTANCE); + } + @Inject(at = @At(value = "FIELD", target = "Lnet/minecraft/client/MinecraftClient;crosshairTarget:Lnet/minecraft/util/hit/HitResult;", ordinal = 0), method = "doAttack()Z", cancellable = true) diff --git a/src/main/java/net/wurstclient/settings/AttackSpeedSliderSetting.java b/src/main/java/net/wurstclient/settings/AttackSpeedSliderSetting.java index c1653bf7..5faae8cf 100644 --- a/src/main/java/net/wurstclient/settings/AttackSpeedSliderSetting.java +++ b/src/main/java/net/wurstclient/settings/AttackSpeedSliderSetting.java @@ -7,10 +7,12 @@ */ package net.wurstclient.settings; +import net.minecraft.util.math.random.Random; import net.wurstclient.WurstClient; public final class AttackSpeedSliderSetting extends SliderSetting { + private final Random random = Random.createLocal(); private int tickTimer; public AttackSpeedSliderSetting() @@ -35,19 +37,43 @@ public final class AttackSpeedSliderSetting extends SliderSetting public void resetTimer() { - tickTimer = 0; + double value = getValue(); + if(value <= 0) + tickTimer = -1; + else + tickTimer = (int)(1000 / value); + } + + public void resetTimer(double maxRandMS) + { + if(maxRandMS <= 0) + { + resetTimer(); + return; + } + + double value = getValue(); + double rand = random.nextGaussian(); + int randOffset = (int)(rand * maxRandMS); + + if(value <= 0) + tickTimer = randOffset; + else + tickTimer = (int)(1000 / value) + randOffset; } public void updateTimer() { - tickTimer += 50; + if(tickTimer >= 0) + tickTimer -= 50; } public boolean isTimeToAttack() { - if(getValue() > 0) - return tickTimer >= 1000 / getValue(); + double value = getValue(); + if(value <= 0 && WurstClient.MC.player.getAttackCooldownProgress(0) < 1) + return false; - return WurstClient.MC.player.getAttackCooldownProgress(0) >= 1; + return tickTimer <= 0; } } From 3a21cbb902d53fadfea49ad931e145ad5e1262b1 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 28 May 2024 14:16:00 +0200 Subject: [PATCH 34/54] Change version to 7.43pre2 --- gradle.properties | 2 +- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index d21f9aa0..e96a998e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ loader_version=0.15.11 fabric_version=0.98.0+1.20.6 # Mod Properties -mod_version = v7.43pre1-MC1.20.6 +mod_version = v7.43pre2-MC1.20.6 maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 98caf5fb..03e3fc96 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -58,7 +58,7 @@ public enum WurstClient public static MinecraftClient MC; public static IMinecraftClient IMC; - public static final String VERSION = "7.43pre1"; + public static final String VERSION = "7.43pre2"; public static final String MC_VERSION = "1.20.6"; private WurstAnalytics analytics; From 92fcaffae6dcc90b81d4a3377ee9d9b9f9a39b0e Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 28 May 2024 20:21:20 +0200 Subject: [PATCH 35/54] Move player abilities for PathFinder to a record --- .../java/net/wurstclient/ai/PathFinder.java | 47 +++++-------------- .../net/wurstclient/ai/PlayerAbilities.java | 40 ++++++++++++++++ 2 files changed, 53 insertions(+), 34 deletions(-) create mode 100644 src/main/java/net/wurstclient/ai/PlayerAbilities.java diff --git a/src/main/java/net/wurstclient/ai/PathFinder.java b/src/main/java/net/wurstclient/ai/PathFinder.java index e90b226f..060be125 100644 --- a/src/main/java/net/wurstclient/ai/PathFinder.java +++ b/src/main/java/net/wurstclient/ai/PathFinder.java @@ -31,20 +31,7 @@ import net.wurstclient.util.RenderUtils; public class PathFinder { - private final WurstClient wurst = WurstClient.INSTANCE; - - private final boolean invulnerable = - WurstClient.MC.player.getAbilities().creativeMode; - private final boolean creativeFlying = - WurstClient.MC.player.getAbilities().flying; - protected final boolean flying = - creativeFlying || wurst.getHax().flightHack.isEnabled(); - private final boolean immuneToFallDamage = - invulnerable || wurst.getHax().noFallHack.isEnabled(); - private final boolean noWaterSlowdown = - wurst.getHax().antiWaterPushHack.isPreventingSlowdown(); - private final boolean jesus = wurst.getHax().jesusHack.isEnabled(); - private final boolean spider = wurst.getHax().spiderHack.isEnabled(); + private final PlayerAbilities abilities = PlayerAbilities.get(); protected boolean fallingAllowed = true; protected boolean divingAllowed = true; @@ -285,8 +272,8 @@ public class PathFinder Block block = state.getBlock(); return state.blocksMovement() && !(block instanceof AbstractSignBlock) - || block instanceof LadderBlock - || jesus && (block == Blocks.WATER || block == Blocks.LAVA); + || block instanceof LadderBlock || abilities.jesus() + && (block == Blocks.WATER || block == Blocks.LAVA); } @SuppressWarnings("deprecation") @@ -310,7 +297,7 @@ public class PathFinder return false; // check if safe - if(!invulnerable + if(!abilities.invulnerable() && (block == Blocks.LAVA || block instanceof AbstractFireBlock)) return false; @@ -337,7 +324,7 @@ public class PathFinder // check if safe BlockState state = BlockUtils.getState(pos); Fluid fluid = state.getFluidState().getFluid(); - if(!invulnerable && (state.getBlock() instanceof CactusBlock + if(!abilities.invulnerable() && (state.getBlock() instanceof CactusBlock || fluid instanceof LavaFluid)) return false; @@ -356,7 +343,7 @@ public class PathFinder return false; // check if fall damage is off - if(immuneToFallDamage && fallingAllowed) + if(abilities.immuneToFallDamage() && fallingAllowed) return true; // check if fall ends with slime block @@ -395,15 +382,15 @@ public class PathFinder private boolean canFlyAt(BlockPos pos) { - return flying - || !noWaterSlowdown && BlockUtils.getBlock(pos) == Blocks.WATER; + return abilities.flying() || !abilities.noWaterSlowdown() + && BlockUtils.getBlock(pos) == Blocks.WATER; } private boolean canClimbUpAt(BlockPos pos) { // check if this block works for climbing Block block = BlockUtils.getBlock(pos); - if(!spider && !(block instanceof LadderBlock) + if(!abilities.spider() && !(block instanceof LadderBlock) && !(block instanceof VineBlock)) return false; @@ -448,7 +435,7 @@ public class PathFinder Block block = BlockUtils.getBlock(pos); // liquids - if(block == Blocks.WATER && !noWaterSlowdown) + if(block == Blocks.WATER && !abilities.noWaterSlowdown()) costs[i] *= 1.3164437838225804F; else if(block == Blocks.LAVA) costs[i] *= 4.539515393656079F; @@ -624,15 +611,7 @@ public class PathFinder throw new IllegalStateException("Path is not formatted!"); // check player abilities - if(invulnerable != WurstClient.MC.player.getAbilities().creativeMode - || flying != (creativeFlying - || wurst.getHax().flightHack.isEnabled()) - || immuneToFallDamage != (invulnerable - || wurst.getHax().noFallHack.isEnabled()) - || noWaterSlowdown != wurst.getHax().antiWaterPushHack - .isPreventingSlowdown() - || jesus != wurst.getHax().jesusHack.isEnabled() - || spider != wurst.getHax().spiderHack.isEnabled()) + if(!abilities.equals(PlayerAbilities.get())) return false; // if index is zero, check if first pos is safe @@ -654,8 +633,8 @@ public class PathFinder public PathProcessor getProcessor() { - if(flying) - return new FlyPathProcessor(path, creativeFlying); + if(abilities.flying()) + return new FlyPathProcessor(path, abilities.creativeFlying()); return new WalkPathProcessor(path); } diff --git a/src/main/java/net/wurstclient/ai/PlayerAbilities.java b/src/main/java/net/wurstclient/ai/PlayerAbilities.java new file mode 100644 index 00000000..42882469 --- /dev/null +++ b/src/main/java/net/wurstclient/ai/PlayerAbilities.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.ai; + +import net.minecraft.client.MinecraftClient; +import net.wurstclient.WurstClient; +import net.wurstclient.hack.HackList; + +public record PlayerAbilities(boolean invulnerable, boolean creativeFlying, + boolean flying, boolean immuneToFallDamage, boolean noWaterSlowdown, + boolean jesus, boolean spider) +{ + + private static final WurstClient WURST = WurstClient.INSTANCE; + private static final MinecraftClient MC = WurstClient.MC; + + public static PlayerAbilities get() + { + HackList hax = WURST.getHax(); + net.minecraft.entity.player.PlayerAbilities mcAbilities = + MC.player.getAbilities(); + + boolean invulnerable = + mcAbilities.invulnerable || mcAbilities.creativeMode; + boolean creativeFlying = mcAbilities.flying; + boolean flying = creativeFlying || hax.flightHack.isEnabled(); + boolean immuneToFallDamage = invulnerable || hax.noFallHack.isEnabled(); + boolean noWaterSlowdown = hax.antiWaterPushHack.isPreventingSlowdown(); + boolean jesus = hax.jesusHack.isEnabled(); + boolean spider = hax.spiderHack.isEnabled(); + + return new PlayerAbilities(invulnerable, creativeFlying, flying, + immuneToFallDamage, noWaterSlowdown, jesus, spider); + } +} From bdb607ce94c9adab7a40fec9cad8fe9780ae6bf8 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 28 May 2024 20:26:30 +0200 Subject: [PATCH 36/54] Fix AntiAFK never resetting if it goes off the path --- src/main/java/net/wurstclient/hacks/AntiAfkHack.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java index 8c5814eb..0e73a502 100644 --- a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java @@ -162,7 +162,8 @@ public final class AntiAfkHack extends Hack // check path if(processor != null - && !pathFinder.isPathStillValid(processor.getIndex())) + && !pathFinder.isPathStillValid(processor.getIndex()) + || processor.getTicksOffPath() > 20) { pathFinder = new RandomPathFinder(pathFinder); return; From 6359b40a893e063c6539ace69e22208ae897bce6 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 29 May 2024 08:14:52 +0200 Subject: [PATCH 37/54] Use Gaussian randomness in AntiAFK timer --- .../net/wurstclient/hacks/AntiAfkHack.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java index 0e73a502..c19b4eb7 100644 --- a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java @@ -8,7 +8,6 @@ package net.wurstclient.hacks; import java.util.ArrayList; -import java.util.Random; import com.mojang.blaze3d.systems.RenderSystem; @@ -16,6 +15,7 @@ import net.minecraft.client.render.GameRenderer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.random.Random; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.ai.PathFinder; @@ -63,7 +63,7 @@ public final class AntiAfkHack extends Hack ValueDisplay.DECIMAL.withPrefix("\u00b1").withSuffix("s")); private int timer; - private Random random = new Random(); + private Random random = Random.createLocal(); private BlockPos start; private BlockPos nextBlock; @@ -112,15 +112,6 @@ public final class AntiAfkHack extends Hack PathProcessor.releaseControls(); } - private void setTimer() - { - int baseTime = (int)(waitTime.getValue() * 20); - int randTime = (int)(waitTimeRand.getValue() * 20); - int randOffset = random.nextInt(randTime * 2 + 1) - randTime; - randOffset = Math.max(randOffset, -baseTime); - timer = baseTime + randOffset; - } - @Override public void onUpdate() { @@ -176,7 +167,7 @@ public final class AntiAfkHack extends Hack pathFinder = new RandomPathFinder( randomize(start, aiRange.getValueI(), true)); - // wait 2 - 3 seconds (40 - 60 ticks) + // wait for timer if(processor.isDone()) { PathProcessor.releaseControls(); @@ -222,6 +213,15 @@ public final class AntiAfkHack extends Hack pathCmd.isDepthTest()); } + private void setTimer() + { + int baseTime = (int)(waitTime.getValue() * 20); + double randTime = waitTimeRand.getValue() * 20; + int randOffset = (int)(random.nextGaussian() * randTime); + randOffset = Math.max(randOffset, -baseTime); + timer = baseTime + randOffset; + } + private BlockPos randomize(BlockPos pos, int range, boolean includeY) { int x = random.nextInt(2 * range + 1) - range; From 4181d5ac537d90930cfa0220e5bf64158336f210 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 29 May 2024 08:48:06 +0200 Subject: [PATCH 38/54] Add AntiAFK show wait time setting --- .../java/net/wurstclient/hacks/AntiAfkHack.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java index c19b4eb7..7896c7e1 100644 --- a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java @@ -62,6 +62,10 @@ public final class AntiAfkHack extends Hack 0.5, 0, 60, 0.05, ValueDisplay.DECIMAL.withPrefix("\u00b1").withSuffix("s")); + private final CheckboxSetting showWaitTime = + new CheckboxSetting("Show wait time", + "Displays the remaining wait time in the HackList.", true); + private int timer; private Random random = Random.createLocal(); private BlockPos start; @@ -81,6 +85,16 @@ public final class AntiAfkHack extends Hack addSetting(nonAiRange); addSetting(waitTime); addSetting(waitTimeRand); + addSetting(showWaitTime); + } + + @Override + public String getRenderName() + { + if(showWaitTime.isChecked() && timer > 0) + return getName() + " [" + timer * 50 + "ms]"; + + return getName(); } @Override From 9849f86c6e2d8d2d957f54ccc9d70d800cc60243 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 29 May 2024 08:51:23 +0200 Subject: [PATCH 39/54] Fix AntiAFK waiting longer than it should --- src/main/java/net/wurstclient/hacks/AntiAfkHack.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java index 7896c7e1..b47906b8 100644 --- a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java @@ -178,13 +178,11 @@ public final class AntiAfkHack extends Hack if(!processor.isDone()) processor.process(); else + { + // reset and wait for timer + PathProcessor.releaseControls(); pathFinder = new RandomPathFinder( randomize(start, aiRange.getValueI(), true)); - - // wait for timer - if(processor.isDone()) - { - PathProcessor.releaseControls(); setTimer(); } }else From 63ab8191f70eb23dfbdf6bd6757007c662dfa20b Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 29 May 2024 09:04:04 +0200 Subject: [PATCH 40/54] Fix AntiAFK drowning protection --- src/main/java/net/wurstclient/hacks/AntiAfkHack.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java index b47906b8..6fb96049 100644 --- a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java @@ -140,12 +140,18 @@ public final class AntiAfkHack extends Hack if(useAi.isChecked()) { + // prevent drowning + if(MC.player.isSubmergedInWater() + && !WURST.getHax().jesusHack.isEnabled()) + { + MC.options.jumpKey.setPressed(true); + return; + } + // update timer if(timer > 0) { timer--; - if(!WURST.getHax().jesusHack.isEnabled()) - MC.options.jumpKey.setPressed(MC.player.isTouchingWater()); return; } From a69014b88122dae587cf1b22cc6703db168a9323 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 29 May 2024 09:06:51 +0200 Subject: [PATCH 41/54] Add MC constant in PathFinder --- .../java/net/wurstclient/ai/PathFinder.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/wurstclient/ai/PathFinder.java b/src/main/java/net/wurstclient/ai/PathFinder.java index 060be125..f656fd72 100644 --- a/src/main/java/net/wurstclient/ai/PathFinder.java +++ b/src/main/java/net/wurstclient/ai/PathFinder.java @@ -18,6 +18,7 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.block.*; +import net.minecraft.client.MinecraftClient; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.fluid.Fluid; import net.minecraft.fluid.LavaFluid; @@ -31,6 +32,8 @@ import net.wurstclient.util.RenderUtils; public class PathFinder { + private static final MinecraftClient MC = WurstClient.MC; + private final PlayerAbilities abilities = PlayerAbilities.get(); protected boolean fallingAllowed = true; protected boolean divingAllowed = true; @@ -53,13 +56,11 @@ public class PathFinder public PathFinder(BlockPos goal) { - if(WurstClient.MC.player.isOnGround()) - start = new PathPos(BlockPos.ofFloored(WurstClient.MC.player.getX(), - WurstClient.MC.player.getY() + 0.5, - WurstClient.MC.player.getZ())); + if(MC.player.isOnGround()) + start = new PathPos(BlockPos.ofFloored(MC.player.getX(), + MC.player.getY() + 0.5, MC.player.getZ())); else - start = - new PathPos(BlockPos.ofFloored(WurstClient.MC.player.getPos())); + start = new PathPos(BlockPos.ofFloored(MC.player.getPos())); this.goal = goal; costMap.put(start, 0F); @@ -183,7 +184,7 @@ public class PathFinder } // up - if(pos.getY() < WurstClient.MC.world.getTopY() && canGoThrough(up.up()) + if(pos.getY() < MC.world.getTopY() && canGoThrough(up.up()) && (flying || onGround || canClimbUpAt(pos)) && (flying || canClimbUpAt(pos) || goal.equals(up) || canSafelyStandOn(north) || canSafelyStandOn(east) @@ -192,7 +193,7 @@ public class PathFinder neighbors.add(new PathPos(up, onGround)); // down - if(pos.getY() > WurstClient.MC.world.getBottomY() && canGoThrough(down) + if(pos.getY() > MC.world.getBottomY() && canGoThrough(down) && canGoAbove(down.down()) && (flying || canFallBelow(pos)) && (divingAllowed || BlockUtils.getBlock(pos) != Blocks.WATER)) neighbors.add(new PathPos(down)); @@ -282,7 +283,7 @@ public class PathFinder // check if loaded // Can't see why isChunkLoaded() is deprecated. Still seems to be widely // used with no replacement. - if(!WurstClient.MC.world.isChunkLoaded(pos)) + if(!MC.world.isChunkLoaded(pos)) return false; // check if solid From 4d520a5d4f373c9c956e1c3fd1e483678ba2328d Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 29 May 2024 09:11:59 +0200 Subject: [PATCH 42/54] Use MC constant in PathProcessor.lockControls() --- src/main/java/net/wurstclient/ai/PathProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/wurstclient/ai/PathProcessor.java b/src/main/java/net/wurstclient/ai/PathProcessor.java index c78f535d..62d57ac4 100644 --- a/src/main/java/net/wurstclient/ai/PathProcessor.java +++ b/src/main/java/net/wurstclient/ai/PathProcessor.java @@ -70,7 +70,7 @@ public abstract class PathProcessor key.setPressed(false); // disable sprinting - WurstClient.MC.player.setSprinting(false); + MC.player.setSprinting(false); } public static final void releaseControls() From 324e269bf4202a650a067b2bd0fd68b75c788284 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 29 May 2024 09:35:15 +0200 Subject: [PATCH 43/54] Remove redundant reset of forward and jump keys --- src/main/java/net/wurstclient/hacks/AntiAfkHack.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java index 6fb96049..14c21332 100644 --- a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java @@ -26,7 +26,6 @@ import net.wurstclient.events.RenderListener; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.DontSaveState; import net.wurstclient.hack.Hack; -import net.wurstclient.mixinterface.IKeyBinding; import net.wurstclient.settings.CheckboxSetting; import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; @@ -117,13 +116,9 @@ public final class AntiAfkHack extends Hack { EVENTS.remove(UpdateListener.class, this); EVENTS.remove(RenderListener.class, this); - - IKeyBinding.get(MC.options.forwardKey).resetPressedState(); - IKeyBinding.get(MC.options.jumpKey).resetPressedState(); - + PathProcessor.releaseControls(); pathFinder = null; processor = null; - PathProcessor.releaseControls(); } @Override From 7aec736c1a628160cecd6abd2c9b67a960b5734b Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 29 May 2024 10:57:33 +0200 Subject: [PATCH 44/54] Use HandleInputListener in KillauraHack --- src/main/java/net/wurstclient/hacks/KillauraHack.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/KillauraHack.java b/src/main/java/net/wurstclient/hacks/KillauraHack.java index 58c7c244..b2f7ab08 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraHack.java @@ -25,7 +25,7 @@ import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; import net.wurstclient.Category; import net.wurstclient.SearchTags; -import net.wurstclient.events.PostMotionListener; +import net.wurstclient.events.HandleInputListener; import net.wurstclient.events.RenderListener; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; @@ -47,7 +47,7 @@ import net.wurstclient.util.RotationUtils; @SearchTags({"kill aura", "ForceField", "force field", "CrystalAura", "crystal aura", "AutoCrystal", "auto crystal"}) public final class KillauraHack extends Hack - implements UpdateListener, PostMotionListener, RenderListener + implements UpdateListener, HandleInputListener, RenderListener { private final SliderSetting range = new SliderSetting("Range", "Determines how far Killaura will reach to attack entities.\n" @@ -124,7 +124,7 @@ public final class KillauraHack extends Hack speed.resetTimer(); EVENTS.add(UpdateListener.class, this); - EVENTS.add(PostMotionListener.class, this); + EVENTS.add(HandleInputListener.class, this); EVENTS.add(RenderListener.class, this); } @@ -132,7 +132,7 @@ public final class KillauraHack extends Hack protected void onDisable() { EVENTS.remove(UpdateListener.class, this); - EVENTS.remove(PostMotionListener.class, this); + EVENTS.remove(HandleInputListener.class, this); EVENTS.remove(RenderListener.class, this); target = null; @@ -177,7 +177,7 @@ public final class KillauraHack extends Hack } @Override - public void onPostMotion() + public void onHandleInput() { if(target == null) return; From 96985c09d692ec06777130e6e67bdc9987aed604 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 29 May 2024 11:04:40 +0200 Subject: [PATCH 45/54] Add speed randomization to KillauraHack --- .../java/net/wurstclient/hacks/KillauraHack.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/KillauraHack.java b/src/main/java/net/wurstclient/hacks/KillauraHack.java index b2f7ab08..7e21b0f4 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraHack.java @@ -57,6 +57,15 @@ public final class KillauraHack extends Hack private final AttackSpeedSliderSetting speed = new AttackSpeedSliderSetting(); + private final SliderSetting speedRandMS = + new SliderSetting("Speed randomization", + "Helps you bypass anti-cheat plugins by varying the delay between" + + " attacks.\n\n" + "\u00b1100ms is recommended for Vulcan.\n\n" + + "0 (off) is fine for NoCheat+, AAC, Grim, Verus, Spartan, and" + + " vanilla servers.", + 100, 0, 1000, 50, ValueDisplay.INTEGER.withPrefix("\u00b1") + .withSuffix("ms").withLabel(0, "off")); + private final EnumSetting priority = new EnumSetting<>("Priority", "Determines which entity will be attacked first.\n" + "\u00a7lDistance\u00a7r - Attacks the closest entity.\n" @@ -98,6 +107,7 @@ public final class KillauraHack extends Hack addSetting(range); addSetting(speed); + addSetting(speedRandMS); addSetting(priority); addSetting(fov); addSetting(swingHand); @@ -122,7 +132,7 @@ public final class KillauraHack extends Hack WURST.getHax().triggerBotHack.setEnabled(false); WURST.getHax().tpAuraHack.setEnabled(false); - speed.resetTimer(); + speed.resetTimer(speedRandMS.getValue()); EVENTS.add(UpdateListener.class, this); EVENTS.add(HandleInputListener.class, this); EVENTS.add(RenderListener.class, this); @@ -187,7 +197,7 @@ public final class KillauraHack extends Hack swingHand.swing(Hand.MAIN_HAND); target = null; - speed.resetTimer(); + speed.resetTimer(speedRandMS.getValue()); } @Override From a748f3f9580e354d4bc16db761be6e61eb1ed316 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 30 May 2024 09:03:57 +0200 Subject: [PATCH 46/54] Update Fabric stuff --- build.gradle | 24 +++--------------------- gradle.properties | 4 ++-- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index f09b401d..0b10ef1a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,12 @@ buildscript { dependencies { - classpath 'org.kohsuke:github-api:1.321' + classpath "org.kohsuke:github-api:1.321" } } plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' - id 'maven-publish' - id 'com.diffplug.spotless' version '6.25.0' + id "fabric-loom" version "1.6-SNAPSHOT" + id "com.diffplug.spotless" version "6.25.0" } def ENV = System.getenv() @@ -85,23 +84,6 @@ spotless { } } -// configure the maven publication -publishing { - publications { - create("mavenJava", MavenPublication) { - from components.java - } - } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // Add repositories to publish to here. - // Notice: This block does NOT have the same function as the block in the top level. - // The repositories here will be used for publishing your artifact, not for - // retrieving dependencies. - } -} - task moveDevLibs(dependsOn: [remapJar, remapSourcesJar]) { doLast { ant.move(file:"${project.buildDir}/devlibs/${archivesBaseName}-${version}-dev.jar", tofile:"${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar") diff --git a/gradle.properties b/gradle.properties index e96a998e..ab05e9db 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,11 +6,11 @@ org.gradle.parallel=true # check these at https://fabricmc.net/develop/ and # https://modrinth.com/mod/fabric-api/versions minecraft_version=1.20.6 -yarn_mappings=1.20.6+build.1 +yarn_mappings=1.20.6+build.3 loader_version=0.15.11 # Fabric API -fabric_version=0.98.0+1.20.6 +fabric_version=0.99.0+1.20.6 # Mod Properties mod_version = v7.43pre2-MC1.20.6 From 871597fd89010bbd1fa6d991e64143c840bea63f Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 30 May 2024 09:44:53 +0200 Subject: [PATCH 47/54] Fix AimAssist detection --- .../events/MouseUpdateListener.java | 77 +++++++++++++++++++ .../net/wurstclient/hacks/AimAssistHack.java | 28 +++---- .../net/wurstclient/mixin/MouseMixin.java | 17 ++++ 3 files changed, 108 insertions(+), 14 deletions(-) create mode 100644 src/main/java/net/wurstclient/events/MouseUpdateListener.java diff --git a/src/main/java/net/wurstclient/events/MouseUpdateListener.java b/src/main/java/net/wurstclient/events/MouseUpdateListener.java new file mode 100644 index 00000000..23467448 --- /dev/null +++ b/src/main/java/net/wurstclient/events/MouseUpdateListener.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.events; + +import java.util.ArrayList; + +import net.wurstclient.event.Event; +import net.wurstclient.event.Listener; + +public interface MouseUpdateListener extends Listener +{ + public void onMouseUpdate(MouseUpdateEvent event); + + public static class MouseUpdateEvent extends Event + { + private double deltaX; + private double deltaY; + private final double defaultDeltaX; + private final double defaultDeltaY; + + public MouseUpdateEvent(double deltaX, double deltaY) + { + this.deltaX = deltaX; + this.deltaY = deltaY; + defaultDeltaX = deltaX; + defaultDeltaY = deltaY; + } + + @Override + public void fire(ArrayList listeners) + { + for(MouseUpdateListener listener : listeners) + listener.onMouseUpdate(this); + } + + @Override + public Class getListenerType() + { + return MouseUpdateListener.class; + } + + public double getDeltaX() + { + return deltaX; + } + + public void setDeltaX(double deltaX) + { + this.deltaX = deltaX; + } + + public double getDeltaY() + { + return deltaY; + } + + public void setDeltaY(double deltaY) + { + this.deltaY = deltaY; + } + + public double getDefaultDeltaX() + { + return defaultDeltaX; + } + + public double getDefaultDeltaY() + { + return defaultDeltaY; + } + } +} diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 7659268a..362550c1 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -11,13 +11,12 @@ import java.util.Comparator; import java.util.stream.Stream; import net.minecraft.client.gui.screen.ingame.HandledScreen; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.Entity; import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.wurstclient.Category; -import net.wurstclient.events.RenderListener; +import net.wurstclient.events.MouseUpdateListener; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; import net.wurstclient.settings.CheckboxSetting; @@ -31,7 +30,7 @@ import net.wurstclient.util.Rotation; import net.wurstclient.util.RotationUtils; public final class AimAssistHack extends Hack - implements UpdateListener, RenderListener + implements UpdateListener, MouseUpdateListener { private final SliderSetting range = new SliderSetting("Range", 4.5, 1, 6, 0.05, ValueDisplay.DECIMAL); @@ -115,14 +114,14 @@ public final class AimAssistHack extends Hack WURST.getHax().tpAuraHack.setEnabled(false); EVENTS.add(UpdateListener.class, this); - EVENTS.add(RenderListener.class, this); + EVENTS.add(MouseUpdateListener.class, this); } @Override protected void onDisable() { EVENTS.remove(UpdateListener.class, this); - EVENTS.remove(RenderListener.class, this); + EVENTS.remove(MouseUpdateListener.class, this); target = null; } @@ -187,16 +186,17 @@ public final class AimAssistHack extends Hack } @Override - public void onRender(MatrixStack matrixStack, float partialTicks) + public void onMouseUpdate(MouseUpdateEvent event) { - if(target == null) + if(target == null || MC.player == null) return; - - // Not actually rendering anything, just using this method to rotate - // more smoothly. - float oldYaw = MC.player.prevYaw; - float oldPitch = MC.player.prevPitch; - MC.player.setYaw(MathHelper.lerp(partialTicks, oldYaw, nextYaw)); - MC.player.setPitch(MathHelper.lerp(partialTicks, oldPitch, nextPitch)); + + int diffYaw = (int)(nextYaw - MC.player.getYaw()); + int diffPitch = (int)(nextPitch - MC.player.getPitch()); + if(MathHelper.abs(diffYaw) < 1 && MathHelper.abs(diffPitch) < 1) + return; + + event.setDeltaX(event.getDefaultDeltaX() + diffYaw); + event.setDeltaY(event.getDefaultDeltaY() + diffPitch); } } diff --git a/src/main/java/net/wurstclient/mixin/MouseMixin.java b/src/main/java/net/wurstclient/mixin/MouseMixin.java index 5b5e3690..01db1018 100644 --- a/src/main/java/net/wurstclient/mixin/MouseMixin.java +++ b/src/main/java/net/wurstclient/mixin/MouseMixin.java @@ -8,6 +8,7 @@ package net.wurstclient.mixin; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -15,14 +16,30 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import net.minecraft.client.Mouse; import net.wurstclient.event.EventManager; import net.wurstclient.events.MouseScrollListener.MouseScrollEvent; +import net.wurstclient.events.MouseUpdateListener.MouseUpdateEvent; @Mixin(Mouse.class) public class MouseMixin { + @Shadow + private double cursorDeltaX; + @Shadow + private double cursorDeltaY; + @Inject(at = @At("RETURN"), method = "onMouseScroll(JDD)V") private void onOnMouseScroll(long window, double horizontal, double vertical, CallbackInfo ci) { EventManager.fire(new MouseScrollEvent(vertical)); } + + @Inject(at = @At("HEAD"), method = "tick()V") + private void onTick(CallbackInfo ci) + { + MouseUpdateEvent event = + new MouseUpdateEvent(cursorDeltaX, cursorDeltaY); + EventManager.fire(event); + cursorDeltaX = event.getDeltaX(); + cursorDeltaY = event.getDeltaY(); + } } From e6706624b0021eca4044e075a2d62087e8ab08a7 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 30 May 2024 09:48:06 +0200 Subject: [PATCH 48/54] Update recommendations for input simulation --- .../net/wurstclient/events/HandleInputListener.java | 6 +++--- .../net/wurstclient/events/MouseUpdateListener.java | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/wurstclient/events/HandleInputListener.java b/src/main/java/net/wurstclient/events/HandleInputListener.java index bc0955ac..928a72f2 100644 --- a/src/main/java/net/wurstclient/events/HandleInputListener.java +++ b/src/main/java/net/wurstclient/events/HandleInputListener.java @@ -15,19 +15,19 @@ import net.wurstclient.event.Listener; /** * Fired at the beginning of {@link MinecraftClient#handleInputEvents()}. - * This is the ideal time to simulate mouse and keyboard input. + * This is the ideal time to simulate keyboard input. */ public interface HandleInputListener extends Listener { /** * Fired at the beginning of {@link MinecraftClient#handleInputEvents()}. - * This is the ideal time to simulate mouse and keyboard input. + * This is the ideal time to simulate keyboard input. */ public void onHandleInput(); /** * Fired at the beginning of {@link MinecraftClient#handleInputEvents()}. - * This is the ideal time to simulate mouse and keyboard input. + * This is the ideal time to simulate keyboard input. */ public static class HandleInputEvent extends Event { diff --git a/src/main/java/net/wurstclient/events/MouseUpdateListener.java b/src/main/java/net/wurstclient/events/MouseUpdateListener.java index 23467448..509a4c6d 100644 --- a/src/main/java/net/wurstclient/events/MouseUpdateListener.java +++ b/src/main/java/net/wurstclient/events/MouseUpdateListener.java @@ -9,13 +9,26 @@ package net.wurstclient.events; import java.util.ArrayList; +import net.minecraft.client.Mouse; import net.wurstclient.event.Event; import net.wurstclient.event.Listener; +/** + * Fired at the beginning of {@link Mouse#tick()}. + * This is the ideal time to simulate mouse input. + */ public interface MouseUpdateListener extends Listener { + /** + * Fired at the beginning of {@link Mouse#tick()}. + * This is the ideal time to simulate mouse input. + */ public void onMouseUpdate(MouseUpdateEvent event); + /** + * Fired at the beginning of {@link Mouse#tick()}. + * This is the ideal time to simulate mouse input. + */ public static class MouseUpdateEvent extends Event { private double deltaX; From 677c4c45e799c7d08b2f591140066b1f5a2fce7f Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 30 May 2024 12:01:55 +0200 Subject: [PATCH 49/54] Add new input simulation and speed randomization to KillauraLegit Fixes #492 Fixes #214 --- .../wurstclient/hacks/KillauraLegitHack.java | 70 ++++++++++++++----- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index 7245e35a..9d9cf86e 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -26,6 +26,8 @@ import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.wurstclient.Category; +import net.wurstclient.events.HandleInputListener; +import net.wurstclient.events.MouseUpdateListener; import net.wurstclient.events.RenderListener; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; @@ -45,8 +47,8 @@ import net.wurstclient.util.RenderUtils; import net.wurstclient.util.Rotation; import net.wurstclient.util.RotationUtils; -public final class KillauraLegitHack extends Hack - implements UpdateListener, RenderListener +public final class KillauraLegitHack extends Hack implements UpdateListener, + HandleInputListener, MouseUpdateListener, RenderListener { private final SliderSetting range = new SliderSetting("Range", 4.25, 1, 4.25, 0.05, ValueDisplay.DECIMAL); @@ -54,6 +56,15 @@ public final class KillauraLegitHack extends Hack private final AttackSpeedSliderSetting speed = new AttackSpeedSliderSetting(); + private final SliderSetting speedRandMS = + new SliderSetting("Speed randomization", + "Helps you bypass anti-cheat plugins by varying the delay between" + + " attacks.\n\n" + "\u00b1100ms is recommended for Vulcan.\n\n" + + "0 (off) is fine for NoCheat+, AAC, Grim, Verus, Spartan, and" + + " vanilla servers.", + 100, 0, 1000, 50, ValueDisplay.INTEGER.withPrefix("\u00b1") + .withSuffix("ms").withLabel(0, "off")); + private final SliderSetting rotationSpeed = new SliderSetting("Rotation Speed", 600, 10, 3600, 10, ValueDisplay.DEGREES.withSuffix("/s")); @@ -122,6 +133,7 @@ public final class KillauraLegitHack extends Hack addSetting(range); addSetting(speed); + addSetting(speedRandMS); addSetting(rotationSpeed); addSetting(priority); addSetting(fov); @@ -145,8 +157,10 @@ public final class KillauraLegitHack extends Hack WURST.getHax().triggerBotHack.setEnabled(false); WURST.getHax().tpAuraHack.setEnabled(false); - speed.resetTimer(); + speed.resetTimer(speedRandMS.getValue()); EVENTS.add(UpdateListener.class, this); + EVENTS.add(HandleInputListener.class, this); + EVENTS.add(MouseUpdateListener.class, this); EVENTS.add(RenderListener.class, this); } @@ -154,6 +168,8 @@ public final class KillauraLegitHack extends Hack protected void onDisable() { EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(HandleInputListener.class, this); + EVENTS.remove(MouseUpdateListener.class, this); EVENTS.remove(RenderListener.class, this); target = null; } @@ -161,16 +177,14 @@ public final class KillauraLegitHack extends Hack @Override public void onUpdate() { - speed.updateTimer(); - if(!speed.isTimeToAttack()) - return; + target = null; // don't attack when a container/inventory screen is open if(MC.currentScreen instanceof HandledScreen) return; Stream stream = EntityUtils.getAttackableEntities(); - double rangeSq = Math.pow(range.getValue(), 2); + double rangeSq = range.getValueSq(); stream = stream.filter(e -> MC.player.squaredDistanceTo(e) <= rangeSq); if(fov.getValue() < 360.0) @@ -183,8 +197,6 @@ public final class KillauraLegitHack extends Hack if(target == null) return; - WURST.getHax().autoSwordHack.setSlot(target); - // check line of sight if(!BlockUtils.hasLineOfSight(target.getBoundingBox().getCenter())) { @@ -193,14 +205,29 @@ public final class KillauraLegitHack extends Hack } // face entity - if(!faceEntityClient(target)) + WURST.getHax().autoSwordHack.setSlot(target); + faceEntityClient(target); + } + + @Override + public void onHandleInput() + { + if(target == null) + return; + + speed.updateTimer(); + if(!speed.isTimeToAttack()) + return; + + if(!RotationUtils.isFacingBox(target.getBoundingBox(), + range.getValue())) return; // attack entity WURST.getHax().criticalsHack.doCritical(); MC.interactionManager.attackEntity(MC.player, target); swingHand.swing(Hand.MAIN_HAND); - speed.resetTimer(); + speed.resetTimer(speedRandMS.getValue()); } private boolean faceEntityClient(Entity entity) @@ -224,17 +251,24 @@ public final class KillauraLegitHack extends Hack } @Override - public void onRender(MatrixStack matrixStack, float partialTicks) + public void onMouseUpdate(MouseUpdateEvent event) { - if(target == null) + if(target == null || MC.player == null) return; - float oldYaw = MC.player.prevYaw; - float oldPitch = MC.player.prevPitch; - MC.player.setYaw(MathHelper.lerp(partialTicks, oldYaw, nextYaw)); - MC.player.setPitch(MathHelper.lerp(partialTicks, oldPitch, nextPitch)); + int diffYaw = (int)(nextYaw - MC.player.getYaw()); + int diffPitch = (int)(nextPitch - MC.player.getPitch()); + if(MathHelper.abs(diffYaw) < 1 && MathHelper.abs(diffPitch) < 1) + return; - if(!damageIndicator.isChecked()) + event.setDeltaX(event.getDefaultDeltaX() + diffYaw); + event.setDeltaY(event.getDefaultDeltaY() + diffPitch); + } + + @Override + public void onRender(MatrixStack matrixStack, float partialTicks) + { + if(target == null || !damageIndicator.isChecked()) return; // GL settings From 8b843868b7431bb7530715909e9a33a9208b3de8 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 30 May 2024 12:13:24 +0200 Subject: [PATCH 50/54] Update Fabric stuff --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index ab05e9db..64c188d9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ yarn_mappings=1.20.6+build.3 loader_version=0.15.11 # Fabric API -fabric_version=0.99.0+1.20.6 +fabric_version=0.99.3+1.20.6 # Mod Properties mod_version = v7.43pre2-MC1.20.6 From a8fcc2ac283540a5cf23ed684b1398f05247f93f Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 30 May 2024 20:51:11 +0200 Subject: [PATCH 51/54] Update Fabric stuff for the third time today --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 64c188d9..c5f5f3d2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ yarn_mappings=1.20.6+build.3 loader_version=0.15.11 # Fabric API -fabric_version=0.99.3+1.20.6 +fabric_version=0.99.4+1.20.6 # Mod Properties mod_version = v7.43pre2-MC1.20.6 From 21ab04cf1e0d2dea63b6e4114af4280c84bc8ff3 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sun, 9 Jun 2024 14:43:48 +0200 Subject: [PATCH 52/54] Add AimAtSetting to AimAssistHack --- .../net/wurstclient/hacks/AimAssistHack.java | 54 ++++---- .../wurstclient/settings/AimAtSetting.java | 130 ++++++++++++++++++ 2 files changed, 156 insertions(+), 28 deletions(-) create mode 100644 src/main/java/net/wurstclient/settings/AimAtSetting.java diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 362550c1..6d9bee7a 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -12,13 +12,13 @@ import java.util.stream.Stream; import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.entity.Entity; -import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.wurstclient.Category; import net.wurstclient.events.MouseUpdateListener; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; +import net.wurstclient.settings.AimAtSetting; import net.wurstclient.settings.CheckboxSetting; import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; @@ -44,6 +44,9 @@ public final class AimAssistHack extends Hack + "360\u00b0 = aims at entities all around you.", 120, 30, 360, 10, ValueDisplay.DEGREES); + private final AimAtSetting aimAt = new AimAtSetting( + "What point in the target's hitbox AimAssist should aim at."); + private final CheckboxSetting checkLOS = new CheckboxSetting( "Check line of sight", "Won't aim at entities behind blocks.", true); @@ -93,6 +96,7 @@ public final class AimAssistHack extends Hack addSetting(range); addSetting(rotationSpeed); addSetting(fov); + addSetting(aimAt); addSetting(checkLOS); addSetting(aimWhileBlocking); @@ -137,24 +141,11 @@ public final class AimAssistHack extends Hack if(!aimWhileBlocking.isChecked() && MC.player.isUsingItem()) return; - Stream stream = EntityUtils.getAttackableEntities(); - double rangeSq = Math.pow(range.getValue(), 2); - stream = stream.filter(e -> MC.player.squaredDistanceTo(e) <= rangeSq); - - if(fov.getValue() < 360.0) - stream = stream.filter(e -> RotationUtils.getAngleToLookVec( - e.getBoundingBox().getCenter()) <= fov.getValue() / 2.0); - - stream = entityFilters.applyTo(stream); - - target = stream - .min(Comparator.comparingDouble(e -> RotationUtils - .getAngleToLookVec(e.getBoundingBox().getCenter()))) - .orElse(null); + chooseTarget(); if(target == null) return; - Vec3d hitVec = target.getBoundingBox().getCenter(); + Vec3d hitVec = aimAt.getAimPoint(target); if(checkLOS.isChecked() && !BlockUtils.hasLineOfSight(hitVec)) { target = null; @@ -162,27 +153,34 @@ public final class AimAssistHack extends Hack } WURST.getHax().autoSwordHack.setSlot(target); - faceEntityClient(target); - } - - private boolean faceEntityClient(Entity entity) - { + // get needed rotation - Box box = entity.getBoundingBox(); - Rotation needed = RotationUtils.getNeededRotations(box.getCenter()); + Rotation needed = RotationUtils.getNeededRotations(hitVec); // turn towards center of boundingBox Rotation next = RotationUtils.slowlyTurnTowards(needed, rotationSpeed.getValueI() / 20F); nextYaw = next.yaw(); nextPitch = next.pitch(); + } + + private void chooseTarget() + { + Stream stream = EntityUtils.getAttackableEntities(); - // check if facing center - if(RotationUtils.isAlreadyFacing(needed)) - return true; + double rangeSq = range.getValueSq(); + stream = stream.filter(e -> MC.player.squaredDistanceTo(e) <= rangeSq); - // if not facing center, check if facing anything in boundingBox - return RotationUtils.isFacingBox(box, range.getValue()); + if(fov.getValue() < 360.0) + stream = stream.filter(e -> RotationUtils.getAngleToLookVec( + aimAt.getAimPoint(e)) <= fov.getValue() / 2.0); + + stream = entityFilters.applyTo(stream); + + target = stream + .min(Comparator.comparingDouble( + e -> RotationUtils.getAngleToLookVec(aimAt.getAimPoint(e)))) + .orElse(null); } @Override diff --git a/src/main/java/net/wurstclient/settings/AimAtSetting.java b/src/main/java/net/wurstclient/settings/AimAtSetting.java new file mode 100644 index 00000000..edaffbc1 --- /dev/null +++ b/src/main/java/net/wurstclient/settings/AimAtSetting.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.settings; + +import java.util.function.Function; + +import net.minecraft.entity.Entity; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; +import net.wurstclient.util.RotationUtils; + +public final class AimAtSetting extends EnumSetting +{ + private static final String FULL_DESCRIPTION_SUFFIX = + buildDescriptionSuffix(); + + private AimAtSetting(String name, String description, AimAt[] values, + AimAt selected) + { + super(name, description, values, selected); + } + + public AimAtSetting(String name, String description, AimAt selected) + { + this(name, description + FULL_DESCRIPTION_SUFFIX, AimAt.values(), + selected); + } + + public AimAtSetting(String description, AimAt selected) + { + this("Aim at", description, selected); + } + + public AimAtSetting(String description) + { + this(description, AimAt.AUTO); + } + + public Vec3d getAimPoint(Entity e) + { + return getSelected().aimFunction.apply(e); + } + + private static String buildDescriptionSuffix() + { + StringBuilder builder = new StringBuilder("\n\n"); + AimAt[] values = AimAt.values(); + + for(AimAt value : values) + builder.append("\u00a7l").append(value.name).append("\u00a7r - ") + .append(value.description).append("\n\n"); + + return builder.toString(); + } + + private static Vec3d aimAtClosestPoint(Entity e) + { + Box box = e.getBoundingBox(); + Vec3d eyes = RotationUtils.getEyesPos(); + + if(box.contains(eyes)) + return eyes; + + double clampedX = MathHelper.clamp(eyes.x, box.minX, box.maxX); + double clampedY = MathHelper.clamp(eyes.y, box.minY, box.maxY); + double clampedZ = MathHelper.clamp(eyes.z, box.minZ, box.maxZ); + + return new Vec3d(clampedX, clampedY, clampedZ); + } + + private static Vec3d aimAtHead(Entity e) + { + float eyeHeight = e.getEyeHeight(e.getPose()); + return e.getPos().add(0, eyeHeight, 0); + } + + private static Vec3d aimAtCenter(Entity e) + { + return e.getBoundingBox().getCenter(); + } + + private static Vec3d aimAtFeet(Entity e) + { + return e.getPos().add(0, 0.001, 0); + } + + public enum AimAt + { + AUTO("Auto", "Aims at the closest point of the target's hitbox.", + AimAtSetting::aimAtClosestPoint), + + HEAD("Head", "Aims at the target's eye position.", + AimAtSetting::aimAtHead), + + CENTER("Center", "Aims at the center of the target's hitbox.", + AimAtSetting::aimAtCenter), + + FEET("Feet", "Aims at the bottom of the target's hitbox.", + AimAtSetting::aimAtFeet); + + private final String name; + private final String description; + private final Function aimFunction; + + private AimAt(String name, String description, + Function aimFunction) + { + this.name = name; + this.description = description; + this.aimFunction = aimFunction; + } + + public Vec3d getAimPoint(Entity e) + { + return aimFunction.apply(e); + } + + @Override + public String toString() + { + return name; + } + } +} From ca61ec184511e28a1fbdac6e19e63be546841701 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sun, 9 Jun 2024 18:32:23 +0200 Subject: [PATCH 53/54] Fix AimAssist missing at certain angles --- .../net/wurstclient/hacks/AimAssistHack.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 6d9bee7a..8de1d135 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -12,7 +12,6 @@ import java.util.stream.Stream; import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.entity.Entity; -import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.wurstclient.Category; import net.wurstclient.events.MouseUpdateListener; @@ -189,10 +188,19 @@ public final class AimAssistHack extends Hack if(target == null || MC.player == null) return; - int diffYaw = (int)(nextYaw - MC.player.getYaw()); - int diffPitch = (int)(nextPitch - MC.player.getPitch()); - if(MathHelper.abs(diffYaw) < 1 && MathHelper.abs(diffPitch) < 1) - return; + float curYaw = MC.player.getYaw(); + float curPitch = MC.player.getPitch(); + int diffYaw = (int)(nextYaw - curYaw); + int diffPitch = (int)(nextPitch - curPitch); + + // If we are <1 degree off but still missing the hitbox, + // slightly exaggerate the difference to fix that. + if(diffYaw == 0 && diffPitch == 0 && !RotationUtils + .isFacingBox(target.getBoundingBox(), range.getValue())) + { + diffYaw = nextYaw < curYaw ? -1 : 1; + diffPitch = nextPitch < curPitch ? -1 : 1; + } event.setDeltaX(event.getDefaultDeltaX() + diffYaw); event.setDeltaY(event.getDefaultDeltaY() + diffPitch); From eb6615f210b028a3f41a1a778dc51715b979cf11 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 14 Jun 2024 09:01:54 +0200 Subject: [PATCH 54/54] Change version to 7.43 --- gradle.properties | 2 +- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index c5f5f3d2..a59aeea9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ loader_version=0.15.11 fabric_version=0.99.4+1.20.6 # Mod Properties -mod_version = v7.43pre2-MC1.20.6 +mod_version = v7.43-MC1.20.6 maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 03e3fc96..265e03d8 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -58,7 +58,7 @@ public enum WurstClient public static MinecraftClient MC; public static IMinecraftClient IMC; - public static final String VERSION = "7.43pre2"; + public static final String VERSION = "7.43"; public static final String MC_VERSION = "1.20.6"; private WurstAnalytics analytics;