Fix entity kill xp

This commit is contained in:
t00thpick1 2016-12-04 20:53:51 -05:00
parent 4b20db47b2
commit 6c5fb5f398
2 changed files with 16 additions and 23 deletions

View File

@ -207,9 +207,8 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
/* Combat XP Multipliers */
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 double getWitherSkeletonXP() { return config.getDouble("Experience.Combat.Multiplier.Wither_Skeleton", 4.0); }
public double getElderGuardianXP() { return config.getDouble("Experience.Combat.Multiplier.Elder_Guardian", 4.0); }
/* Materials */
public int getXp(SkillType skill, Material material) { return config.getInt("Experience." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); }

View File

@ -13,6 +13,7 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.Guardian;
import org.bukkit.entity.IronGolem;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Tameable;
@ -458,7 +459,13 @@ public final class CombatUtils {
baseXP = mcMMO.getModManager().getEntity(target).getXpMultiplier();
}
else if (target instanceof Animals) {
baseXP = ExperienceConfig.getInstance().getAnimalsXP();
ntityType type = target.getType();
baseXP = ExperienceConfig.getInstance().getAnimalsXP(type);
}
else if (target instanceof Monster)
{
EntityType type = target.getType();
baseXP = ExperienceConfig.getInstance().getCombatXP(type);
}
else {
EntityType type = target.getType();
@ -467,7 +474,7 @@ public final class CombatUtils {
case BAT:
case SQUID:
case RABBIT:
baseXP = ExperienceConfig.getInstance().getAnimalsXP();
baseXP = ExperienceConfig.getInstance().getAnimalsXP(type);
break;
case BLAZE:
@ -486,20 +493,15 @@ public final class CombatUtils {
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 SKELETON:
switch (((Skeleton) target).getSkeletonType()) {
case WITHER:
baseXP = ExperienceConfig.getInstance().getWitherSkeletonXP();
break;
default:
baseXP = ExperienceConfig.getInstance().getCombatXP(type);
break;
}
break;
case IRON_GOLEM:
@ -508,14 +510,6 @@ public final class CombatUtils {
}
break;
case GUARDIAN:
if (((Guardian) target).isElder()) {
baseXP = ExperienceConfig.getInstance().getElderGuardianXP();
} else {
baseXP = ExperienceConfig.getInstance().getCombatXP(type);
}
break;
default:
baseXP = 1.0;
mcMMO.getModManager().addCustomEntity(target);