From fec87d0c8bc3eba243fbe8af3e19a4caec99e56c Mon Sep 17 00:00:00 2001 From: RaphiMC <50594595+RaphiMC@users.noreply.github.com> Date: Wed, 13 Dec 2023 18:08:30 +0100 Subject: [PATCH] Moved reach fix injection point --- .../mixin/fixes/minecraft/entity/MixinPlayerEntity.java | 7 +++++++ .../network/MixinClientPlayerInteractionManager.java | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) 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 5d694fcc5..c4fe872d8 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 @@ -239,4 +239,11 @@ public float getBlockBreakingSpeed(BlockState block) { return f; } + @Inject(method = "getReachDistance", at = @At("RETURN"), cancellable = true) + private static void modifyReachDistance(boolean creative, CallbackInfoReturnable cir) { + if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_0_0tor1_0_1) && !creative) { + cir.setReturnValue(4F); + } + } + } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/network/MixinClientPlayerInteractionManager.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/network/MixinClientPlayerInteractionManager.java index 421ad5558..1796d1350 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/network/MixinClientPlayerInteractionManager.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/network/MixinClientPlayerInteractionManager.java @@ -292,13 +292,6 @@ private void removeExperienceBar(CallbackInfoReturnable cir) { } } - @Inject(method = "getReachDistance", at = @At("RETURN"), cancellable = true) - private void modifyReachDistance(CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_0_0tor1_0_1) && !this.gameMode.isCreative()) { - cir.setReturnValue(4F); - } - } - @Unique private boolean extinguishFire(BlockPos blockPos, final Direction direction) { blockPos = blockPos.offset(direction);