diff --git a/pom.xml b/pom.xml index 78fdfd7cb..3408ef220 100755 --- a/pom.xml +++ b/pom.xml @@ -135,7 +135,7 @@ org.bukkit bukkit - 1.11-R0.1-SNAPSHOT + 1.11.2-R0.1-SNAPSHOT provided diff --git a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java index 52cc229fd..bc9841e79 100644 --- a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -128,11 +128,11 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { } /* Taming */ - if (getTamingXPWolf() <= 0) { + if (getTamingXP(EntityType.WOLF) <= 0) { reason.add("Experience.Taming.Animal_Taming.Wolf should be greater than 0!"); } - if (getTamingXPOcelot() <= 0) { + if (getTamingXP(EntityType.OCELOT) <= 0) { reason.add("Experience.Taming.Animal_Taming.Ocelot should be greater than 0!"); } @@ -370,9 +370,10 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { public double getRepairXP(MaterialType repairMaterialType) { return config.getDouble("Experience.Repair." + StringUtils.getCapitalized(repairMaterialType.toString())); } /* Taming */ - public int getTamingXPHorse() { return config.getInt("Experience.Taming.Animal_Taming.Horse", 1000); } - public int getTamingXPWolf() { return config.getInt("Experience.Taming.Animal_Taming.Wolf", 250); } - public int getTamingXPOcelot() { return config.getInt("Experience.Taming.Animal_Taming.Ocelot", 500); } + public int getTamingXP(EntityType type) + { + return config.getInt("Experience.Taming.Animal_Taming." + StringUtils.getPrettyEntityTypeString(type)); + } /* Woodcutting */ public int getWoodcuttingTreeXP(TreeSpecies species) { return config.getInt("Experience.Woodcutting." + StringUtils.getPrettyTreeSpeciesString(species).replace(" ", "_")); } diff --git a/src/main/java/com/gmail/nossr50/skills/taming/Taming.java b/src/main/java/com/gmail/nossr50/skills/taming/Taming.java index dc6bb89d9..acd6a471b 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/Taming.java +++ b/src/main/java/com/gmail/nossr50/skills/taming/Taming.java @@ -30,10 +30,6 @@ public class Taming { public static int thickFurUnlockLevel = AdvancedConfig.getInstance().getThickFurUnlock(); public static double thickFurModifier = AdvancedConfig.getInstance().getThickFurModifier(); - public static int wolfXp = ExperienceConfig.getInstance().getTamingXPWolf(); - public static int ocelotXp = ExperienceConfig.getInstance().getTamingXPOcelot(); - public static int horseXp = ExperienceConfig.getInstance().getTamingXPHorse(); - public static boolean canPreventDamage(Tameable pet, AnimalTamer owner) { return pet.isTamed() && owner instanceof Player && pet instanceof Wolf; } diff --git a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java index 1426fa247..e8ccaf9af 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java @@ -19,6 +19,7 @@ import org.bukkit.inventory.ItemStack; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.SecondaryAbility; import com.gmail.nossr50.datatypes.skills.SkillType; @@ -81,22 +82,7 @@ public class TamingManager extends SkillManager { * @param entity The LivingEntity to award XP for */ public void awardTamingXP(LivingEntity entity) { - switch (entity.getType()) { - case HORSE: - applyXpGain(Taming.horseXp, XPGainReason.PVE); - return; - - case WOLF: - applyXpGain(Taming.wolfXp, XPGainReason.PVE); - return; - - case OCELOT: - applyXpGain(Taming.ocelotXp, XPGainReason.PVE); - return; - - default: - return; - } + applyXpGain(ExperienceConfig.getInstance().getTamingXP(entity.getType()), XPGainReason.PVE); } /** 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 7933adad1..af0c373d6 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -477,56 +477,22 @@ public final class CombatUtils { else if (target instanceof Monster) { EntityType type = target.getType(); - baseXP = ExperienceConfig.getInstance().getCombatXP(type); + + if (type == EntityType.IRON_GOLEM) + { + if (!((IronGolem) target).isPlayerCreated()) { + baseXP = ExperienceConfig.getInstance().getCombatXP(type); + } + } + else + { + baseXP = ExperienceConfig.getInstance().getCombatXP(type); + } + } else { - EntityType type = target.getType(); - - switch (type) { - case BAT: - case SQUID: - case RABBIT: - baseXP = ExperienceConfig.getInstance().getAnimalsXP(type); - break; - - case BLAZE: - case CAVE_SPIDER: - case CREEPER: - case ENDER_DRAGON: - case ENDERMAN: - case ENDERMITE: - case GHAST: - case GIANT: - case MAGMA_CUBE: - case PIG_ZOMBIE: - case SHULKER: - case SILVERFISH: - case SLIME: - case SPIDER: - case WITCH: - case WITHER: - case ZOMBIE_VILLAGER: - case ZOMBIE: - case GUARDIAN: - case ELDER_GUARDIAN: - case HUSK: - case STRAY: - case WITHER_SKELETON: - baseXP = ExperienceConfig.getInstance().getCombatXP(type); - - break; - - case IRON_GOLEM: - if (!((IronGolem) target).isPlayerCreated()) { - baseXP = ExperienceConfig.getInstance().getCombatXP(type); - } - break; - - default: - baseXP = 1.0; - mcMMO.getModManager().addCustomEntity(target); - break; - } + baseXP = 1.0; + mcMMO.getModManager().addCustomEntity(target); } if (target.hasMetadata(mcMMO.entityMetadataKey)) {