From 8257fd8e7cd73036629b56ceb4ebf34c2b27c00f Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 2 Jul 2012 21:05:55 -0400 Subject: [PATCH] Tweaked a few switch statements. --- .../nossr50/skills/gathering/Mining.java | 2 +- .../com/gmail/nossr50/util/BlockChecks.java | 21 +++++++++---------- .../java/com/gmail/nossr50/util/Combat.java | 3 ++- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java b/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java index 0eaf4b742..95e23289b 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java @@ -399,7 +399,7 @@ public class Mining { } default: - break; + return; } } } diff --git a/src/main/java/com/gmail/nossr50/util/BlockChecks.java b/src/main/java/com/gmail/nossr50/util/BlockChecks.java index c370ab305..0453808ff 100644 --- a/src/main/java/com/gmail/nossr50/util/BlockChecks.java +++ b/src/main/java/com/gmail/nossr50/util/BlockChecks.java @@ -71,6 +71,10 @@ public class BlockChecks { * @return true if the block should allow ability activation, false otherwise */ public static boolean abilityBlockCheck(Block block) { + if (customBlocksEnabled && CustomBlocksConfig.getInstance().customAbilityBlocks.contains(new ItemStack(block.getTypeId(), 1, (short) 0, block.getData()))) { + return false; + } + switch (block.getType()) { case BED_BLOCK: case BREWING_STAND: @@ -94,17 +98,12 @@ public class BlockChecks { return false; default: - break; - } - - if (block.getTypeId() == Config.getInstance().getRepairAnvilId()) { - return false; - } - else if (customBlocksEnabled && CustomBlocksConfig.getInstance().customAbilityBlocks.contains(new ItemStack(block.getTypeId(), 1, (short) 0, block.getData()))) { - return false; - } - else { - return true; + if (block.getTypeId() == Config.getInstance().getRepairAnvilId()) { + return false; + } + else { + return true; + } } } diff --git a/src/main/java/com/gmail/nossr50/util/Combat.java b/src/main/java/com/gmail/nossr50/util/Combat.java index f767d41fe..d6752cb65 100644 --- a/src/main/java/com/gmail/nossr50/util/Combat.java +++ b/src/main/java/com/gmail/nossr50/util/Combat.java @@ -148,6 +148,7 @@ public class Combat { } break; + case WOLF: Wolf wolf = (Wolf) damager; @@ -173,6 +174,7 @@ public class Combat { } break; + case ARROW: LivingEntity shooter = ((Arrow) damager).getShooter(); @@ -190,7 +192,6 @@ public class Combat { } archeryCheck((Player) shooter, target, event); - break; default: