Skip to content

Commit

Permalink
Final fixes for my cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleBigBug committed Jul 6, 2020
1 parent 85b0e25 commit 0db588a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/net/TheDgtl/Stargate/Portal.java
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ public ArrayList<String> 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;

Expand All @@ -693,8 +693,7 @@ public ArrayList<String> getSignLines() {
msg = " >" + msg + "< ";

lines.add(msg);

if (i++ > max) break;
i++;
}

return lines;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0db588a

Please sign in to comment.