From 2aade8b7ff14690744da6bcb1b52b675c165ff27 Mon Sep 17 00:00:00 2001 From: t00thpick1 Date: Sat, 25 Jul 2015 22:29:19 -0400 Subject: [PATCH] Remove no longer needed DualSupport classes, we crossed that road long ago. --- .../com/gmail/nossr50/util/BlockUtils.java | 18 +++++++++++++--- .../nossr50/util/skills/CombatUtils.java | 21 ++++++++----------- .../util/temp/CompatableGuardianXP.java | 17 --------------- .../gmail/nossr50/util/temp/DualSupport.java | 19 ----------------- 4 files changed, 24 insertions(+), 51 deletions(-) delete mode 100644 src/main/java/com/gmail/nossr50/util/temp/CompatableGuardianXP.java delete mode 100644 src/main/java/com/gmail/nossr50/util/temp/DualSupport.java diff --git a/src/main/java/com/gmail/nossr50/util/BlockUtils.java b/src/main/java/com/gmail/nossr50/util/BlockUtils.java index 277baefc9..6662f37b1 100644 --- a/src/main/java/com/gmail/nossr50/util/BlockUtils.java +++ b/src/main/java/com/gmail/nossr50/util/BlockUtils.java @@ -15,7 +15,6 @@ import org.bukkit.material.SmoothBrick; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.repair.Repair; import com.gmail.nossr50.skills.salvage.Salvage; -import com.gmail.nossr50.util.temp.DualSupport; public final class BlockUtils { private BlockUtils() {} @@ -65,10 +64,21 @@ public final class BlockUtils { case HOPPER: case TRAPPED_CHEST: case IRON_DOOR: + case IRON_TRAPDOOR: + case ACACIA_DOOR: + case SPRUCE_DOOR: + case BIRCH_DOOR: + case JUNGLE_DOOR: + case DARK_OAK_DOOR: + case ACACIA_FENCE: + case DARK_OAK_FENCE: + case BIRCH_FENCE: + case JUNGLE_FENCE: + case ARMOR_STAND: return false; default: - return DualSupport.canActivateAbilities(blockState) && !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState); + return !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState); } } @@ -163,10 +173,12 @@ public final class BlockUtils { case SANDSTONE: case STAINED_CLAY: case STONE: + case PRISMARINE: + case RED_SANDSTONE: return true; default: - return DualSupport.affectedBySuperBreaker(blockState) || isOre(blockState) || mcMMO.getModManager().isCustomMiningBlock(blockState); + return isOre(blockState) || mcMMO.getModManager().isCustomMiningBlock(blockState); } } 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 2b250ba96..a47f44051 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -10,6 +10,7 @@ import org.bukkit.entity.Animals; import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; +import org.bukkit.entity.Guardian; import org.bukkit.entity.IronGolem; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -48,7 +49,6 @@ import com.gmail.nossr50.util.MobHealthbarUtils; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.temp.CompatableGuardianXP; - import com.google.common.collect.ImmutableMap; public final class CombatUtils { @@ -467,6 +467,7 @@ public final class CombatUtils { switch (type) { case BAT: case SQUID: + case RABBIT: baseXP = ExperienceConfig.getInstance().getAnimalsXP(); break; @@ -506,19 +507,15 @@ public final class CombatUtils { } break; - default: - if (type.name().equals("RABBIT")) { - baseXP = ExperienceConfig.getInstance().getAnimalsXP(); - break; - } - if (type.name().equals("ENDERMITE")) { + case GUARDIAN: + if (((Guardian) target).isElder()) { + baseXP = ExperienceConfig.getInstance().getElderGuardianXP(); + } else { baseXP = ExperienceConfig.getInstance().getCombatXP(type); - break; - } - if (type.name().equals("GUARDIAN")) { - baseXP = CompatableGuardianXP.get(target); - break; } + break; + + default: baseXP = 1.0; mcMMO.getModManager().addCustomEntity(target); break; diff --git a/src/main/java/com/gmail/nossr50/util/temp/CompatableGuardianXP.java b/src/main/java/com/gmail/nossr50/util/temp/CompatableGuardianXP.java deleted file mode 100644 index 0ca848100..000000000 --- a/src/main/java/com/gmail/nossr50/util/temp/CompatableGuardianXP.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.gmail.nossr50.util.temp; - -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Guardian; - -import com.gmail.nossr50.config.experience.ExperienceConfig; - -public class CompatableGuardianXP { - public static double get(Entity target) { - if (((Guardian) target).isElder()) { - return ExperienceConfig.getInstance().getElderGuardianXP(); - } else { - return ExperienceConfig.getInstance().getCombatXP(EntityType.GUARDIAN); - } - } -} diff --git a/src/main/java/com/gmail/nossr50/util/temp/DualSupport.java b/src/main/java/com/gmail/nossr50/util/temp/DualSupport.java deleted file mode 100644 index bc55f8c62..000000000 --- a/src/main/java/com/gmail/nossr50/util/temp/DualSupport.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.gmail.nossr50.util.temp; - -import org.bukkit.block.BlockState; - -public class DualSupport { - - public static boolean canActivateAbilities(BlockState blockState) { - String mat = blockState.getType().name(); - return !mat.equals("IRON_TRAPDOOR") && !mat.equals("ACACIA_DOOR") && !mat.equals("SPRUCE_DOOR") && !mat.equals("BIRCH_DOOR") - && !mat.equals("JUNGLE_DOOR") && !mat.equals("DARK_OAK_DOOR") && !mat.equals("ACACIA_FENCE") && !mat.equals("DARK_OAK_FENCE") - && !mat.equals("BIRCH_FENCE") && !mat.equals("JUNGLE_FENCE") && !mat.equals("ARMOR_STAND"); - } - - public static boolean affectedBySuperBreaker(BlockState blockState) { - String mat = blockState.getType().name(); - return mat.equals("PRISMARINE") || mat.equals("RED_SANDSTONE"); - } - -}