From c90ea75fde2db93a26c83c812b059ef498cabc56 Mon Sep 17 00:00:00 2001 From: mezz Date: Sat, 13 Jun 2015 15:33:00 -0700 Subject: [PATCH] Minor code tidying in Escritoire --- .../forestry/core/gadgets/NaturalistGame.java | 19 ++++++++++++------- .../java/forestry/core/gui/GuiEscritoire.java | 4 ++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/java/forestry/core/gadgets/NaturalistGame.java b/src/main/java/forestry/core/gadgets/NaturalistGame.java index 2186b41d3..ad5e2864c 100755 --- a/src/main/java/forestry/core/gadgets/NaturalistGame.java +++ b/src/main/java/forestry/core/gadgets/NaturalistGame.java @@ -224,7 +224,11 @@ public class NaturalistGame implements INBTTagable, IStreamable { if (boardSize % 2 != 0) { boardSize = Math.round((float) boardSize / 2) * 2; } - boardSize = boardSize <= 22 ? boardSize >= 6 ? boardSize : 6 : 22; + if (boardSize > 22) { + boardSize = 22; + } else if (boardSize < 6) { + boardSize = 6; + } isEnded = false; bountyLevel = BOUNTY_MAX; @@ -446,10 +450,7 @@ public class NaturalistGame implements INBTTagable, IStreamable { ArrayList singles = new ArrayList(); for (GameToken token : gameTokens) { - if (!token.isRevealed) { - continue; - } - if (token == exclude) { + if (!token.isRevealed || token == exclude) { continue; } @@ -479,10 +480,14 @@ public class NaturalistGame implements INBTTagable, IStreamable { } int samples = gameTokens.length / 4; - return samples >= 2 ? samples : 2; + return Math.max(samples, 2); } public GameToken getToken(int index) { - return gameTokens != null ? index < gameTokens.length ? gameTokens[index] : null : null; + if (gameTokens != null && index < gameTokens.length) { + return gameTokens[index]; + } + + return null; } } diff --git a/src/main/java/forestry/core/gui/GuiEscritoire.java b/src/main/java/forestry/core/gui/GuiEscritoire.java index 2e3cd1727..77cee81d9 100755 --- a/src/main/java/forestry/core/gui/GuiEscritoire.java +++ b/src/main/java/forestry/core/gui/GuiEscritoire.java @@ -37,7 +37,7 @@ import forestry.core.utils.StringUtil; public class GuiEscritoire extends GuiForestry { - private static enum Notes { + private enum Notes { level1, level2, level3, level4, success, failure } @@ -48,7 +48,7 @@ public class GuiEscritoire extends GuiForestry