mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-12-22 16:48:25 +01:00
Add magically eye position offset in <= 1.20.4 water detection
This commit is contained in:
parent
316ee89a93
commit
087a306d97
@ -116,6 +116,15 @@ public abstract class MixinEntity implements IEntity {
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "updateSubmergedInWaterState", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;getEyeY()D"))
|
||||
private double addMagicOffset(Entity instance) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {
|
||||
return instance.getEyeY() - 0.11111111F;
|
||||
} else {
|
||||
return instance.getEyeY();
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "updatePassengerPosition(Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/Entity$PositionUpdater;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;getVehicleAttachmentPos(Lnet/minecraft/entity/Entity;)Lnet/minecraft/util/math/Vec3d;"))
|
||||
private Vec3d use1_20_1RidingOffset(Entity instance, Entity vehicle) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20)) {
|
||||
|
Loading…
Reference in New Issue
Block a user