mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-09-18 03:01:00 +02:00
Changed block breaking progress calculation in 1.20 -> 1.19.4
This commit is contained in:
parent
6505c85726
commit
45c8f03912
@ -75,6 +75,7 @@ public abstract class MixinClientPlayerInteractionManager {
|
|||||||
@Shadow
|
@Shadow
|
||||||
private BlockPos currentBreakingPos;
|
private BlockPos currentBreakingPos;
|
||||||
|
|
||||||
|
@Shadow private float currentBreakingProgress;
|
||||||
@Unique
|
@Unique
|
||||||
private ItemStack viafabricplus_oldCursorStack;
|
private ItemStack viafabricplus_oldCursorStack;
|
||||||
|
|
||||||
@ -195,4 +196,11 @@ public abstract class MixinClientPlayerInteractionManager {
|
|||||||
ClientPlayerInteractionManager1_18_2.trackBlockAction(playerActionC2SPacket.getAction(), playerActionC2SPacket.getPos());
|
ClientPlayerInteractionManager1_18_2.trackBlockAction(playerActionC2SPacket.getAction(), playerActionC2SPacket.getPos());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "getBlockBreakingProgress", at = @At("HEAD"), cancellable = true)
|
||||||
|
public void changeCalculation(CallbackInfoReturnable<Integer> cir) {
|
||||||
|
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_4)) {
|
||||||
|
cir.setReturnValue((int)(this.currentBreakingProgress * 10.0F) - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user