diff options
Diffstat (limited to 'src/main/java/me/Danker/gui/buttons')
-rw-r--r-- | src/main/java/me/Danker/gui/buttons/LocationButton.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/me/Danker/gui/buttons/LocationButton.java b/src/main/java/me/Danker/gui/buttons/LocationButton.java index 061f198..a8937fd 100644 --- a/src/main/java/me/Danker/gui/buttons/LocationButton.java +++ b/src/main/java/me/Danker/gui/buttons/LocationButton.java @@ -34,12 +34,11 @@ public class LocationButton extends GuiButton { } else { splitText = text2.split("\n"); } - int index = 0; + int longestText = -1; - for (int i = 0; i < splitText.length; i++) { - int stringLength = mc.fontRendererObj.getStringWidth(splitText[i]); + for (String s : splitText) { + int stringLength = mc.fontRendererObj.getStringWidth(s); if (stringLength > longestText) { - index = i; longestText = stringLength; } } |