diff options
author | olim <bobq4582@gmail.com> | 2024-02-03 12:56:16 +0000 |
---|---|---|
committer | olim <bobq4582@gmail.com> | 2024-02-03 12:56:16 +0000 |
commit | 075775e2c2f8fdd01b048721b0bd2d88aefe2464 (patch) | |
tree | 2fcc3d9440043266d79e456beaa9c27bc634087b | |
parent | ebd53811b276b28bf4848846503c8c2a78104223 (diff) | |
download | Skyblocker-075775e2c2f8fdd01b048721b0bd2d88aefe2464.tar.gz Skyblocker-075775e2c2f8fdd01b048721b0bd2d88aefe2464.tar.bz2 Skyblocker-075775e2c2f8fdd01b048721b0bd2d88aefe2464.zip |
Fixed rotation of Map Player Marker
make it so it rotates around the centre of the player marker and re add the flip (+180) so marker is facing correct direction.
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java index 35f26c0e..ee6d4307 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java @@ -106,7 +106,7 @@ public class CrystalsHud { //position, scale and rotate the player marker matrices.translate(renderX, renderY, 0f); matrices.scale(0.75f, 0.75f, 0f); - matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(yaw2Cardinal(playerRotation)), 2, 3, 0); + matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(yaw2Cardinal(playerRotation)), 2.5f, 3.5f, 0); //draw marker on map context.drawTexture(MAP_ICON, 0, 0, 2, 0, 5, 7, 128, 128); @@ -139,6 +139,7 @@ public class CrystalsHud { * Based off code from {@link net.minecraft.client.render.MapRenderer} */ private static float yaw2Cardinal(float yaw) { + yaw += + 180; //flip direction byte clipped = (byte)((yaw += yaw < 0.0 ? -8.0 : 8.0) * 16.0 / 360.0); return (clipped * 360f) / 16f; |