mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-24 12:15:41 +01:00
Fix sprinting and sneaking packet order in <= 1.21.1
This commit is contained in:
parent
5a64809ad6
commit
3195eeb5a0
@ -78,18 +78,21 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
|
||||
@Shadow
|
||||
public abstract void setClientPermissionLevel(int clientPermissionLevel);
|
||||
|
||||
@Shadow private boolean inSneakingPose;
|
||||
@Shadow
|
||||
private boolean inSneakingPose;
|
||||
|
||||
@Shadow protected abstract void sendSneakingPacket();
|
||||
@Shadow
|
||||
protected abstract void sendSneakingPacket();
|
||||
|
||||
@Shadow private boolean lastHorizontalCollision;
|
||||
@Shadow
|
||||
private boolean lastHorizontalCollision;
|
||||
|
||||
@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"))
|
||||
@Inject(method = "sendMovementPackets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;sendSprintingPacket()V", shift = At.Shift.AFTER))
|
||||
private void sendSneakingAfterSprinting(CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21)) {
|
||||
this.sendSneakingPacket();
|
||||
|
@ -122,6 +122,7 @@
|
||||
"fixes.minecraft.entity.MixinSkeletonHorseEntity",
|
||||
"fixes.minecraft.entity.MixinSquidEntity",
|
||||
"fixes.minecraft.entity.MixinWolfEntity",
|
||||
"fixes.minecraft.entity.MixinZombieVillagerEntity",
|
||||
"fixes.minecraft.item.MixinAxeItem",
|
||||
"fixes.minecraft.item.MixinBlockItem",
|
||||
"fixes.minecraft.item.MixinBowItem",
|
||||
@ -218,8 +219,5 @@
|
||||
},
|
||||
"overwrites": {
|
||||
"requireAnnotations": true
|
||||
},
|
||||
"mixins": [
|
||||
"fixes.minecraft.entity.MixinZombieVillagerEntity"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user