Skip to content

Commit a23e293

Browse files
Change sprinting conditions in <= 1.21.3
1 parent 84d6e71 commit a23e293

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ public MixinClientPlayerEntity(ClientWorld world, GameProfile profile) {
8787
super(world, profile);
8888
}
8989

90+
@WrapWithCondition(method = "canStartSprinting", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;shouldSlowDown()Z"))
91+
private boolean removeSlowdownCondition(ClientPlayerEntity instance) {
92+
return instance.shouldSlowDown() && ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_21_4);
93+
}
94+
95+
@WrapWithCondition(method = "canStartSprinting", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isSubmergedInWater()Z"))
96+
private boolean removeSlowdownCondition2(ClientPlayerEntity instance) {
97+
return instance.isSubmergedInWater() && ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_21_4);
98+
}
99+
90100
@Redirect(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;shouldStopSprinting()Z"))
91101
private boolean dontUnsprint(ClientPlayerEntity instance) {
92102
return shouldStopSprinting() && ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_21_4);

0 commit comments

Comments
 (0)