aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
diff options
context:
space:
mode:
authorThatGravyBoat <ThatGravyBoat@users.noreply.github.com>2021-07-12 01:29:58 +0000
committerGitHub Action <actions@github.com>2021-07-12 01:29:58 +0000
commit087d97fb0663edc5e343187c0fa4ec1bc6b081bc (patch)
treeb3f74dfcead856a61e0f93b92405bd76786cba2a /src/main/java/com/thatgravyboat/skyblockhud/Utils.java
parent06587d2dc10241ec6a8f5e21c8f55ae710c5cc8d (diff)
downloadSkyblockHud-Death-Defied-087d97fb0663edc5e343187c0fa4ec1bc6b081bc.tar.gz
SkyblockHud-Death-Defied-087d97fb0663edc5e343187c0fa4ec1bc6b081bc.tar.bz2
SkyblockHud-Death-Defied-087d97fb0663edc5e343187c0fa4ec1bc6b081bc.zip
Prettified Code!
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/Utils.java')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/Utils.java21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/Utils.java b/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
index e988677..b80d5ae 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
@@ -1,5 +1,9 @@
package com.thatgravyboat.skyblockhud;
+import java.nio.FloatBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedList;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.FontRenderer;
@@ -21,11 +25,6 @@ import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;
-import java.nio.FloatBuffer;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.LinkedList;
-
public class Utils {
private static LinkedList<Integer> guiScales = new LinkedList<>();
@@ -292,12 +291,12 @@ public class Utils {
double y = loc.getY() - viewerY - viewer.getEyeHeight();
double z = loc.getZ() - viewerZ;
- double distSq = x*x + y*y + z*z;
+ double distSq = x * x + y * y + z * z;
double dist = Math.sqrt(distSq);
- if(distSq > 144) {
- x *= 12/dist;
- y *= 12/dist;
- z *= 12/dist;
+ if (distSq > 144) {
+ x *= 12 / dist;
+ y *= 12 / dist;
+ z *= 12 / dist;
}
GlStateManager.translate(x, y, z);
GlStateManager.translate(0, viewer.getEyeHeight(), 0);
@@ -310,7 +309,7 @@ public class Utils {
GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F);
- drawNametag(EnumChatFormatting.YELLOW.toString()+Math.round(dist)+"m");
+ drawNametag(EnumChatFormatting.YELLOW.toString() + Math.round(dist) + "m");
GlStateManager.popMatrix();