From 075775e2c2f8fdd01b048721b0bd2d88aefe2464 Mon Sep 17 00:00:00 2001 From: olim Date: Sat, 3 Feb 2024 12:56:16 +0000 Subject: 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. --- src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java') 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; -- cgit