Tweaked a few switch statements.

This commit is contained in:
GJ 2012-07-02 21:05:55 -04:00
parent bc58aff362
commit 8257fd8e7c
3 changed files with 13 additions and 13 deletions

View File

@ -399,7 +399,7 @@ public class Mining {
} }
default: default:
break; return;
} }
} }
} }

View File

@ -71,6 +71,10 @@ public class BlockChecks {
* @return true if the block should allow ability activation, false otherwise * @return true if the block should allow ability activation, false otherwise
*/ */
public static boolean abilityBlockCheck(Block block) { 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()) { switch (block.getType()) {
case BED_BLOCK: case BED_BLOCK:
case BREWING_STAND: case BREWING_STAND:
@ -94,19 +98,14 @@ public class BlockChecks {
return false; return false;
default: default:
break;
}
if (block.getTypeId() == Config.getInstance().getRepairAnvilId()) { if (block.getTypeId() == Config.getInstance().getRepairAnvilId()) {
return false; return false;
} }
else if (customBlocksEnabled && CustomBlocksConfig.getInstance().customAbilityBlocks.contains(new ItemStack(block.getTypeId(), 1, (short) 0, block.getData()))) {
return false;
}
else { else {
return true; return true;
} }
} }
}
/** /**
* Check if a block type is an ore. * Check if a block type is an ore.

View File

@ -148,6 +148,7 @@ public class Combat {
} }
break; break;
case WOLF: case WOLF:
Wolf wolf = (Wolf) damager; Wolf wolf = (Wolf) damager;
@ -173,6 +174,7 @@ public class Combat {
} }
break; break;
case ARROW: case ARROW:
LivingEntity shooter = ((Arrow) damager).getShooter(); LivingEntity shooter = ((Arrow) damager).getShooter();
@ -190,7 +192,6 @@ public class Combat {
} }
archeryCheck((Player) shooter, target, event); archeryCheck((Player) shooter, target, event);
break; break;
default: default: