From 37c9112a04b4bd11f5f22c12fcbeadbef45fd298 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 12 Nov 2023 23:51:19 +0100 Subject: [PATCH] Implemented yOffset change in 1.19 -> 1.18.2 --- .../injection/mixin/fixes/minecraft/entity/MixinEntity.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntity.java index 0616d35d..5623137b 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntity.java @@ -177,9 +177,10 @@ public abstract class MixinEntity { @Inject(method = "getPosWithYOffset", at = @At("HEAD"), cancellable = true) public void changeLogic(float offset, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_4)) { + final VersionEnum target = ProtocolHack.getTargetVersion(); + if (target.isOlderThanOrEqualTo(VersionEnum.r1_19_4)) { int i = MathHelper.floor(this.pos.x); - int j = MathHelper.floor(this.pos.y - (double)offset); + int j = MathHelper.floor(this.pos.y - (double) (target.isOlderThanOrEqualTo(VersionEnum.r1_18_2) && offset == 1.0E-5F ? 0.2F : offset)); int k = MathHelper.floor(this.pos.z); BlockPos blockPos = new BlockPos(i, j, k); if (this.world.getBlockState(blockPos).isAir()) {