From 3f6a33dea649bde387d8a2a0f98558a413194605 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 13 May 2019 03:39:24 -0700 Subject: [PATCH] Refactoring experience manager --- .../com/gmail/nossr50/api/ExperienceAPI.java | 26 +++++++-------- .../gmail/nossr50/commands/XprateCommand.java | 6 ++-- .../nossr50/core/DynamicSettingsManager.java | 16 ++++----- .../nossr50/datatypes/player/McMMOPlayer.java | 2 +- .../nossr50/listeners/PlayerListener.java | 2 +- .../gmail/nossr50/listeners/SelfListener.java | 3 +- .../nossr50/skills/excavation/Excavation.java | 2 +- .../skills/herbalism/HerbalismManager.java | 2 +- .../gmail/nossr50/skills/mining/Mining.java | 2 +- .../nossr50/skills/taming/TamingManager.java | 2 +- .../skills/woodcutting/Woodcutting.java | 2 +- .../com/gmail/nossr50/util/BlockUtils.java | 16 ++++----- ...MapManager.java => ExperienceManager.java} | 33 +++++++++++++++---- .../nossr50/util/skills/CombatUtils.java | 11 +++---- 14 files changed, 71 insertions(+), 54 deletions(-) rename src/main/java/com/gmail/nossr50/util/experience/{ExperienceMapManager.java => ExperienceManager.java} (93%) diff --git a/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java b/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java index a581e3ee7..0ebc22fd5 100644 --- a/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java +++ b/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java @@ -195,7 +195,7 @@ public final class ExperienceAPI { * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addMultipliedXP(Player player, String skillType, int XP, String xpGainReason) { - getPlayer(player).applyXpGain(getSkillType(skillType), (int) (XP * mcMMO.getDynamicSettingsManager().getExperienceMapManager().getGlobalXpMult()), getXPGainReason(xpGainReason), XPGainSource.CUSTOM); + getPlayer(player).applyXpGain(getSkillType(skillType), (int) (XP * mcMMO.getDynamicSettingsManager().getExperienceManager().getGlobalXpMult()), getXPGainReason(xpGainReason), XPGainSource.CUSTOM); } /** @@ -211,7 +211,7 @@ public final class ExperienceAPI { */ @Deprecated public static void addMultipliedXPOffline(String playerName, String skillType, int XP) { - addOfflineXP(playerName, getSkillType(skillType), (int) (XP * mcMMO.getDynamicSettingsManager().getExperienceMapManager().getGlobalXpMult())); + addOfflineXP(playerName, getSkillType(skillType), (int) (XP * mcMMO.getDynamicSettingsManager().getExperienceManager().getGlobalXpMult())); } /** @@ -262,11 +262,11 @@ public final class ExperienceAPI { PrimarySkillType skill = getSkillType(skillType); if (isUnshared) { - getPlayer(player).beginUnsharedXpGain(skill, (int) (XP / skill.getXpModifier() * mcMMO.getDynamicSettingsManager().getExperienceMapManager().getGlobalXpMult()), getXPGainReason(xpGainReason), XPGainSource.CUSTOM); + getPlayer(player).beginUnsharedXpGain(skill, (int) (XP / skill.getXpModifier() * mcMMO.getDynamicSettingsManager().getExperienceManager().getGlobalXpMult()), getXPGainReason(xpGainReason), XPGainSource.CUSTOM); return; } - getPlayer(player).applyXpGain(skill, (int) (XP / skill.getXpModifier() * mcMMO.getDynamicSettingsManager().getExperienceMapManager().getGlobalXpMult()), getXPGainReason(xpGainReason), XPGainSource.CUSTOM); + getPlayer(player).applyXpGain(skill, (int) (XP / skill.getXpModifier() * mcMMO.getDynamicSettingsManager().getExperienceManager().getGlobalXpMult()), getXPGainReason(xpGainReason), XPGainSource.CUSTOM); } /** @@ -284,7 +284,7 @@ public final class ExperienceAPI { public static void addModifiedXPOffline(String playerName, String skillType, int XP) { PrimarySkillType skill = getSkillType(skillType); - addOfflineXP(playerName, skill, (int) (XP / skill.getXpModifier() * mcMMO.getDynamicSettingsManager().getExperienceMapManager().getGlobalXpMult())); + addOfflineXP(playerName, skill, (int) (XP / skill.getXpModifier() * mcMMO.getDynamicSettingsManager().getExperienceManager().getGlobalXpMult())); } /** @@ -1000,8 +1000,8 @@ public final class ExperienceAPI { public static void addXpFromBlocks(ArrayList blockStates, McMMOPlayer mcMMOPlayer) { for (BlockState bs : blockStates) { for (PrimarySkillType skillType : PrimarySkillType.values()) { - if (mcMMO.getDynamicSettingsManager().getExperienceMapManager().getBlockBreakXpValue(skillType, bs.getType()) > 0) { - mcMMOPlayer.applyXpGain(skillType, mcMMO.getDynamicSettingsManager().getExperienceMapManager().getBlockBreakXpValue(skillType, bs.getType()), XPGainReason.PVE, XPGainSource.SELF); + if (mcMMO.getDynamicSettingsManager().getExperienceManager().getBlockBreakXpValue(skillType, bs.getType()) > 0) { + mcMMOPlayer.applyXpGain(skillType, mcMMO.getDynamicSettingsManager().getExperienceManager().getBlockBreakXpValue(skillType, bs.getType()), XPGainReason.PVE, XPGainSource.SELF); } } } @@ -1016,8 +1016,8 @@ public final class ExperienceAPI { */ public static void addXpFromBlocksBySkill(ArrayList blockStates, McMMOPlayer mcMMOPlayer, PrimarySkillType skillType) { for (BlockState bs : blockStates) { - if (mcMMO.getDynamicSettingsManager().getExperienceMapManager().getBlockBreakXpValue(skillType, bs.getType()) > 0) { - mcMMOPlayer.applyXpGain(skillType, mcMMO.getDynamicSettingsManager().getExperienceMapManager().getBlockBreakXpValue(skillType, bs.getType()), XPGainReason.PVE, XPGainSource.SELF); + if (mcMMO.getDynamicSettingsManager().getExperienceManager().getBlockBreakXpValue(skillType, bs.getType()) > 0) { + mcMMOPlayer.applyXpGain(skillType, mcMMO.getDynamicSettingsManager().getExperienceManager().getBlockBreakXpValue(skillType, bs.getType()), XPGainReason.PVE, XPGainSource.SELF); } } } @@ -1030,8 +1030,8 @@ public final class ExperienceAPI { */ public static void addXpFromBlock(BlockState blockState, McMMOPlayer mcMMOPlayer) { for (PrimarySkillType skillType : PrimarySkillType.values()) { - if (mcMMO.getDynamicSettingsManager().getExperienceMapManager().getBlockBreakXpValue(skillType, blockState.getType()) > 0) { - mcMMOPlayer.applyXpGain(skillType, mcMMO.getDynamicSettingsManager().getExperienceMapManager().getBlockBreakXpValue(skillType, blockState.getType()), XPGainReason.PVE, XPGainSource.SELF); + if (mcMMO.getDynamicSettingsManager().getExperienceManager().getBlockBreakXpValue(skillType, blockState.getType()) > 0) { + mcMMOPlayer.applyXpGain(skillType, mcMMO.getDynamicSettingsManager().getExperienceManager().getBlockBreakXpValue(skillType, blockState.getType()), XPGainReason.PVE, XPGainSource.SELF); } } } @@ -1044,8 +1044,8 @@ public final class ExperienceAPI { * @param skillType target primary skill */ public static void addXpFromBlockBySkill(BlockState blockState, McMMOPlayer mcMMOPlayer, PrimarySkillType skillType) { - if (mcMMO.getDynamicSettingsManager().getExperienceMapManager().getBlockBreakXpValue(skillType, blockState.getType()) > 0) { - mcMMOPlayer.applyXpGain(skillType, mcMMO.getDynamicSettingsManager().getExperienceMapManager().getBlockBreakXpValue(skillType, blockState.getType()), XPGainReason.PVE, XPGainSource.SELF); + if (mcMMO.getDynamicSettingsManager().getExperienceManager().getBlockBreakXpValue(skillType, blockState.getType()) > 0) { + mcMMOPlayer.applyXpGain(skillType, mcMMO.getDynamicSettingsManager().getExperienceManager().getBlockBreakXpValue(skillType, blockState.getType()), XPGainReason.PVE, XPGainSource.SELF); } } diff --git a/src/main/java/com/gmail/nossr50/commands/XprateCommand.java b/src/main/java/com/gmail/nossr50/commands/XprateCommand.java index 96d149993..f36ca3e56 100644 --- a/src/main/java/com/gmail/nossr50/commands/XprateCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/XprateCommand.java @@ -18,7 +18,7 @@ import java.util.ArrayList; import java.util.List; public class XprateCommand implements TabExecutor { - private final double ORIGINAL_XP_RATE = mcMMO.getDynamicSettingsManager().getExperienceMapManager().getGlobalXpMult(); + private final double ORIGINAL_XP_RATE = mcMMO.getDynamicSettingsManager().getExperienceManager().getGlobalXpMult(); @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { @@ -48,7 +48,7 @@ public class XprateCommand implements TabExecutor { mcMMO.p.toggleXpEventEnabled(); } - mcMMO.getDynamicSettingsManager().getExperienceMapManager().resetGlobalXpMult(); + mcMMO.getDynamicSettingsManager().getExperienceManager().resetGlobalXpMult(); return true; case 2: @@ -76,7 +76,7 @@ public class XprateCommand implements TabExecutor { return true; } - mcMMO.getDynamicSettingsManager().getExperienceMapManager().setGlobalXpMult(newXpRate); + mcMMO.getDynamicSettingsManager().getExperienceManager().setGlobalXpMult(newXpRate); if (mcMMO.p.isXPEventEnabled()) { if (AdvancedConfig.getInstance().useTitlesForXPEvent()) { diff --git a/src/main/java/com/gmail/nossr50/core/DynamicSettingsManager.java b/src/main/java/com/gmail/nossr50/core/DynamicSettingsManager.java index 9d09a0e13..68fb5754c 100644 --- a/src/main/java/com/gmail/nossr50/core/DynamicSettingsManager.java +++ b/src/main/java/com/gmail/nossr50/core/DynamicSettingsManager.java @@ -7,7 +7,7 @@ import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.skills.repair.repairables.RepairableManager; import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; import com.gmail.nossr50.skills.salvage.salvageables.SalvageableManager; -import com.gmail.nossr50.util.experience.ExperienceMapManager; +import com.gmail.nossr50.util.experience.ExperienceManager; import com.google.common.collect.Maps; import org.bukkit.Material; @@ -33,7 +33,7 @@ public class DynamicSettingsManager { /* Platform Ready Managers */ private BonusDropManager bonusDropManager; - private ExperienceMapManager experienceMapManager; + private ExperienceManager experienceManager; /* Party Settings */ private HashMap partyItemWeights; @@ -67,11 +67,11 @@ public class DynamicSettingsManager { * Misc managers */ private void initMiscManagers() { - experienceMapManager = new ExperienceMapManager(); + experienceManager = new ExperienceManager(); //Set the global XP val - experienceMapManager.setGlobalXpMult(mcMMO.getConfigManager().getConfigExperience().getGlobalXPMultiplier()); - experienceMapManager.buildBlockXPMaps(); //Block XP value maps - experienceMapManager.fillCombatXPMultiplierMap(mcMMO.getConfigManager().getConfigExperience().getCombatExperienceMap()); + experienceManager.setGlobalXpMult(mcMMO.getConfigManager().getConfigExperience().getGlobalXPMultiplier()); + experienceManager.buildBlockXPMaps(); //Block XP value maps + experienceManager.fillCombatXPMultiplierMap(mcMMO.getConfigManager().getConfigExperience().getCombatExperienceMap()); // potionManager = new PotionManager(); } @@ -127,8 +127,8 @@ public class DynamicSettingsManager { return salvageableManager; } - public ExperienceMapManager getExperienceMapManager() { - return experienceMapManager; + public ExperienceManager getExperienceManager() { + return experienceManager; } public BonusDropManager getBonusDropManager() { diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java index c689dfbf6..993784fd0 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -775,7 +775,7 @@ public class McMMOPlayer { return 0; } - xp = (float) (xp / primarySkillType.getXpModifier() * mcMMO.getDynamicSettingsManager().getExperienceMapManager().getGlobalXpMult()); + xp = (float) (xp / primarySkillType.getXpModifier() * mcMMO.getDynamicSettingsManager().getExperienceManager().getGlobalXpMult()); //Multiply by the players personal XP rate return xp * personalXPModifiers.get(primarySkillType); diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 7932c8f02..fdf827f62 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -520,7 +520,7 @@ public class PlayerListener implements Listener { } if (plugin.isXPEventEnabled()) { - player.sendMessage(LocaleLoader.getString("XPRate.Event", mcMMO.getDynamicSettingsManager().getExperienceMapManager().getGlobalXpMult())); + player.sendMessage(LocaleLoader.getString("XPRate.Event", mcMMO.getDynamicSettingsManager().getExperienceManager().getGlobalXpMult())); } //TODO: Remove this warning diff --git a/src/main/java/com/gmail/nossr50/listeners/SelfListener.java b/src/main/java/com/gmail/nossr50/listeners/SelfListener.java index 9be4187a7..51528e02b 100644 --- a/src/main/java/com/gmail/nossr50/listeners/SelfListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/SelfListener.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.config.MainConfig; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; @@ -119,7 +118,7 @@ public class SelfListener implements Listener { float guaranteedMinimum = mcMMO.getConfigManager().getConfigLeveling().getGuaranteedMinimums() * rawXp; - float modifiedThreshold = (float) (threshold / primarySkillType.getXpModifier() * mcMMO.getDynamicSettingsManager().getExperienceMapManager().getGlobalXpMult()); + float modifiedThreshold = (float) (threshold / primarySkillType.getXpModifier() * mcMMO.getDynamicSettingsManager().getExperienceManager().getGlobalXpMult()); float difference = (mcMMOPlayer.getProfile().getRegisteredXpGain(primarySkillType) - modifiedThreshold) / modifiedThreshold; if (difference > 0) { diff --git a/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java b/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java index e5cfe6eba..5068553e2 100644 --- a/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java +++ b/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java @@ -24,7 +24,7 @@ public class Excavation { } protected static int getBlockXP(BlockState blockState) { - int xp = mcMMO.getDynamicSettingsManager().getExperienceMapManager().getExcavationXp(blockState.getType()); + int xp = mcMMO.getDynamicSettingsManager().getExperienceManager().getExcavationXp(blockState.getType()); return xp; } diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java index 60b38566b..958416d54 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java @@ -148,7 +148,7 @@ public class HerbalismManager extends SkillManager { // } // } // else { - xp = mcMMO.getDynamicSettingsManager().getExperienceMapManager().getHerbalismXp(blockState.getType()); + xp = mcMMO.getDynamicSettingsManager().getExperienceManager().getHerbalismXp(blockState.getType()); if (!oneBlockPlant) { //Kelp is actually two blocks mixed together diff --git a/src/main/java/com/gmail/nossr50/skills/mining/Mining.java b/src/main/java/com/gmail/nossr50/skills/mining/Mining.java index 0645f1304..b6c15b1da 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/Mining.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/Mining.java @@ -32,7 +32,7 @@ public class Mining { * @param blockState The {@link BlockState} to check ability activation for */ public static int getBlockXp(BlockState blockState) { - int xp = mcMMO.getDynamicSettingsManager().getExperienceMapManager().getMiningXp(blockState.getType()); + int xp = mcMMO.getDynamicSettingsManager().getExperienceManager().getMiningXp(blockState.getType()); return xp; } 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 3929cde39..240e18d07 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java @@ -106,7 +106,7 @@ public class TamingManager extends SkillManager { * @param entity The LivingEntity to award XP for */ public void awardTamingXP(LivingEntity entity) { - applyXpGain(mcMMO.getDynamicSettingsManager().getExperienceMapManager().getTamingXp(entity.getType()), XPGainReason.PVE); + applyXpGain(mcMMO.getDynamicSettingsManager().getExperienceManager().getTamingXp(entity.getType()), XPGainReason.PVE); } /** diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java index d63f41e74..46054fa3c 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java @@ -43,7 +43,7 @@ public final class Woodcutting { return mcMMO.getModManager().getBlock(blockState).getXpGain(); }*/ - return mcMMO.getDynamicSettingsManager().getExperienceMapManager().getWoodcuttingXp(blockState.getType()); + return mcMMO.getDynamicSettingsManager().getExperienceManager().getWoodcuttingXp(blockState.getType()); } /** diff --git a/src/main/java/com/gmail/nossr50/util/BlockUtils.java b/src/main/java/com/gmail/nossr50/util/BlockUtils.java index 0e664ac95..519a0dc74 100644 --- a/src/main/java/com/gmail/nossr50/util/BlockUtils.java +++ b/src/main/java/com/gmail/nossr50/util/BlockUtils.java @@ -129,7 +129,7 @@ public final class BlockUtils { * @return true if the block should affected by Green Terra, false otherwise */ public static boolean affectedByGreenTerra(BlockState blockState) { - return mcMMO.getDynamicSettingsManager().getExperienceMapManager().hasHerbalismXp(blockState.getType()); + return mcMMO.getDynamicSettingsManager().getExperienceManager().hasHerbalismXp(blockState.getType()); } /** @@ -139,7 +139,7 @@ public final class BlockUtils { * @return true if the block should affected by Green Terra, false otherwise */ public static boolean affectedByGreenTerra(Material material) { - return mcMMO.getDynamicSettingsManager().getExperienceMapManager().hasHerbalismXp(material); + return mcMMO.getDynamicSettingsManager().getExperienceManager().hasHerbalismXp(material); } /** @@ -150,7 +150,7 @@ public final class BlockUtils { * otherwise */ public static Boolean affectedBySuperBreaker(BlockState blockState) { - if (mcMMO.getDynamicSettingsManager().getExperienceMapManager().hasMiningXp(blockState.getType())) + if (mcMMO.getDynamicSettingsManager().getExperienceManager().hasMiningXp(blockState.getType())) return true; return isMineable(blockState); @@ -164,7 +164,7 @@ public final class BlockUtils { * otherwise */ public static Boolean affectedBySuperBreaker(Material material) { - if (mcMMO.getDynamicSettingsManager().getExperienceMapManager().hasMiningXp(material)) + if (mcMMO.getDynamicSettingsManager().getExperienceManager().hasMiningXp(material)) return true; return isMineable(material); @@ -215,7 +215,7 @@ public final class BlockUtils { * otherwise */ public static boolean affectedByGigaDrillBreaker(Material material) { - if (mcMMO.getDynamicSettingsManager().getExperienceMapManager().hasExcavationXp(material)) + if (mcMMO.getDynamicSettingsManager().getExperienceManager().hasExcavationXp(material)) return true; return isDiggable(material); @@ -229,7 +229,7 @@ public final class BlockUtils { * otherwise */ public static boolean affectedByGigaDrillBreaker(BlockState blockState) { - if (mcMMO.getDynamicSettingsManager().getExperienceMapManager().hasExcavationXp(blockState.getType())) + if (mcMMO.getDynamicSettingsManager().getExperienceManager().hasExcavationXp(blockState.getType())) return true; return isDiggable(blockState); @@ -281,7 +281,7 @@ public final class BlockUtils { * @return true if the block is a log, false otherwise */ public static boolean isLog(BlockState blockState) { - if (mcMMO.getDynamicSettingsManager().getExperienceMapManager().hasWoodcuttingXp(blockState.getType())) + if (mcMMO.getDynamicSettingsManager().getExperienceManager().hasWoodcuttingXp(blockState.getType())) return true; return isLoggingRelated(blockState); @@ -295,7 +295,7 @@ public final class BlockUtils { * @return true if the block is a log, false otherwise */ public static boolean isLog(Material material) { - if (mcMMO.getDynamicSettingsManager().getExperienceMapManager().hasWoodcuttingXp(material)) + if (mcMMO.getDynamicSettingsManager().getExperienceManager().hasWoodcuttingXp(material)) return true; return isLoggingRelated(material); diff --git a/src/main/java/com/gmail/nossr50/util/experience/ExperienceMapManager.java b/src/main/java/com/gmail/nossr50/util/experience/ExperienceManager.java similarity index 93% rename from src/main/java/com/gmail/nossr50/util/experience/ExperienceMapManager.java rename to src/main/java/com/gmail/nossr50/util/experience/ExperienceManager.java index 99735fe99..0edbc5cb7 100644 --- a/src/main/java/com/gmail/nossr50/util/experience/ExperienceMapManager.java +++ b/src/main/java/com/gmail/nossr50/util/experience/ExperienceManager.java @@ -10,9 +10,9 @@ import org.bukkit.entity.EntityType; import java.util.HashMap; /** - * This class handles the XP for block break related XP + * This class handles the XP maps for various skills */ -public class ExperienceMapManager { +public class ExperienceManager { private HashMap> skillMaterialXPMap; private HashMap miningFullyQualifiedBlockXpMap; private HashMap herbalismFullyQualifiedBlockXpMap; @@ -24,7 +24,7 @@ public class ExperienceMapManager { private double globalXpMult; - public ExperienceMapManager() { + public ExperienceManager() { initExperienceMaps(); registerDefaultValues(); @@ -167,28 +167,47 @@ public class ExperienceMapManager { globalXpMult = newGlobalXpMult; } + /** + * Reset the Global XP multiplier to its original value + */ public void resetGlobalXpMult() { mcMMO.p.getLogger().info("Resetting the global XP multiplier " + globalXpMult + " -> " + getOriginalGlobalXpMult()); globalXpMult = getOriginalGlobalXpMult(); } + /** + * Set the mining block XP map to the provided one + * @param miningFullyQualifiedBlockXpMap the XP map to change to + */ public void setMiningFullyQualifiedBlockXpMap(HashMap miningFullyQualifiedBlockXpMap) { - mcMMO.p.getLogger().info("Registering Mining XP Values..."); + mcMMO.p.getLogger().info("Changing Mining XP Values..."); this.miningFullyQualifiedBlockXpMap = miningFullyQualifiedBlockXpMap; } + /** + * Set the mining block XP map to the provided one + * @param herbalismFullyQualifiedBlockXpMap the XP map to change to + */ public void setHerbalismFullyQualifiedBlockXpMap(HashMap herbalismFullyQualifiedBlockXpMap) { - mcMMO.p.getLogger().info("Registering Herbalism XP Values..."); + mcMMO.p.getLogger().info("Changing Herbalism XP Values..."); this.herbalismFullyQualifiedBlockXpMap = herbalismFullyQualifiedBlockXpMap; } + /** + * Set the mining block XP map to the provided one + * @param woodcuttingFullyQualifiedBlockXpMap the XP map to change to + */ public void setWoodcuttingFullyQualifiedBlockXpMap(HashMap woodcuttingFullyQualifiedBlockXpMap) { - mcMMO.p.getLogger().info("Registering Woodcutting XP Values..."); + mcMMO.p.getLogger().info("Changin Woodcutting XP Values..."); this.woodcuttingFullyQualifiedBlockXpMap = woodcuttingFullyQualifiedBlockXpMap; } + /** + * Set the mining block XP map to the provided one + * @param excavationFullyQualifiedBlockXpMap the XP map to change to + */ public void setExcavationFullyQualifiedBlockXpMap(HashMap excavationFullyQualifiedBlockXpMap) { - mcMMO.p.getLogger().info("Registering Excavation XP Values..."); + mcMMO.p.getLogger().info("Changing Excavation XP Values..."); this.excavationFullyQualifiedBlockXpMap = excavationFullyQualifiedBlockXpMap; } 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 44e26eaf4..ab7b128f0 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.util.skills; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.MetadataConstants; import com.gmail.nossr50.datatypes.experience.SpecialXPKey; import com.gmail.nossr50.datatypes.experience.XPGainReason; @@ -553,21 +552,21 @@ public final class CombatUtils { }*/ //else if (target instanceof Animals) { if (target instanceof Animals) { - baseXPMultiplier = mcMMO.getDynamicSettingsManager().getExperienceMapManager().getSpecialCombatXP(SpecialXPKey.ANIMALS); + baseXPMultiplier = mcMMO.getDynamicSettingsManager().getExperienceManager().getSpecialCombatXP(SpecialXPKey.ANIMALS); } else if (target instanceof Monster) { EntityType type = target.getType(); - baseXPMultiplier = mcMMO.getDynamicSettingsManager().getExperienceMapManager().getCombatXPMultiplier(type); + baseXPMultiplier = mcMMO.getDynamicSettingsManager().getExperienceManager().getCombatXPMultiplier(type); } else { EntityType type = target.getType(); - if (mcMMO.getDynamicSettingsManager().getExperienceMapManager().hasCombatXP(type)) { + if (mcMMO.getDynamicSettingsManager().getExperienceManager().hasCombatXP(type)) { //Exploit stuff if (type == EntityType.IRON_GOLEM) { if (!((IronGolem) target).isPlayerCreated()) { - baseXPMultiplier = mcMMO.getDynamicSettingsManager().getExperienceMapManager().getCombatXPMultiplier(type); + baseXPMultiplier = mcMMO.getDynamicSettingsManager().getExperienceManager().getCombatXPMultiplier(type); } } else { - baseXPMultiplier = mcMMO.getDynamicSettingsManager().getExperienceMapManager().getCombatXPMultiplier(type); + baseXPMultiplier = mcMMO.getDynamicSettingsManager().getExperienceManager().getCombatXPMultiplier(type); } } else { baseXPMultiplier = 1.0f;