Skip to content

Commit

Permalink
Move idle packet fix to VV
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Oct 31, 2024
1 parent 141c1b0 commit 0045791
Showing 1 changed file with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ public MixinClientPlayerEntity(ClientWorld world, GameProfile profile) {
@Shadow
protected abstract void sendSneakingPacket();

@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);
Expand All @@ -99,16 +96,6 @@ private void sendSneakingAfterSprinting(CallbackInfo ci) {
}
}

@Redirect(method = "sendMovementPackets", at = @At(value = "FIELD", target = "Lnet/minecraft/client/network/ClientPlayerEntity;lastHorizontalCollision:Z", ordinal = 0))
private boolean removeHorizontalCollisionFromOnGroundCheck(ClientPlayerEntity instance) {
// Since it doesn't exist in older versions, we need to exclude it from the check to prevent bad packets
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21)) {
return this.horizontalCollision;
} else {
return this.lastHorizontalCollision;
}
}

@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);
Expand Down

0 comments on commit 0045791

Please sign in to comment.