From a0df65c5787706cb6fd91da6d1ff03f4e0a3573a Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 24 Sep 2023 04:00:23 +0200 Subject: [PATCH] Implemented movement change in <= 1.20.1 --- .../de/florianmichael/viafabricplus/ViaFabricPlus.java | 3 --- .../fixes/minecraft/entity/MixinClientPlayerEntity.java | 9 +++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java b/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java index 4d620aec..357fe28f 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java +++ b/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java @@ -40,9 +40,6 @@ import org.apache.logging.log4j.Logger; import java.io.File; /* - * TODO | Port - * - Entity passenger points and heights/offsets are completely broken across all entities - * * TODO | General * - Check if relevant for protocol translation: TakeItemEntityPacket isEmpty case (1.20 -> 1.20.1 change) * - Window interactions in <= 1.16.5 has changed and can be detected by the server diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java index 3b2e18db..4a4f7bc7 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java @@ -185,6 +185,15 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity return MathHelper.inverseSqrt(x); } + @Redirect(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;hasVehicle()Z", ordinal = 0)) + public boolean removeVehicleRequirement(ClientPlayerEntity instance) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_20tor1_20_1)) { + return false; + } + + return instance.hasVehicle(); + } + @Override public boolean isCreative() { if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_7_6tor1_7_10)) {