From 5e006367610cf817104ccccbbce3facce0824574 Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 22 May 2013 22:30:09 -0400 Subject: [PATCH] And a little more... --- .../nossr50/config/treasure/TreasureConfig.java | 7 ++----- .../nossr50/datatypes/spout/huds/McMMOHud.java | 6 +----- .../java/com/gmail/nossr50/party/PartyManager.java | 6 +----- .../nossr50/skills/repair/config/RepairConfig.java | 13 +++---------- .../nossr50/skills/woodcutting/Woodcutting.java | 10 +++------- .../com/gmail/nossr50/util/skills/CombatUtils.java | 4 +--- 6 files changed, 11 insertions(+), 35 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java b/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java index 19788089b..18428d050 100644 --- a/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java +++ b/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java @@ -442,13 +442,10 @@ public class TreasureConfig extends ConfigLoader { } private boolean noErrorsInTreasure(List issues) { - if (issues.isEmpty()) { - return true; - } - for (String issue : issues) { plugin.getLogger().warning(issue); } - return false; + + return issues.isEmpty(); } } diff --git a/src/main/java/com/gmail/nossr50/datatypes/spout/huds/McMMOHud.java b/src/main/java/com/gmail/nossr50/datatypes/spout/huds/McMMOHud.java index b841b7f4f..141ae147e 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/spout/huds/McMMOHud.java +++ b/src/main/java/com/gmail/nossr50/datatypes/spout/huds/McMMOHud.java @@ -56,11 +56,7 @@ public class McMMOHud { } public boolean isMenuOpened() { - if (menu != null) { - return true; - } - - return false; + return (menu != null); } public void openMenu() { diff --git a/src/main/java/com/gmail/nossr50/party/PartyManager.java b/src/main/java/com/gmail/nossr50/party/PartyManager.java index 192bc9eaf..2753cc443 100644 --- a/src/main/java/com/gmail/nossr50/party/PartyManager.java +++ b/src/main/java/com/gmail/nossr50/party/PartyManager.java @@ -381,11 +381,7 @@ public final class PartyManager { * @return true if the player can invite */ public static boolean canInvite(Player player, Party party) { - if (party.isLocked() && !party.getLeader().equalsIgnoreCase(player.getName())) { - return false; - } - - return true; + return !(party.isLocked() && !party.getLeader().equalsIgnoreCase(player.getName())) } /** diff --git a/src/main/java/com/gmail/nossr50/skills/repair/config/RepairConfig.java b/src/main/java/com/gmail/nossr50/skills/repair/config/RepairConfig.java index 4133da19a..a949e7a4f 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/config/RepairConfig.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/config/RepairConfig.java @@ -88,21 +88,14 @@ public class RepairConfig extends ConfigLoader { } protected List getLoadedRepairables() { - if (repairables == null) { - return new ArrayList(); - } - - return repairables; + return repairables == null ? new ArrayList() : repairables; } private boolean noErrorsInRepairable(List issues) { - if (issues.isEmpty()) { - return true; - } - for (String issue : issues) { plugin.getLogger().warning(issue); } - return false; + + return issues.isEmpty(); } } diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java index 76a6c7200..c1fe4c8e9 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java @@ -230,14 +230,10 @@ public final class Woodcutting { short finalDurability = (short) (inHand.getDurability() + durabilityLoss); short maxDurability = ModUtils.isCustomTool(inHand) ? ModUtils.getToolFromItemStack(inHand).getDurability() : inHandMaterial.getMaxDurability(); + boolean overMax = (finalDurability >= maxDurability); - if (finalDurability >= maxDurability) { - inHand.setDurability(maxDurability); - return false; - } - - inHand.setDurability(finalDurability); - return true; + inHand.setDurability(overMax ? maxDurability : finalDurability); + return overMax; } /** diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index 844b06fa6..4312175b8 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -591,9 +591,7 @@ public final class CombatUtils { if (tamer instanceof Player) { Player owner = (Player) tamer; - if (owner == attacker || PartyManager.inSameParty(attacker, owner)) { - return true; - } + return (owner == attacker || PartyManager.inSameParty(attacker, owner)); } }