From fb8e70246fdc0b85f17ec434346453de2216cac9 Mon Sep 17 00:00:00 2001 From: RaphiMC <50594595+RaphiMC@users.noreply.github.com> Date: Tue, 30 Jan 2024 23:06:49 +0100 Subject: [PATCH] Fixed errors introduced by block breaking speed calculation rewrite --- .../minecraft/entity/MixinPlayerEntity.java | 17 ++++++++++------- 1 file changed, 10 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 dfb823050..5f9266471 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 @@ -41,7 +41,10 @@ import net.minecraft.util.Identifier; import net.minecraft.world.World; import net.raphimc.vialoader.util.VersionEnum; -import org.spongepowered.asm.mixin.*; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.*; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @@ -187,16 +190,16 @@ private void changeSpeedCalculation(BlockState block, CallbackInfoReturnable 1F || ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_4_6tor1_4_7)) { if (!this.getMainHandStack().isEmpty()) { if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_7_6tor1_7_10)) { if (fValue <= 1.0 && !this.canHarvest(block)) { f.set(fValue + (efficiency * efficiency + 1) * 0.08F); + } else { + f.set(fValue + (efficiency * efficiency + 1)); } } } @@ -207,7 +210,7 @@ private void changeSpeedCalculation(BlockState block, CallbackInfoReturnable