Experience configs are now fully converted

This commit is contained in:
nossr50 2019-05-13 05:32:49 -07:00
parent ab4b4edb1a
commit d3a719eb8d
7 changed files with 0 additions and 133 deletions

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.config; package com.gmail.nossr50.config;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.config.hocon.*; import com.gmail.nossr50.config.hocon.*;
import com.gmail.nossr50.config.hocon.admin.ConfigAdmin; import com.gmail.nossr50.config.hocon.admin.ConfigAdmin;
import com.gmail.nossr50.config.hocon.antiexploit.ConfigExploitPrevention; import com.gmail.nossr50.config.hocon.antiexploit.ConfigExploitPrevention;
@ -123,7 +122,6 @@ public final class ConfigManager {
private FishingTreasureConfig fishingTreasureConfig; private FishingTreasureConfig fishingTreasureConfig;
private ExcavationTreasureConfig excavationTreasureConfig; private ExcavationTreasureConfig excavationTreasureConfig;
private HerbalismTreasureConfig herbalismTreasureConfig; private HerbalismTreasureConfig herbalismTreasureConfig;
private ExperienceConfig experienceConfig;
private AdvancedConfig advancedConfig; private AdvancedConfig advancedConfig;
private CoreSkillsConfig coreSkillsConfig; private CoreSkillsConfig coreSkillsConfig;
private SoundConfig soundConfig; private SoundConfig soundConfig;
@ -340,10 +338,6 @@ public final class ConfigManager {
return rankConfig; return rankConfig;
} }
public ExperienceConfig getExperienceConfig() {
return experienceConfig;
}
public ConfigDatabase getConfigDatabase() { public ConfigDatabase getConfigDatabase() {
return configDatabase.getConfig(); return configDatabase.getConfig();
} }

View File

@ -1,122 +0,0 @@
package com.gmail.nossr50.config.experience;
import com.gmail.nossr50.config.ConfigConstants;
import com.gmail.nossr50.config.ConfigValidated;
import com.gmail.nossr50.datatypes.skills.ItemMaterialCategory;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.StringUtils;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarStyle;
import java.util.ArrayList;
import java.util.List;
@ConfigSerializable
public class ExperienceConfig extends ConfigValidated {
public static final String EXPLOIT_FIX = "ExploitFix";
public static final String ENDERMAN_ENDERMITE_FARMS = "EndermanEndermiteFarms";
public static final String EXPERIENCE = "Experience";
public static final String EXPERIENCE_FORMULA = EXPERIENCE + "_Formula";
public static final String CURVE = "Curve";
public static final String VALUES = "_Values";
//public static final String MULTIPLIER = "multiplier";
public static final String BASE = "base";
public static final String EXPONENT = "exponent";
public static final String MULTIPLIER = "Multiplier";
public static final String GLOBAL = "Global";
public static final String MOBSPAWNERS = "Mobspawners";
public static final String BREEDING = "Breeding";
public static final String MODIFIER = "Modifier";
public static final String CUSTOM_XP_PERK = "Custom_XP_Perk";
public static final String BOOST = "Boost";
public static final String DIMISHED_RETURNS = "Dimished_Returns";
public static final String GUARANTEED_MINIMUM_PERCENTAGE = "Guaranteed_Minimum_Percentage";
public static final String DIMINISHED_RETURNS = "Diminished_Returns";
public static final String ENABLE = "Enable";
public static final String ENABLED = ENABLE + "d";
public static final String TIME_INTERVAL = "Time_Interval";
public static final String CONVERSION = "Conversion";
public static final String EXP = "Exp_";
public static final String PVP = "PVP";
public static final String REWARDS = "Rewards";
public static final String COMBAT = "Combat";
public static final String ANIMALS = "Animals";
public static final String BARS = "_Bars";
public static final String UPDATE = "Update";
public static final String PASSIVE = "Passive";
public static final String THIS_MAY_CAUSE_LAG = "ThisMayCauseLag";
public static final String ALWAYS = "Always";
public static final String TITLES_WHEN_XPIS_GAINED = "TitlesWhenXPIsGained";
public static final String EXTRA_DETAILS = "ExtraDetails";
public static final String COLOR = "Color";
public static final String BAR_STYLE = "BarStyle";
public static final String ACROBATICS = "Acrobatics";
public static final String DODGE = "Dodge";
public static final String ROLL = "Roll";
public static final String FALL = "Fall";
public static final String FEATHER = "Feather";
public static final String ALCHEMY = "Alchemy";
public static final String POTION_STAGE = "Potion_Stage_";
public static final String ARCHERY = "Archery";
public static final String DISTANCE = "Distance_";
public static final String FISHING = "Fishing";
public static final String SHAKE = "Shake";
public static final String REPAIR = "Repair";
public static final String BASE1 = "Base";
public static final String TAMING = "Taming";
public static final String ANIMAL_TAMING = "Animal_Taming";
public static final String PARTY = "Party";
public static final String THRESHOLD = "Threshold";
public static final String CUMULATIVE = "Cumulative_";
public static final String OCELOT = "Ocelot";
public static final String WOLF = "Wolf";
public static final String FEATHER_FALL_MULTIPLIER = "FeatherFall_Multiplier";
private static final String PISTONS = "Pistons";
//TODO: Should merge be false? Seems okay to leave it as true..
public ExperienceConfig() {
//super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "experience.yml", true);
super("experience", mcMMO.p.getDataFolder().getAbsoluteFile(), ConfigConstants.RELATIVE_PATH_CONFIG_DIR, true, false, true, false);
}
/**
* This grabs an instance of this config class from the Config Manager
* This method is deprecated and will be removed in the future
*
* @return the instance of this config
* @see mcMMO#getConfigManager()
* @deprecated Please use mcMMO.getConfigManager() to grab a specific config instead
*/
@Deprecated
public static ExperienceConfig getInstance() {
return mcMMO.getConfigManager().getExperienceConfig();
}
/**
* The version of this config
*
* @return
*/
@Override
public double getConfigVersion() {
return 1;
}
@Override
public List<String> validateKeys() {
List<String> reason = new ArrayList<>();
return reason;
}
/* Repair */
public double getRepairXPBase() {
return getDoubleValue(EXPERIENCE, REPAIR, BASE1);
}
public double getRepairXP(ItemMaterialCategory repairItemMaterialCategory) {
return getDoubleValue(EXPERIENCE, REPAIR, StringUtils.getCapitalized(repairItemMaterialCategory.toString()));
}
}

View File

@ -3,7 +3,6 @@ package com.gmail.nossr50.datatypes.player;
import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.config.WorldBlacklist; import com.gmail.nossr50.config.WorldBlacklist;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.chat.ChatMode; import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource; import com.gmail.nossr50.datatypes.experience.XPGainSource;

View File

@ -2,7 +2,6 @@ package com.gmail.nossr50.listeners;
import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.config.WorldBlacklist; import com.gmail.nossr50.config.WorldBlacklist;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.core.MetadataConstants; import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.meta.BonusDropMeta; import com.gmail.nossr50.datatypes.meta.BonusDropMeta;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;

View File

@ -1,7 +1,6 @@
package com.gmail.nossr50.skills.repair; package com.gmail.nossr50.skills.repair;
import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.util.experience; package com.gmail.nossr50.util.experience;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.util.experience; package com.gmail.nossr50.util.experience;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;