From d01f2913fbe3fd55bfec2f5ffc3ba5ceeb40b8e1 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sat, 23 Sep 2023 20:23:36 +0200 Subject: [PATCH] Started with fixing passenger offsets --- .../mixin/fixes/minecraft/entity/MixinAllayEntity.java | 4 ++-- .../mixin/fixes/minecraft/entity/MixinPlayerEntity.java | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAllayEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAllayEntity.java index cbcfdd55..72fc7459 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAllayEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAllayEntity.java @@ -36,11 +36,11 @@ public abstract class MixinAllayEntity extends PathAwareEntity { } @Inject(method = "getUnscaledRidingOffset", at = @At("HEAD"), cancellable = true) - public void changeHeightOffset(CallbackInfoReturnable cir) { + public void changeHeightOffset(CallbackInfoReturnable cir) { final var ver = ProtocolHack.getTargetVersion(); if (ver.isOlderThanOrEqualTo(VersionEnum.r1_20tor1_20_1)) { - cir.setReturnValue(ver.isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2) ? 0.0 : 0.4); + cir.setReturnValue(ver.isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2) ? 0.0F : 0.4F); } } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java index 37eb39af..c3cdd385 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java @@ -133,11 +133,4 @@ public abstract class MixinPlayerEntity extends LivingEntity { } return instance.isSprinting(); } - - @Inject(method = "getUnscaledRidingOffset", at = @At("HEAD"), cancellable = true) - public void setStaticScale(Entity vehicle, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_20tor1_20_1)) { - cir.setReturnValue(-0.35F); - } - } }