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 3112803f8..98c590d5d 100644 --- a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -190,6 +190,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { public double getCombatXP(EntityType entity) { return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); } public double getAnimalsXP(EntityType entity) { return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_"), getAnimalsXP()); } public double getAnimalsXP() { return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); } + public boolean hasCombatXP(EntityType entity) {return config.contains("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); } /* Materials */ public int getXp(SkillType skill, MaterialData data) 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 af0c373d6..d4453be7b 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -477,22 +477,28 @@ public final class CombatUtils { else if (target instanceof Monster) { EntityType type = target.getType(); - - if (type == EntityType.IRON_GOLEM) - { - if (!((IronGolem) target).isPlayerCreated()) { + baseXP = ExperienceConfig.getInstance().getCombatXP(type); + } + else { + EntityType type = target.getType(); + + if (ExperienceConfig.getInstance().hasCombatXP(type)) { + if (type == EntityType.IRON_GOLEM) + { + if (!((IronGolem) target).isPlayerCreated()) { + baseXP = ExperienceConfig.getInstance().getCombatXP(type); + } + } + else + { baseXP = ExperienceConfig.getInstance().getCombatXP(type); } } else { - baseXP = ExperienceConfig.getInstance().getCombatXP(type); + baseXP = 1.0; + mcMMO.getModManager().addCustomEntity(target); } - - } - else { - baseXP = 1.0; - mcMMO.getModManager().addCustomEntity(target); } if (target.hasMetadata(mcMMO.entityMetadataKey)) {