From bbe5d6ae24a013b51cc4f70a82bac35614cff112 Mon Sep 17 00:00:00 2001 From: JAXPLE Date: Sat, 31 Aug 2024 15:54:36 +0900 Subject: [PATCH 1/9] Add condition sendPlayerLookPacket() --- src/main/java/net/wurstclient/hacks/MultiAuraHack.java | 7 ++++--- src/main/java/net/wurstclient/hacks/TpAuraHack.java | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/MultiAuraHack.java b/src/main/java/net/wurstclient/hacks/MultiAuraHack.java index a1b836fd7e..613bfb6ebf 100644 --- a/src/main/java/net/wurstclient/hacks/MultiAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/MultiAuraHack.java @@ -118,9 +118,10 @@ public void onUpdate() // attack entities for(Entity entity : entities) { - RotationUtils - .getNeededRotations(entity.getBoundingBox().getCenter()) - .sendPlayerLookPacket(); + if(swingHand.getSelected() != SwingHand.OFF) + RotationUtils + .getNeededRotations(entity.getBoundingBox().getCenter()) + .sendPlayerLookPacket(); MC.interactionManager.attackEntity(MC.player, entity); } diff --git a/src/main/java/net/wurstclient/hacks/TpAuraHack.java b/src/main/java/net/wurstclient/hacks/TpAuraHack.java index cec37a0578..9fe4d0a871 100644 --- a/src/main/java/net/wurstclient/hacks/TpAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/TpAuraHack.java @@ -131,8 +131,10 @@ public void onUpdate() return; // attack entity - RotationUtils.getNeededRotations(entity.getBoundingBox().getCenter()) - .sendPlayerLookPacket(); + if(swingHand.getSelected() != SwingHand.OFF) + RotationUtils + .getNeededRotations(entity.getBoundingBox().getCenter()) + .sendPlayerLookPacket(); MC.interactionManager.attackEntity(player, entity); swingHand.swing(Hand.MAIN_HAND); From 07acff78a92f11bbfdaf67f16d34e04cedfcffd3 Mon Sep 17 00:00:00 2001 From: JAXPLE Date: Sun, 29 Sep 2024 13:36:51 +0900 Subject: [PATCH 2/9] Refactoring Code Format --- src/main/java/net/wurstclient/hacks/MultiAuraHack.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/MultiAuraHack.java b/src/main/java/net/wurstclient/hacks/MultiAuraHack.java index 613bfb6ebf..07e992bfc8 100644 --- a/src/main/java/net/wurstclient/hacks/MultiAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/MultiAuraHack.java @@ -119,9 +119,7 @@ public void onUpdate() for(Entity entity : entities) { if(swingHand.getSelected() != SwingHand.OFF) - RotationUtils - .getNeededRotations(entity.getBoundingBox().getCenter()) - .sendPlayerLookPacket(); + sendRotationPacket(entity); MC.interactionManager.attackEntity(MC.player, entity); } @@ -129,4 +127,10 @@ public void onUpdate() swingHand.swing(Hand.MAIN_HAND); speed.resetTimer(); } + + private void sendRotationPacket(Entity entity) + { + RotationUtils.getNeededRotations(entity.getBoundingBox().getCenter()) + .sendPlayerLookPacket(); + } } From c927a0906d1d347452bdd17611cb3bf0b1b5c93b Mon Sep 17 00:00:00 2001 From: JAXPLE Date: Sat, 31 Aug 2024 15:54:36 +0900 Subject: [PATCH 3/9] Add condition sendPlayerLookPacket() --- src/main/java/net/wurstclient/hacks/MultiAuraHack.java | 7 ++++--- src/main/java/net/wurstclient/hacks/TpAuraHack.java | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/MultiAuraHack.java b/src/main/java/net/wurstclient/hacks/MultiAuraHack.java index 2931d07d57..ba017df11a 100644 --- a/src/main/java/net/wurstclient/hacks/MultiAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/MultiAuraHack.java @@ -117,9 +117,10 @@ public void onUpdate() // attack entities for(Entity entity : entities) { - RotationUtils - .getNeededRotations(entity.getBoundingBox().getCenter()) - .sendPlayerLookPacket(); + if(swingHand.getSelected() != SwingHand.OFF) + RotationUtils + .getNeededRotations(entity.getBoundingBox().getCenter()) + .sendPlayerLookPacket(); MC.interactionManager.attackEntity(MC.player, entity); } diff --git a/src/main/java/net/wurstclient/hacks/TpAuraHack.java b/src/main/java/net/wurstclient/hacks/TpAuraHack.java index 6c428b74f5..577db462bc 100644 --- a/src/main/java/net/wurstclient/hacks/TpAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/TpAuraHack.java @@ -131,8 +131,10 @@ public void onUpdate() return; // attack entity - RotationUtils.getNeededRotations(entity.getBoundingBox().getCenter()) - .sendPlayerLookPacket(); + if(swingHand.getSelected() != SwingHand.OFF) + RotationUtils + .getNeededRotations(entity.getBoundingBox().getCenter()) + .sendPlayerLookPacket(); MC.interactionManager.attackEntity(player, entity); swingHand.swing(Hand.MAIN_HAND); From e868c8cb34b8d76183c97f373dd5b72f5782fd54 Mon Sep 17 00:00:00 2001 From: JAXPLE Date: Sun, 29 Sep 2024 13:36:51 +0900 Subject: [PATCH 4/9] Refactoring Code Format --- src/main/java/net/wurstclient/hacks/MultiAuraHack.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/MultiAuraHack.java b/src/main/java/net/wurstclient/hacks/MultiAuraHack.java index ba017df11a..b12e2fee7e 100644 --- a/src/main/java/net/wurstclient/hacks/MultiAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/MultiAuraHack.java @@ -118,9 +118,7 @@ public void onUpdate() for(Entity entity : entities) { if(swingHand.getSelected() != SwingHand.OFF) - RotationUtils - .getNeededRotations(entity.getBoundingBox().getCenter()) - .sendPlayerLookPacket(); + sendRotationPacket(entity); MC.interactionManager.attackEntity(MC.player, entity); } @@ -128,4 +126,10 @@ public void onUpdate() swingHand.swing(Hand.MAIN_HAND); speed.resetTimer(); } + + private void sendRotationPacket(Entity entity) + { + RotationUtils.getNeededRotations(entity.getBoundingBox().getCenter()) + .sendPlayerLookPacket(); + } } From 1e46a454d1586e8a1dd424e900c49f35a4c34425 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 2 Oct 2024 05:50:17 +0200 Subject: [PATCH 5/9] Increase range of AntiKnockback strength sliders Fixes https://wurstforum.net/d/809 --- .../java/net/wurstclient/hacks/AntiKnockbackHack.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AntiKnockbackHack.java b/src/main/java/net/wurstclient/hacks/AntiKnockbackHack.java index 99bdfd1dff..610775582c 100644 --- a/src/main/java/net/wurstclient/hacks/AntiKnockbackHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiKnockbackHack.java @@ -21,19 +21,20 @@ public final class AntiKnockbackHack extends Hack implements KnockbackListener private final SliderSetting hStrength = new SliderSetting("Horizontal Strength", "How far to reduce horizontal knockback.\n" + + "-100% = double knockback\n" + "0% = normal knockback\n" + "100% = no knockback\n" + ">100% = reverse knockback", - 1, 0.01, 2, 0.01, ValueDisplay.PERCENTAGE); + 1, -1, 2, 0.01, ValueDisplay.PERCENTAGE); private final SliderSetting vStrength = new SliderSetting("Vertical Strength", - "How far to reduce vertical knockback.\n" + "100% = no knockback\n" - + ">100% = reverse knockback", - 1, 0.01, 2, 0.01, ValueDisplay.PERCENTAGE); + "How far to reduce vertical knockback.\n" + + "-100% = double knockback\n" + "0% = normal knockback\n" + + "100% = no knockback\n" + ">100% = reverse knockback", + 1, -1, 2, 0.01, ValueDisplay.PERCENTAGE); public AntiKnockbackHack() { super("AntiKnockback"); - setCategory(Category.COMBAT); addSetting(hStrength); addSetting(vStrength); From 208e1988022cbb60716f3edbbe2f40d7ae75ea38 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sat, 5 Oct 2024 17:26:45 +0200 Subject: [PATCH 6/9] Fix rotation bug causing AutoFish mcMMO mode to get stuck in vehicles Fixes #1067 --- src/main/java/net/wurstclient/util/RotationUtils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/wurstclient/util/RotationUtils.java b/src/main/java/net/wurstclient/util/RotationUtils.java index 6b6f0b8d1e..fce4c56031 100644 --- a/src/main/java/net/wurstclient/util/RotationUtils.java +++ b/src/main/java/net/wurstclient/util/RotationUtils.java @@ -89,7 +89,12 @@ public static double getAngleToLastReportedLookVec(Vec3d vec) public static double getAngleToLastReportedLookVec(Rotation rotation) { ClientPlayerEntity player = MC.player; - Rotation lastReported = new Rotation(player.lastYaw, player.lastPitch); + + // lastYaw/Pitch do not get updated when the player is in a vehicle + Rotation lastReported = player.hasVehicle() + ? new Rotation(player.getYaw(), player.getPitch()) + : new Rotation(player.lastYaw, player.lastPitch); + return lastReported.getAngleTo(rotation); } From 64b881fd443074fbc277a4292800d8541de3d37e Mon Sep 17 00:00:00 2001 From: ThisTestUser Date: Fri, 4 Oct 2024 16:29:04 +0000 Subject: [PATCH 7/9] ProfileKeys fix --- .../altmanager/MicrosoftLoginManager.java | 2 +- .../wurstclient/mixin/MinecraftClientMixin.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java b/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java index 2d4acab168..244da40080 100644 --- a/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java +++ b/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java @@ -104,7 +104,7 @@ public static void login(String email, String password) Session session = new Session(mcProfile.getName(), mcProfile.getUUID(), mcProfile.getAccessToken(), Optional.empty(), Optional.empty(), - Session.AccountType.MOJANG); + Session.AccountType.MSA); WurstClient.IMC.setSession(session); } diff --git a/src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java b/src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java index 50c6320935..f1434baedb 100644 --- a/src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java +++ b/src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java @@ -8,7 +8,6 @@ package net.wurstclient.mixin; import java.io.File; -import java.util.UUID; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -27,7 +26,6 @@ import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.network.ClientPlayerInteractionManager; import net.minecraft.client.session.ProfileKeys; -import net.minecraft.client.session.ProfileKeysImpl; import net.minecraft.client.session.Session; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.HitResult; @@ -59,7 +57,7 @@ public abstract class MinecraftClientMixin private YggdrasilAuthenticationService authenticationService; private Session wurstSession; - private ProfileKeysImpl wurstProfileKeys; + private ProfileKeys wurstProfileKeys; private MinecraftClientMixin(WurstClient wurst, String name) { @@ -213,10 +211,12 @@ public void setSession(Session session) { wurstSession = session; - UserApiService userApiService = authenticationService - .createUserApiService(session.getAccessToken()); - UUID uuid = wurstSession.getUuidOrNull(); + UserApiService userApiService = + session.getAccountType() == Session.AccountType.MSA + ? authenticationService.createUserApiService( + session.getAccessToken()) + : UserApiService.OFFLINE; wurstProfileKeys = - new ProfileKeysImpl(userApiService, uuid, runDirectory.toPath()); + ProfileKeys.create(userApiService, session, runDirectory.toPath()); } } From 2bebdf0b9eb82835e812edbd6bd6788e2cc11084 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 8 Oct 2024 16:50:28 +0200 Subject: [PATCH 8/9] Restore compatibility with old Sodium versions Fixes https://wurstforum.net/d/807 --- .../SodiumOldBlockOcclusionCacheMixin.java | 46 ++++++++++++++++++ .../mixin/SodiumOldFluidRendererMixin.java | 48 +++++++++++++++++++ src/main/resources/fabric.mod.json | 3 +- src/main/resources/wurst.mixins.json | 2 + 4 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 src/main/java/net/wurstclient/mixin/SodiumOldBlockOcclusionCacheMixin.java create mode 100644 src/main/java/net/wurstclient/mixin/SodiumOldFluidRendererMixin.java diff --git a/src/main/java/net/wurstclient/mixin/SodiumOldBlockOcclusionCacheMixin.java b/src/main/java/net/wurstclient/mixin/SodiumOldBlockOcclusionCacheMixin.java new file mode 100644 index 0000000000..cf3083ebfd --- /dev/null +++ b/src/main/java/net/wurstclient/mixin/SodiumOldBlockOcclusionCacheMixin.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Pseudo; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.block.BlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.BlockView; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent; + +@Pseudo +@Mixin(targets = { + // < Sodium 0.6.0-beta.1 + "me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockOcclusionCache", + // < Sodium 0.5.0 + "me.jellysquid.mods.sodium.client.render.occlusion.BlockOcclusionCache"}, + remap = false) +public class SodiumOldBlockOcclusionCacheMixin +{ + /** + * This mixin hides and shows regular full blocks when using X-Ray with + * old versions of Sodium installed. + */ + @Inject(at = @At("HEAD"), method = "shouldDrawSide", cancellable = true) + public void shouldDrawSide(BlockState state, BlockView world, BlockPos pos, + Direction side, CallbackInfoReturnable cir) + { + ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos); + EventManager.fire(event); + + if(event.isRendered() != null) + cir.setReturnValue(event.isRendered()); + } +} diff --git a/src/main/java/net/wurstclient/mixin/SodiumOldFluidRendererMixin.java b/src/main/java/net/wurstclient/mixin/SodiumOldFluidRendererMixin.java new file mode 100644 index 0000000000..acf7b1bff5 --- /dev/null +++ b/src/main/java/net/wurstclient/mixin/SodiumOldFluidRendererMixin.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Pseudo; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.block.BlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.BlockRenderView; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent; + +@Pseudo +@Mixin(targets = { + // < Sodium 0.6.0-beta.1 + "me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.FluidRenderer", + // < Sodium 0.4.9 + "me.jellysquid.mods.sodium.client.render.pipeline.FluidRenderer"}, + remap = false) +public class SodiumOldFluidRendererMixin +{ + /** + * This mixin hides and shows fluids when using X-Ray with old versions of + * Sodium installed. + */ + @Inject(at = @At("HEAD"), method = "isSideExposed", cancellable = true) + private void isSideExposed(BlockRenderView world, int x, int y, int z, + Direction dir, float height, CallbackInfoReturnable cir) + { + BlockPos pos = new BlockPos(x, y, z); + BlockState state = world.getBlockState(pos); + ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos); + EventManager.fire(event); + + if(event.isRendered() != null) + cir.setReturnValue(event.isRendered()); + } +} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 023db277a3..c881efd7ea 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -36,8 +36,7 @@ "breaks": { "wi_zoom": "*", "wi-zoom": "*", - "vulkanmod": "*", - "sodium": "<0.6.0-beta.1" + "vulkanmod": "*" }, "custom": { "modmenu": { diff --git a/src/main/resources/wurst.mixins.json b/src/main/resources/wurst.mixins.json index 342c496fe1..dfc3f747e0 100644 --- a/src/main/resources/wurst.mixins.json +++ b/src/main/resources/wurst.mixins.json @@ -60,6 +60,8 @@ "SimpleOptionMixin", "SodiumBlockOcclusionCacheMixin", "SodiumFluidRendererMixin", + "SodiumOldBlockOcclusionCacheMixin", + "SodiumOldFluidRendererMixin", "StatsScreenMixin", "StatusEffectInstanceMixin", "TelemetryManagerMixin", From 5b0a117b971e66cc2c1a950b9fe24161733c4b0d Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 8 Oct 2024 17:03:35 +0200 Subject: [PATCH 9/9] Change version to 7.46.1 --- gradle.properties | 2 +- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index f51fa62194..040b598ff9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ loader_version=0.16.5 fabric_version=0.105.0+1.21.1 # Mod Properties -mod_version = v7.46-MC1.21.1 +mod_version = v7.46.1-MC1.21.1 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 d7fc59253a..18e523b3d3 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -50,7 +50,7 @@ public enum WurstClient public static MinecraftClient MC; public static IMinecraftClient IMC; - public static final String VERSION = "7.46"; + public static final String VERSION = "7.46.1"; public static final String MC_VERSION = "1.21.1"; private WurstAnalytics analytics;