From 495c4183dc4371945fa5c7506ca264f43ff428f5 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 18 Dec 2023 20:25:41 +0100 Subject: [PATCH 01/35] [Wurst-Bot] Update to 23w51b --- gradle.properties | 10 +++++----- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index a10b2a86..4408ab56 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=1.20.4 -yarn_mappings=1.20.4+build.3 -loader_version=0.15.2 +minecraft_version=23w51b +yarn_mappings=23w51b+build.1 +loader_version=0.15.3 #Fabric api -fabric_version=0.91.2+1.20.4 +fabric_version=0.91.4+1.20.5 # Mod Properties -mod_version = v7.40-MC1.20.4 +mod_version = v7.40-MC23w51b 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 5f0025c2..0ff04a33 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 IMinecraftClient IMC; public static final String VERSION = "7.40"; - public static final String MC_VERSION = "1.20.4"; + public static final String MC_VERSION = "23w51b"; private WurstAnalytics analytics; private EventManager eventManager; From 9a6b7540bd60fb51b685d20946a5cde391a8e5dc Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 19 Dec 2023 19:45:07 +0100 Subject: [PATCH 02/35] Update to 23w51a/b --- .../net/wurstclient/commands/PotionCmd.java | 33 +++++++++---------- .../net/wurstclient/hacks/AutoEatHack.java | 4 ++- .../net/wurstclient/hacks/AutoPotionHack.java | 4 ++- .../net/wurstclient/hacks/LiquidsHack.java | 2 +- .../java/net/wurstclient/hacks/ReachHack.java | 9 ++--- .../net/wurstclient/hacks/SafeWalkHack.java | 2 +- .../java/net/wurstclient/hacks/StepHack.java | 17 +++++----- .../wurstclient/mixin/ChatScreenMixin.java | 9 +++-- .../mixin/ClientPlayerEntityMixin.java | 32 +++++++++++++++++- .../ClientPlayerInteractionManagerMixin.java | 29 ---------------- .../mixin/EntityRendererMixin.java | 9 ++--- .../net/wurstclient/mixin/IngameHudMixin.java | 13 ++++---- .../serverfinder/WurstServerPinger.java | 2 +- src/main/resources/fabric.mod.json | 4 +-- src/main/resources/wurst.accesswidener | 1 - 15 files changed, 86 insertions(+), 84 deletions(-) diff --git a/src/main/java/net/wurstclient/commands/PotionCmd.java b/src/main/java/net/wurstclient/commands/PotionCmd.java index 66b20635..199a3801 100644 --- a/src/main/java/net/wurstclient/commands/PotionCmd.java +++ b/src/main/java/net/wurstclient/commands/PotionCmd.java @@ -80,7 +80,7 @@ public final class PotionCmd extends Command { NbtCompound effect = new NbtCompound(); - effect.putInt("id", parseEffectId(args[1 + i * 3])); + effect.putString("id", parseEffectId(args[1 + i * 3])); effect.putInt("amplifier", parseInt(args[2 + i * 3]) - 1); effect.putInt("duration", parseInt(args[3 + i * 3]) * 20); @@ -103,8 +103,9 @@ public final class PotionCmd extends Command { NbtCompound tag = new NbtCompound(); - int id = Registries.STATUS_EFFECT.getRawId(effect.getEffectType()); - tag.putInt("id", id); + String id = Registries.STATUS_EFFECT + .getId(effect.getEffectType().value()).toString(); + tag.putString("id", id); tag.putInt("amplifier", effect.getAmplifier()); tag.putInt("duration", effect.getDuration()); @@ -119,7 +120,7 @@ public final class PotionCmd extends Command if(args.length != 2) throw new CmdSyntaxError(); - int id = parseEffectId(args[1]); + String id = parseEffectId(args[1]); List oldEffects = PotionUtil.getCustomPotionEffects(stack); @@ -127,14 +128,14 @@ public final class PotionCmd extends Command NbtList newEffects = new NbtList(); for(StatusEffectInstance oldEffect : oldEffects) { - int oldId = - Registries.STATUS_EFFECT.getRawId(oldEffect.getEffectType()); + String oldId = Registries.STATUS_EFFECT + .getId(oldEffect.getEffectType().value()).toString(); - if(oldId == id) + if(oldId.equals(id)) continue; NbtCompound effect = new NbtCompound(); - effect.putInt("id", oldId); + effect.putString("id", oldId); effect.putInt("amplifier", oldEffect.getAmplifier()); effect.putInt("duration", oldEffect.getDuration()); newEffects.add(effect); @@ -146,29 +147,27 @@ public final class PotionCmd extends Command ChatUtils.message("Effect removed."); } - private int parseEffectId(String input) throws CmdSyntaxError + private String parseEffectId(String input) throws CmdSyntaxError { - int id = 0; + StatusEffect effect; if(MathUtils.isInteger(input)) - id = Integer.parseInt(input); + effect = Registries.STATUS_EFFECT.get(Integer.parseInt(input)); else try { Identifier identifier = new Identifier(input); - StatusEffect effect = Registries.STATUS_EFFECT.get(identifier); - - id = Registries.STATUS_EFFECT.getRawId(effect); + effect = Registries.STATUS_EFFECT.get(identifier); }catch(InvalidIdentifierException e) { throw new CmdSyntaxError("Invalid effect: " + input); } - if(id < 1) - throw new CmdSyntaxError(); + if(effect == null) + throw new CmdSyntaxError("Invalid effect: " + input); - return id; + return Registries.STATUS_EFFECT.getId(effect).toString(); } private int parseInt(String s) throws CmdSyntaxError diff --git a/src/main/java/net/wurstclient/hacks/AutoEatHack.java b/src/main/java/net/wurstclient/hacks/AutoEatHack.java index 488858cd..e8f8e103 100644 --- a/src/main/java/net/wurstclient/hacks/AutoEatHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoEatHack.java @@ -28,6 +28,7 @@ import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.FoodComponent; import net.minecraft.item.FoodComponents; import net.minecraft.item.Item; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.HitResult; @@ -276,7 +277,8 @@ public final class AutoEatHack extends Hack implements UpdateListener for(Pair pair : food.getStatusEffects()) { - StatusEffect effect = pair.getFirst().getEffectType(); + RegistryEntry effect = + pair.getFirst().getEffectType(); if(!allowHunger.isChecked() && effect == StatusEffects.HUNGER) return false; diff --git a/src/main/java/net/wurstclient/hacks/AutoPotionHack.java b/src/main/java/net/wurstclient/hacks/AutoPotionHack.java index 9fa1814a..2693b05d 100644 --- a/src/main/java/net/wurstclient/hacks/AutoPotionHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoPotionHack.java @@ -14,6 +14,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.potion.PotionUtil; +import net.minecraft.registry.entry.RegistryEntry; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.UpdateListener; @@ -121,7 +122,8 @@ public final class AutoPotionHack extends Hack implements UpdateListener return -1; } - private boolean hasEffect(ItemStack stack, StatusEffect effect) + private boolean hasEffect(ItemStack stack, + RegistryEntry effect) { for(StatusEffectInstance effectInstance : PotionUtil .getPotionEffects(stack)) diff --git a/src/main/java/net/wurstclient/hacks/LiquidsHack.java b/src/main/java/net/wurstclient/hacks/LiquidsHack.java index 97752717..e040bbb6 100644 --- a/src/main/java/net/wurstclient/hacks/LiquidsHack.java +++ b/src/main/java/net/wurstclient/hacks/LiquidsHack.java @@ -34,7 +34,7 @@ public final class LiquidsHack extends Hack implements HitResultRayTraceListener @Override public void onHitResultRayTrace(float partialTicks) { - float reach = MC.interactionManager.getReachDistance(); + double reach = MC.player.method_55754(); MC.crosshairTarget = MC.getCameraEntity().raycast(reach, partialTicks, true); } diff --git a/src/main/java/net/wurstclient/hacks/ReachHack.java b/src/main/java/net/wurstclient/hacks/ReachHack.java index c327427e..e9d65ea6 100644 --- a/src/main/java/net/wurstclient/hacks/ReachHack.java +++ b/src/main/java/net/wurstclient/hacks/ReachHack.java @@ -13,6 +13,7 @@ import net.wurstclient.hack.Hack; import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; +// TODO: Remove this hack in 1.20.5, as it seems to be patched. @SearchTags({"range"}) public final class ReachHack extends Hack { @@ -26,11 +27,11 @@ public final class ReachHack extends Hack addSetting(range); } - public float getReachDistance() + public double getReachDistance() { - return range.getValueF(); + return range.getValue(); } - // See ClientPlayerInteractionManagerMixin.onGetReachDistance() and - // ClientPlayerInteractionManagerMixin.hasExtendedReach() + // See ClientPlayerEntityMixin.method_55754() and + // ClientPlayerEntityMixin.method_55755() } diff --git a/src/main/java/net/wurstclient/hacks/SafeWalkHack.java b/src/main/java/net/wurstclient/hacks/SafeWalkHack.java index 745d5965..ac409d54 100644 --- a/src/main/java/net/wurstclient/hacks/SafeWalkHack.java +++ b/src/main/java/net/wurstclient/hacks/SafeWalkHack.java @@ -67,7 +67,7 @@ public final class SafeWalkHack extends Hack } Box box = player.getBoundingBox(); - Box adjustedBox = box.stretch(0, -player.stepHeight, 0) + Box adjustedBox = box.stretch(0, -player.getStepHeight(), 0) .expand(-edgeDistance.getValue(), 0, -edgeDistance.getValue()); if(MC.world.isSpaceEmpty(player, adjustedBox)) diff --git a/src/main/java/net/wurstclient/hacks/StepHack.java b/src/main/java/net/wurstclient/hacks/StepHack.java index 689cfcdc..8dbfe7c4 100644 --- a/src/main/java/net/wurstclient/hacks/StepHack.java +++ b/src/main/java/net/wurstclient/hacks/StepHack.java @@ -48,23 +48,15 @@ public final class StepHack extends Hack implements UpdateListener public void onDisable() { EVENTS.remove(UpdateListener.class, this); - MC.player.stepHeight = 0.5F; } @Override public void onUpdate() { if(mode.getSelected() == Mode.SIMPLE) - { - // simple mode - MC.player.stepHeight = height.getValueF(); return; - } - // legit mode ClientPlayerEntity player = MC.player; - player.stepHeight = 0.5F; - if(!player.horizontalCollision) return; @@ -80,7 +72,6 @@ public final class StepHack extends Hack implements UpdateListener return; Box box = player.getBoundingBox().offset(0, 0.05, 0).expand(0.05); - if(!MC.world.isSpaceEmpty(player, box.offset(0, 1, 0))) return; @@ -106,6 +97,14 @@ public final class StepHack extends Hack implements UpdateListener player.getZ()); } + public float adjustStepHeight(float stepHeight) + { + if(isEnabled() && mode.getSelected() == Mode.SIMPLE) + return height.getValueF(); + + return stepHeight; + } + public boolean isAutoJumpAllowed() { return !isEnabled() && !WURST.getCmds().goToCmd.isActive(); diff --git a/src/main/java/net/wurstclient/mixin/ChatScreenMixin.java b/src/main/java/net/wurstclient/mixin/ChatScreenMixin.java index 9a4b2105..306067b0 100644 --- a/src/main/java/net/wurstclient/mixin/ChatScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/ChatScreenMixin.java @@ -12,7 +12,6 @@ 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; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import net.minecraft.client.gui.screen.ChatScreen; import net.minecraft.client.gui.screen.Screen; @@ -41,10 +40,10 @@ public abstract class ChatScreenMixin extends Screen } @Inject(at = @At("HEAD"), - method = "sendMessage(Ljava/lang/String;Z)Z", + method = "sendMessage(Ljava/lang/String;Z)V", cancellable = true) public void onSendMessage(String message, boolean addToHistory, - CallbackInfoReturnable cir) + CallbackInfo ci) { if((message = normalize(message)).isEmpty()) return; @@ -54,7 +53,7 @@ public abstract class ChatScreenMixin extends Screen if(event.isCancelled()) { - cir.setReturnValue(true); + ci.cancel(); return; } @@ -71,7 +70,7 @@ public abstract class ChatScreenMixin extends Screen else client.player.networkHandler.sendChatMessage(newMessage); - cir.setReturnValue(true); + ci.cancel(); } @Shadow diff --git a/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java b/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java index ff3b5522..3d5b31c8 100644 --- a/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java @@ -26,6 +26,7 @@ import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.MovementType; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.util.math.Vec3d; import net.wurstclient.WurstClient; import net.wurstclient.event.EventManager; @@ -269,7 +270,7 @@ public class ClientPlayerEntityMixin extends AbstractClientPlayerEntity } @Override - public boolean hasStatusEffect(StatusEffect effect) + public boolean hasStatusEffect(RegistryEntry effect) { HackList hax = WurstClient.INSTANCE.getHax(); @@ -286,4 +287,33 @@ public class ClientPlayerEntityMixin extends AbstractClientPlayerEntity return super.hasStatusEffect(effect); } + + @Override + public float getStepHeight() + { + return WurstClient.INSTANCE.getHax().stepHack + .adjustStepHeight(super.getStepHeight()); + } + + // getter for GENERIC_BLOCK_INTERACTION_RANGE + @Override + public double method_55754() + { + HackList hax = WurstClient.INSTANCE.getHax(); + if(hax == null || !hax.reachHack.isEnabled()) + return super.method_55754(); + + return hax.reachHack.getReachDistance(); + } + + // getter for GENERIC_ENTITY_INTERACTION_RANGE + @Override + public double method_55755() + { + HackList hax = WurstClient.INSTANCE.getHax(); + if(hax == null || !hax.reachHack.isEnabled()) + return super.method_55755(); + + return hax.reachHack.getReachDistance(); + } } diff --git a/src/main/java/net/wurstclient/mixin/ClientPlayerInteractionManagerMixin.java b/src/main/java/net/wurstclient/mixin/ClientPlayerInteractionManagerMixin.java index 6fdc8912..fefa8abd 100644 --- a/src/main/java/net/wurstclient/mixin/ClientPlayerInteractionManagerMixin.java +++ b/src/main/java/net/wurstclient/mixin/ClientPlayerInteractionManagerMixin.java @@ -31,12 +31,9 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.wurstclient.WurstClient; import net.wurstclient.event.EventManager; import net.wurstclient.events.BlockBreakingProgressListener.BlockBreakingProgressEvent; import net.wurstclient.events.StopUsingItemListener.StopUsingItemEvent; -import net.wurstclient.hack.HackList; -import net.wurstclient.hacks.ReachHack; import net.wurstclient.mixinterface.IClientPlayerInteractionManager; @Mixin(ClientPlayerInteractionManager.class) @@ -57,32 +54,6 @@ public abstract class ClientPlayerInteractionManagerMixin EventManager.fire(new BlockBreakingProgressEvent(pos, direction)); } - @Inject(at = @At("HEAD"), - method = "getReachDistance()F", - cancellable = true) - private void onGetReachDistance(CallbackInfoReturnable ci) - { - HackList hax = WurstClient.INSTANCE.getHax(); - if(hax == null) - return; - - ReachHack reach = hax.reachHack; - if(reach.isEnabled()) - ci.setReturnValue(reach.getReachDistance()); - } - - @Inject(at = @At("HEAD"), - method = "hasExtendedReach()Z", - cancellable = true) - private void hasExtendedReach(CallbackInfoReturnable cir) - { - HackList hax = WurstClient.INSTANCE.getHax(); - if(hax == null || !hax.reachHack.isEnabled()) - return; - - cir.setReturnValue(true); - } - @Inject(at = @At("HEAD"), method = "stopUsingItem(Lnet/minecraft/entity/player/PlayerEntity;)V") private void onStopUsingItem(PlayerEntity player, CallbackInfo ci) diff --git a/src/main/java/net/wurstclient/mixin/EntityRendererMixin.java b/src/main/java/net/wurstclient/mixin/EntityRendererMixin.java index c8acb3fd..5aa221a3 100644 --- a/src/main/java/net/wurstclient/mixin/EntityRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/EntityRendererMixin.java @@ -35,11 +35,11 @@ public abstract class EntityRendererMixin protected EntityRenderDispatcher dispatcher; @Inject(at = @At("HEAD"), - method = "renderLabelIfPresent(Lnet/minecraft/entity/Entity;Lnet/minecraft/text/Text;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", + method = "renderLabelIfPresent(Lnet/minecraft/entity/Entity;Lnet/minecraft/text/Text;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IF)V", cancellable = true) private void onRenderLabelIfPresent(T entity, Text text, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, - int i, CallbackInfo ci) + int i, float tickDelta, CallbackInfo ci) { // add HealthTags info if(entity instanceof LivingEntity) @@ -48,7 +48,7 @@ public abstract class EntityRendererMixin // do NameTags adjustments wurstRenderLabelIfPresent(entity, text, matrixStack, - vertexConsumerProvider, i); + vertexConsumerProvider, i, tickDelta); ci.cancel(); } @@ -57,7 +57,8 @@ public abstract class EntityRendererMixin * an infinite loop. Also makes it easier to modify. */ protected void wurstRenderLabelIfPresent(T entity, Text text, - MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) + MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, + float tickDelta) { NameTagsHack nameTags = WurstClient.INSTANCE.getHax().nameTagsHack; diff --git a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java index 157661d5..a1c3e592 100644 --- a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java +++ b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java @@ -29,13 +29,12 @@ public class IngameHudMixin @Final private DebugHud debugHud; - @Inject( - at = @At(value = "INVOKE", - target = "Lcom/mojang/blaze3d/systems/RenderSystem;enableBlend()V", - remap = false, - ordinal = 3), - method = "render(Lnet/minecraft/client/gui/DrawContext;F)V") - private void onRender(DrawContext context, float tickDelta, CallbackInfo ci) + // runs after renderScoreboardSidebar() + // and before playerListHud.setVisible() + @Inject(at = @At("HEAD"), + method = "method_55804(Lnet/minecraft/client/gui/DrawContext;F)V") + private void onMethod_55804(DrawContext context, float tickDelta, + CallbackInfo ci) { if(debugHud.shouldShowDebugHud()) return; diff --git a/src/main/java/net/wurstclient/serverfinder/WurstServerPinger.java b/src/main/java/net/wurstclient/serverfinder/WurstServerPinger.java index 64de3bdf..7a2369f8 100644 --- a/src/main/java/net/wurstclient/serverfinder/WurstServerPinger.java +++ b/src/main/java/net/wurstclient/serverfinder/WurstServerPinger.java @@ -41,7 +41,7 @@ public class WurstServerPinger try { - pinger.add(server, () -> {}); + pinger.add(server, () -> {}, () -> {}); System.out.println("Ping successful: " + ip + ":" + port); }catch(UnknownHostException e) diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 827d585e..5f20a310 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,8 +30,8 @@ "depends": { "fabricloader": ">=0.15.0", - "fabric-api": ">=0.91.1", - "minecraft": "~1.20.3-beta.3", + "fabric-api": ">=0.91.4", + "minecraft": "~1.20.5-alpha.23.51.a", "java": ">=17" }, "suggests": { diff --git a/src/main/resources/wurst.accesswidener b/src/main/resources/wurst.accesswidener index 6961e92a..c727812c 100644 --- a/src/main/resources/wurst.accesswidener +++ b/src/main/resources/wurst.accesswidener @@ -16,6 +16,5 @@ accessible field net/minecraft/client/network/ClientPlayerInteractionManager bre accessible field net/minecraft/client/network/ClientPlayerInteractionManager currentBreakingProgress F accessible field net/minecraft/client/toast/ToastManager toastQueue Ljava/util/Deque; accessible field net/minecraft/entity/Entity movementMultiplier Lnet/minecraft/util/math/Vec3d; -accessible field net/minecraft/entity/Entity stepHeight F accessible field net/minecraft/item/ArmorItem toughness F accessible field net/minecraft/network/packet/s2c/play/ChunkDeltaUpdateS2CPacket sectionPos Lnet/minecraft/util/math/ChunkSectionPos; From af01d9d387422cc87df9e22d8e36fa76946903fa Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 24 Jan 2024 11:13:11 +0100 Subject: [PATCH 03/35] [Wurst-Bot] Update to 24w03b --- gradle.properties | 10 +++++----- src/main/java/net/wurstclient/WurstClient.java | 2 +- src/main/java/net/wurstclient/hacks/LiquidsHack.java | 2 +- .../net/wurstclient/mixin/ClientPlayerEntityMixin.java | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gradle.properties b/gradle.properties index 4408ab56..288c1793 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=23w51b -yarn_mappings=23w51b+build.1 -loader_version=0.15.3 +minecraft_version=24w03b +yarn_mappings=24w03b+build.6 +loader_version=0.15.6 #Fabric api -fabric_version=0.91.4+1.20.5 +fabric_version=0.95.1+1.20.5 # Mod Properties -mod_version = v7.40-MC23w51b +mod_version = v7.40-MC24w03b 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 0ff04a33..12f5c10f 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 IMinecraftClient IMC; public static final String VERSION = "7.40"; - public static final String MC_VERSION = "23w51b"; + public static final String MC_VERSION = "24w03b"; private WurstAnalytics analytics; private EventManager eventManager; diff --git a/src/main/java/net/wurstclient/hacks/LiquidsHack.java b/src/main/java/net/wurstclient/hacks/LiquidsHack.java index e040bbb6..0440403c 100644 --- a/src/main/java/net/wurstclient/hacks/LiquidsHack.java +++ b/src/main/java/net/wurstclient/hacks/LiquidsHack.java @@ -34,7 +34,7 @@ public final class LiquidsHack extends Hack implements HitResultRayTraceListener @Override public void onHitResultRayTrace(float partialTicks) { - double reach = MC.player.method_55754(); + double reach = MC.player.getBlockInteractionRange(); MC.crosshairTarget = MC.getCameraEntity().raycast(reach, partialTicks, true); } diff --git a/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java b/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java index 3d5b31c8..b46fc6d6 100644 --- a/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java @@ -297,22 +297,22 @@ public class ClientPlayerEntityMixin extends AbstractClientPlayerEntity // getter for GENERIC_BLOCK_INTERACTION_RANGE @Override - public double method_55754() + public double getBlockInteractionRange() { HackList hax = WurstClient.INSTANCE.getHax(); if(hax == null || !hax.reachHack.isEnabled()) - return super.method_55754(); + return super.getBlockInteractionRange(); return hax.reachHack.getReachDistance(); } // getter for GENERIC_ENTITY_INTERACTION_RANGE @Override - public double method_55755() + public double getEntityInteractionRange() { HackList hax = WurstClient.INSTANCE.getHax(); if(hax == null || !hax.reachHack.isEnabled()) - return super.method_55755(); + return super.getEntityInteractionRange(); return hax.reachHack.getReachDistance(); } From 2e66a9cfc8adcc0b0fc589e0ee7e9ac068e89e45 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 24 Jan 2024 17:57:33 +0100 Subject: [PATCH 04/35] Update to 24w03b --- build.gradle | 2 +- .../events/HitResultRayTraceListener.java | 42 ------------------- .../net/wurstclient/hacks/AutoSwordHack.java | 5 +-- .../net/wurstclient/hacks/LiquidsHack.java | 23 +--------- .../net/wurstclient/hacks/TunnellerHack.java | 8 ++-- .../mixin/ClientPlayNetworkHandlerMixin.java | 9 ++-- .../wurstclient/mixin/GameRendererMixin.java | 27 ++++++++---- .../net/wurstclient/mixin/IngameHudMixin.java | 4 +- .../other_features/VanillaSpoofOtf.java | 29 ++++++------- .../util/LastServerRememberer.java | 2 +- src/main/resources/fabric.mod.json | 6 +-- 11 files changed, 50 insertions(+), 107 deletions(-) delete mode 100644 src/main/java/net/wurstclient/events/HitResultRayTraceListener.java diff --git a/build.gradle b/build.gradle index 9b3ab546..2613a257 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { } plugins { - id 'fabric-loom' version '1.4-SNAPSHOT' + id 'fabric-loom' version '1.5-SNAPSHOT' id 'maven-publish' id 'com.diffplug.spotless' version '6.23.3' } diff --git a/src/main/java/net/wurstclient/events/HitResultRayTraceListener.java b/src/main/java/net/wurstclient/events/HitResultRayTraceListener.java deleted file mode 100644 index 84f55dd5..00000000 --- a/src/main/java/net/wurstclient/events/HitResultRayTraceListener.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2014-2023 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 HitResultRayTraceListener extends Listener -{ - public void onHitResultRayTrace(float partialTicks); - - public static class HitResultRayTraceEvent - extends Event - { - private float partialTicks; - - public HitResultRayTraceEvent(float partialTicks) - { - this.partialTicks = partialTicks; - } - - @Override - public void fire(ArrayList listeners) - { - for(HitResultRayTraceListener listener : listeners) - listener.onHitResultRayTrace(partialTicks); - } - - @Override - public Class getListenerType() - { - return HitResultRayTraceListener.class; - } - } -} diff --git a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java index 7a44fc7c..5d65db81 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java @@ -9,7 +9,7 @@ package net.wurstclient.hacks; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityGroup; +import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -156,8 +156,7 @@ public final class AutoSwordHack extends Hack implements UpdateListener return ItemUtils.getAttackSpeed(item); case DAMAGE: - EntityGroup group = entity instanceof LivingEntity le - ? le.getGroup() : EntityGroup.DEFAULT; + EntityType group = entity.getType(); float dmg = EnchantmentHelper.getAttackDamage(stack, group); if(item instanceof SwordItem sword) dmg += sword.getAttackDamage(); diff --git a/src/main/java/net/wurstclient/hacks/LiquidsHack.java b/src/main/java/net/wurstclient/hacks/LiquidsHack.java index 0440403c..102c0de9 100644 --- a/src/main/java/net/wurstclient/hacks/LiquidsHack.java +++ b/src/main/java/net/wurstclient/hacks/LiquidsHack.java @@ -8,10 +8,9 @@ package net.wurstclient.hacks; import net.wurstclient.Category; -import net.wurstclient.events.HitResultRayTraceListener; import net.wurstclient.hack.Hack; -public final class LiquidsHack extends Hack implements HitResultRayTraceListener +public final class LiquidsHack extends Hack { public LiquidsHack() { @@ -19,23 +18,5 @@ public final class LiquidsHack extends Hack implements HitResultRayTraceListener setCategory(Category.BLOCKS); } - @Override - protected void onEnable() - { - EVENTS.add(HitResultRayTraceListener.class, this); - } - - @Override - protected void onDisable() - { - EVENTS.remove(HitResultRayTraceListener.class, this); - } - - @Override - public void onHitResultRayTrace(float partialTicks) - { - double reach = MC.player.getBlockInteractionRange(); - MC.crosshairTarget = - MC.getCameraEntity().raycast(reach, partialTicks, true); - } + // See GameRendererMixin.liquidsRaycast() } diff --git a/src/main/java/net/wurstclient/hacks/TunnellerHack.java b/src/main/java/net/wurstclient/hacks/TunnellerHack.java index 3e97cbdd..ff9ba6fb 100644 --- a/src/main/java/net/wurstclient/hacks/TunnellerHack.java +++ b/src/main/java/net/wurstclient/hacks/TunnellerHack.java @@ -713,7 +713,6 @@ public final class TunnellerHack extends Hack private class PlaceTorchTask extends Task { - @SuppressWarnings("deprecation") @Override public boolean canRun() { @@ -755,10 +754,9 @@ public final class TunnellerHack extends Hack BlockState state = BlockUtils.getState(nextTorch); if(!state.isReplaceable()) return false; - - // Can't see why canPlaceAt() is deprecated. Still seems to be - // widely used with no replacement. - return Blocks.TORCH.canPlaceAt(state, MC.world, nextTorch); + + return Blocks.TORCH.getDefaultState().canPlaceAt(MC.world, + nextTorch); } @Override diff --git a/src/main/java/net/wurstclient/mixin/ClientPlayNetworkHandlerMixin.java b/src/main/java/net/wurstclient/mixin/ClientPlayNetworkHandlerMixin.java index 7f2a213f..7c2f44c2 100644 --- a/src/main/java/net/wurstclient/mixin/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/net/wurstclient/mixin/ClientPlayNetworkHandlerMixin.java @@ -23,7 +23,7 @@ import net.minecraft.network.listener.TickablePacketListener; import net.minecraft.network.packet.s2c.play.BlockUpdateS2CPacket; import net.minecraft.network.packet.s2c.play.ChunkData; import net.minecraft.network.packet.s2c.play.ChunkDeltaUpdateS2CPacket; -import net.minecraft.network.packet.s2c.play.ServerMetadataS2CPacket; +import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.wurstclient.WurstClient; @@ -42,15 +42,14 @@ public abstract class ClientPlayNetworkHandlerMixin } @Inject(at = @At("TAIL"), - method = "onServerMetadata(Lnet/minecraft/network/packet/s2c/play/ServerMetadataS2CPacket;)V") - public void onOnServerMetadata(ServerMetadataS2CPacket packet, - CallbackInfo ci) + method = "onGameJoin(Lnet/minecraft/network/packet/s2c/play/GameJoinS2CPacket;)V") + public void onOnGameJoin(GameJoinS2CPacket packet, CallbackInfo ci) { if(!WurstClient.INSTANCE.isEnabled()) return; // Remove Mojang's dishonest warning toast on safe servers - if(!packet.isSecureChatEnforced()) + if(!packet.enforcesSecureChat()) { client.getToastManager().toastQueue.removeIf(toast -> toast .getType() == SystemToast.Type.UNSECURE_SERVER_WARNING); diff --git a/src/main/java/net/wurstclient/mixin/GameRendererMixin.java b/src/main/java/net/wurstclient/mixin/GameRendererMixin.java index 71f9aab3..7d4ac335 100644 --- a/src/main/java/net/wurstclient/mixin/GameRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/GameRendererMixin.java @@ -15,15 +15,19 @@ import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; + import net.minecraft.client.render.Camera; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; +import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.MathHelper; import net.wurstclient.WurstClient; import net.wurstclient.event.EventManager; import net.wurstclient.events.CameraTransformViewBobbingListener.CameraTransformViewBobbingEvent; -import net.wurstclient.events.HitResultRayTraceListener.HitResultRayTraceEvent; import net.wurstclient.events.RenderListener.RenderEvent; import net.wurstclient.hacks.FullbrightHack; @@ -104,14 +108,21 @@ public abstract class GameRendererMixin implements AutoCloseable .changeFovBasedOnZoom(cir.getReturnValueD())); } - @Inject(at = @At(value = "INVOKE", - target = "Lnet/minecraft/entity/Entity;getCameraPosVec(F)Lnet/minecraft/util/math/Vec3d;", - opcode = Opcodes.INVOKEVIRTUAL, - ordinal = 0), method = "updateTargetedEntity(F)V") - private void onHitResultRayTrace(float tickDelta, CallbackInfo ci) + /** + * This is the part that makes Liquids work. + */ + @WrapOperation(at = @At(value = "INVOKE", + target = "Lnet/minecraft/entity/Entity;raycast(DFZ)Lnet/minecraft/util/hit/HitResult;", + ordinal = 0), + method = "findCrosshairTarget(Lnet/minecraft/entity/Entity;DDF)Lnet/minecraft/util/hit/HitResult;") + private HitResult liquidsRaycast(Entity instance, double maxDistance, + float tickDelta, boolean includeFluids, Operation original) { - HitResultRayTraceEvent event = new HitResultRayTraceEvent(tickDelta); - EventManager.fire(event); + if(!WurstClient.INSTANCE.getHax().liquidsHack.isEnabled()) + return original.call(instance, maxDistance, tickDelta, + includeFluids); + + return original.call(instance, maxDistance, tickDelta, true); } @Redirect( diff --git a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java index a1c3e592..590441a6 100644 --- a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java +++ b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java @@ -32,8 +32,8 @@ public class IngameHudMixin // runs after renderScoreboardSidebar() // and before playerListHud.setVisible() @Inject(at = @At("HEAD"), - method = "method_55804(Lnet/minecraft/client/gui/DrawContext;F)V") - private void onMethod_55804(DrawContext context, float tickDelta, + method = "renderPlayerList(Lnet/minecraft/client/gui/DrawContext;F)V") + private void onRenderPlayerList(DrawContext context, float tickDelta, CallbackInfo ci) { if(debugHud.shouldShowDebugHud()) diff --git a/src/main/java/net/wurstclient/other_features/VanillaSpoofOtf.java b/src/main/java/net/wurstclient/other_features/VanillaSpoofOtf.java index 0ad90444..7304a644 100644 --- a/src/main/java/net/wurstclient/other_features/VanillaSpoofOtf.java +++ b/src/main/java/net/wurstclient/other_features/VanillaSpoofOtf.java @@ -7,8 +7,8 @@ */ package net.wurstclient.other_features; +import net.minecraft.network.packet.BrandCustomPayload; import net.minecraft.network.packet.c2s.common.CustomPayloadC2SPacket; -import net.minecraft.util.Identifier; import net.wurstclient.DontBlock; import net.wurstclient.SearchTags; import net.wurstclient.events.ConnectionPacketOutputListener; @@ -42,23 +42,20 @@ public final class VanillaSpoofOtf extends OtherFeature if(!(event.getPacket() instanceof CustomPayloadC2SPacket packet)) return; - Identifier channel = packet.payload().id(); - - if(channel.getNamespace().equals("minecraft") - && channel.getPath().equals("register")) - event.cancel(); + // change client brand "fabric" back to "vanilla" + if(packet.payload() instanceof BrandCustomPayload) + event.setPacket( + new CustomPayloadC2SPacket(new BrandCustomPayload("vanilla"))); - // Apparently the Minecraft client no longer sends its brand to the - // server as of 23w31a + // cancel Fabric's "c:version", "c:register" and + // "fabric:custom_ingredient_sync" packets + // TODO: Something else is needed to prevent the connection from + // hanging when these packets are cancelled. - // if(packet.getChannel().getNamespace().equals("minecraft") - // && packet.getChannel().getPath().equals("brand")) - // event.setPacket(new CustomPayloadC2SPacket( - // CustomPayloadC2SPacket.BRAND, - // new PacketByteBuf(Unpooled.buffer()).writeString("vanilla"))); - - if(channel.getNamespace().equals("fabric")) - event.cancel(); + // Identifier channel = packet.payload().getId().id(); + // if(channel.getNamespace().equals("fabric") + // || channel.getNamespace().equals("c")) + // event.cancel(); } @Override diff --git a/src/main/java/net/wurstclient/util/LastServerRememberer.java b/src/main/java/net/wurstclient/util/LastServerRememberer.java index 28b5b88f..c552765c 100644 --- a/src/main/java/net/wurstclient/util/LastServerRememberer.java +++ b/src/main/java/net/wurstclient/util/LastServerRememberer.java @@ -49,6 +49,6 @@ public enum LastServerRememberer return; ConnectScreen.connect(prevScreen, WurstClient.MC, - ServerAddress.parse(lastServer.address), lastServer, false); + ServerAddress.parse(lastServer.address), lastServer, false, null); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 5f20a310..fa296f86 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,9 +29,9 @@ "accessWidener" : "wurst.accesswidener", "depends": { - "fabricloader": ">=0.15.0", - "fabric-api": ">=0.91.4", - "minecraft": "~1.20.5-alpha.23.51.a", + "fabricloader": ">=0.15.3", + "fabric-api": ">=0.91.5", + "minecraft": "~1.20.5-alpha.24.3.a", "java": ">=17" }, "suggests": { From 114bf6976aad42cc416cd910a0bec5fb875fd62c Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 25 Jan 2024 07:30:59 +0100 Subject: [PATCH 05/35] [Wurst-Bot] Update to 24w04a --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 288c1793..a48ee8f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w03b -yarn_mappings=24w03b+build.6 +minecraft_version=24w04a +yarn_mappings=24w04a+build.2 loader_version=0.15.6 #Fabric api -fabric_version=0.95.1+1.20.5 +fabric_version=0.95.2+1.20.5 # Mod Properties -mod_version = v7.40-MC24w03b +mod_version = v7.40-MC24w04a 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 12f5c10f..76d78345 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 IMinecraftClient IMC; public static final String VERSION = "7.40"; - public static final String MC_VERSION = "24w03b"; + public static final String MC_VERSION = "24w04a"; private WurstAnalytics analytics; private EventManager eventManager; From 7bd23bcc500a5f578de6df14c0e7b44ce6f2cfa0 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 1 Feb 2024 11:50:41 +0100 Subject: [PATCH 06/35] [Wurst-Bot] Update to 24w05a --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index b18c9d68..02094787 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w04a -yarn_mappings=24w04a+build.3 +minecraft_version=24w05a +yarn_mappings=24w05a+build.4 loader_version=0.15.6 #Fabric api -fabric_version=0.95.3+1.20.5 +fabric_version=0.95.4+1.20.5 # Mod Properties -mod_version = v7.41-MC24w04a +mod_version = v7.41-MC24w05a 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 a2f2e81b..d422d1a7 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 IMinecraftClient IMC; public static final String VERSION = "7.41"; - public static final String MC_VERSION = "24w04a"; + public static final String MC_VERSION = "24w05a"; private WurstAnalytics analytics; private EventManager eventManager; From e5bedfe581e67332a7d39555aaea771e0c33d973 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 1 Feb 2024 15:01:00 +0100 Subject: [PATCH 07/35] Update to 24w05a --- .../net/wurstclient/hacks/AutoArmorHack.java | 4 +-- .../wurstclient/mixin/GameRendererMixin.java | 33 ++++++++++--------- src/main/resources/fabric.mod.json | 4 +-- src/main/resources/wurst.accesswidener | 1 - 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoArmorHack.java b/src/main/java/net/wurstclient/hacks/AutoArmorHack.java index 0e609ad2..af945014 100644 --- a/src/main/java/net/wurstclient/hacks/AutoArmorHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoArmorHack.java @@ -175,8 +175,8 @@ public final class AutoArmorHack extends Hack { int armorPoints = item.getProtection(); int prtPoints = 0; - int armorToughness = (int)item.toughness; - int armorType = item.getMaterial().getProtection(Type.LEGGINGS); + int armorToughness = (int)item.getToughness(); + int armorType = item.getMaterial().value().getProtection(Type.LEGGINGS); if(useEnchantments.isChecked()) { diff --git a/src/main/java/net/wurstclient/mixin/GameRendererMixin.java b/src/main/java/net/wurstclient/mixin/GameRendererMixin.java index 947c72dd..60f80225 100644 --- a/src/main/java/net/wurstclient/mixin/GameRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/GameRendererMixin.java @@ -7,16 +7,17 @@ */ package net.wurstclient.mixin; +import org.joml.Matrix4f; import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import com.llamalad7.mixinextras.sugar.Local; import net.minecraft.client.render.Camera; import net.minecraft.client.render.GameRenderer; @@ -24,7 +25,6 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.util.hit.HitResult; -import net.minecraft.util.math.MathHelper; import net.wurstclient.WurstClient; import net.wurstclient.event.EventManager; import net.wurstclient.events.CameraTransformViewBobbingListener.CameraTransformViewBobbingEvent; @@ -42,10 +42,9 @@ public abstract class GameRendererMixin implements AutoCloseable */ @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/GameRenderer;bobView(Lnet/minecraft/client/util/math/MatrixStack;F)V", - ordinal = 0), - method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V") + ordinal = 0), method = "renderWorld(FJ)V") private void onRenderWorldViewBobbing(float tickDelta, long limitTime, - MatrixStack matrices, CallbackInfo ci) + CallbackInfo ci) { CameraTransformViewBobbingEvent event = new CameraTransformViewBobbingEvent(); @@ -78,9 +77,8 @@ public abstract class GameRendererMixin implements AutoCloseable * after the view-bobbing call. */ @Inject(at = @At("HEAD"), - method = "renderHand(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/Camera;F)V") - private void onRenderHand(MatrixStack matrices, Camera camera, - float tickDelta, CallbackInfo ci) + method = "renderHand(Lnet/minecraft/client/render/Camera;F)V") + private void onRenderHand(Camera camera, float tickDelta, CallbackInfo ci) { cancelNextBobView = false; } @@ -90,11 +88,13 @@ public abstract class GameRendererMixin implements AutoCloseable target = "Lnet/minecraft/client/render/GameRenderer;renderHand:Z", opcode = Opcodes.GETFIELD, ordinal = 0), - method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V") - private void onRenderWorld(float tickDelta, long limitTime, - MatrixStack matrices, CallbackInfo ci) + method = "renderWorld(FJ)V") + private void onRenderWorld(float tickDelta, long limitTime, CallbackInfo ci, + @Local(ordinal = 1) Matrix4f matrix4f2) { - RenderEvent event = new RenderEvent(matrices, tickDelta); + MatrixStack matrixStack = new MatrixStack(); + matrixStack.multiplyPositionMatrix(matrix4f2); + RenderEvent event = new RenderEvent(matrixStack, tickDelta); EventManager.fire(event); } @@ -125,15 +125,16 @@ public abstract class GameRendererMixin implements AutoCloseable return original.call(instance, maxDistance, tickDelta, true); } - @Redirect( + @WrapOperation( at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;lerp(FFF)F", ordinal = 0), - method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V") - private float wurstNauseaLerp(float delta, float start, float end) + method = "renderWorld(FJ)V") + private float wurstNauseaLerp(float delta, float start, float end, + Operation original) { if(!WurstClient.INSTANCE.getHax().antiWobbleHack.isEnabled()) - return MathHelper.lerp(delta, start, end); + return original.call(delta, start, end); return 0; } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index fa296f86..5664c240 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,8 +30,8 @@ "depends": { "fabricloader": ">=0.15.3", - "fabric-api": ">=0.91.5", - "minecraft": "~1.20.5-alpha.24.3.a", + "fabric-api": ">=0.95.4", + "minecraft": "~1.20.5-alpha.24.5.a", "java": ">=17" }, "suggests": { diff --git a/src/main/resources/wurst.accesswidener b/src/main/resources/wurst.accesswidener index c0a98925..e0f169e2 100644 --- a/src/main/resources/wurst.accesswidener +++ b/src/main/resources/wurst.accesswidener @@ -17,5 +17,4 @@ accessible field net/minecraft/client/network/ClientPlayerInteractionManager bre accessible field net/minecraft/client/network/ClientPlayerInteractionManager currentBreakingProgress F accessible field net/minecraft/client/toast/ToastManager toastQueue Ljava/util/Deque; accessible field net/minecraft/entity/Entity movementMultiplier Lnet/minecraft/util/math/Vec3d; -accessible field net/minecraft/item/ArmorItem toughness F accessible field net/minecraft/network/packet/s2c/play/ChunkDeltaUpdateS2CPacket sectionPos Lnet/minecraft/util/math/ChunkSectionPos; From 2aa8f7b5db7667880f23618f61c53cf693ff7483 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sat, 10 Feb 2024 16:18:26 +0100 Subject: [PATCH 08/35] [Wurst-Bot] Update to 24w06a --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 02094787..b4442efb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w05a -yarn_mappings=24w05a+build.4 +minecraft_version=24w06a +yarn_mappings=24w06a+build.7 loader_version=0.15.6 #Fabric api -fabric_version=0.95.4+1.20.5 +fabric_version=0.96.0+1.20.5 # Mod Properties -mod_version = v7.41-MC24w05a +mod_version = v7.41-MC24w06a 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 d422d1a7..ecd95c7e 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 IMinecraftClient IMC; public static final String VERSION = "7.41"; - public static final String MC_VERSION = "24w05a"; + public static final String MC_VERSION = "24w06a"; private WurstAnalytics analytics; private EventManager eventManager; From fa504fb3fdfc32d4b4e23b9c147aeb458e68bd50 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sat, 10 Feb 2024 16:38:07 +0100 Subject: [PATCH 09/35] Update to 24w06a --- .../net/wurstclient/mixin/AbstractBlockStateMixin.java | 10 +++++----- src/main/resources/fabric.mod.json | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/wurstclient/mixin/AbstractBlockStateMixin.java b/src/main/java/net/wurstclient/mixin/AbstractBlockStateMixin.java index 885abc2a..9596fa29 100644 --- a/src/main/java/net/wurstclient/mixin/AbstractBlockStateMixin.java +++ b/src/main/java/net/wurstclient/mixin/AbstractBlockStateMixin.java @@ -13,9 +13,9 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import com.google.common.collect.ImmutableMap; import com.mojang.serialization.MapCodec; +import it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap; import net.minecraft.block.AbstractBlock.AbstractBlockState; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -37,11 +37,11 @@ import net.wurstclient.hacks.HandNoClipHack; @Mixin(AbstractBlockState.class) public abstract class AbstractBlockStateMixin extends State { - private AbstractBlockStateMixin(WurstClient wurst, Block object, - ImmutableMap, Comparable> immutableMap, - MapCodec mapCodec) + private AbstractBlockStateMixin(WurstClient wurst, Block owner, + Reference2ObjectArrayMap, Comparable> propertyMap, + MapCodec codec) { - super(object, immutableMap, mapCodec); + super(owner, propertyMap, codec); } @Inject(at = @At("TAIL"), diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 5664c240..af79f50e 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,9 +29,9 @@ "accessWidener" : "wurst.accesswidener", "depends": { - "fabricloader": ">=0.15.3", - "fabric-api": ">=0.95.4", - "minecraft": "~1.20.5-alpha.24.5.a", + "fabricloader": ">=0.15.6", + "fabric-api": ">=0.95.6", + "minecraft": "~1.20.5-alpha.24.6.a", "java": ">=17" }, "suggests": { From c07b4209a654867d02d4a771ea033dc55f74503c Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sat, 10 Feb 2024 16:44:05 +0100 Subject: [PATCH 10/35] Update default X-Ray ores --- src/main/java/net/wurstclient/hacks/XRayHack.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/XRayHack.java b/src/main/java/net/wurstclient/hacks/XRayHack.java index 24cc7cc4..467a4611 100644 --- a/src/main/java/net/wurstclient/hacks/XRayHack.java +++ b/src/main/java/net/wurstclient/hacks/XRayHack.java @@ -42,12 +42,12 @@ public final class XRayHack extends Hack implements UpdateListener, "A list of blocks that X-Ray will show. They don't have to be just ores" + " - you can add any block you want.\n\n" + "Remember to restart X-Ray when changing this setting.", - "minecraft:ancient_debris", "minecraft:anvil", "minecraft:beacon", - "minecraft:bone_block", "minecraft:bookshelf", - "minecraft:brewing_stand", "minecraft:chain_command_block", - "minecraft:chest", "minecraft:clay", "minecraft:coal_block", - "minecraft:coal_ore", "minecraft:command_block", "minecraft:copper_ore", - "minecraft:crafter", "minecraft:crafting_table", + "minecraft:amethyst_cluster", "minecraft:ancient_debris", + "minecraft:anvil", "minecraft:beacon", "minecraft:bone_block", + "minecraft:bookshelf", "minecraft:brewing_stand", + "minecraft:chain_command_block", "minecraft:chest", "minecraft:clay", + "minecraft:coal_block", "minecraft:coal_ore", "minecraft:command_block", + "minecraft:copper_ore", "minecraft:crafter", "minecraft:crafting_table", "minecraft:decorated_pot", "minecraft:deepslate_coal_ore", "minecraft:deepslate_copper_ore", "minecraft:deepslate_diamond_ore", "minecraft:deepslate_emerald_ore", "minecraft:deepslate_gold_ore", @@ -68,7 +68,8 @@ public final class XRayHack extends Hack implements UpdateListener, "minecraft:redstone_ore", "minecraft:repeating_command_block", "minecraft:spawner", "minecraft:suspicious_gravel", "minecraft:suspicious_sand", "minecraft:tnt", "minecraft:torch", - "minecraft:trapped_chest", "minecraft:water"); + "minecraft:trapped_chest", "minecraft:trial_spawner", "minecraft:vault", + "minecraft:water"); private final CheckboxSetting onlyExposed = new CheckboxSetting( "Only show exposed", From 53894902dd9bca6347e5f62b8861d5c861b4839d Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 15 Feb 2024 17:14:24 +0100 Subject: [PATCH 11/35] [Wurst-Bot] Update to 24w07a --- gradle.properties | 10 +++++----- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index b4442efb..8eb3f288 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w06a -yarn_mappings=24w06a+build.7 -loader_version=0.15.6 +minecraft_version=24w07a +yarn_mappings=24w07a+build.4 +loader_version=0.15.7 #Fabric api -fabric_version=0.96.0+1.20.5 +fabric_version=0.96.2+1.20.5 # Mod Properties -mod_version = v7.41-MC24w06a +mod_version = v7.41-MC24w07a 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 ecd95c7e..cca17938 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 IMinecraftClient IMC; public static final String VERSION = "7.41"; - public static final String MC_VERSION = "24w06a"; + public static final String MC_VERSION = "24w07a"; private WurstAnalytics analytics; private EventManager eventManager; From 6b3485c93a8071f4eef29a9cf059157c79be9d4b Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sat, 2 Mar 2024 13:32:49 +0100 Subject: [PATCH 12/35] [Wurst-Bot] Update to 24w09a --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- src/main/java/net/wurstclient/commands/PotionCmd.java | 7 +++---- .../java/net/wurstclient/hacks/AutoLibrarianHack.java | 2 +- src/main/java/net/wurstclient/hacks/AutoPotionHack.java | 4 ++-- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/gradle.properties b/gradle.properties index 3c7c4159..d4c141f8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w07a -yarn_mappings=24w07a+build.7 +minecraft_version=24w09a +yarn_mappings=24w09a+build.8 loader_version=0.15.7 #Fabric api -fabric_version=0.96.4+1.20.5 +fabric_version=0.96.6+1.20.5 # Mod Properties -mod_version = v7.41.1-MC24w07a +mod_version = v7.41.1-MC24w09a 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 9f7f6106..40dd9a05 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.1"; - public static final String MC_VERSION = "24w07a"; + public static final String MC_VERSION = "24w09a"; private WurstAnalytics analytics; private EventManager eventManager; diff --git a/src/main/java/net/wurstclient/commands/PotionCmd.java b/src/main/java/net/wurstclient/commands/PotionCmd.java index 342e2c11..64613ad1 100644 --- a/src/main/java/net/wurstclient/commands/PotionCmd.java +++ b/src/main/java/net/wurstclient/commands/PotionCmd.java @@ -8,14 +8,13 @@ package net.wurstclient.commands; import java.util.List; - +import net.minecraft.component.type.PotionContentsComponent; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.item.ItemStack; import net.minecraft.item.PotionItem; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtList; -import net.minecraft.potion.PotionUtil; import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; import net.minecraft.util.InvalidIdentifierException; @@ -97,7 +96,7 @@ public final class PotionCmd extends Command { NbtList nbt = new NbtList(); List effects = - PotionUtil.getCustomPotionEffects(stack); + PotionContentsComponent.getCustomPotionEffects(stack); for(StatusEffectInstance effect : effects) { @@ -123,7 +122,7 @@ public final class PotionCmd extends Command String id = parseEffectId(args[1]); List oldEffects = - PotionUtil.getCustomPotionEffects(stack); + PotionContentsComponent.getCustomPotionEffects(stack); NbtList newEffects = new NbtList(); for(StatusEffectInstance oldEffect : oldEffects) diff --git a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java index 0f1345be..be89bccc 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java @@ -428,7 +428,7 @@ public final class AutoLibrarianHack extends Hack NbtList bookNbt = EnchantedBookItem.getEnchantmentNbt(stack); String enchantment = bookNbt.getCompound(0).getString("id"); int level = bookNbt.getCompound(0).getInt("lvl"); - int price = tradeOffer.getAdjustedFirstBuyItem().getCount(); + int price = tradeOffer.getDisplayedFirstBuyItem().getCount(); BookOffer bookOffer = new BookOffer(enchantment, level, price); if(!bookOffer.isValid()) diff --git a/src/main/java/net/wurstclient/hacks/AutoPotionHack.java b/src/main/java/net/wurstclient/hacks/AutoPotionHack.java index 29a7440b..aa2504fb 100644 --- a/src/main/java/net/wurstclient/hacks/AutoPotionHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoPotionHack.java @@ -7,12 +7,12 @@ */ package net.wurstclient.hacks; +import net.minecraft.component.type.PotionContentsComponent; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.potion.PotionUtil; import net.minecraft.registry.entry.RegistryEntry; import net.wurstclient.Category; import net.wurstclient.SearchTags; @@ -122,7 +122,7 @@ public final class AutoPotionHack extends Hack implements UpdateListener private boolean hasEffect(ItemStack stack, RegistryEntry effect) { - for(StatusEffectInstance effectInstance : PotionUtil + for(StatusEffectInstance effectInstance : PotionContentsComponent .getPotionEffects(stack)) { if(effectInstance.getEffectType() != effect) From 19e311d9250f7f3030e1827fa709152d037558a5 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 5 Mar 2024 18:54:53 +0100 Subject: [PATCH 13/35] Update to 24w09a --- .../clickgui/screens/AddBookOfferScreen.java | 2 + .../clickgui/screens/EditBlockListScreen.java | 2 + .../clickgui/screens/EditBookOfferScreen.java | 2 +- .../screens/EditBookOffersScreen.java | 2 + .../clickgui/screens/EditItemListScreen.java | 2 + .../net/wurstclient/commands/AuthorCmd.java | 21 ++-- .../net/wurstclient/commands/EnchantCmd.java | 3 +- .../net/wurstclient/commands/GiveCmd.java | 4 +- .../net/wurstclient/commands/ModifyCmd.java | 24 ++-- .../net/wurstclient/commands/PotionCmd.java | 108 ++++++++---------- .../net/wurstclient/commands/RenameCmd.java | 9 +- .../net/wurstclient/commands/ViewNbtCmd.java | 12 +- .../net/wurstclient/hacks/AntiSpamHack.java | 14 ++- .../wurstclient/hacks/AutoLibrarianHack.java | 22 ++-- .../net/wurstclient/hacks/AutoPotionHack.java | 22 +--- .../net/wurstclient/hacks/AutoSwordHack.java | 18 ++- .../net/wurstclient/hacks/CrashChestHack.java | 6 +- .../net/wurstclient/hacks/KillPotionHack.java | 26 +++-- .../wurstclient/hacks/TrollPotionHack.java | 33 +++--- .../wurstclient/mixin/StatsScreenMixin.java | 49 +++++--- .../java/net/wurstclient/util/ItemUtils.java | 57 +++++---- .../java/net/wurstclient/util/ListWidget.java | 21 ++-- src/main/resources/fabric.mod.json | 6 +- 23 files changed, 252 insertions(+), 213 deletions(-) diff --git a/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java b/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java index 505c960f..0322c2d6 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java @@ -291,6 +291,8 @@ public final class AddBookOfferScreen extends Screen float partialTicks) { MatrixStack matrixStack = context.getMatrices(); + renderBackground(context, mouseX, mouseY, partialTicks); + listGui.render(context, mouseX, mouseY, partialTicks); matrixStack.push(); diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditBlockListScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditBlockListScreen.java index eaf1a46b..feaefa59 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditBlockListScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditBlockListScreen.java @@ -165,6 +165,8 @@ public final class EditBlockListScreen extends Screen float partialTicks) { MatrixStack matrixStack = context.getMatrices(); + renderBackground(context, mouseX, mouseY, partialTicks); + listGui.render(context, mouseX, mouseY, partialTicks); context.drawCenteredTextWithShadow(client.textRenderer, diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java index f54aeb74..5b33aeb4 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java @@ -254,7 +254,7 @@ public final class EditBookOfferScreen extends Screen float partialTicks) { MatrixStack matrixStack = context.getMatrices(); - renderBackgroundTexture(context); + renderBackground(context, mouseX, mouseY, partialTicks); matrixStack.push(); matrixStack.translate(0, 0, 300); diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java index 1e8c0aba..d834e115 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java @@ -183,6 +183,8 @@ public final class EditBookOffersScreen extends Screen float partialTicks) { MatrixStack matrixStack = context.getMatrices(); + renderBackground(context, mouseX, mouseY, partialTicks); + listGui.render(context, mouseX, mouseY, partialTicks); matrixStack.push(); diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditItemListScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditItemListScreen.java index 3153aedf..a1a21b0e 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditItemListScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditItemListScreen.java @@ -167,6 +167,8 @@ public final class EditItemListScreen extends Screen float partialTicks) { MatrixStack matrixStack = context.getMatrices(); + renderBackground(context, mouseX, mouseY, partialTicks); + listGui.render(context, mouseX, mouseY, partialTicks); context.drawCenteredTextWithShadow(client.textRenderer, diff --git a/src/main/java/net/wurstclient/commands/AuthorCmd.java b/src/main/java/net/wurstclient/commands/AuthorCmd.java index cc8d58ea..2e988b00 100644 --- a/src/main/java/net/wurstclient/commands/AuthorCmd.java +++ b/src/main/java/net/wurstclient/commands/AuthorCmd.java @@ -7,10 +7,10 @@ */ package net.wurstclient.commands; -import net.minecraft.item.Item; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.WrittenBookContentComponent; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.nbt.NbtString; import net.wurstclient.command.CmdError; import net.wurstclient.command.CmdException; import net.wurstclient.command.CmdSyntaxError; @@ -33,15 +33,20 @@ public final class AuthorCmd extends Command if(!MC.player.getAbilities().creativeMode) throw new CmdError("Creative mode only."); - ItemStack heldItem = MC.player.getInventory().getMainHandStack(); - int heldItemID = Item.getRawId(heldItem.getItem()); - int writtenBookID = Item.getRawId(Items.WRITTEN_BOOK); - - if(heldItemID != writtenBookID) + ItemStack heldStack = MC.player.getInventory().getMainHandStack(); + if(!heldStack.isOf(Items.WRITTEN_BOOK)) throw new CmdError( "You must hold a written book in your main hand."); + WrittenBookContentComponent oldData = heldStack.getComponents() + .get(DataComponentTypes.WRITTEN_BOOK_CONTENT); + if(oldData == null) + throw new CmdError("Can't find book data."); + String author = String.join(" ", args); - heldItem.setSubNbt("author", NbtString.of(author)); + WrittenBookContentComponent newData = + new WrittenBookContentComponent(oldData.title(), author, + oldData.generation(), oldData.pages(), oldData.resolved()); + heldStack.set(DataComponentTypes.WRITTEN_BOOK_CONTENT, newData); } } diff --git a/src/main/java/net/wurstclient/commands/EnchantCmd.java b/src/main/java/net/wurstclient/commands/EnchantCmd.java index f8c745ca..121000ca 100644 --- a/src/main/java/net/wurstclient/commands/EnchantCmd.java +++ b/src/main/java/net/wurstclient/commands/EnchantCmd.java @@ -16,7 +16,6 @@ import net.wurstclient.command.CmdException; import net.wurstclient.command.CmdSyntaxError; import net.wurstclient.command.Command; import net.wurstclient.util.ChatUtils; -import net.wurstclient.util.ItemUtils; public final class EnchantCmd extends Command { @@ -71,7 +70,7 @@ public final class EnchantCmd extends Command continue; } - ItemUtils.addEnchantment(stack, enchantment, level); + stack.addEnchantment(enchantment, level); } } diff --git a/src/main/java/net/wurstclient/commands/GiveCmd.java b/src/main/java/net/wurstclient/commands/GiveCmd.java index a55604bb..8cfc07ec 100644 --- a/src/main/java/net/wurstclient/commands/GiveCmd.java +++ b/src/main/java/net/wurstclient/commands/GiveCmd.java @@ -11,6 +11,8 @@ import java.util.Arrays; import com.mojang.brigadier.exceptions.CommandSyntaxException; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.NbtComponent; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -83,7 +85,7 @@ public final class GiveCmd extends Command try { NbtCompound tag = StringNbtReader.parse(nbt); - stack.setNbt(tag); + NbtComponent.set(DataComponentTypes.CUSTOM_DATA, stack, tag); }catch(CommandSyntaxException e) { diff --git a/src/main/java/net/wurstclient/commands/ModifyCmd.java b/src/main/java/net/wurstclient/commands/ModifyCmd.java index 675921b3..5fe1f81c 100644 --- a/src/main/java/net/wurstclient/commands/ModifyCmd.java +++ b/src/main/java/net/wurstclient/commands/ModifyCmd.java @@ -12,6 +12,8 @@ import java.util.Arrays; import com.mojang.brigadier.exceptions.CommandSyntaxException; import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.NbtComponent; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.StringNbtReader; @@ -77,16 +79,19 @@ public final class ModifyCmd extends Command private void add(ItemStack stack, String[] args) throws CmdError { - String nbt = String.join(" ", Arrays.copyOfRange(args, 1, args.length)); - nbt = nbt.replace("$", "\u00a7").replace("\u00a7\u00a7", "$"); + String nbtString = + String.join(" ", Arrays.copyOfRange(args, 1, args.length)) + .replace("$", "\u00a7").replace("\u00a7\u00a7", "$"); - if(!stack.hasNbt()) - stack.setNbt(new NbtCompound()); + NbtCompound itemNbt = stack + .getOrDefault(DataComponentTypes.CUSTOM_DATA, NbtComponent.DEFAULT) + .copyNbt(); try { - NbtCompound tag = StringNbtReader.parse(nbt); - stack.getNbt().copyFrom(tag); + NbtCompound parsedNbt = StringNbtReader.parse(nbtString); + itemNbt.copyFrom(parsedNbt); + stack.set(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(itemNbt)); }catch(CommandSyntaxException e) { @@ -103,7 +108,7 @@ public final class ModifyCmd extends Command try { NbtCompound tag = StringNbtReader.parse(nbt); - stack.setNbt(tag); + stack.set(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(tag)); }catch(CommandSyntaxException e) { @@ -117,12 +122,15 @@ public final class ModifyCmd extends Command if(args.length > 2) throw new CmdSyntaxError(); - NbtPath path = parseNbtPath(stack.getNbt(), args[1]); + NbtPath path = parseNbtPath(stack + .getOrDefault(DataComponentTypes.CUSTOM_DATA, NbtComponent.DEFAULT) + .copyNbt(), args[1]); if(path == null) throw new CmdError("The path does not exist."); path.base.remove(path.key); + stack.set(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(path.base)); } private NbtPath parseNbtPath(NbtCompound tag, String path) diff --git a/src/main/java/net/wurstclient/commands/PotionCmd.java b/src/main/java/net/wurstclient/commands/PotionCmd.java index 64613ad1..9f559868 100644 --- a/src/main/java/net/wurstclient/commands/PotionCmd.java +++ b/src/main/java/net/wurstclient/commands/PotionCmd.java @@ -7,15 +7,18 @@ */ package net.wurstclient.commands; -import java.util.List; +import java.util.ArrayList; +import java.util.Optional; + +import net.minecraft.component.DataComponentTypes; import net.minecraft.component.type.PotionContentsComponent; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.item.ItemStack; import net.minecraft.item.PotionItem; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtList; +import net.minecraft.potion.Potion; import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.util.Identifier; import net.minecraft.util.InvalidIdentifierException; import net.wurstclient.command.CmdError; @@ -58,16 +61,23 @@ public final class PotionCmd extends Command if((args.length - 1) % 3 != 0) throw new CmdSyntaxError(); + PotionContentsComponent oldContents = stack.getComponents() + .getOrDefault(DataComponentTypes.POTION_CONTENTS, + PotionContentsComponent.DEFAULT); + // get effects to start with - NbtList effects; + ArrayList effects; + Optional> potion; switch(args[0].toLowerCase()) { case "add": - effects = convertEffectsToNbt(stack); + effects = new ArrayList<>(oldContents.customEffects()); + potion = oldContents.potion(); break; case "set": - effects = new NbtList(); + effects = new ArrayList<>(); + potion = Optional.empty(); break; default: @@ -77,76 +87,54 @@ public final class PotionCmd extends Command // add new effects for(int i = 0; i < (args.length - 1) / 3; i++) { - NbtCompound effect = new NbtCompound(); + RegistryEntry effect = parseEffect(args[1 + i * 3]); + int amplifier = parseInt(args[2 + i * 3]) - 1; + int duration = parseInt(args[3 + i * 3]) * 20; - effect.putString("id", parseEffectId(args[1 + i * 3])); - effect.putInt("amplifier", parseInt(args[2 + i * 3]) - 1); - effect.putInt("duration", parseInt(args[3 + i * 3]) * 20); - - effects.add(effect); + effects.add(new StatusEffectInstance(effect, duration, amplifier)); } - NbtCompound nbt = new NbtCompound(); - nbt.put("custom_potion_effects", effects); - stack.setNbt(nbt); + stack.set(DataComponentTypes.POTION_CONTENTS, + new PotionContentsComponent(potion, oldContents.customColor(), + effects)); ChatUtils.message("Potion modified."); } - private NbtList convertEffectsToNbt(ItemStack stack) - { - NbtList nbt = new NbtList(); - List effects = - PotionContentsComponent.getCustomPotionEffects(stack); - - for(StatusEffectInstance effect : effects) - { - NbtCompound tag = new NbtCompound(); - - String id = Registries.STATUS_EFFECT - .getId(effect.getEffectType().value()).toString(); - tag.putString("id", id); - tag.putInt("amplifier", effect.getAmplifier()); - tag.putInt("duration", effect.getDuration()); - - nbt.add(tag); - } - - return nbt; - } - private void remove(ItemStack stack, String[] args) throws CmdSyntaxError { if(args.length != 2) throw new CmdSyntaxError(); - String id = parseEffectId(args[1]); + RegistryEntry targetEffect = parseEffect(args[1]); - List oldEffects = - PotionContentsComponent.getCustomPotionEffects(stack); + PotionContentsComponent oldContents = stack.getComponents() + .getOrDefault(DataComponentTypes.POTION_CONTENTS, + PotionContentsComponent.DEFAULT); - NbtList newEffects = new NbtList(); - for(StatusEffectInstance oldEffect : oldEffects) - { - String oldId = Registries.STATUS_EFFECT - .getId(oldEffect.getEffectType().value()).toString(); - - if(oldId.equals(id)) - continue; - - NbtCompound effect = new NbtCompound(); - effect.putString("id", oldId); - effect.putInt("amplifier", oldEffect.getAmplifier()); - effect.putInt("duration", oldEffect.getDuration()); - newEffects.add(effect); - } + boolean mainPotionContainsTargetEffect = + oldContents.potion().isPresent() + && oldContents.potion().get().value().getEffects().stream() + .anyMatch(effect -> effect.getEffectType() == targetEffect); + + ArrayList newEffects = new ArrayList<>(); + if(mainPotionContainsTargetEffect) + oldContents.getEffects().forEach(newEffects::add); + else + oldContents.customEffects().forEach(newEffects::add); + newEffects.removeIf(effect -> effect.getEffectType() == targetEffect); + + Optional> newPotion = + mainPotionContainsTargetEffect ? Optional.empty() + : oldContents.potion(); + stack.set(DataComponentTypes.POTION_CONTENTS, + new PotionContentsComponent(newPotion, oldContents.customColor(), + newEffects)); - NbtCompound nbt = new NbtCompound(); - nbt.put("custom_potion_effects", newEffects); - stack.setNbt(nbt); ChatUtils.message("Effect removed."); } - private String parseEffectId(String input) throws CmdSyntaxError + private RegistryEntry parseEffect(String input) + throws CmdSyntaxError { StatusEffect effect; @@ -166,7 +154,7 @@ public final class PotionCmd extends Command if(effect == null) throw new CmdSyntaxError("Invalid effect: " + input); - return Registries.STATUS_EFFECT.getId(effect).toString(); + return Registries.STATUS_EFFECT.getEntry(effect); } private int parseInt(String s) throws CmdSyntaxError diff --git a/src/main/java/net/wurstclient/commands/RenameCmd.java b/src/main/java/net/wurstclient/commands/RenameCmd.java index d7c96a08..cf7c7eef 100644 --- a/src/main/java/net/wurstclient/commands/RenameCmd.java +++ b/src/main/java/net/wurstclient/commands/RenameCmd.java @@ -7,6 +7,7 @@ */ package net.wurstclient.commands; +import net.minecraft.component.DataComponentTypes; import net.minecraft.item.ItemStack; import net.minecraft.text.Text; import net.wurstclient.command.CmdError; @@ -38,12 +39,12 @@ public final class RenameCmd extends Command message += " " + args[i]; message = message.replace("$", "\u00a7").replace("\u00a7\u00a7", "$"); - ItemStack item = MC.player.getInventory().getMainHandStack(); + ItemStack stack = MC.player.getInventory().getMainHandStack(); - if(item == null) + if(stack == null) throw new CmdError("There is no item in your hand."); - item.setCustomName(Text.literal(message)); - ChatUtils.message("Renamed item to \"" + message + "\u00a7r\"."); + stack.set(DataComponentTypes.CUSTOM_NAME, Text.literal(message)); + ChatUtils.message("Renamed item to \"\u00a7o" + message + "\u00a7r\"."); } } diff --git a/src/main/java/net/wurstclient/commands/ViewNbtCmd.java b/src/main/java/net/wurstclient/commands/ViewNbtCmd.java index da69ec56..241868bf 100644 --- a/src/main/java/net/wurstclient/commands/ViewNbtCmd.java +++ b/src/main/java/net/wurstclient/commands/ViewNbtCmd.java @@ -8,6 +8,8 @@ package net.wurstclient.commands; import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.NbtComponent; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; import net.wurstclient.SearchTags; @@ -34,17 +36,19 @@ public final class ViewNbtCmd extends Command if(stack.isEmpty()) throw new CmdError("You must hold an item in your main hand."); - NbtCompound tag = stack.getNbt(); - String nbt = tag == null ? "" : tag.asString(); + NbtCompound tag = stack + .getOrDefault(DataComponentTypes.CUSTOM_DATA, NbtComponent.DEFAULT) + .copyNbt(); + String nbtString = tag.asString(); switch(String.join(" ", args).toLowerCase()) { case "": - ChatUtils.message("NBT: " + nbt); + ChatUtils.message("NBT: " + nbtString); break; case "copy": - MC.keyboard.setClipboard(nbt); + MC.keyboard.setClipboard(nbtString); ChatUtils.message("NBT data copied to clipboard."); break; diff --git a/src/main/java/net/wurstclient/hacks/AntiSpamHack.java b/src/main/java/net/wurstclient/hacks/AntiSpamHack.java index efae48f6..16aed807 100644 --- a/src/main/java/net/wurstclient/hacks/AntiSpamHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiSpamHack.java @@ -135,7 +135,17 @@ public final class AntiSpamHack extends Hack implements ChatInputListener } if(spamCounter > 1) - event.setComponent(((MutableText)event.getComponent()) - .append(" [x" + spamCounter + "]")); + { + // Someone, somewhere, is creating a MutableText object with an + // immutable List siblings parameter, which causes the game to + // crash when calling append(). So we always have to create a new + // MutableText object to avoid that. + MutableText oldText = (MutableText)event.getComponent(); + MutableText newText = MutableText.of(oldText.getContent()); + newText.setStyle(oldText.getStyle()); + oldText.getSiblings().forEach(newText::append); + + event.setComponent(newText.append(" [x" + spamCounter + "]")); + } } } diff --git a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java index be89bccc..ed5a4d5c 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java @@ -9,6 +9,7 @@ package net.wurstclient.hacks; import java.util.Comparator; import java.util.HashSet; +import java.util.Set; import java.util.stream.Stream; import java.util.stream.StreamSupport; @@ -16,17 +17,21 @@ import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.systems.RenderSystem; +import it.unimi.dsi.fastutil.objects.Object2IntMap; +import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry; import net.minecraft.block.Blocks; import net.minecraft.client.gui.screen.ingame.MerchantScreen; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.network.ClientPlayerInteractionManager; import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.item.EnchantedBookItem; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.nbt.NbtList; import net.minecraft.network.packet.c2s.play.SelectMerchantTradeC2SPacket; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.screen.slot.SlotActionType; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; @@ -421,20 +426,23 @@ public final class AutoLibrarianHack extends Hack if(!(stack.getItem() instanceof EnchantedBookItem book)) continue; - NbtList enchantmentNbt = EnchantedBookItem.getEnchantmentNbt(stack); - if(enchantmentNbt.isEmpty()) + Set>> enchantmentLevelMap = + EnchantmentHelper.getEnchantments(stack).getEnchantmentsMap(); + if(enchantmentLevelMap.isEmpty()) continue; - NbtList bookNbt = EnchantedBookItem.getEnchantmentNbt(stack); - String enchantment = bookNbt.getCompound(0).getString("id"); - int level = bookNbt.getCompound(0).getInt("lvl"); + Object2IntMap.Entry> firstEntry = + enchantmentLevelMap.stream().findFirst().orElseThrow(); + + String enchantment = firstEntry.getKey().getIdAsString(); + int level = firstEntry.getIntValue(); int price = tradeOffer.getDisplayedFirstBuyItem().getCount(); BookOffer bookOffer = new BookOffer(enchantment, level, price); if(!bookOffer.isValid()) { System.out.println("Found invalid enchanted book offer.\n" - + "NBT data: " + stack.getNbt()); + + "Component data: " + enchantmentLevelMap); continue; } diff --git a/src/main/java/net/wurstclient/hacks/AutoPotionHack.java b/src/main/java/net/wurstclient/hacks/AutoPotionHack.java index aa2504fb..1507af04 100644 --- a/src/main/java/net/wurstclient/hacks/AutoPotionHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoPotionHack.java @@ -7,19 +7,16 @@ */ package net.wurstclient.hacks; -import net.minecraft.component.type.PotionContentsComponent; -import net.minecraft.entity.effect.StatusEffect; -import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.registry.entry.RegistryEntry; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; +import net.wurstclient.util.ItemUtils; import net.wurstclient.util.Rotation; @SearchTags({"AutoPotion", "auto potion", "AutoSplashPotion", @@ -112,25 +109,10 @@ public final class AutoPotionHack extends Hack implements UpdateListener continue; // search for instant health effects - if(hasEffect(stack, StatusEffects.INSTANT_HEALTH)) + if(ItemUtils.hasEffect(stack, StatusEffects.INSTANT_HEALTH)) return i; } return -1; } - - private boolean hasEffect(ItemStack stack, - RegistryEntry effect) - { - for(StatusEffectInstance effectInstance : PotionContentsComponent - .getPotionEffects(stack)) - { - if(effectInstance.getEffectType() != effect) - continue; - - return true; - } - - return false; - } } diff --git a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java index 49760deb..f545df72 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java @@ -11,10 +11,9 @@ import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.item.MiningToolItem; -import net.minecraft.item.SwordItem; import net.minecraft.item.ToolItem; import net.minecraft.item.TridentItem; import net.minecraft.util.hit.EntityHitResult; @@ -153,17 +152,16 @@ public final class AutoSwordHack extends Hack implements UpdateListener switch(priority.getSelected()) { case SPEED: - return ItemUtils.getAttackSpeed(item); + return (float)ItemUtils + .getAttribute(item, EntityAttributes.GENERIC_ATTACK_SPEED) + .orElseThrow(); case DAMAGE: EntityType group = entity.getType(); - float dmg = EnchantmentHelper.getAttackDamage(stack, group); - if(item instanceof SwordItem sword) - dmg += sword.getAttackDamage(); - if(item instanceof MiningToolItem tool) - dmg += tool.getAttackDamage(); - if(item instanceof TridentItem) - dmg += TridentItem.ATTACK_DAMAGE; + float dmg = (float)ItemUtils + .getAttribute(item, EntityAttributes.GENERIC_ATTACK_DAMAGE) + .orElseThrow(); + dmg += EnchantmentHelper.getAttackDamage(stack, group); return dmg; } diff --git a/src/main/java/net/wurstclient/hacks/CrashChestHack.java b/src/main/java/net/wurstclient/hacks/CrashChestHack.java index e76ce26d..f6b95559 100644 --- a/src/main/java/net/wurstclient/hacks/CrashChestHack.java +++ b/src/main/java/net/wurstclient/hacks/CrashChestHack.java @@ -8,6 +8,8 @@ package net.wurstclient.hacks; import net.minecraft.block.Blocks; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.NbtComponent; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtList; @@ -51,8 +53,8 @@ public final class CrashChestHack extends Hack for(int i = 0; i < 40000; i++) nbtList.add(new NbtList()); nbtCompound.put("www.wurstclient.net", nbtList); - stack.setNbt(nbtCompound); - stack.setCustomName(Text.literal("Copy Me")); + stack.set(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(nbtCompound)); + stack.set(DataComponentTypes.CUSTOM_NAME, Text.literal("Copy Me")); // give item MC.player.getInventory().armor.set(0, stack); diff --git a/src/main/java/net/wurstclient/hacks/KillPotionHack.java b/src/main/java/net/wurstclient/hacks/KillPotionHack.java index 48a43226..e241e88c 100644 --- a/src/main/java/net/wurstclient/hacks/KillPotionHack.java +++ b/src/main/java/net/wurstclient/hacks/KillPotionHack.java @@ -7,11 +7,16 @@ */ package net.wurstclient.hacks; +import java.util.List; +import java.util.Optional; + +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.PotionContentsComponent; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtList; import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket; import net.minecraft.text.Text; import net.wurstclient.Category; @@ -106,21 +111,18 @@ public final class KillPotionHack extends Hack { ItemStack stack = new ItemStack(item); - NbtCompound effect = new NbtCompound(); - effect.putInt("amplifier", 125); - effect.putInt("duration", 2000); - effect.putString("id", "instant_health"); + StatusEffectInstance effect = new StatusEffectInstance( + StatusEffects.INSTANT_HEALTH, 2000, 125); - NbtList effects = new NbtList(); - effects.add(effect); + PotionContentsComponent potionContents = + new PotionContentsComponent(Optional.empty(), Optional.empty(), + List.of(effect)); - NbtCompound nbt = new NbtCompound(); - nbt.put("custom_potion_effects", effects); - stack.setNbt(nbt); + stack.set(DataComponentTypes.POTION_CONTENTS, potionContents); String name = "\u00a7f" + itemName + " of \u00a74\u00a7lINSTANT DEATH"; - stack.setCustomName(Text.literal(name)); + stack.set(DataComponentTypes.CUSTOM_NAME, Text.literal(name)); return stack; } diff --git a/src/main/java/net/wurstclient/hacks/TrollPotionHack.java b/src/main/java/net/wurstclient/hacks/TrollPotionHack.java index 29a8e499..21398d1d 100644 --- a/src/main/java/net/wurstclient/hacks/TrollPotionHack.java +++ b/src/main/java/net/wurstclient/hacks/TrollPotionHack.java @@ -7,13 +7,19 @@ */ package net.wurstclient.hacks; +import java.util.ArrayList; +import java.util.Optional; + +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.PotionContentsComponent; +import net.minecraft.entity.effect.StatusEffect; +import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtList; import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket; import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.text.Text; import net.wurstclient.Category; import net.wurstclient.SearchTags; @@ -104,25 +110,24 @@ public final class TrollPotionHack extends Hack { ItemStack stack = new ItemStack(item); - NbtList effects = new NbtList(); + ArrayList effects = new ArrayList<>(); for(int i = 1; i <= 23; i++) { - String id = Registries.STATUS_EFFECT.getEntry(i).get().getKey() - .get().getValue().toString(); + StatusEffect effect = + Registries.STATUS_EFFECT.getEntry(i).get().value(); + RegistryEntry entry = + Registries.STATUS_EFFECT.getEntry(effect); - NbtCompound effect = new NbtCompound(); - effect.putInt("amplifier", Integer.MAX_VALUE); - effect.putInt("duration", Integer.MAX_VALUE); - effect.putString("id", id); - effects.add(effect); + effects.add(new StatusEffectInstance(entry, Integer.MAX_VALUE, + Integer.MAX_VALUE)); } - NbtCompound nbt = new NbtCompound(); - nbt.put("custom_potion_effects", effects); - stack.setNbt(nbt); + stack.set(DataComponentTypes.POTION_CONTENTS, + new PotionContentsComponent(Optional.empty(), Optional.empty(), + effects)); String name = "\u00a7f" + itemName + " of Trolling"; - stack.setCustomName(Text.literal(name)); + stack.set(DataComponentTypes.CUSTOM_NAME, Text.literal(name)); return stack; } diff --git a/src/main/java/net/wurstclient/mixin/StatsScreenMixin.java b/src/main/java/net/wurstclient/mixin/StatsScreenMixin.java index b445e13a..2335f03a 100644 --- a/src/main/java/net/wurstclient/mixin/StatsScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/StatsScreenMixin.java @@ -8,13 +8,13 @@ package net.wurstclient.mixin; 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; import net.fabricmc.fabric.api.client.screen.v1.Screens; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.screen.StatsListener; import net.minecraft.client.gui.screen.StatsScreen; import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.ClickableWidget; @@ -23,8 +23,11 @@ import net.minecraft.text.Text; import net.wurstclient.WurstClient; @Mixin(StatsScreen.class) -public abstract class StatsScreenMixin extends Screen implements StatsListener +public abstract class StatsScreenMixin extends Screen { + @Unique + private ButtonWidget toggleWurstButton; + private StatsScreenMixin(WurstClient wurst, Text title) { super(title); @@ -36,24 +39,39 @@ public abstract class StatsScreenMixin extends Screen implements StatsListener if(WurstClient.INSTANCE.getOtfs().disableOtf.shouldHideEnableButton()) return; - ButtonWidget toggleWurstButton = - ButtonWidget.builder(Text.literal(""), this::toggleWurst) - .dimensions(width / 2 - 152, height - 28, 150, 20).build(); + toggleWurstButton = ButtonWidget + .builder(Text.literal(""), this::toggleWurst).width(150).build(); updateWurstButtonText(toggleWurstButton); addDrawableChild(toggleWurstButton); - - for(ClickableWidget button : Screens.getButtons(this)) - { - if(!button.getMessage().getString() - .equals(I18n.translate("gui.done"))) - continue; - - button.setX(width / 2 + 2); - button.setWidth(150); - } } + @Inject(at = @At("TAIL"), method = "initTabNavigation()V") + private void onInitTabNavigation(CallbackInfo ci) + { + if(toggleWurstButton == null) + return; + + ClickableWidget doneButton = wurst_getDoneButton(); + doneButton.setX(width / 2 + 2); + doneButton.setWidth(150); + + toggleWurstButton.setPosition(width / 2 - 152, doneButton.getY()); + } + + @Unique + private ClickableWidget wurst_getDoneButton() + { + for(ClickableWidget button : Screens.getButtons(this)) + if(button.getMessage().getString() + .equals(I18n.translate("gui.done"))) + return button; + + throw new IllegalStateException( + "Can't find the done button on the statistics screen."); + } + + @Unique private void toggleWurst(ButtonWidget button) { WurstClient wurst = WurstClient.INSTANCE; @@ -62,6 +80,7 @@ public abstract class StatsScreenMixin extends Screen implements StatsListener updateWurstButtonText(button); } + @Unique private void updateWurstButtonText(ButtonWidget button) { WurstClient wurst = WurstClient.INSTANCE; diff --git a/src/main/java/net/wurstclient/util/ItemUtils.java b/src/main/java/net/wurstclient/util/ItemUtils.java index 22829a1e..f3916bbe 100644 --- a/src/main/java/net/wurstclient/util/ItemUtils.java +++ b/src/main/java/net/wurstclient/util/ItemUtils.java @@ -7,16 +7,18 @@ */ package net.wurstclient.util; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.EquipmentSlot; -import net.minecraft.entity.attribute.EntityAttributes; +import java.util.OptionalDouble; + +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.AttributeModifiersComponent; +import net.minecraft.component.type.PotionContentsComponent; +import net.minecraft.entity.attribute.EntityAttribute; +import net.minecraft.entity.effect.StatusEffect; +import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtElement; -import net.minecraft.nbt.NbtList; import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.util.Identifier; import net.minecraft.util.InvalidIdentifierException; @@ -55,32 +57,29 @@ public enum ItemUtils } } - public static float getAttackSpeed(Item item) + public static OptionalDouble getAttribute(Item item, + RegistryEntry attribute) { - return (float)item.getAttributeModifiers(EquipmentSlot.MAINHAND) - .get(EntityAttributes.GENERIC_ATTACK_SPEED).stream().findFirst() - .orElseThrow().getValue(); + return item.getComponents() + .getOrDefault(DataComponentTypes.ATTRIBUTE_MODIFIERS, + AttributeModifiersComponent.DEFAULT) + .modifiers().stream() + .filter(modifier -> modifier.attribute() == attribute) + .mapToDouble(modifier -> modifier.modifier().getValue()) + .findFirst(); } - /** - * Adds the specified enchantment to the specified item stack. Unlike - * {@link ItemStack#addEnchantment(Enchantment, int)}, this method doesn't - * limit the level to 127. - */ - public static void addEnchantment(ItemStack stack, Enchantment enchantment, - int level) + public static boolean hasEffect(ItemStack stack, + RegistryEntry effect) { - Identifier id = EnchantmentHelper.getEnchantmentId(enchantment); - NbtList nbt = getOrCreateNbtList(stack, ItemStack.ENCHANTMENTS_KEY); - nbt.add(EnchantmentHelper.createNbt(id, level)); - } - - public static NbtList getOrCreateNbtList(ItemStack stack, String key) - { - NbtCompound nbt = stack.getOrCreateNbt(); - if(!nbt.contains(key, NbtElement.LIST_TYPE)) - nbt.put(key, new NbtList()); + PotionContentsComponent potionContents = stack.getComponents() + .getOrDefault(DataComponentTypes.POTION_CONTENTS, + PotionContentsComponent.DEFAULT); - return nbt.getList(key, NbtElement.COMPOUND_TYPE); + for(StatusEffectInstance effectInstance : potionContents.getEffects()) + if(effectInstance.getEffectType() == effect) + return true; + + return false; } } diff --git a/src/main/java/net/wurstclient/util/ListWidget.java b/src/main/java/net/wurstclient/util/ListWidget.java index 236a8011..83060fdd 100644 --- a/src/main/java/net/wurstclient/util/ListWidget.java +++ b/src/main/java/net/wurstclient/util/ListWidget.java @@ -21,18 +21,21 @@ import net.minecraft.client.gui.AbstractParentElement; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Drawable; import net.minecraft.client.gui.Element; -import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.Identifier; import net.minecraft.util.math.MathHelper; public abstract class ListWidget extends AbstractParentElement implements Drawable { + private static final Identifier MENU_LIST_BACKGROUND_TEXTURE = + new Identifier("textures/gui/menu_list_background.png"); + protected final MinecraftClient client; protected int width; protected int height; @@ -144,7 +147,8 @@ public abstract class ListWidget extends AbstractParentElement capYPosition(); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferBuilder = tessellator.getBuffer(); - RenderSystem.setShaderTexture(0, Screen.OPTIONS_BACKGROUND_TEXTURE); + RenderSystem.enableBlend(); + RenderSystem.setShaderTexture(0, MENU_LIST_BACKGROUND_TEXTURE); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShader(GameRenderer::getPositionTexColorProgram); bufferBuilder.begin(VertexFormat.DrawMode.QUADS, @@ -167,7 +171,9 @@ public abstract class ListWidget extends AbstractParentElement if(renderHeader) renderHeader(k, l, tessellator); + context.enableScissor(left, top, right, bottom); renderList(context, k, l, mouseX, mouseY, delta); + context.disableScissor(); RenderSystem.disableDepthTest(); renderHoleBackground(0, top, 255, 255); renderHoleBackground(bottom, height, 255, 255); @@ -175,9 +181,6 @@ public abstract class ListWidget extends AbstractParentElement RenderSystem.blendFuncSeparate(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SrcFactor.ZERO, GlStateManager.DstFactor.ONE); - // RenderSystem.disableAlphaTest(); - // RenderSystem.shadeModel(7425); - // RenderSystem.disableTexture(); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); @@ -246,9 +249,6 @@ public abstract class ListWidget extends AbstractParentElement } renderDecorations(mouseX, mouseY); - // RenderSystem.enableTexture(); - // RenderSystem.shadeModel(7424); - // RenderSystem.enableAlphaTest(); RenderSystem.disableBlend(); } } @@ -392,7 +392,6 @@ public abstract class ListWidget extends AbstractParentElement { int q = left + width / 2 - getRowWidth() / 2; int r = left + width / 2 + getRowWidth() / 2; - // RenderSystem.disableTexture(); float g = isFocused() ? 1.0F : 0.5F; RenderSystem.setShaderColor(g, g, g, 1.0F); bufferBuilder.begin(VertexFormat.DrawMode.QUADS, @@ -410,7 +409,6 @@ public abstract class ListWidget extends AbstractParentElement bufferBuilder.vertex(r - 1, o - 1, 0.0D).next(); bufferBuilder.vertex(q + 1, o - 1, 0.0D).next(); tessellator.draw(); - // RenderSystem.enableTexture(); } RenderSystem.setShaderColor(1, 1, 1, 1); @@ -435,7 +433,8 @@ public abstract class ListWidget extends AbstractParentElement { Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferBuilder = tessellator.getBuffer(); - RenderSystem.setShaderTexture(0, Screen.OPTIONS_BACKGROUND_TEXTURE); + RenderSystem.enableBlend(); + RenderSystem.setShaderTexture(0, MENU_LIST_BACKGROUND_TEXTURE); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShader(GameRenderer::getPositionTexColorProgram); bufferBuilder.begin(VertexFormat.DrawMode.QUADS, diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index af79f50e..51fc8ca8 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,9 +29,9 @@ "accessWidener" : "wurst.accesswidener", "depends": { - "fabricloader": ">=0.15.6", - "fabric-api": ">=0.95.6", - "minecraft": "~1.20.5-alpha.24.6.a", + "fabricloader": ">=0.15.7", + "fabric-api": ">=0.96.6", + "minecraft": "~1.20.5-alpha.24.9.a", "java": ">=17" }, "suggests": { From e268098a37c0b8a21bad48f2de5b5764284cda6f Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 6 Mar 2024 19:27:41 +0100 Subject: [PATCH 14/35] [Wurst-Bot] Update to 24w10a --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index d4c141f8..cf525046 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w09a -yarn_mappings=24w09a+build.8 +minecraft_version=24w10a +yarn_mappings=24w10a+build.1 loader_version=0.15.7 #Fabric api -fabric_version=0.96.6+1.20.5 +fabric_version=0.96.8+1.20.5 # Mod Properties -mod_version = v7.41.1-MC24w09a +mod_version = v7.41.1-MC24w10a 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 40dd9a05..9e8fbe22 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.1"; - public static final String MC_VERSION = "24w09a"; + public static final String MC_VERSION = "24w10a"; private WurstAnalytics analytics; private EventManager eventManager; From e7fcc6a914527fb9f8a8b5d69054f33aa1831e33 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 6 Mar 2024 19:45:22 +0100 Subject: [PATCH 15/35] Update to 24w10a --- src/main/java/net/wurstclient/util/ItemUtils.java | 3 +-- src/main/resources/fabric.mod.json | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/wurstclient/util/ItemUtils.java b/src/main/java/net/wurstclient/util/ItemUtils.java index f3916bbe..4150aacc 100644 --- a/src/main/java/net/wurstclient/util/ItemUtils.java +++ b/src/main/java/net/wurstclient/util/ItemUtils.java @@ -65,8 +65,7 @@ public enum ItemUtils AttributeModifiersComponent.DEFAULT) .modifiers().stream() .filter(modifier -> modifier.attribute() == attribute) - .mapToDouble(modifier -> modifier.modifier().getValue()) - .findFirst(); + .mapToDouble(modifier -> modifier.modifier().value()).findFirst(); } public static boolean hasEffect(ItemStack stack, diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 51fc8ca8..cfb987fb 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,8 +30,8 @@ "depends": { "fabricloader": ">=0.15.7", - "fabric-api": ">=0.96.6", - "minecraft": "~1.20.5-alpha.24.9.a", + "fabric-api": ">=0.96.8", + "minecraft": "~1.20.5-alpha.24.10.a", "java": ">=17" }, "suggests": { From 94a14a17ec1ccfbd0022afb01d222d23914501b5 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 14 Mar 2024 21:43:17 +0100 Subject: [PATCH 16/35] [Wurst-Bot] Update to 24w11a --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index cf525046..f4aa5ce8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w10a -yarn_mappings=24w10a+build.1 +minecraft_version=24w11a +yarn_mappings=24w11a+build.2 loader_version=0.15.7 #Fabric api -fabric_version=0.96.8+1.20.5 +fabric_version=0.96.9+1.20.5 # Mod Properties -mod_version = v7.41.1-MC24w10a +mod_version = v7.41.1-MC24w11a 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 9e8fbe22..d4da21eb 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.1"; - public static final String MC_VERSION = "24w10a"; + public static final String MC_VERSION = "24w11a"; private WurstAnalytics analytics; private EventManager eventManager; From 759cec751c2c88d547d264b2af756cd3c3ee3309 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 14 Mar 2024 22:07:54 +0100 Subject: [PATCH 17/35] Update to 24w11a --- src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java | 2 ++ src/main/java/net/wurstclient/mixin/GameRendererMixin.java | 5 +++-- src/main/resources/fabric.mod.json | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java b/src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java index 19797948..d7e72da5 100644 --- a/src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java @@ -77,6 +77,8 @@ public abstract class GameMenuScreenMixin extends Screen float u = 0; float v = 0; context.drawTexture(WURST_TEXTURE, x, y, u, v, w, h, fw, fh); + + GL11.glDisable(GL11.GL_BLEND); } private void addWurstOptionsButton() diff --git a/src/main/java/net/wurstclient/mixin/GameRendererMixin.java b/src/main/java/net/wurstclient/mixin/GameRendererMixin.java index 60f80225..172024d8 100644 --- a/src/main/java/net/wurstclient/mixin/GameRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/GameRendererMixin.java @@ -77,8 +77,9 @@ public abstract class GameRendererMixin implements AutoCloseable * after the view-bobbing call. */ @Inject(at = @At("HEAD"), - method = "renderHand(Lnet/minecraft/client/render/Camera;F)V") - private void onRenderHand(Camera camera, float tickDelta, CallbackInfo ci) + method = "renderHand(Lnet/minecraft/client/render/Camera;FLorg/joml/Matrix4f;)V") + private void onRenderHand(Camera camera, float tickDelta, Matrix4f matrix4f, + CallbackInfo ci) { cancelNextBobView = false; } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index cfb987fb..229a267a 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,8 +30,8 @@ "depends": { "fabricloader": ">=0.15.7", - "fabric-api": ">=0.96.8", - "minecraft": "~1.20.5-alpha.24.10.a", + "fabric-api": ">=0.96.9", + "minecraft": "~1.20.5-alpha.24.11.a", "java": ">=17" }, "suggests": { From b756d424f761e9b3a525bce0f866ce01ccdc175b Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 20 Mar 2024 20:50:30 +0100 Subject: [PATCH 18/35] [Wurst-Bot] Update to 24w12a --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index f4aa5ce8..24b5821f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w11a -yarn_mappings=24w11a+build.2 +minecraft_version=24w12a +yarn_mappings=24w12a+build.3 loader_version=0.15.7 #Fabric api -fabric_version=0.96.9+1.20.5 +fabric_version=0.96.12+1.20.5 # Mod Properties -mod_version = v7.41.1-MC24w11a +mod_version = v7.41.1-MC24w12a 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 d4da21eb..45f01ffd 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.1"; - public static final String MC_VERSION = "24w11a"; + public static final String MC_VERSION = "24w12a"; private WurstAnalytics analytics; private EventManager eventManager; From 2039e96e321796c5623bf013e8c60dea7e65319a Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 20 Mar 2024 22:08:11 +0100 Subject: [PATCH 19/35] Update to 24w12a --- .../net/wurstclient/hacks/AutoEatHack.java | 22 +++++++++---------- .../net/wurstclient/hacks/AutoToolHack.java | 2 +- src/main/resources/fabric.mod.json | 4 ++-- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoEatHack.java b/src/main/java/net/wurstclient/hacks/AutoEatHack.java index 2c1064d4..ed8f66b3 100644 --- a/src/main/java/net/wurstclient/hacks/AutoEatHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoEatHack.java @@ -11,23 +11,22 @@ import java.util.ArrayList; import java.util.Comparator; import java.util.stream.Stream; -import com.mojang.datafixers.util.Pair; - import net.minecraft.block.Block; import net.minecraft.block.BlockWithEntity; import net.minecraft.block.CraftingTableBlock; import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.component.DataComponentTypes; import net.minecraft.entity.Entity; import net.minecraft.entity.effect.StatusEffect; -import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.passive.TameableEntity; import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.entity.player.HungerManager; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.FoodComponent; +import net.minecraft.item.FoodComponent.StatusEffectEntry; import net.minecraft.item.FoodComponents; -import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; @@ -217,21 +216,21 @@ public final class AutoEatHack extends Hack implements UpdateListener .forEach(i -> slots.add(i)); Comparator comparator = - Comparator.comparingDouble(FoodComponent::getSaturationModifier); + Comparator.comparingDouble(FoodComponent::saturationModifier); for(int slot : slots) { - Item item = inventory.getStack(slot).getItem(); + ItemStack stack = inventory.getStack(slot); // filter out non-food items - if(!item.isFood()) + if(!stack.contains(DataComponentTypes.FOOD)) continue; - FoodComponent food = item.getFoodComponent(); + FoodComponent food = stack.get(DataComponentTypes.FOOD); if(!isAllowedFood(food)) continue; - if(maxPoints >= 0 && food.getHunger() > maxPoints) + if(maxPoints >= 0 && food.hunger() > maxPoints) continue; // compare to previously found food @@ -275,10 +274,9 @@ public final class AutoEatHack extends Hack implements UpdateListener if(!allowChorus.isChecked() && food == FoodComponents.CHORUS_FRUIT) return false; - for(Pair pair : food.getStatusEffects()) + for(StatusEffectEntry entry : food.statusEffects()) { - RegistryEntry effect = - pair.getFirst().getEffectType(); + RegistryEntry effect = entry.effect().getEffectType(); if(!allowHunger.isChecked() && effect == StatusEffects.HUNGER) return false; diff --git a/src/main/java/net/wurstclient/hacks/AutoToolHack.java b/src/main/java/net/wurstclient/hacks/AutoToolHack.java index e8f6f395..0b5451ee 100644 --- a/src/main/java/net/wurstclient/hacks/AutoToolHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoToolHack.java @@ -191,7 +191,7 @@ public final class AutoToolHack extends Hack private boolean isDamageable(ItemStack stack) { - return !stack.isEmpty() && stack.getItem().isDamageable(); + return !stack.isEmpty() && stack.isDamageable(); } private boolean isTooDamaged(ItemStack stack, int repairMode) diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 229a267a..cd75c081 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,8 +30,8 @@ "depends": { "fabricloader": ">=0.15.7", - "fabric-api": ">=0.96.9", - "minecraft": "~1.20.5-alpha.24.11.a", + "fabric-api": ">=0.96.12", + "minecraft": "~1.20.5-alpha.24.12.a", "java": ">=17" }, "suggests": { From edf46d4d289b0cbab6ced6c680e8e0f887ad30a4 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sun, 24 Mar 2024 02:06:40 +0100 Subject: [PATCH 20/35] Update Formatter and Clean Up settings for Eclipse 2024-03 --- codestyle/cleanup.xml | 259 +++++++++--------- codestyle/formatter.xml | 3 + .../wurstclient/hacks/AutoLibrarianHack.java | 2 +- 3 files changed, 135 insertions(+), 129 deletions(-) diff --git a/codestyle/cleanup.xml b/codestyle/cleanup.xml index 70a36773..a6aa8d3e 100644 --- a/codestyle/cleanup.xml +++ b/codestyle/cleanup.xml @@ -1,144 +1,147 @@ - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/codestyle/formatter.xml b/codestyle/formatter.xml index b44984ad..3c2ecb64 100644 --- a/codestyle/formatter.xml +++ b/codestyle/formatter.xml @@ -200,6 +200,7 @@ + @@ -280,6 +281,7 @@ + @@ -310,6 +312,7 @@ + diff --git a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java index ed5a4d5c..034069d8 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java @@ -423,7 +423,7 @@ public final class AutoLibrarianHack extends Hack for(TradeOffer tradeOffer : tradeOffers) { ItemStack stack = tradeOffer.getSellItem(); - if(!(stack.getItem() instanceof EnchantedBookItem book)) + if(!(stack.getItem() instanceof EnchantedBookItem)) continue; Set>> enchantmentLevelMap = From 25e5ccac9ce64425f1faa5fdef57f2aa584fd514 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 28 Mar 2024 14:42:34 +0100 Subject: [PATCH 21/35] [Wurst-Bot] Update to 24w13a --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index c30ec462..e57ebcd4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w12a -yarn_mappings=24w12a+build.6 +minecraft_version=24w13a +yarn_mappings=24w13a+build.4 loader_version=0.15.7 #Fabric api -fabric_version=0.96.12+1.20.5 +fabric_version=0.96.13+1.20.5 # Mod Properties -mod_version = v7.41.2-MC24w12a +mod_version = v7.41.2-MC24w13a 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 b04c23dc..f7e1234f 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "24w12a"; + public static final String MC_VERSION = "24w13a"; private WurstAnalytics analytics; private EventManager eventManager; From ecbf95bff8b2ca9431ec0505b63a6bb5b23cdfb9 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 28 Mar 2024 19:14:50 +0100 Subject: [PATCH 22/35] Update to 24w13a --- .../net/wurstclient/mixin/ChatHudMixin.java | 35 ++++--------------- .../wurstclient/mixin/ChatScreenMixin.java | 32 +++++++++-------- src/main/resources/fabric.mod.json | 4 +-- 3 files changed, 27 insertions(+), 44 deletions(-) diff --git a/src/main/java/net/wurstclient/mixin/ChatHudMixin.java b/src/main/java/net/wurstclient/mixin/ChatHudMixin.java index 65793b3d..e3ab4af8 100644 --- a/src/main/java/net/wurstclient/mixin/ChatHudMixin.java +++ b/src/main/java/net/wurstclient/mixin/ChatHudMixin.java @@ -17,7 +17,9 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import net.minecraft.client.MinecraftClient; +import com.llamalad7.mixinextras.sugar.Local; +import com.llamalad7.mixinextras.sugar.ref.LocalRef; + import net.minecraft.client.gui.hud.ChatHud; import net.minecraft.client.gui.hud.ChatHudLine; import net.minecraft.client.gui.hud.MessageIndicator; @@ -33,16 +35,14 @@ public class ChatHudMixin @Shadow @Final private List visibleMessages; - @Shadow - @Final - private MinecraftClient client; @Inject(at = @At("HEAD"), method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/client/gui/hud/MessageIndicator;)V", cancellable = true) private void onAddMessage(Text message, @Nullable MessageSignatureData signature, - @Nullable MessageIndicator indicator, CallbackInfo ci) + @Nullable MessageIndicator indicatorDontUse, CallbackInfo ci, + @Local LocalRef indicator) { ChatInputEvent event = new ChatInputEvent(message, visibleMessages); @@ -54,28 +54,7 @@ public class ChatHudMixin } message = event.getComponent(); - indicator = WurstClient.INSTANCE.getOtfs().noChatReportsOtf - .modifyIndicator(message, signature, indicator); - - shadow$logChatMessage(message, indicator); - shadow$addMessage(message, signature, client.inGameHud.getTicks(), - indicator, false); - - ci.cancel(); - } - - @Shadow - private void shadow$logChatMessage(Text message, - @Nullable MessageIndicator indicator) - { - - } - - @Shadow - private void shadow$addMessage(Text message, - @Nullable MessageSignatureData signature, int ticks, - @Nullable MessageIndicator indicator, boolean refresh) - { - + indicator.set(WurstClient.INSTANCE.getOtfs().noChatReportsOtf + .modifyIndicator(message, signature, indicator.get())); } } diff --git a/src/main/java/net/wurstclient/mixin/ChatScreenMixin.java b/src/main/java/net/wurstclient/mixin/ChatScreenMixin.java index 750c1b63..a4696229 100644 --- a/src/main/java/net/wurstclient/mixin/ChatScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/ChatScreenMixin.java @@ -45,32 +45,36 @@ public abstract class ChatScreenMixin extends Screen public void onSendMessage(String message, boolean addToHistory, CallbackInfo ci) { + // Ignore empty messages just like vanilla if((message = normalize(message)).isEmpty()) return; + // Create and fire the chat output event ChatOutputEvent event = new ChatOutputEvent(message); EventManager.fire(event); - if(event.isCancelled()) - { - ci.cancel(); - return; - } - - if(!event.isModified()) + // If the event hasn't been modified or cancelled, + // let the vanilla method handle the message + boolean cancelled = event.isCancelled(); + if(!cancelled && !event.isModified()) return; + // Otherwise, cancel the vanilla method and handle the message here + ci.cancel(); + + // Add the message to history, even if it was cancelled + // Otherwise the up/down arrows won't work correctly String newMessage = event.getMessage(); if(addToHistory) client.inGameHud.getChatHud().addToMessageHistory(newMessage); - if(newMessage.startsWith("/")) - client.player.networkHandler - .sendChatCommand(newMessage.substring(1)); - else - client.player.networkHandler.sendChatMessage(newMessage); - - ci.cancel(); + // If the event isn't cancelled, send the modified message + if(!cancelled) + if(newMessage.startsWith("/")) + client.player.networkHandler + .sendChatCommand(newMessage.substring(1)); + else + client.player.networkHandler.sendChatMessage(newMessage); } @Shadow diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index cd75c081..3be41284 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,8 +30,8 @@ "depends": { "fabricloader": ">=0.15.7", - "fabric-api": ">=0.96.12", - "minecraft": "~1.20.5-alpha.24.12.a", + "fabric-api": ">=0.96.13", + "minecraft": "~1.20.5-alpha.24.13.a", "java": ">=17" }, "suggests": { From 2b87ad52026aaae4528288d4e0b77628b50fad5f Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 3 Apr 2024 17:14:31 +0200 Subject: [PATCH 23/35] [Wurst-Bot] Update to 24w14a --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 68d4f4b1..f0a8aacc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w13a -yarn_mappings=24w13a+build.4 +minecraft_version=24w14a +yarn_mappings=24w14a+build.2 loader_version=0.15.9 #Fabric api -fabric_version=0.96.13+1.20.5 +fabric_version=0.96.14+1.20.5 # Mod Properties -mod_version = v7.41.2-MC24w13a +mod_version = v7.41.2-MC24w14a 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 f7e1234f..53d6f1af 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "24w13a"; + public static final String MC_VERSION = "24w14a"; private WurstAnalytics analytics; private EventManager eventManager; From 35204610387b010a64260d76bf39cf1f6cd368df Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 3 Apr 2024 18:22:15 +0200 Subject: [PATCH 24/35] Update to 24w14a and Java 21 --- .github/workflows/gradle.yml | 4 ++-- README.md | 2 +- build.gradle | 8 ++++---- .../net/wurstclient/altmanager/MicrosoftLoginManager.java | 5 +++-- .../analytics/dmurph/JGoogleAnalyticsTracker.java | 3 ++- .../hacks/autocomplete/OobaboogaMessageCompleter.java | 4 +++- .../hacks/autocomplete/OpenAiMessageCompleter.java | 8 +++++--- src/main/java/net/wurstclient/util/GoogleTranslate.java | 3 ++- src/main/resources/fabric.mod.json | 4 ++-- 9 files changed, 24 insertions(+), 17 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 7f4b1a79..daa6bd3d 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -23,10 +23,10 @@ jobs: - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@v2 - - name: Set up Java 17 + - name: Set up Java 21 uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'microsoft' - name: Grant execute permission for gradlew diff --git a/README.md b/README.md index c0b9e644..10645cfc 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## Setup (for developers) -(This assumes that you are using Windows with [Eclipse](https://www.eclipse.org/downloads/) and [Java Development Kit 17](https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot) already installed.) +(This assumes that you are using Windows with [Eclipse](https://www.eclipse.org/downloads/) and [Java Development Kit 21](https://adoptium.net/?variant=openjdk21&jvmVariant=hotspot) already installed.) 1. Run this command in PowerShell: diff --git a/build.gradle b/build.gradle index 5750e1eb..d54de53b 100644 --- a/build.gradle +++ b/build.gradle @@ -12,8 +12,8 @@ plugins { def ENV = System.getenv() -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_21 +targetCompatibility = JavaVersion.VERSION_21 archivesBaseName = project.archives_base_name version = project.mod_version @@ -58,8 +58,8 @@ processResources { } tasks.withType(JavaCompile).configureEach { - // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. - it.options.release = 17 + // Minecraft 1.20.5 (24w14a) upwards uses Java 21. + it.options.release = 21 } java { diff --git a/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java b/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java index f5fbbd10..8179146c 100644 --- a/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java +++ b/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java @@ -14,6 +14,7 @@ import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; +import java.net.URI; import java.net.URL; import java.net.URLConnection; import java.net.URLDecoder; @@ -197,7 +198,7 @@ public enum MicrosoftLoginManager try { - URL url = new URL(urlPost); + URL url = URI.create(urlPost).toURL(); HttpURLConnection connection = (HttpURLConnection)url.openConnection(); @@ -504,7 +505,7 @@ public enum MicrosoftLoginManager { try { - return new URL(url); + return URI.create(url).toURL(); }catch(MalformedURLException e) { diff --git a/src/main/java/net/wurstclient/analytics/dmurph/JGoogleAnalyticsTracker.java b/src/main/java/net/wurstclient/analytics/dmurph/JGoogleAnalyticsTracker.java index 0fd3d814..e558257b 100644 --- a/src/main/java/net/wurstclient/analytics/dmurph/JGoogleAnalyticsTracker.java +++ b/src/main/java/net/wurstclient/analytics/dmurph/JGoogleAnalyticsTracker.java @@ -30,6 +30,7 @@ import java.net.InetSocketAddress; import java.net.Proxy; import java.net.Proxy.Type; import java.net.SocketAddress; +import java.net.URI; import java.net.URL; import java.util.LinkedList; import java.util.Scanner; @@ -532,7 +533,7 @@ public class JGoogleAnalyticsTracker { try { - URL url = new URL(argURL); + URL url = URI.create(argURL).toURL(); HttpURLConnection connection = (HttpURLConnection)url.openConnection(proxy); connection.setRequestMethod("GET"); diff --git a/src/main/java/net/wurstclient/hacks/autocomplete/OobaboogaMessageCompleter.java b/src/main/java/net/wurstclient/hacks/autocomplete/OobaboogaMessageCompleter.java index d6847970..575c98d6 100644 --- a/src/main/java/net/wurstclient/hacks/autocomplete/OobaboogaMessageCompleter.java +++ b/src/main/java/net/wurstclient/hacks/autocomplete/OobaboogaMessageCompleter.java @@ -10,6 +10,7 @@ package net.wurstclient.hacks.autocomplete; import java.io.IOException; import java.io.OutputStream; import java.net.HttpURLConnection; +import java.net.URI; import java.net.URL; import com.google.gson.JsonArray; @@ -50,7 +51,8 @@ public final class OobaboogaMessageCompleter extends MessageCompleter throws IOException, JsonException { // set up the API request - URL url = new URL(modelSettings.oobaboogaEndpoint.getValue()); + URL url = + URI.create(modelSettings.oobaboogaEndpoint.getValue()).toURL(); HttpURLConnection conn = (HttpURLConnection)url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/json"); diff --git a/src/main/java/net/wurstclient/hacks/autocomplete/OpenAiMessageCompleter.java b/src/main/java/net/wurstclient/hacks/autocomplete/OpenAiMessageCompleter.java index 2b74290c..9555c613 100644 --- a/src/main/java/net/wurstclient/hacks/autocomplete/OpenAiMessageCompleter.java +++ b/src/main/java/net/wurstclient/hacks/autocomplete/OpenAiMessageCompleter.java @@ -10,6 +10,7 @@ package net.wurstclient.hacks.autocomplete; import java.io.IOException; import java.io.OutputStream; import java.net.HttpURLConnection; +import java.net.URI; import java.net.URL; import com.google.gson.JsonArray; @@ -64,9 +65,10 @@ public final class OpenAiMessageCompleter extends MessageCompleter throws IOException, JsonException { // get the API URL - URL url = modelSettings.openAiModel.getSelected().isChatModel() - ? new URL(modelSettings.openaiChatEndpoint.getValue()) - : new URL(modelSettings.openaiLegacyEndpoint.getValue()); + URL url = + URI.create(modelSettings.openAiModel.getSelected().isChatModel() + ? modelSettings.openaiChatEndpoint.getValue() + : modelSettings.openaiLegacyEndpoint.getValue()).toURL(); // set up the API request HttpURLConnection conn = (HttpURLConnection)url.openConnection(); diff --git a/src/main/java/net/wurstclient/util/GoogleTranslate.java b/src/main/java/net/wurstclient/util/GoogleTranslate.java index e3414e06..705ca85b 100644 --- a/src/main/java/net/wurstclient/util/GoogleTranslate.java +++ b/src/main/java/net/wurstclient/util/GoogleTranslate.java @@ -12,6 +12,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; +import java.net.URI; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder; @@ -69,7 +70,7 @@ public enum GoogleTranslate "https://translate.google.com/m?hl=en&sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s", langFrom, langTo, encodedText); - return new URL(urlString); + return URI.create(urlString).toURL(); }catch(MalformedURLException | UnsupportedEncodingException e) { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 75f403b5..cae3c62c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,9 +30,9 @@ "depends": { "fabricloader": ">=0.15.9", - "fabric-api": ">=0.96.13", + "fabric-api": ">=0.96.14", "minecraft": "~1.20.5-alpha.24.13.a", - "java": ">=17" + "java": ">=21" }, "suggests": { "mo_glass": "*" From 26c40d728dfe67fdd2423dd28dadc816347fe843 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 10 Apr 2024 20:46:39 +0200 Subject: [PATCH 25/35] [Wurst-Bot] Update to 1.20.5-pre1 --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- src/main/java/net/wurstclient/hacks/AutoEatHack.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index f0a8aacc..197e99eb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=24w14a -yarn_mappings=24w14a+build.2 +minecraft_version=1.20.5-pre1 +yarn_mappings=1.20.5-pre1+build.3 loader_version=0.15.9 #Fabric api -fabric_version=0.96.14+1.20.5 +fabric_version=0.96.15+1.20.5 # Mod Properties -mod_version = v7.41.2-MC24w14a +mod_version = v7.41.2-MC1.20.5-pre1 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 53d6f1af..0f477961 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "24w14a"; + public static final String MC_VERSION = "1.20.5-pre1"; private WurstAnalytics analytics; private EventManager eventManager; diff --git a/src/main/java/net/wurstclient/hacks/AutoEatHack.java b/src/main/java/net/wurstclient/hacks/AutoEatHack.java index 6d3adaac..edff4edf 100644 --- a/src/main/java/net/wurstclient/hacks/AutoEatHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoEatHack.java @@ -216,7 +216,7 @@ public final class AutoEatHack extends Hack implements UpdateListener .forEach(i -> slots.add(i)); Comparator comparator = - Comparator.comparingDouble(FoodComponent::saturationModifier); + Comparator.comparingDouble(FoodComponent::saturation); for(int slot : slots) { From c2b159e02cd0d5cca21823b77480aef33ace706c Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 15 Apr 2024 18:32:48 +0200 Subject: [PATCH 26/35] [Wurst-Bot] Update to 1.20.5-pre2 --- gradle.properties | 10 +++++----- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 197e99eb..f574950f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=1.20.5-pre1 -yarn_mappings=1.20.5-pre1+build.3 -loader_version=0.15.9 +minecraft_version=1.20.5-pre2 +yarn_mappings=1.20.5-pre2+build.1 +loader_version=0.15.10 #Fabric api -fabric_version=0.96.15+1.20.5 +fabric_version=0.97.1+1.20.5 # Mod Properties -mod_version = v7.41.2-MC1.20.5-pre1 +mod_version = v7.41.2-MC1.20.5-pre2 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 0f477961..8f95a6dc 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "1.20.5-pre1"; + public static final String MC_VERSION = "1.20.5-pre2"; private WurstAnalytics analytics; private EventManager eventManager; From 31a65e9d16ba4012605d934bba1113fe7459e877 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 15 Apr 2024 18:45:31 +0200 Subject: [PATCH 27/35] Update to 1.20.5-pre2 --- src/main/resources/fabric.mod.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index cae3c62c..69f539f1 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,7 +30,7 @@ "depends": { "fabricloader": ">=0.15.9", - "fabric-api": ">=0.96.14", + "fabric-api": ">=0.97.1", "minecraft": "~1.20.5-alpha.24.13.a", "java": ">=21" }, From 1f5759a4c4e437b1f6ecf0608be69593eb2a2777 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 16 Apr 2024 22:58:56 +0200 Subject: [PATCH 28/35] [Wurst-Bot] Update to 1.20.5-pre3 --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index f574950f..36f2a1e4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=1.20.5-pre2 -yarn_mappings=1.20.5-pre2+build.1 +minecraft_version=1.20.5-pre3 +yarn_mappings=1.20.5-pre3+build.1 loader_version=0.15.10 #Fabric api -fabric_version=0.97.1+1.20.5 +fabric_version=0.97.2+1.20.5 # Mod Properties -mod_version = v7.41.2-MC1.20.5-pre2 +mod_version = v7.41.2-MC1.20.5-pre3 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 8f95a6dc..5ac74023 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "1.20.5-pre2"; + public static final String MC_VERSION = "1.20.5-pre3"; private WurstAnalytics analytics; private EventManager eventManager; From b2e816ba8c1971fc609411eac2bb3e74630216c2 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 17 Apr 2024 20:04:41 +0200 Subject: [PATCH 29/35] [Wurst-Bot] Update to 1.20.5-pre4 --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 36f2a1e4..1cd44108 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=1.20.5-pre3 -yarn_mappings=1.20.5-pre3+build.1 +minecraft_version=1.20.5-pre4 +yarn_mappings=1.20.5-pre4+build.1 loader_version=0.15.10 #Fabric api -fabric_version=0.97.2+1.20.5 +fabric_version=0.97.3+1.20.5 # Mod Properties -mod_version = v7.41.2-MC1.20.5-pre3 +mod_version = v7.41.2-MC1.20.5-pre4 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 5ac74023..df9743fb 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "1.20.5-pre3"; + public static final String MC_VERSION = "1.20.5-pre4"; private WurstAnalytics analytics; private EventManager eventManager; From 1942b3b1137cd2d7835957453fafe4532fd147bc Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 18 Apr 2024 18:40:21 +0200 Subject: [PATCH 30/35] [Wurst-Bot] Update to 1.20.5-rc1 --- gradle.properties | 6 +++--- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 1cd44108..8e6b01d0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=1.20.5-pre4 -yarn_mappings=1.20.5-pre4+build.1 +minecraft_version=1.20.5-rc1 +yarn_mappings=1.20.5-rc1+build.1 loader_version=0.15.10 #Fabric api fabric_version=0.97.3+1.20.5 # Mod Properties -mod_version = v7.41.2-MC1.20.5-pre4 +mod_version = v7.41.2-MC1.20.5-rc1 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 df9743fb..81402573 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "1.20.5-pre4"; + public static final String MC_VERSION = "1.20.5-rc1"; private WurstAnalytics analytics; private EventManager eventManager; From fee6e3057820cac8e6dd6d7a542d23beef85381a Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 19 Apr 2024 18:38:49 +0200 Subject: [PATCH 31/35] [Wurst-Bot] Update to 1.20.5-rc2 --- gradle.properties | 6 +++--- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 8e6b01d0..2dfb9f98 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=1.20.5-rc1 -yarn_mappings=1.20.5-rc1+build.1 +minecraft_version=1.20.5-rc2 +yarn_mappings=1.20.5-rc2+build.1 loader_version=0.15.10 #Fabric api fabric_version=0.97.3+1.20.5 # Mod Properties -mod_version = v7.41.2-MC1.20.5-rc1 +mod_version = v7.41.2-MC1.20.5-rc2 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 81402573..9bdcd043 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "1.20.5-rc1"; + public static final String MC_VERSION = "1.20.5-rc2"; private WurstAnalytics analytics; private EventManager eventManager; From f6768e3e6c076ac1c78b4aaefe85bfb565ebf58f Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 22 Apr 2024 18:59:49 +0200 Subject: [PATCH 32/35] [Wurst-Bot] Update to 1.20.5-rc3 --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 2dfb9f98..f1a01598 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=1.20.5-rc2 -yarn_mappings=1.20.5-rc2+build.1 +minecraft_version=1.20.5-rc3 +yarn_mappings=1.20.5-rc3+build.1 loader_version=0.15.10 #Fabric api -fabric_version=0.97.3+1.20.5 +fabric_version=0.97.5+1.20.5 # Mod Properties -mod_version = v7.41.2-MC1.20.5-rc2 +mod_version = v7.41.2-MC1.20.5-rc3 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 9bdcd043..39ac70ea 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "1.20.5-rc2"; + public static final String MC_VERSION = "1.20.5-rc3"; private WurstAnalytics analytics; private EventManager eventManager; From 662d8730b72a8fb84df55be221aafe4210a08819 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 23 Apr 2024 18:04:38 +0200 Subject: [PATCH 33/35] [Wurst-Bot] Update to 1.20.5 --- gradle.properties | 6 +++--- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index f1a01598..490b4fbc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=1.20.5-rc3 -yarn_mappings=1.20.5-rc3+build.1 +minecraft_version=1.20.5 +yarn_mappings=1.20.5+build.1 loader_version=0.15.10 #Fabric api fabric_version=0.97.5+1.20.5 # Mod Properties -mod_version = v7.41.2-MC1.20.5-rc3 +mod_version = v7.41.2-MC1.20.5 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 39ac70ea..546d6a16 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "1.20.5-rc3"; + public static final String MC_VERSION = "1.20.5"; private WurstAnalytics analytics; private EventManager eventManager; From e8ab6da2cff93f9666c384673ae9e63f50b153ec Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 26 Apr 2024 16:10:21 +0200 Subject: [PATCH 34/35] [Wurst-Bot] Update to 1.20.6-rc1 --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 490b4fbc..e0544e42 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=1.20.5 -yarn_mappings=1.20.5+build.1 +minecraft_version=1.20.6-rc1 +yarn_mappings=1.20.6-rc1+build.4 loader_version=0.15.10 #Fabric api -fabric_version=0.97.5+1.20.5 +fabric_version=0.97.6+1.20.6 # Mod Properties -mod_version = v7.41.2-MC1.20.5 +mod_version = v7.41.2-MC1.20.6-rc1 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 546d6a16..f43a4445 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "1.20.5"; + public static final String MC_VERSION = "1.20.6-rc1"; private WurstAnalytics analytics; private EventManager eventManager; From bdd8d9a61114a8d8d8db77f6395dc756d2cc11c3 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 29 Apr 2024 18:49:37 +0200 Subject: [PATCH 35/35] [Wurst-Bot] Update to 1.20.6 --- gradle.properties | 8 ++++---- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index e0544e42..0ce4b512 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these at https://fabricmc.net/develop/ and # https://www.curseforge.com/minecraft/mc-mods/fabric-api -minecraft_version=1.20.6-rc1 -yarn_mappings=1.20.6-rc1+build.4 +minecraft_version=1.20.6 +yarn_mappings=1.20.6+build.1 loader_version=0.15.10 #Fabric api -fabric_version=0.97.6+1.20.6 +fabric_version=0.97.8+1.20.6 # Mod Properties -mod_version = v7.41.2-MC1.20.6-rc1 +mod_version = v7.41.2-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 f43a4445..c901b895 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -59,7 +59,7 @@ public enum WurstClient public static IMinecraftClient IMC; public static final String VERSION = "7.41.2"; - public static final String MC_VERSION = "1.20.6-rc1"; + public static final String MC_VERSION = "1.20.6"; private WurstAnalytics analytics; private EventManager eventManager;