So many useless else statements...

This commit is contained in:
gmcferrin
2013-01-09 22:43:21 -05:00
parent 75a5ffcb10
commit 8b9432d1d9
33 changed files with 358 additions and 407 deletions

View File

@ -211,8 +211,7 @@ public class Axes {
if (inventory.getBoots() != null || inventory.getChestplate() != null || inventory.getHelmet() != null || inventory.getLeggings() != null) {
return true;
}
else {
return false;
}
return false;
}
}

View File

@ -327,9 +327,8 @@ public class WoodCutting {
if ((currentType.equals(Material.LEAVES) || currentType.equals(Material.AIR) || (Config.getInstance().getBlockModsEnabled() && ModChecks.isCustomLeafBlock(currentBlock))) && (newType.equals(Material.LEAVES) || newType.equals(Material.AIR) || (Config.getInstance().getBlockModsEnabled() && ModChecks.isCustomLeafBlock(currentBlock)))) {
return true;
}
else {
return false;
}
return false;
}
/**

View File

@ -69,47 +69,45 @@ public class SuperBreakerEventHandler {
if (ModChecks.getCustomBlock(block).getTier() < tier) {
return false;
}
else {
return true;
}
return true;
}
else {
switch (blockType) {
case OBSIDIAN:
if (tier < Mining.DIAMOND_TOOL_TIER) {
return false;
}
/* FALL THROUGH */
case DIAMOND_ORE:
case GLOWING_REDSTONE_ORE:
case GOLD_ORE:
case LAPIS_ORE:
case REDSTONE_ORE:
case EMERALD_ORE:
if (tier < Mining.IRON_TOOL_TIER) {
return false;
}
/* FALL THROUGH */
case IRON_ORE:
if (tier < Mining.STONE_TOOL_TIER) {
return false;
}
/* FALL THROUGH */
case COAL_ORE:
case ENDER_STONE:
case GLOWSTONE:
case MOSSY_COBBLESTONE:
case NETHERRACK:
case SANDSTONE:
case STONE:
return true;
default:
switch (blockType) {
case OBSIDIAN:
if (tier < Mining.DIAMOND_TOOL_TIER) {
return false;
}
/* FALL THROUGH */
case DIAMOND_ORE:
case GLOWING_REDSTONE_ORE:
case GOLD_ORE:
case LAPIS_ORE:
case REDSTONE_ORE:
case EMERALD_ORE:
if (tier < Mining.IRON_TOOL_TIER) {
return false;
}
/* FALL THROUGH */
case IRON_ORE:
if (tier < Mining.STONE_TOOL_TIER) {
return false;
}
/* FALL THROUGH */
case COAL_ORE:
case ENDER_STONE:
case GLOWSTONE:
case MOSSY_COBBLESTONE:
case NETHERRACK:
case SANDSTONE:
case STONE:
return true;
default:
return false;
}
}

View File

@ -187,9 +187,8 @@ public class SimpleRepairManager implements RepairManager {
if (inventory.getItem(location).getTypeId() == itemId) {
return location;
}
else {
return -1;
}
return -1;
}
/**

View File

@ -44,8 +44,7 @@ public class BeastLoreEventHandler {
if (tamer instanceof Player) {
return ((Player) tamer).getName();
}
else {
return "Offline Master";
}
return "Offline Master";
}
}

View File

@ -195,15 +195,14 @@ public class TamingManager {
eventHandler.sendInsufficientAmountMessage();
return;
}
if (eventHandler.nearbyEntityExists()) {
eventHandler.sendFailureMessage();
}
else {
if (eventHandler.nearbyEntityExists()) {
eventHandler.sendFailureMessage();
}
else {
eventHandler.spawnCreature();
eventHandler.processResourceCost();
eventHandler.sendSuccessMessage();
}
eventHandler.spawnCreature();
eventHandler.processResourceCost();
eventHandler.sendSuccessMessage();
}
}

View File

@ -134,9 +134,8 @@ public class UnarmedManager {
eventHandler.sendAbilityMessages();
return true;
}
else {
return false;
}
return false;
}
protected int getSkillLevel() {