From 06016f4ada290342d427d763b1ac88752770f27a Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 30 Apr 2019 00:57:50 -0700 Subject: [PATCH] Wire up special combat XP multipliers --- .../config/experience/ExperienceConfig.java | 16 ---------------- .../hocon/experience/ConfigExperience.java | 4 ++++ .../hocon/experience/ConfigExperienceCombat.java | 4 ++++ .../hocon/experience/ConfigExperienceSkills.java | 4 ++++ .../gmail/nossr50/util/skills/CombatUtils.java | 8 ++++---- 5 files changed, 16 insertions(+), 20 deletions(-) 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 1e63b77ac..7b9e78791 100644 --- a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -128,18 +128,6 @@ public class ExperienceConfig extends ConfigValidated { }*/ /* PVP modifier */ - public double getPlayerVersusPlayerXP() { - return getDoubleValue(EXPERIENCE_FORMULA, MULTIPLIER, PVP); - } - - /* Spawned Mob modifier */ - public double getSpawnedMobXpMultiplier() { - return getDoubleValue(EXPERIENCE_FORMULA, MOBSPAWNERS, MULTIPLIER); - } - - public double getBredMobXpMultiplier() { - return getDoubleValue(EXPERIENCE_FORMULA, BREEDING, MULTIPLIER); - } /* Skill modifiers */ public double getFormulaSkillModifier(PrimarySkillType skill) { @@ -186,10 +174,6 @@ public class ExperienceConfig extends ConfigValidated { return getDoubleValue(EXPERIENCE, COMBAT, MULTIPLIER, StringUtils.getEntityConfigName(entity)); } - public double getAnimalsXP() { - return getDoubleValue(EXPERIENCE, COMBAT, MULTIPLIER, ANIMALS); - } - public boolean hasCombatXP(EntityType entity) { return hasNode(EXPERIENCE, COMBAT, MULTIPLIER, StringUtils.getEntityConfigName(entity)); } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperience.java b/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperience.java index aa8af7f63..6610a5485 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperience.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperience.java @@ -177,6 +177,10 @@ public class ConfigExperience { return getConfigExperienceSkills().getSpawnedMobXPMult(); } + public double getPlayerBredMobsXPMult() { + return getExperienceCombat().getPlayerBredMobsXPMult(); + } + public double getPVPXPMult() { return getConfigExperienceSkills().getPVPXPMult(); } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperienceCombat.java b/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperienceCombat.java index f56b6b118..875f85ead 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperienceCombat.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperienceCombat.java @@ -112,4 +112,8 @@ public class ConfigExperienceCombat { public double getAnimalsXPMult() { return specialCombatExperienceMap.get("animals"); } + + public double getPlayerBredMobsXPMult() { + return specialCombatExperienceMap.get("player-bred-mobs"); + } } \ No newline at end of file diff --git a/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperienceSkills.java b/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperienceSkills.java index e9b127610..d096973c8 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperienceSkills.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperienceSkills.java @@ -47,6 +47,10 @@ public class ConfigExperienceSkills { * BOILER PLATE GETTERS */ + public double getPlayerBredMobsXPMult() { + return experienceCombat.getPlayerBredMobsXPMult(); + } + public ConfigExperienceAcrobatics getExperienceAcrobatics() { return experienceAcrobatics; } 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 89a857d76..5c0c164b7 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -543,7 +543,7 @@ public final class CombatUtils { Player defender = (Player) target; if (defender.isOnline() && SkillUtils.cooldownExpired(mcMMOPlayer.getRespawnATS(), Misc.PLAYER_RESPAWN_COOLDOWN_SECONDS)) { - baseXP = 20 * ExperienceConfig.getInstance().getPlayerVersusPlayerXP(); + baseXP = 20 * mcMMO.getConfigManager().getConfigExperience().getPVPXPMult(); } } else { /*if (mcMMO.getModManager().isCustomEntity(target)) { @@ -552,7 +552,7 @@ public final class CombatUtils { //else if (target instanceof Animals) { if (target instanceof Animals) { EntityType type = target.getType(); - baseXP = ExperienceConfig.getInstance().getAnimalsXP(type); + baseXP = mcMMO.getConfigManager().getConfigExperience().getAnimalsXPMult(); } else if (target instanceof Monster) { EntityType type = target.getType(); baseXP = ExperienceConfig.getInstance().getCombatXP(type); @@ -574,11 +574,11 @@ public final class CombatUtils { } if (target.hasMetadata(mcMMO.entityMetadataKey)) { - baseXP *= ExperienceConfig.getInstance().getSpawnedMobXpMultiplier(); + baseXP *= mcMMO.getConfigManager().getConfigExperience().getSpawnedMobXPMult(); } if (target.hasMetadata(mcMMO.bredMetadataKey)) { - baseXP *= ExperienceConfig.getInstance().getBredMobXpMultiplier(); + baseXP *= mcMMO.getConfigManager().getConfigExperience().getPlayerBredMobsXPMult(); } xpGainReason = XPGainReason.PVE;