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

@ -74,7 +74,7 @@ public final class ConfigManager {
/* UNLOAD REGISTER */
SkillPropertiesManager skillPropertiesManager;
private SkillPropertiesManager skillPropertiesManager;
private ArrayList<Unload> unloadables;
/* COLLECTION MANAGERS */

View File

@ -8,199 +8,181 @@ import java.util.HashMap;
@ConfigSerializable
public class ConfigExperience {
@Setting(value = "Acrobatics", comment = "XP Settings for Acrobatics")
private ConfigExperienceAcrobatics experienceAcrobatics = new ConfigExperienceAcrobatics();
private static final double GLOBAL_XP_MULT_DEFAULT = 1.0D;
@Setting(value = "Alchemy", comment = "XP Settings for Alchemy")
private ConfigExperienceAlchemy experienceAlchemy = new ConfigExperienceAlchemy();
@Setting(value = "Global-XP-Multiplier", comment = "This multiplier is applied at the very end of every XP gain, you can use it as a shortcut to increase or decrease xp gains across the entire plugin" +
"\nThis value is temporarily overridden by xprate events." +
"\nDefault value: " + GLOBAL_XP_MULT_DEFAULT)
private double globalXPMultiplier = GLOBAL_XP_MULT_DEFAULT;
@Setting(value = "Archery", comment = "XP Settings for Archery")
private ConfigExperienceArchery experienceArchery = new ConfigExperienceArchery();
@Setting(value = "Fishing", comment = "XP Settings for Fishing")
private ConfigExperienceFishing experienceFishing = new ConfigExperienceFishing();
@Setting(value = "Excavation", comment = "XP Settings for Excavation")
private ConfigExperienceExcavation experienceExcavation = new ConfigExperienceExcavation();
@Setting(value = "Woodcutting", comment = "XP Settings for Woodcutting")
private ConfigExperienceWoodcutting experienceWoodcutting = new ConfigExperienceWoodcutting();
@Setting(value = "Herbalism", comment = "XP Settings for Herbalism")
private ConfigExperienceHerbalism experienceHerbalism = new ConfigExperienceHerbalism();
@Setting(value = "Mining", comment = "XP Settings for Mining")
private ConfigExperienceMining experienceMining = new ConfigExperienceMining();
@Setting(value = "Repair", comment = "XP Settings for Repair")
private ConfigExperienceRepair experienceRepair = new ConfigExperienceRepair();
@Setting(value = "Smelting", comment = "XP Settings for Smelting")
private ConfigExperienceSmelting experienceSmelting = new ConfigExperienceSmelting();
@Setting(value = "Taming", comment = "XP Settings for Taming")
private ConfigExperienceTaming experienceTaming = new ConfigExperienceTaming();
@Setting(value = "Z-Combat", comment = "XP Settings for Combat")
private ConfigExperienceCombat experienceCombat = new ConfigExperienceCombat();
@Setting(value = "Skill-XP-Settings", comment = "XP values and multipliers for each skill")
private ConfigExperienceSkills configExperienceSkills = new ConfigExperienceSkills();
/*
* BOILER PLATE GETTERS
*/
public ConfigExperienceAcrobatics getExperienceAcrobatics() {
return experienceAcrobatics;
return getConfigExperienceSkills().getExperienceAcrobatics();
}
public ConfigExperienceAlchemy getExperienceAlchemy() {
return experienceAlchemy;
return getConfigExperienceSkills().getExperienceAlchemy();
}
public ConfigExperienceArchery getExperienceArchery() {
return experienceArchery;
return getConfigExperienceSkills().getExperienceArchery();
}
public ConfigExperienceFishing getExperienceFishing() {
return experienceFishing;
return getConfigExperienceSkills().getExperienceFishing();
}
public ConfigExperienceExcavation getExperienceExcavation() {
return experienceExcavation;
return getConfigExperienceSkills().getExperienceExcavation();
}
public ConfigExperienceWoodcutting getExperienceWoodcutting() {
return experienceWoodcutting;
return getConfigExperienceSkills().getExperienceWoodcutting();
}
public ConfigExperienceHerbalism getExperienceHerbalism() {
return experienceHerbalism;
return getConfigExperienceSkills().getExperienceHerbalism();
}
public ConfigExperienceMining getExperienceMining() {
return experienceMining;
return getConfigExperienceSkills().getExperienceMining();
}
public ConfigExperienceRepair getExperienceRepair() {
return experienceRepair;
return getConfigExperienceSkills().getExperienceRepair();
}
public ConfigExperienceSmelting getExperienceSmelting() {
return experienceSmelting;
return getConfigExperienceSkills().getExperienceSmelting();
}
public ConfigExperienceTaming getExperienceTaming() {
return experienceTaming;
return getConfigExperienceSkills().getExperienceTaming();
}
public ConfigExperienceCombat getExperienceCombat() {
return experienceCombat;
return getConfigExperienceSkills().getExperienceCombat();
}
public HashMap<String, Integer> getTamingExperienceMap() {
return experienceTaming.getTamingExperienceMap();
return getConfigExperienceSkills().getTamingExperienceMap();
}
public HashMap<String, Integer> getMiningExperienceMap() {
return experienceMining.getMiningExperienceMap();
return getConfigExperienceSkills().getMiningExperienceMap();
}
public HashMap<String, Integer> getSmeltingExperienceMap() {
return experienceSmelting.getSmeltingExperienceMap();
return getConfigExperienceSkills().getSmeltingExperienceMap();
}
public HashMap<String, Double> getItemMaterialXPMultiplier() {
return experienceRepair.getItemMaterialXPMultiplier();
return getConfigExperienceSkills().getItemMaterialXPMultiplier();
}
public double getRepairXPBase() {
return experienceRepair.getRepairXPBase();
return getConfigExperienceSkills().getRepairXPBase();
}
public HashMap<String, Integer> getAcrobaticsXPMap() {
return experienceAcrobatics.getAcrobaticsXPMap();
return getConfigExperienceSkills().getAcrobaticsXPMap();
}
public Double getFeatherFallMultiplier() {
return experienceAcrobatics.getFeatherFallMultiplier();
return getConfigExperienceSkills().getFeatherFallMultiplier();
}
public HashMap<String, Integer> getAlchemyXPMap() {
return experienceAlchemy.getAlchemyXPMap();
return getConfigExperienceSkills().getAlchemyXPMap();
}
public int getDodgeXP() {
return experienceAcrobatics.getDodgeXP();
return getConfigExperienceSkills().getDodgeXP();
}
public int getRollXP() {
return experienceAcrobatics.getRollXP();
return getConfigExperienceSkills().getRollXP();
}
public int getFallXP() {
return experienceAcrobatics.getFallXP();
return getConfigExperienceSkills().getFallXP();
}
public int getStageOnePotionXP() {
return experienceAlchemy.getStageOnePotionXP();
return getConfigExperienceSkills().getStageOnePotionXP();
}
public int getStageTwoPotionXP() {
return experienceAlchemy.getStageTwoPotionXP();
return getConfigExperienceSkills().getStageTwoPotionXP();
}
public int getStageThreePotionXP() {
return experienceAlchemy.getStageThreePotionXP();
return getConfigExperienceSkills().getStageThreePotionXP();
}
public int getStageFourPotionXP() {
return experienceAlchemy.getStageFourPotionXP();
return getConfigExperienceSkills().getStageFourPotionXP();
}
public int getPotionXPByStage(int potionStage) {
return experienceAlchemy.getPotionXPByStage(potionStage);
return getConfigExperienceSkills().getPotionXPByStage(potionStage);
}
public boolean isPvpXPEnabled() {
return experienceCombat.isPvpXPEnabled();
return getConfigExperienceSkills().isPvpXPEnabled();
}
public HashMap<String, Double> getCombatExperienceMap() {
return experienceCombat.getCombatExperienceMap();
return getConfigExperienceSkills().getCombatExperienceMap();
}
public double getDistanceMultiplier() {
return experienceArchery.getDistanceMultiplier();
return getConfigExperienceSkills().getDistanceMultiplier();
}
public HashMap<String, Integer> getHerbalismXPMap() {
return experienceHerbalism.getHerbalismXPMap();
return getConfigExperienceSkills().getHerbalismXPMap();
}
public HashMap<String, Integer> getWoodcuttingExperienceMap() {
return experienceWoodcutting.getWoodcuttingExperienceMap();
return getConfigExperienceSkills().getWoodcuttingExperienceMap();
}
public HashMap<String, Integer> getExcavationExperienceMap() {
return experienceExcavation.getExcavationExperienceMap();
return getConfigExperienceSkills().getExcavationExperienceMap();
}
public HashMap<String, Integer> getFishingXPMap() {
return experienceFishing.getFishingXPMap();
return getConfigExperienceSkills().getFishingXPMap();
}
public int getShakeXP() {
return experienceFishing.getShakeXP();
return getConfigExperienceSkills().getShakeXP();
}
public double getMobSpawnerXPMult() {
return experienceCombat.getMobSpawnerXPMult();
public double getSpawnedMobXPMult() {
return getConfigExperienceSkills().getSpawnedMobXPMult();
}
public double getPVPXPMult() {
return experienceCombat.getPVPXPMult();
return getConfigExperienceSkills().getPVPXPMult();
}
public double getAnimalsXPMult() {
return experienceCombat.getAnimalsXPMult();
return getConfigExperienceSkills().getAnimalsXPMult();
}
public ConfigExperienceSkills getConfigExperienceSkills() {
return configExperienceSkills;
}
public double getGlobalXPMultiplier() {
return globalXPMultiplier;
}
}

View File

@ -77,8 +77,9 @@ public class ConfigExperienceCombat {
//SPECIAL
SPECIAL_COMBAT_EXPERIENCE_DEFAULT = new HashMap<>();
SPECIAL_COMBAT_EXPERIENCE_DEFAULT.put("animals", 1.0D); //TODO: this seems like a dumb config option
SPECIAL_COMBAT_EXPERIENCE_DEFAULT.put("mobspawners", 0.0D);
SPECIAL_COMBAT_EXPERIENCE_DEFAULT.put("spawned", 0.0D);
SPECIAL_COMBAT_EXPERIENCE_DEFAULT.put("pvp", 1.0D);
SPECIAL_COMBAT_EXPERIENCE_DEFAULT.put("player-bred-mobs", 1.0D);
}
@Setting(value = "Combat-XP-Multipliers")
@ -100,7 +101,7 @@ public class ConfigExperienceCombat {
return combatExperienceMap;
}
public double getMobSpawnerXPMult() {
public double getSpawnedMobXPMult() {
return specialCombatExperienceMap.get("mobspawners");
}

View File

@ -0,0 +1,205 @@
package com.gmail.nossr50.config.hocon.experience;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
import java.util.HashMap;
@ConfigSerializable
public class ConfigExperienceSkills {
@Setting(value = "Acrobatics", comment = "XP Settings for Acrobatics")
private ConfigExperienceAcrobatics experienceAcrobatics = new ConfigExperienceAcrobatics();
@Setting(value = "Alchemy", comment = "XP Settings for Alchemy")
private ConfigExperienceAlchemy experienceAlchemy = new ConfigExperienceAlchemy();
@Setting(value = "Archery", comment = "XP Settings for Archery")
private ConfigExperienceArchery experienceArchery = new ConfigExperienceArchery();
@Setting(value = "Fishing", comment = "XP Settings for Fishing")
private ConfigExperienceFishing experienceFishing = new ConfigExperienceFishing();
@Setting(value = "Excavation", comment = "XP Settings for Excavation")
private ConfigExperienceExcavation experienceExcavation = new ConfigExperienceExcavation();
@Setting(value = "Woodcutting", comment = "XP Settings for Woodcutting")
private ConfigExperienceWoodcutting experienceWoodcutting = new ConfigExperienceWoodcutting();
@Setting(value = "Herbalism", comment = "XP Settings for Herbalism")
private ConfigExperienceHerbalism experienceHerbalism = new ConfigExperienceHerbalism();
@Setting(value = "Mining", comment = "XP Settings for Mining")
private ConfigExperienceMining experienceMining = new ConfigExperienceMining();
@Setting(value = "Repair", comment = "XP Settings for Repair")
private ConfigExperienceRepair experienceRepair = new ConfigExperienceRepair();
@Setting(value = "Smelting", comment = "XP Settings for Smelting")
private ConfigExperienceSmelting experienceSmelting = new ConfigExperienceSmelting();
@Setting(value = "Taming", comment = "XP Settings for Taming")
private ConfigExperienceTaming experienceTaming = new ConfigExperienceTaming();
@Setting(value = "Z-Combat", comment = "XP Settings for Combat")
private ConfigExperienceCombat experienceCombat = new ConfigExperienceCombat();
/*
* BOILER PLATE GETTERS
*/
public ConfigExperienceAcrobatics getExperienceAcrobatics() {
return experienceAcrobatics;
}
public ConfigExperienceAlchemy getExperienceAlchemy() {
return experienceAlchemy;
}
public ConfigExperienceArchery getExperienceArchery() {
return experienceArchery;
}
public ConfigExperienceFishing getExperienceFishing() {
return experienceFishing;
}
public ConfigExperienceExcavation getExperienceExcavation() {
return experienceExcavation;
}
public ConfigExperienceWoodcutting getExperienceWoodcutting() {
return experienceWoodcutting;
}
public ConfigExperienceHerbalism getExperienceHerbalism() {
return experienceHerbalism;
}
public ConfigExperienceMining getExperienceMining() {
return experienceMining;
}
public ConfigExperienceRepair getExperienceRepair() {
return experienceRepair;
}
public ConfigExperienceSmelting getExperienceSmelting() {
return experienceSmelting;
}
public ConfigExperienceTaming getExperienceTaming() {
return experienceTaming;
}
public ConfigExperienceCombat getExperienceCombat() {
return experienceCombat;
}
public HashMap<String, Integer> getTamingExperienceMap() {
return experienceTaming.getTamingExperienceMap();
}
public HashMap<String, Integer> getMiningExperienceMap() {
return experienceMining.getMiningExperienceMap();
}
public HashMap<String, Integer> getSmeltingExperienceMap() {
return experienceSmelting.getSmeltingExperienceMap();
}
public HashMap<String, Double> getItemMaterialXPMultiplier() {
return experienceRepair.getItemMaterialXPMultiplier();
}
public double getRepairXPBase() {
return experienceRepair.getRepairXPBase();
}
public HashMap<String, Integer> getAcrobaticsXPMap() {
return experienceAcrobatics.getAcrobaticsXPMap();
}
public Double getFeatherFallMultiplier() {
return experienceAcrobatics.getFeatherFallMultiplier();
}
public HashMap<String, Integer> getAlchemyXPMap() {
return experienceAlchemy.getAlchemyXPMap();
}
public int getDodgeXP() {
return experienceAcrobatics.getDodgeXP();
}
public int getRollXP() {
return experienceAcrobatics.getRollXP();
}
public int getFallXP() {
return experienceAcrobatics.getFallXP();
}
public int getStageOnePotionXP() {
return experienceAlchemy.getStageOnePotionXP();
}
public int getStageTwoPotionXP() {
return experienceAlchemy.getStageTwoPotionXP();
}
public int getStageThreePotionXP() {
return experienceAlchemy.getStageThreePotionXP();
}
public int getStageFourPotionXP() {
return experienceAlchemy.getStageFourPotionXP();
}
public int getPotionXPByStage(int potionStage) {
return experienceAlchemy.getPotionXPByStage(potionStage);
}
public boolean isPvpXPEnabled() {
return experienceCombat.isPvpXPEnabled();
}
public HashMap<String, Double> getCombatExperienceMap() {
return experienceCombat.getCombatExperienceMap();
}
public double getDistanceMultiplier() {
return experienceArchery.getDistanceMultiplier();
}
public HashMap<String, Integer> getHerbalismXPMap() {
return experienceHerbalism.getHerbalismXPMap();
}
public HashMap<String, Integer> getWoodcuttingExperienceMap() {
return experienceWoodcutting.getWoodcuttingExperienceMap();
}
public HashMap<String, Integer> getExcavationExperienceMap() {
return experienceExcavation.getExcavationExperienceMap();
}
public HashMap<String, Integer> getFishingXPMap() {
return experienceFishing.getFishingXPMap();
}
public int getShakeXP() {
return experienceFishing.getShakeXP();
}
public double getSpawnedMobXPMult() {
return experienceCombat.getSpawnedMobXPMult();
}
public double getPVPXPMult() {
return experienceCombat.getPVPXPMult();
}
public double getAnimalsXPMult() {
return experienceCombat.getAnimalsXPMult();
}
}

View File

@ -4,6 +4,7 @@ public class ActionBarNotificationSetting {
public boolean enabled;
public boolean sendCopyOfMessageToChat;
public ActionBarNotificationSetting(boolean enabled, boolean sendCopyOfMessageToChat) {
this.enabled = enabled;
this.sendCopyOfMessageToChat = sendCopyOfMessageToChat;

View File

@ -21,7 +21,9 @@ public class ConfigExperienceFormula {
"\nEXPONENTIAL Formula: multiplier * level ^ exponent + base")
private ConfigExperienceFormulaExponential configExperienceFormulaExponential = new ConfigExperienceFormulaExponential();
@Setting(value = "Use-Cumulative-XP-Curve", comment = "")
@Setting(value = "Use-Cumulative-XP-Curve", comment = "Replaces the value for level used in the XP formulas with a players power level." +
"\nEffectively this makes it much harder to level, especially on exponential curve." +
"\nDefault value: " + CUMULATIVE_CURVE_DEFAULT)
private boolean cumulativeCurveEnabled = CUMULATIVE_CURVE_DEFAULT;
public FormulaType getFormulaType() {

View File

@ -98,35 +98,35 @@ public class ConfigLeveling {
public int getLevelCap(PrimarySkillType primarySkillType) {
switch (primarySkillType) {
case ACROBATICS:
return configSectionLevelCaps.getConfigSectionSkills().getAcrobatics().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getAcrobatics().getLevelCap();
case ALCHEMY:
return configSectionLevelCaps.getConfigSectionSkills().getAlchemy().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getAlchemy().getLevelCap();
case ARCHERY:
return configSectionLevelCaps.getConfigSectionSkills().getArchery().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getArchery().getLevelCap();
case AXES:
return configSectionLevelCaps.getConfigSectionSkills().getAxes().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getAxes().getLevelCap();
case EXCAVATION:
return configSectionLevelCaps.getConfigSectionSkills().getExcavation().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getExcavation().getLevelCap();
case FISHING:
return configSectionLevelCaps.getConfigSectionSkills().getFishing().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getFishing().getLevelCap();
case HERBALISM:
return configSectionLevelCaps.getConfigSectionSkills().getHerbalism().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getHerbalism().getLevelCap();
case MINING:
return configSectionLevelCaps.getConfigSectionSkills().getMining().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getMining().getLevelCap();
case REPAIR:
return configSectionLevelCaps.getConfigSectionSkills().getRepair().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getRepair().getLevelCap();
case SWORDS:
return configSectionLevelCaps.getConfigSectionSkills().getSwords().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getSwords().getLevelCap();
case TAMING:
return configSectionLevelCaps.getConfigSectionSkills().getTaming().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getTaming().getLevelCap();
case UNARMED:
return configSectionLevelCaps.getConfigSectionSkills().getUnarmed().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getUnarmed().getLevelCap();
case WOODCUTTING:
return configSectionLevelCaps.getConfigSectionSkills().getWoodcutting().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getWoodcutting().getLevelCap();
case SMELTING:
return configSectionLevelCaps.getConfigSectionSkills().getSmelting().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getSmelting().getLevelCap();
case SALVAGE:
return configSectionLevelCaps.getConfigSectionSkills().getSalvage().getLevelCap();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getSalvage().getLevelCap();
default:
return Integer.MAX_VALUE;
}
@ -135,35 +135,35 @@ public class ConfigLeveling {
public boolean isLevelCapEnabled(PrimarySkillType primarySkillType) {
switch (primarySkillType) {
case ACROBATICS:
return configSectionLevelCaps.getConfigSectionSkills().getAcrobatics().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getAcrobatics().isLevelCapEnabled();
case ALCHEMY:
return configSectionLevelCaps.getConfigSectionSkills().getAlchemy().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getAlchemy().isLevelCapEnabled();
case ARCHERY:
return configSectionLevelCaps.getConfigSectionSkills().getArchery().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getArchery().isLevelCapEnabled();
case AXES:
return configSectionLevelCaps.getConfigSectionSkills().getAxes().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getAxes().isLevelCapEnabled();
case EXCAVATION:
return configSectionLevelCaps.getConfigSectionSkills().getExcavation().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getExcavation().isLevelCapEnabled();
case FISHING:
return configSectionLevelCaps.getConfigSectionSkills().getFishing().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getFishing().isLevelCapEnabled();
case HERBALISM:
return configSectionLevelCaps.getConfigSectionSkills().getHerbalism().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getHerbalism().isLevelCapEnabled();
case MINING:
return configSectionLevelCaps.getConfigSectionSkills().getMining().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getMining().isLevelCapEnabled();
case REPAIR:
return configSectionLevelCaps.getConfigSectionSkills().getRepair().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getRepair().isLevelCapEnabled();
case SWORDS:
return configSectionLevelCaps.getConfigSectionSkills().getSwords().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getSwords().isLevelCapEnabled();
case TAMING:
return configSectionLevelCaps.getConfigSectionSkills().getTaming().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getTaming().isLevelCapEnabled();
case UNARMED:
return configSectionLevelCaps.getConfigSectionSkills().getUnarmed().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getUnarmed().isLevelCapEnabled();
case WOODCUTTING:
return configSectionLevelCaps.getConfigSectionSkills().getWoodcutting().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getWoodcutting().isLevelCapEnabled();
case SMELTING:
return configSectionLevelCaps.getConfigSectionSkills().getSmelting().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getSmelting().isLevelCapEnabled();
case SALVAGE:
return configSectionLevelCaps.getConfigSectionSkills().getSalvage().isLevelCapEnabled();
return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getSalvage().isLevelCapEnabled();
default:
return false;
}

View File

@ -23,7 +23,7 @@ public class ConfigSectionLevelCaps {
private ConfigSectionSkillLevelCap powerLevel = new ConfigSectionSkillLevelCap();
@Setting(value = "Skills", comment = "Per Skill cap settings")
private ConfigSectionSkills configSectionSkills = new ConfigSectionSkills();
private ConfigSectionSkillLevelCaps configSectionSkillLevelCaps = new ConfigSectionSkillLevelCaps();
/*
* GETTER BOILERPLATE
@ -37,7 +37,7 @@ public class ConfigSectionLevelCaps {
return truncateSkillsAboveCap;
}
public ConfigSectionSkills getConfigSectionSkills() {
return configSectionSkills;
public ConfigSectionSkillLevelCaps getConfigSectionSkillLevelCaps() {
return configSectionSkillLevelCaps;
}
}

View File

@ -4,7 +4,7 @@ import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ConfigSectionSkills {
public class ConfigSectionSkillLevelCaps {
/*
* CONFIG NODES

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
*