Gloabl XP multiplier is now tracked by the ExperienceMapManager

Added method to grab original value to ExperienceMapManager
Moved skill xp values/mults into their own section
This commit is contained in:
nossr50
2019-04-29 21:59:01 -07:00
parent 7f64fe11b8
commit d0259d73c5
10 changed files with 334 additions and 115 deletions

View File

@@ -10,10 +10,11 @@ import java.util.HashMap;
* This class handles the XP for block break related XP
*/
public class ExperienceMapManager implements Unload {
public HashMap<Material, Integer> miningXpMap;
public HashMap<Material, Integer> herbalismXpMap;
public HashMap<Material, Integer> woodcuttingXpMap;
public HashMap<Material, Integer> excavationXpMap;
private HashMap<Material, Integer> miningXpMap;
private HashMap<Material, Integer> herbalismXpMap;
private HashMap<Material, Integer> woodcuttingXpMap;
private HashMap<Material, Integer> excavationXpMap;
private double globalXpMult;
public ExperienceMapManager() {
miningXpMap = new HashMap<>();
@@ -25,6 +26,33 @@ public class ExperienceMapManager implements Unload {
mcMMO.getConfigManager().registerUnloadable(this);
}
/**
* Change the gloabl xp multiplier, this is temporary and will not be serialiized
* @param newValue new global xp multiplier value
*/
public void setGlobalXpMult(double newValue) {
globalXpMult = newValue;
}
/**
* Gets the current global xp multiplier value
* This value can be changed by the xprate command
* @return
*/
public double getGlobalXpMult() {
return globalXpMult;
}
/**
* Gets the original value of the global XP multiplier
* This is defined by the users config
* This value can be different from the current working value (due to xprate etc)
* @return the original global xp multiplier value from the user config file
*/
public double getOriginalGlobalXpMult() {
return mcMMO.getConfigManager().getConfigExperience().getGlobalXPMultiplier();
}
/**
* Determines whether or not a block has Mining XP
*