Fixed entity movement fix

This commit is contained in:
RaphiMC 2024-10-29 21:11:51 +01:00
parent e00a9816b1
commit ba9abdbb23
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94

View File

@ -86,10 +86,12 @@ public abstract class MixinEntity implements IEntity {
@Unique @Unique
private boolean viaFabricPlus$isInLoadedChunkAndShouldTick; private boolean viaFabricPlus$isInLoadedChunkAndShouldTick;
@Redirect(method = "move", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/Vec3d;lengthSquared()D")) @Redirect(method = "move", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/Vec3d;lengthSquared()D", ordinal = 1), slice = @Slice(
from = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;adjustMovementForCollisions(Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;")
))
private double allowSmallValues(Vec3d instance) { private double allowSmallValues(Vec3d instance) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21)) { if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21)) {
return 0; return Double.MAX_VALUE;
} else { } else {
return instance.lengthSquared(); return instance.lengthSquared();
} }