From 2efd2d188a93b55a4128956cc3f82111fd32863d Mon Sep 17 00:00:00 2001 From: Gregorius Techneticies Date: Mon, 25 Sep 2023 21:42:37 +0200 Subject: [PATCH] whoops i forgot there was two geticons --- .../java/gregtech/items/MultiItemRandomTools.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/gregtech/items/MultiItemRandomTools.java b/src/main/java/gregtech/items/MultiItemRandomTools.java index 4e179cc22..192397523 100644 --- a/src/main/java/gregtech/items/MultiItemRandomTools.java +++ b/src/main/java/gregtech/items/MultiItemRandomTools.java @@ -632,7 +632,16 @@ public IIcon getIcon(ItemStack aStack, int aRenderPass) { case 11004: aTarget = LAST_DEATH_OF_THE_PLAYER; break; default: return getIconIndex(aStack); } - return aTarget == null ? Textures.ItemIcons.COMPASS[(int)(CLIENT_TIME % Textures.ItemIcons.COMPASS.length)].getIcon(0) : Textures.ItemIcons.COMPASS[UT.Code.roundDown(0.5+Textures.ItemIcons.COMPASS.length*(361170+aPlayer.rotationYaw-Math.atan2(aTarget.posZ+0.5-aPlayer.posZ, aTarget.posX+0.5-aPlayer.posX)*180/Math.PI)/360)%Textures.ItemIcons.COMPASS.length].getIcon(0); + // Spin to Win! + if (aTarget == null) return Textures.ItemIcons.COMPASS[(int)(CLIENT_TIME % Textures.ItemIcons.COMPASS.length)].getIcon(0); + // Point to Target! + double tDistance = aTarget.getDistanceSquared(UT.Code.roundDown(aPlayer.posX), aTarget.posY, UT.Code.roundDown(aPlayer.posZ)); + int tIndex = UT.Code.roundDown(0.5+Textures.ItemIcons.COMPASS.length*(361170+aPlayer.rotationYaw-Math.atan2(aTarget.posZ+0.5-aPlayer.posZ, aTarget.posX+0.5-aPlayer.posX)*180/Math.PI)/360)%Textures.ItemIcons.COMPASS.length; + if (tDistance < 1) return Textures.ItemIcons.COMPASS[(tIndex + Textures.ItemIcons.COMPASS.length + new Random(CLIENT_TIME).nextInt(9) - 4) % Textures.ItemIcons.COMPASS.length].getIcon(0); + if (tDistance < 4) return Textures.ItemIcons.COMPASS[(tIndex + Textures.ItemIcons.COMPASS.length + new Random(CLIENT_TIME).nextInt(7) - 3) % Textures.ItemIcons.COMPASS.length].getIcon(0); + if (tDistance < 16) return Textures.ItemIcons.COMPASS[(tIndex + Textures.ItemIcons.COMPASS.length + new Random(CLIENT_TIME).nextInt(5) - 2) % Textures.ItemIcons.COMPASS.length].getIcon(0); + if (tDistance < 256) return Textures.ItemIcons.COMPASS[(tIndex + Textures.ItemIcons.COMPASS.length + new Random(CLIENT_TIME).nextInt(3) - 1) % Textures.ItemIcons.COMPASS.length].getIcon(0); + return Textures.ItemIcons.COMPASS[tIndex].getIcon(0); } @Override