mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
So many useless else statements...
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -187,9 +187,8 @@ public class SimpleRepairManager implements RepairManager {
|
||||
if (inventory.getItem(location).getTypeId() == itemId) {
|
||||
return location;
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,8 +44,7 @@ public class BeastLoreEventHandler {
|
||||
if (tamer instanceof Player) {
|
||||
return ((Player) tamer).getName();
|
||||
}
|
||||
else {
|
||||
return "Offline Master";
|
||||
}
|
||||
|
||||
return "Offline Master";
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,9 +134,8 @@ public class UnarmedManager {
|
||||
eventHandler.sendAbilityMessages();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected int getSkillLevel() {
|
||||
|
Reference in New Issue
Block a user