From 0db588ae7c92978ed3bd3a4ad256bf524b50042f Mon Sep 17 00:00:00 2001 From: Ethan Jones Date: Mon, 6 Jul 2020 05:37:16 -0600 Subject: [PATCH] Final fixes for my cleanups --- src/main/java/net/TheDgtl/Stargate/Portal.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/TheDgtl/Stargate/Portal.java b/src/main/java/net/TheDgtl/Stargate/Portal.java index 42ea693e7..85754e405 100644 --- a/src/main/java/net/TheDgtl/Stargate/Portal.java +++ b/src/main/java/net/TheDgtl/Stargate/Portal.java @@ -678,7 +678,7 @@ public ArrayList getSignLines() { int curIndex = destinations.indexOf(destination); int i = Math.min(max, Math.max(0, curIndex - (curIndex == max ? 2 : 1))); - while (lines.size() < 3) { + while (lines.size() < 3 && i <= max) { String drawDestination = destinations.get(i); String msg = drawDestination; @@ -693,8 +693,7 @@ public ArrayList getSignLines() { msg = " >" + msg + "< "; lines.add(msg); - - if (i++ > max) break; + i++; } return lines; @@ -813,7 +812,7 @@ public final void drawSign() { String line = ""; try { - line = lines.get(i); + line = lines.get(i - 1); } catch (IndexOutOfBoundsException ignored) { } Stargate.setLine(sign, i, line);