mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-21 11:46:49 +01:00
Fix sprinting<->sneaking packet order in <= 1.21.1
This commit is contained in:
parent
9009ba2315
commit
3b34d6349b
@ -77,6 +77,20 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
|
||||
|
||||
@Shadow private boolean inSneakingPose;
|
||||
|
||||
@Shadow protected abstract void sendSneakingPacket();
|
||||
|
||||
@WrapWithCondition(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;sendSneakingPacket()V"))
|
||||
private boolean sendSneakingAfterSprinting(ClientPlayerEntity instance) {
|
||||
return ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_21_2);
|
||||
}
|
||||
|
||||
@Inject(method = "sendMovementPackets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;sendSprintingPacket()V"))
|
||||
private void sendSneakingAfterSprinting(CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_12_1)) {
|
||||
this.sendSneakingPacket();
|
||||
}
|
||||
}
|
||||
|
||||
@WrapWithCondition(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;jump()V"))
|
||||
private boolean dontJumpBeforeFlying(ClientPlayerEntity instance) {
|
||||
return ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_20_5);
|
||||
|
Loading…
Reference in New Issue
Block a user