From d0cdc208e34cf66fbe8e8f7ce9a9d242bde8b30a Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 21 May 2012 07:53:52 -0400 Subject: [PATCH] Avoid a duplicate config call. --- src/main/java/com/gmail/nossr50/util/Misc.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/Misc.java b/src/main/java/com/gmail/nossr50/util/Misc.java index a7103760b..7c8be0be2 100644 --- a/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/src/main/java/com/gmail/nossr50/util/Misc.java @@ -94,7 +94,7 @@ public class Misc { return false; } } - + /** * Simulate a block break event. * @@ -266,8 +266,10 @@ public class Misc { } public static int getPowerLevelCap() { - if (Config.getInstance().getPowerLevelCap() > 0) { - return Config.getInstance().getPowerLevelCap(); + int levelCap = Config.getInstance().getPowerLevelCap(); + + if (levelCap > 0) { + return levelCap; } else { return Integer.MAX_VALUE;