From 4bb6066d0ed1fa43e121580394b9f9b240134350 Mon Sep 17 00:00:00 2001 From: Gaider10 <72764892+Gaider10@users.noreply.github.com> Date: Tue, 19 Oct 2021 15:31:08 +0300 Subject: [PATCH] Minor fixes --- .../java/me/andrew/gravitychanger/mixin/LivingEntityMixin.java | 2 +- .../gravitychanger/mixin/client/PlayerEntityRendererMixin.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/andrew/gravitychanger/mixin/LivingEntityMixin.java b/src/main/java/me/andrew/gravitychanger/mixin/LivingEntityMixin.java index ae70178..bbb3d1f 100644 --- a/src/main/java/me/andrew/gravitychanger/mixin/LivingEntityMixin.java +++ b/src/main/java/me/andrew/gravitychanger/mixin/LivingEntityMixin.java @@ -357,7 +357,7 @@ private double redirect_tick_getX_0(LivingEntity livingEntity) { private double redirect_tick_getZ_0(LivingEntity livingEntity) { Direction gravityDirection = ((EntityAccessor) livingEntity).gravitychanger$getAppliedGravityDirection(); if(gravityDirection == Direction.DOWN) { - return livingEntity.getX(); + return livingEntity.getZ(); } return RotationUtil.vecWorldToPlayer(livingEntity.getX() - livingEntity.prevX, livingEntity.getY() - livingEntity.prevY, livingEntity.getZ() - livingEntity.prevZ, gravityDirection).z + livingEntity.prevZ; diff --git a/src/main/java/me/andrew/gravitychanger/mixin/client/PlayerEntityRendererMixin.java b/src/main/java/me/andrew/gravitychanger/mixin/client/PlayerEntityRendererMixin.java index 941be10..5bee4cd 100644 --- a/src/main/java/me/andrew/gravitychanger/mixin/client/PlayerEntityRendererMixin.java +++ b/src/main/java/me/andrew/gravitychanger/mixin/client/PlayerEntityRendererMixin.java @@ -24,6 +24,9 @@ public abstract class PlayerEntityRendererMixin { ) private Vec3d modify_setupTransforms_Vec3d_0(Vec3d vec3d, AbstractClientPlayerEntity abstractClientPlayerEntity, MatrixStack matrixStack, float f, float g, float h) { Direction gravityDirection = ((EntityAccessor) abstractClientPlayerEntity).gravitychanger$getAppliedGravityDirection(); + if(gravityDirection == Direction.DOWN) { + return vec3d; + } return RotationUtil.vecWorldToPlayer(vec3d, gravityDirection); }