From 651ef45f3dc6664cc8e8474073a5714c2a5152e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?der=5Ffr=C3=BChling?= Date: Thu, 8 Aug 2024 13:59:55 -0700 Subject: [PATCH] calculate height based on camera y - foot y instead of relying on minecraft being correct --- .../minecraft/create/trainperspective/MixinUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/MixinUtil.java b/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/MixinUtil.java index e7a46b1..e40d948 100644 --- a/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/MixinUtil.java +++ b/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/MixinUtil.java @@ -27,7 +27,7 @@ public static float getExtraYRot(Perspective persp, float xRot, float yRot, floa public static Vector3d applyStandingCameraTranslation(Player player, double x, double y, double z, Perspective persp, float f) { var lean = persp.getLean(f) * Mth.DEG_TO_RAD; var yaw = persp.getYaw(f) * Mth.DEG_TO_RAD; - var height = player.getEyeHeight(); + var height = y - player.getY(); var newY = y + ((height * Mth.cos(lean)) - height); var leanSin = Mth.sin(lean); var newZ = z - (height * Mth.sin(yaw) * leanSin);