diff --git a/src/main/java/com/gmail/nossr50/config/ConfigManager.java b/src/main/java/com/gmail/nossr50/config/ConfigManager.java index b8dc6ef8b..1448ecb3a 100644 --- a/src/main/java/com/gmail/nossr50/config/ConfigManager.java +++ b/src/main/java/com/gmail/nossr50/config/ConfigManager.java @@ -307,12 +307,10 @@ public final class ConfigManager { customSerializers = TypeSerializers.getDefaultSerializers().newChild(); mcMMO.p.getLogger().info("Registering custom type serializers for Configurate..."); - customSerializers.registerType(new TypeToken() { - }, new CustomEnumValueSerializer()); - customSerializers.registerType(new TypeToken() { - }, new CustomEnumValueSerializer()); - customSerializers.registerType(new TypeToken() { - }, new CustomEnumValueSerializer()); + customSerializers.registerType(new TypeToken() {}, new CustomEnumValueSerializer()); + customSerializers.registerType(new TypeToken() {}, new CustomEnumValueSerializer()); + customSerializers.registerType(new TypeToken() {}, new CustomEnumValueSerializer()); + customSerializers.registerType(new TypeToken() {}, new CustomEnumValueSerializer()); customSerializers.registerType(TypeToken.of(Repairable.class), new RepairableSerializer()); customSerializers.registerType(TypeToken.of(Salvageable.class), new SalvageableSerializer()); customSerializers.registerType(TypeToken.of(MinecraftMaterialWrapper.class), new MinecraftMaterialWrapperSerializer()); 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 e1cd047ef..aa8af7f63 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 @@ -15,6 +15,9 @@ public class ConfigExperience { "\nDefault value: " + GLOBAL_XP_MULT_DEFAULT) private double globalXPMultiplier = GLOBAL_XP_MULT_DEFAULT; + @Setting(value = "Global-Skill-XP-Multipliers", comment = "This multiplier is applied at the very end of an XP calculation specific to its corresponding skill, this value is applied before the global multiplier is applied.") + private ConfigExperienceSkillMultiplier configExperienceSkillMultiplier = new ConfigExperienceSkillMultiplier(); + @Setting(value = "Skill-XP-Settings", comment = "XP values and multipliers for each skill") private ConfigExperienceSkills configExperienceSkills = new ConfigExperienceSkills(); @@ -22,6 +25,10 @@ public class ConfigExperience { * BOILER PLATE GETTERS */ + public ConfigExperienceSkillMultiplier getConfigExperienceSkillMultiplier() { + return configExperienceSkillMultiplier; + } + public ConfigExperienceAcrobatics getExperienceAcrobatics() { return getConfigExperienceSkills().getExperienceAcrobatics(); } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperienceSkillMultiplier.java b/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperienceSkillMultiplier.java new file mode 100644 index 000000000..d80fe944e --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/experience/ConfigExperienceSkillMultiplier.java @@ -0,0 +1,31 @@ +package com.gmail.nossr50.config.hocon.experience; + +import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +import java.util.HashMap; + +@ConfigSerializable +public class ConfigExperienceSkillMultiplier { + + private static final HashMap SKILL_GLOBAL_MULT_DEFAULT; + + static { + SKILL_GLOBAL_MULT_DEFAULT = new HashMap<>(); + for(PrimarySkillType primarySkillType : PrimarySkillType.values()) + { + if(primarySkillType.isChildSkill()) + continue; + + SKILL_GLOBAL_MULT_DEFAULT.put(primarySkillType,1.0D); + } + } + + @Setting(value = "Skill-XP-Multipliers") + private HashMap perSkillGlobalMultiplier = SKILL_GLOBAL_MULT_DEFAULT; + + public double getSkillGlobalMultiplier(PrimarySkillType primarySkillType) { + return perSkillGlobalMultiplier.get(primarySkillType); + } +}