Ported all* fixes now.

*MilkBucketMixin needs special treatment
This commit is contained in:
FlorianMichael 2024-10-26 23:01:20 +02:00
parent 49fa8d049e
commit d32b2851c9
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -231,15 +231,14 @@ public abstract class MixinClientPlayNetworkHandler extends ClientCommonNetworkH
}
}
// TODO UPDATE-1.21.3
// @Redirect(method = "onEntityPosition", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;updateTrackedPositionAndAngles(DDDFFI)V"))
// private void cancelSmallChanges(Entity instance, double x, double y, double z, float yaw, float pitch, int interpolationSteps) {
// if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_16_1) && Math.abs(instance.getX() - x) < 0.03125 && Math.abs(instance.getY() - y) < 0.015625 && Math.abs(instance.getZ() - z) < 0.03125) {
// instance.updateTrackedPositionAndAngles(instance.getX(), instance.getY(), instance.getZ(), yaw, pitch, ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_15_2) ? 0 : interpolationSteps);
// } else {
// instance.updateTrackedPositionAndAngles(x, y, z, yaw, pitch, interpolationSteps);
// }
// }
@Redirect(method = "setPosition", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;updateTrackedPositionAndAngles(DDDFFI)V"))
private static void cancelSmallChanges(Entity instance, double x, double y, double z, float yaw, float pitch, int interpolationSteps) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_16_1) && Math.abs(instance.getX() - x) < 0.03125 && Math.abs(instance.getY() - y) < 0.015625 && Math.abs(instance.getZ() - z) < 0.03125) {
instance.updateTrackedPositionAndAngles(instance.getX(), instance.getY(), instance.getZ(), yaw, pitch, ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_15_2) ? 0 : interpolationSteps);
} else {
instance.updateTrackedPositionAndAngles(x, y, z, yaw, pitch, interpolationSteps);
}
}
@Inject(method = "onGameJoin", at = @At("RETURN"))
private void initPlayerListFix(GameJoinS2CPacket packet, CallbackInfo ci) {