From b18ef2c799bf2f43dbe1d6e83f37ccc529446013 Mon Sep 17 00:00:00 2001 From: Desoroxxx Date: Thu, 16 Feb 2023 19:30:52 +0100 Subject: [PATCH] Fixes #20 --- .../redstudioragnarok/FBP/particle/FBPParticleDigging.java | 6 ++++-- .../io/redstudioragnarok/FBP/particle/FBPParticleSnow.java | 6 ++++-- .../io/redstudioragnarok/FBP/renderer/FastCubeUploader.java | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/redstudioragnarok/FBP/particle/FBPParticleDigging.java b/src/main/java/io/redstudioragnarok/FBP/particle/FBPParticleDigging.java index 7a3a077e..67311583 100644 --- a/src/main/java/io/redstudioragnarok/FBP/particle/FBPParticleDigging.java +++ b/src/main/java/io/redstudioragnarok/FBP/particle/FBPParticleDigging.java @@ -300,8 +300,10 @@ else if (motionZ > 0) move(motionX, motionY, motionZ); - rot.x = (float) FastMath.round(rot.x / 90) * 90; - rot.z = (float) FastMath.round(rot.z / 90) * 90; + if (onGround) { + rot.x = (float) FastMath.round(rot.x / 90) * 90; + rot.z = (float) FastMath.round(rot.z / 90) * 90; + } if (MathUtil.absolute((float) motionX) > 0.00001) prevMotionX = motionX; diff --git a/src/main/java/io/redstudioragnarok/FBP/particle/FBPParticleSnow.java b/src/main/java/io/redstudioragnarok/FBP/particle/FBPParticleSnow.java index 2f459249..8ad2c77c 100644 --- a/src/main/java/io/redstudioragnarok/FBP/particle/FBPParticleSnow.java +++ b/src/main/java/io/redstudioragnarok/FBP/particle/FBPParticleSnow.java @@ -141,8 +141,10 @@ public void onUpdate() { move(motionX, motionY, motionZ); - rot.x = (float) FastMath.round(rot.x / 90) * 90; - rot.z = (float) FastMath.round(rot.z / 90) * 90; + if (onGround) { + rot.x = (float) FastMath.round(rot.x / 90) * 90; + rot.z = (float) FastMath.round(rot.z / 90) * 90; + } motionX *= 0.98; diff --git a/src/main/java/io/redstudioragnarok/FBP/renderer/FastCubeUploader.java b/src/main/java/io/redstudioragnarok/FBP/renderer/FastCubeUploader.java index e5008b10..37bb42c3 100644 --- a/src/main/java/io/redstudioragnarok/FBP/renderer/FastCubeUploader.java +++ b/src/main/java/io/redstudioragnarok/FBP/renderer/FastCubeUploader.java @@ -21,9 +21,9 @@ public static void putCube(BufferBuilder buffer, float x, float y, float z, floa MATRIX_STACK.modelMatrix().setIdentity(); MATRIX_STACK.normalMatrix().setIdentity(); MATRIX_STACK.translate(x, y, z); - Quaternion rotation = Quaternion.createRotateX((float) Math.toRadians(rotX)); + Quaternion rotation = Quaternion.createRotateY((float) Math.toRadians(rotY)); rotation.rotateZ((float) Math.toRadians(rotZ)); - rotation.rotateY((float) Math.toRadians(rotY)); + rotation.rotateX((float) Math.toRadians(rotX)); MATRIX_STACK.rotate(rotation); MATRIX_STACK.scale(scaleX, scaleY, scaleZ);