mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-12-31 18:18:04 +01:00
Change sprinting conditions in <= 1.21.3
This commit is contained in:
parent
ab86e95d5e
commit
31ed7f9607
@ -87,6 +87,16 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
|
|||||||
super(world, profile);
|
super(world, profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@WrapWithCondition(method = "canStartSprinting", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;shouldSlowDown()Z"))
|
||||||
|
private boolean removeSlowdownCondition(ClientPlayerEntity instance) {
|
||||||
|
return instance.shouldSlowDown() && ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_21_4);
|
||||||
|
}
|
||||||
|
|
||||||
|
@WrapWithCondition(method = "canStartSprinting", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isSubmergedInWater()Z"))
|
||||||
|
private boolean removeSlowdownCondition2(ClientPlayerEntity instance) {
|
||||||
|
return instance.isSubmergedInWater() && ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_21_4);
|
||||||
|
}
|
||||||
|
|
||||||
@Redirect(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;shouldStopSprinting()Z"))
|
@Redirect(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;shouldStopSprinting()Z"))
|
||||||
private boolean dontUnsprint(ClientPlayerEntity instance) {
|
private boolean dontUnsprint(ClientPlayerEntity instance) {
|
||||||
return shouldStopSprinting() && ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_21_4);
|
return shouldStopSprinting() && ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_21_4);
|
||||||
|
Loading…
Reference in New Issue
Block a user