2019-02-17 11:32:53 -08:00
|
|
|
package com.gmail.nossr50.config;
|
2019-02-17 08:59:09 -08:00
|
|
|
|
2019-02-18 09:08:16 -08:00
|
|
|
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
2019-04-09 20:12:52 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.*;
|
2019-03-17 04:12:56 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.admin.ConfigAdmin;
|
2019-03-14 17:34:13 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.antiexploit.ConfigExploitPrevention;
|
2019-03-14 20:30:20 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.backup.ConfigAutomatedBackups;
|
|
|
|
import com.gmail.nossr50.config.hocon.commands.ConfigCommands;
|
2019-03-08 17:54:23 -08:00
|
|
|
import com.gmail.nossr50.config.hocon.database.ConfigDatabase;
|
2019-03-14 20:06:26 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.donation.ConfigAuthorAdvertisements;
|
2019-04-09 20:12:52 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.experience.ConfigExperience;
|
2019-03-14 20:06:26 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.hardcore.ConfigHardcore;
|
2019-03-14 20:30:20 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.items.ConfigItems;
|
|
|
|
import com.gmail.nossr50.config.hocon.language.ConfigLanguage;
|
2019-03-14 20:06:26 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.metrics.ConfigMetrics;
|
2019-03-19 08:56:48 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.mobs.ConfigMobs;
|
2019-03-14 18:14:08 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.motd.ConfigMOTD;
|
2019-03-14 20:30:20 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.notifications.ConfigNotifications;
|
|
|
|
import com.gmail.nossr50.config.hocon.particles.ConfigParticles;
|
|
|
|
import com.gmail.nossr50.config.hocon.party.ConfigParty;
|
2019-03-18 07:43:11 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.party.data.ConfigPartyData;
|
2019-03-13 18:09:33 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.playerleveling.ConfigLeveling;
|
2019-03-13 09:42:57 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.scoreboard.ConfigScoreboard;
|
2019-03-20 15:53:12 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.skills.acrobatics.ConfigAcrobatics;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.alchemy.ConfigAlchemy;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.archery.ConfigArchery;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.axes.ConfigAxes;
|
2019-04-24 17:19:04 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.skills.exampleconfigs.ConfigNameRegisterDefaults;
|
2019-04-09 20:12:52 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.skills.exampleconfigs.MinecraftMaterialWrapper;
|
2019-03-20 15:53:12 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.skills.excavation.ConfigExcavation;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.fishing.ConfigFishing;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.herbalism.ConfigHerbalism;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.mining.ConfigMining;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.repair.ConfigRepair;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.salvage.ConfigSalvage;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.smelting.ConfigSmelting;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.swords.ConfigSwords;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.taming.ConfigTaming;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.unarmed.ConfigUnarmed;
|
|
|
|
import com.gmail.nossr50.config.hocon.skills.woodcutting.ConfigWoodcutting;
|
2019-03-14 20:30:20 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.superabilities.ConfigSuperAbilities;
|
2019-03-13 18:34:40 -07:00
|
|
|
import com.gmail.nossr50.config.hocon.worldblacklist.ConfigWorldBlacklist;
|
2019-02-17 08:59:09 -08:00
|
|
|
import com.gmail.nossr50.config.skills.alchemy.PotionConfig;
|
2019-02-21 19:06:59 -08:00
|
|
|
import com.gmail.nossr50.config.treasure.ExcavationTreasureConfig;
|
|
|
|
import com.gmail.nossr50.config.treasure.FishingTreasureConfig;
|
|
|
|
import com.gmail.nossr50.config.treasure.HerbalismTreasureConfig;
|
2019-04-24 21:01:33 -07:00
|
|
|
import com.gmail.nossr50.datatypes.experience.FormulaType;
|
2019-03-17 04:12:56 -07:00
|
|
|
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
2019-04-04 22:47:40 -07:00
|
|
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
2019-03-21 20:16:16 -07:00
|
|
|
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
2019-03-17 04:12:56 -07:00
|
|
|
import com.gmail.nossr50.mcMMO;
|
2019-04-02 17:42:35 -07:00
|
|
|
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
|
|
|
import com.gmail.nossr50.skills.repair.repairables.RepairableManager;
|
2019-02-17 08:59:09 -08:00
|
|
|
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
2019-04-02 17:42:35 -07:00
|
|
|
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableManager;
|
2019-03-06 16:50:38 -08:00
|
|
|
import com.gmail.nossr50.util.experience.ExperienceMapManager;
|
2019-03-17 04:12:56 -07:00
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
import com.google.common.reflect.TypeToken;
|
2019-04-24 21:01:33 -07:00
|
|
|
import ninja.leaping.configurate.objectmapping.serialize.TypeSerializerCollection;
|
2019-03-17 04:12:56 -07:00
|
|
|
import ninja.leaping.configurate.objectmapping.serialize.TypeSerializers;
|
|
|
|
import org.bukkit.Material;
|
2019-02-17 08:59:09 -08:00
|
|
|
|
2019-02-21 19:06:59 -08:00
|
|
|
import java.io.File;
|
2019-02-17 08:59:09 -08:00
|
|
|
import java.util.ArrayList;
|
2019-03-17 04:12:56 -07:00
|
|
|
import java.util.HashMap;
|
2019-02-17 08:59:09 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The Config Manager handles initializing, loading, and unloading registers for all configs that mcMMO uses
|
|
|
|
* This makes sure that mcMMO properly loads and unloads its values on reload
|
2019-04-24 22:52:53 -07:00
|
|
|
* <p>
|
2019-02-17 08:59:09 -08:00
|
|
|
* Config Manager also holds all of our MultiConfigContainers
|
|
|
|
*/
|
|
|
|
public final class ConfigManager {
|
|
|
|
|
|
|
|
/* UNLOAD REGISTER */
|
|
|
|
|
2019-04-24 22:52:53 -07:00
|
|
|
SkillPropertiesManager skillPropertiesManager;
|
2019-02-17 08:59:09 -08:00
|
|
|
private ArrayList<Unload> unloadables;
|
|
|
|
|
|
|
|
/* COLLECTION MANAGERS */
|
2019-04-24 22:52:53 -07:00
|
|
|
private ArrayList<File> userFiles;
|
2019-04-02 17:42:35 -07:00
|
|
|
private RepairableManager repairableManager;
|
|
|
|
private SalvageableManager salvageableManager;
|
2019-02-17 08:59:09 -08:00
|
|
|
|
2019-04-24 21:01:33 -07:00
|
|
|
/* CUSTOM SERIALIZERS */
|
2019-04-24 22:52:53 -07:00
|
|
|
private BonusDropManager bonusDropManager;
|
2019-04-24 21:01:33 -07:00
|
|
|
|
2019-02-18 12:16:10 -08:00
|
|
|
/* MOD MANAGERS */
|
|
|
|
|
|
|
|
//TODO: Add these back when modded servers become a thing again
|
|
|
|
|
2019-03-06 16:50:38 -08:00
|
|
|
/* MISC MANAGERS */
|
2019-04-24 22:52:53 -07:00
|
|
|
private TypeSerializerCollection customSerializers;
|
2019-03-06 16:50:38 -08:00
|
|
|
private ExperienceMapManager experienceMapManager;
|
|
|
|
|
2019-02-17 08:59:09 -08:00
|
|
|
/* CONFIG INSTANCES */
|
|
|
|
|
2019-03-12 04:21:46 -07:00
|
|
|
private SerializedConfigLoader<ConfigDatabase> configDatabase;
|
2019-03-13 09:42:57 -07:00
|
|
|
private SerializedConfigLoader<ConfigScoreboard> configScoreboard;
|
2019-03-13 13:09:27 -07:00
|
|
|
private SerializedConfigLoader<ConfigLeveling> configLeveling;
|
2019-03-13 18:34:40 -07:00
|
|
|
private SerializedConfigLoader<ConfigWorldBlacklist> configWorldBlacklist;
|
2019-03-14 17:34:13 -07:00
|
|
|
private SerializedConfigLoader<ConfigExploitPrevention> configExploitPrevention;
|
2019-03-14 20:06:26 -07:00
|
|
|
private SerializedConfigLoader<ConfigHardcore> configHardcore;
|
|
|
|
private SerializedConfigLoader<ConfigMetrics> configMetrics;
|
2019-03-14 18:14:08 -07:00
|
|
|
private SerializedConfigLoader<ConfigMOTD> configMOTD;
|
2019-03-14 20:06:26 -07:00
|
|
|
private SerializedConfigLoader<ConfigAuthorAdvertisements> configAuthorAdvertisements;
|
2019-03-14 20:30:20 -07:00
|
|
|
private SerializedConfigLoader<ConfigAutomatedBackups> configAutomatedBackups;
|
|
|
|
private SerializedConfigLoader<ConfigCommands> configCommands;
|
|
|
|
private SerializedConfigLoader<ConfigItems> configItems;
|
|
|
|
private SerializedConfigLoader<ConfigLanguage> configLanguage;
|
|
|
|
private SerializedConfigLoader<ConfigParticles> configParticles;
|
|
|
|
private SerializedConfigLoader<ConfigParty> configParty;
|
|
|
|
private SerializedConfigLoader<ConfigNotifications> configNotifications;
|
|
|
|
private SerializedConfigLoader<ConfigSuperAbilities> configSuperAbilities;
|
2019-03-17 04:12:56 -07:00
|
|
|
private SerializedConfigLoader<ConfigAdmin> configAdmin;
|
2019-03-19 08:56:48 -07:00
|
|
|
private SerializedConfigLoader<ConfigMobs> configMobs;
|
2019-04-09 20:12:52 -07:00
|
|
|
private SerializedConfigLoader<ConfigExperience> configExperience;
|
2019-03-14 20:30:20 -07:00
|
|
|
|
2019-03-20 15:53:12 -07:00
|
|
|
private SerializedConfigLoader<ConfigAcrobatics> configAcrobatics;
|
|
|
|
private SerializedConfigLoader<ConfigAlchemy> configAlchemy;
|
|
|
|
private SerializedConfigLoader<ConfigArchery> configArchery;
|
|
|
|
private SerializedConfigLoader<ConfigAxes> configAxes;
|
|
|
|
private SerializedConfigLoader<ConfigExcavation> configExcavation;
|
|
|
|
private SerializedConfigLoader<ConfigFishing> configFishing;
|
|
|
|
private SerializedConfigLoader<ConfigHerbalism> configHerbalism;
|
|
|
|
private SerializedConfigLoader<ConfigMining> configMining;
|
|
|
|
private SerializedConfigLoader<ConfigRepair> configRepair;
|
|
|
|
private SerializedConfigLoader<ConfigSwords> configSwords;
|
|
|
|
private SerializedConfigLoader<ConfigTaming> configTaming;
|
|
|
|
private SerializedConfigLoader<ConfigUnarmed> configUnarmed;
|
|
|
|
private SerializedConfigLoader<ConfigWoodcutting> configWoodcutting;
|
|
|
|
private SerializedConfigLoader<ConfigSmelting> configSmelting;
|
|
|
|
private SerializedConfigLoader<ConfigSalvage> configSalvage;
|
2019-04-24 17:19:04 -07:00
|
|
|
private SerializedConfigLoader<ConfigNameRegisterDefaults> configDefaultExamples;
|
2019-03-20 15:53:12 -07:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
private HashMap<PrimarySkillType, SerializedConfigLoader> skillConfigLoaders;
|
|
|
|
|
2019-03-18 07:43:11 -07:00
|
|
|
//Data
|
|
|
|
private SerializedConfigLoader<ConfigPartyData> partyData;
|
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
//YAML CONFIGS
|
|
|
|
private PotionConfig potionConfig;
|
|
|
|
|
2019-02-17 11:32:53 -08:00
|
|
|
private MainConfig mainConfig;
|
2019-02-21 19:06:59 -08:00
|
|
|
private FishingTreasureConfig fishingTreasureConfig;
|
|
|
|
private ExcavationTreasureConfig excavationTreasureConfig;
|
|
|
|
private HerbalismTreasureConfig herbalismTreasureConfig;
|
2019-02-18 09:08:16 -08:00
|
|
|
private ExperienceConfig experienceConfig;
|
2019-02-17 08:59:09 -08:00
|
|
|
private AdvancedConfig advancedConfig;
|
|
|
|
private CoreSkillsConfig coreSkillsConfig;
|
|
|
|
private SoundConfig soundConfig;
|
|
|
|
private RankConfig rankConfig;
|
|
|
|
|
2019-03-20 11:03:09 -07:00
|
|
|
private HashMap<Material, Integer> partyItemWeights;
|
|
|
|
private HashMap<PartyFeature, Integer> partyFeatureUnlocks;
|
2019-03-17 04:12:56 -07:00
|
|
|
|
2019-02-18 09:04:20 -08:00
|
|
|
/* CONFIG ERRORS */
|
|
|
|
|
|
|
|
private ArrayList<String> configErrors; //Collect errors to whine about to server admins
|
|
|
|
|
2019-04-24 22:52:53 -07:00
|
|
|
public ConfigManager() {
|
2019-02-17 08:59:09 -08:00
|
|
|
unloadables = new ArrayList<>();
|
2019-02-21 19:06:59 -08:00
|
|
|
userFiles = new ArrayList<>();
|
2019-02-26 11:26:06 -08:00
|
|
|
}
|
2019-02-17 08:59:09 -08:00
|
|
|
|
2019-04-24 22:52:53 -07:00
|
|
|
public void loadConfigs() {
|
2019-03-17 04:12:56 -07:00
|
|
|
//Register Custom Serializers
|
2019-04-04 23:46:48 -07:00
|
|
|
registerCustomTypeSerializers();
|
2019-03-20 11:03:09 -07:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
//Serialized Configs
|
|
|
|
initSerializedConfigs();
|
2019-03-20 11:03:09 -07:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
//Serialized Data
|
|
|
|
initSerializedDataFiles();
|
2019-03-20 11:03:09 -07:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
//Skill Property Registers
|
|
|
|
skillPropertiesManager = new SkillPropertiesManager();
|
|
|
|
skillPropertiesManager.fillRegisters();
|
2019-03-20 11:03:09 -07:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
//Assign Maps
|
|
|
|
partyItemWeights = Maps.newHashMap(configParty.getConfig().getPartyItemShare().getItemShareMap()); //Item Share Weights
|
|
|
|
partyFeatureUnlocks = Maps.newHashMap(configParty.getConfig().getPartyXP().getPartyLevel().getPartyFeatureUnlockMap()); //Party Progression
|
2019-03-20 11:03:09 -07:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
//Register Bonus Drops
|
|
|
|
registerBonusDrops();
|
2019-03-20 11:03:09 -07:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
//YAML Configs
|
|
|
|
initYAMLConfigs();
|
2019-03-20 11:03:09 -07:00
|
|
|
|
2019-03-20 14:26:30 -07:00
|
|
|
/*
|
2019-04-04 23:46:48 -07:00
|
|
|
* Managers
|
2019-03-20 14:26:30 -07:00
|
|
|
*/
|
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
// Register Managers
|
|
|
|
initMiscManagers();
|
|
|
|
initCollectionManagers();
|
|
|
|
}
|
2019-03-17 04:12:56 -07:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
private void initYAMLConfigs() {
|
|
|
|
potionConfig = new PotionConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void initSerializedDataFiles() {
|
|
|
|
partyData = new SerializedConfigLoader<>(ConfigPartyData.class, "partydata.conf", "PartyData", null);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void initSerializedConfigs() {
|
2019-03-21 17:31:57 -07:00
|
|
|
configDatabase = new SerializedConfigLoader<>(ConfigDatabase.class, "database_settings.conf", "Database", null);
|
|
|
|
configScoreboard = new SerializedConfigLoader<>(ConfigScoreboard.class, "scoreboard.conf", "Scoreboard", null);
|
|
|
|
configLeveling = new SerializedConfigLoader<>(ConfigLeveling.class, "player_leveling.conf", "Player-Leveling", null);
|
|
|
|
configWorldBlacklist = new SerializedConfigLoader<>(ConfigWorldBlacklist.class, "world_blacklist.conf", "World-Blacklist", null);
|
|
|
|
configExploitPrevention = new SerializedConfigLoader<>(ConfigExploitPrevention.class, "anti_exploit.conf", "Anti-Exploit", null);
|
|
|
|
configMOTD = new SerializedConfigLoader<>(ConfigMOTD.class, "message_of_the_day.conf", "MOTD", null);
|
|
|
|
configHardcore = new SerializedConfigLoader<>(ConfigHardcore.class, "hardcore_mode.conf", "Hardcore-Mode", null);
|
|
|
|
configMetrics = new SerializedConfigLoader<>(ConfigMetrics.class, "analytics_reporting.conf", "Analytic-Reporting", null);
|
|
|
|
configAuthorAdvertisements = new SerializedConfigLoader<>(ConfigAuthorAdvertisements.class, "author_support_advertisements.conf", "mcMMO", null);
|
|
|
|
configAutomatedBackups = new SerializedConfigLoader<>(ConfigAutomatedBackups.class, "automated_backups.conf", "Automated-Backups", null);
|
|
|
|
configCommands = new SerializedConfigLoader<>(ConfigCommands.class, "commands.conf", "Commands", null);
|
|
|
|
configItems = new SerializedConfigLoader<>(ConfigItems.class, "custom_items.conf", "Items", null);
|
|
|
|
configLanguage = new SerializedConfigLoader<>(ConfigLanguage.class, "language.conf", "Language", null);
|
|
|
|
configParticles = new SerializedConfigLoader<>(ConfigParticles.class, "particle_spawning.conf", "Particles", null);
|
|
|
|
configParty = new SerializedConfigLoader<>(ConfigParty.class, "party.conf", "Party", null);
|
|
|
|
configNotifications = new SerializedConfigLoader<>(ConfigNotifications.class, "alerts_and_notifications.conf", "Notifications", null);
|
|
|
|
configSuperAbilities = new SerializedConfigLoader<>(ConfigSuperAbilities.class, "skill_super_abilities.conf", "Super-Abilities", null);
|
|
|
|
configAdmin = new SerializedConfigLoader<>(ConfigAdmin.class, "admin.conf", "Admin", null);
|
|
|
|
configMobs = new SerializedConfigLoader<>(ConfigMobs.class, "creatures.conf", "Creatures", null);
|
2019-04-09 20:12:52 -07:00
|
|
|
configExperience = new SerializedConfigLoader<>(ConfigExperience.class, "experience.conf", "Experience", null);
|
2019-03-21 17:31:57 -07:00
|
|
|
|
2019-04-24 17:19:04 -07:00
|
|
|
configDefaultExamples = new SerializedConfigLoader<>(ConfigNameRegisterDefaults.class, "minecraft_item_block_name_examples.conf", "Minecraft", null);
|
2019-04-04 23:46:48 -07:00
|
|
|
initSerializedSkillConfigs();
|
|
|
|
}
|
|
|
|
|
|
|
|
@SuppressWarnings(value = "unchecked")
|
|
|
|
private void initSerializedSkillConfigs() {
|
|
|
|
//Init HashMap
|
|
|
|
skillConfigLoaders = new HashMap<>();
|
|
|
|
|
|
|
|
//Init and register serialized skill configs
|
2019-04-04 22:47:40 -07:00
|
|
|
registerSkillConfig(PrimarySkillType.ACROBATICS, ConfigAcrobatics.class);
|
2019-04-04 23:46:48 -07:00
|
|
|
registerSkillConfig(PrimarySkillType.ALCHEMY, ConfigAlchemy.class);
|
2019-04-04 22:47:40 -07:00
|
|
|
registerSkillConfig(PrimarySkillType.SALVAGE, ConfigSalvage.class);
|
|
|
|
registerSkillConfig(PrimarySkillType.ARCHERY, ConfigArchery.class);
|
|
|
|
registerSkillConfig(PrimarySkillType.AXES, ConfigAxes.class);
|
|
|
|
registerSkillConfig(PrimarySkillType.EXCAVATION, ConfigExcavation.class);
|
|
|
|
registerSkillConfig(PrimarySkillType.FISHING, ConfigFishing.class);
|
|
|
|
registerSkillConfig(PrimarySkillType.HERBALISM, ConfigHerbalism.class);
|
|
|
|
registerSkillConfig(PrimarySkillType.MINING, ConfigMining.class);
|
|
|
|
registerSkillConfig(PrimarySkillType.REPAIR, ConfigRepair.class);
|
|
|
|
registerSkillConfig(PrimarySkillType.SWORDS, ConfigSwords.class);
|
|
|
|
registerSkillConfig(PrimarySkillType.TAMING, ConfigTaming.class);
|
|
|
|
registerSkillConfig(PrimarySkillType.UNARMED, ConfigUnarmed.class);
|
|
|
|
registerSkillConfig(PrimarySkillType.WOODCUTTING, ConfigWoodcutting.class);
|
|
|
|
registerSkillConfig(PrimarySkillType.SMELTING, ConfigSmelting.class);
|
2019-03-20 15:53:12 -07:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
//Setup Typed refs
|
|
|
|
configAcrobatics = (SerializedConfigLoader<ConfigAcrobatics>) skillConfigLoaders.get(PrimarySkillType.ACROBATICS).getConfig();
|
|
|
|
configAlchemy = (SerializedConfigLoader<ConfigAlchemy>) skillConfigLoaders.get(PrimarySkillType.ALCHEMY).getConfig();
|
|
|
|
configSalvage = (SerializedConfigLoader<ConfigSalvage>) skillConfigLoaders.get(PrimarySkillType.SALVAGE).getConfig();
|
|
|
|
configArchery = (SerializedConfigLoader<ConfigArchery>) skillConfigLoaders.get(PrimarySkillType.ARCHERY).getConfig();
|
|
|
|
configAxes = (SerializedConfigLoader<ConfigAxes>) skillConfigLoaders.get(PrimarySkillType.AXES).getConfig();
|
|
|
|
configExcavation = (SerializedConfigLoader<ConfigExcavation>) skillConfigLoaders.get(PrimarySkillType.EXCAVATION).getConfig();
|
|
|
|
configFishing = (SerializedConfigLoader<ConfigFishing>) skillConfigLoaders.get(PrimarySkillType.FISHING).getConfig();
|
|
|
|
configHerbalism = (SerializedConfigLoader<ConfigHerbalism>) skillConfigLoaders.get(PrimarySkillType.HERBALISM).getConfig();
|
|
|
|
configMining = (SerializedConfigLoader<ConfigMining>) skillConfigLoaders.get(PrimarySkillType.MINING).getConfig();
|
|
|
|
configRepair = (SerializedConfigLoader<ConfigRepair>) skillConfigLoaders.get(PrimarySkillType.REPAIR).getConfig();
|
|
|
|
configSwords = (SerializedConfigLoader<ConfigSwords>) skillConfigLoaders.get(PrimarySkillType.SWORDS).getConfig();
|
|
|
|
configTaming = (SerializedConfigLoader<ConfigTaming>) skillConfigLoaders.get(PrimarySkillType.TAMING).getConfig();
|
|
|
|
configUnarmed = (SerializedConfigLoader<ConfigUnarmed>) skillConfigLoaders.get(PrimarySkillType.UNARMED).getConfig();
|
|
|
|
configWoodcutting = (SerializedConfigLoader<ConfigWoodcutting>) skillConfigLoaders.get(PrimarySkillType.WOODCUTTING).getConfig();
|
|
|
|
configSmelting = (SerializedConfigLoader<ConfigSmelting>) skillConfigLoaders.get(PrimarySkillType.SMELTING).getConfig();
|
|
|
|
}
|
2019-03-13 09:42:57 -07:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
private void registerCustomTypeSerializers() {
|
|
|
|
/*
|
|
|
|
TypeTokens are obtained in two ways
|
2019-04-02 18:59:48 -07:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
For Raw basic classes:
|
2019-02-17 11:32:53 -08:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
TypeToken<String> stringTok = TypeToken.of(String.class);
|
|
|
|
TypeToken<Integer> intTok = TypeToken.of(Integer.class);
|
2019-02-17 08:59:09 -08:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
For Generics:
|
2019-02-17 08:59:09 -08:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
TypeToken<List<String>> stringListTok = new TypeToken<List<String>>() {};
|
2019-02-18 09:08:16 -08:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
Wildcard example:
|
2019-02-17 08:59:09 -08:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
TypeToken<Map<?, ?>> wildMapTok = new TypeToken<Map<?, ?>>() {};
|
2019-02-17 08:59:09 -08:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
*/
|
2019-02-17 08:59:09 -08:00
|
|
|
|
2019-03-06 16:50:38 -08:00
|
|
|
/*
|
2019-04-04 23:46:48 -07:00
|
|
|
List of default serializers for reference
|
|
|
|
DEFAULT_SERIALIZERS.registerType(TypeToken.of(URI.class), new URISerializer());
|
|
|
|
DEFAULT_SERIALIZERS.registerType(TypeToken.of(URL.class), new URLSerializer());
|
|
|
|
DEFAULT_SERIALIZERS.registerType(TypeToken.of(UUID.class), new UUIDSerializer());
|
|
|
|
DEFAULT_SERIALIZERS.registerPredicate(input -> input.getRawType().isAnnotationPresent(ConfigSerializable.class), new AnnotatedObjectSerializer());
|
|
|
|
DEFAULT_SERIALIZERS.registerPredicate(NumberSerializer.getPredicate(), new NumberSerializer());
|
|
|
|
DEFAULT_SERIALIZERS.registerType(TypeToken.of(String.class), new StringSerializer());
|
|
|
|
DEFAULT_SERIALIZERS.registerType(TypeToken.of(Boolean.class), new BooleanSerializer());
|
|
|
|
DEFAULT_SERIALIZERS.registerType(new TypeToken<Map<?, ?>>() {}, new MapSerializer());
|
|
|
|
DEFAULT_SERIALIZERS.registerType(new TypeToken<List<?>>() {}, new ListSerializer());
|
|
|
|
DEFAULT_SERIALIZERS.registerType(new TypeToken<Enum<?>>() {}, new EnumValueSerializer());
|
|
|
|
DEFAULT_SERIALIZERS.registerType(TypeToken.of(Pattern.class), new PatternSerializer());
|
2019-03-06 16:50:38 -08:00
|
|
|
*/
|
|
|
|
|
2019-04-24 21:38:32 -07:00
|
|
|
customSerializers = TypeSerializers.getDefaultSerializers().newChild();
|
2019-04-24 21:01:33 -07:00
|
|
|
|
2019-04-04 23:46:48 -07:00
|
|
|
mcMMO.p.getLogger().info("Registering custom type serializers for Configurate...");
|
2019-04-24 22:52:53 -07:00
|
|
|
customSerializers.registerType(new TypeToken<Material>() {
|
|
|
|
}, new CustomEnumValueSerializer());
|
|
|
|
customSerializers.registerType(new TypeToken<PartyFeature>() {
|
|
|
|
}, new CustomEnumValueSerializer());
|
|
|
|
customSerializers.registerType(new TypeToken<FormulaType>() {
|
|
|
|
}, new CustomEnumValueSerializer());
|
2019-04-24 21:01:33 -07:00
|
|
|
customSerializers.registerType(TypeToken.of(Repairable.class), new RepairableSerializer());
|
|
|
|
customSerializers.registerType(TypeToken.of(Salvageable.class), new SalvageableSerializer());
|
|
|
|
customSerializers.registerType(TypeToken.of(MinecraftMaterialWrapper.class), new MinecraftMaterialWrapperSerializer());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the serializers registered and used by mcMMO
|
|
|
|
* This includes all default serializers
|
2019-04-24 22:52:53 -07:00
|
|
|
*
|
2019-04-24 21:01:33 -07:00
|
|
|
* @return our custom serializers
|
|
|
|
*/
|
|
|
|
public TypeSerializerCollection getCustomSerializers() {
|
|
|
|
return customSerializers;
|
2019-02-17 08:59:09 -08:00
|
|
|
}
|
|
|
|
|
2019-04-24 22:52:53 -07:00
|
|
|
private void registerSkillConfig(PrimarySkillType primarySkillType, Class clazz) {
|
2019-04-04 22:47:40 -07:00
|
|
|
skillConfigLoaders.put(primarySkillType, SkillConfigFactory.initSkillConfig(primarySkillType, clazz));
|
|
|
|
}
|
|
|
|
|
2019-03-06 16:50:38 -08:00
|
|
|
/**
|
|
|
|
* Misc managers
|
|
|
|
*/
|
2019-04-24 22:52:53 -07:00
|
|
|
private void initMiscManagers() {
|
2019-03-06 16:50:38 -08:00
|
|
|
experienceMapManager = new ExperienceMapManager();
|
|
|
|
}
|
|
|
|
|
2019-02-17 08:59:09 -08:00
|
|
|
/**
|
|
|
|
* Initializes all of our Multi Config Containers
|
|
|
|
*/
|
2019-03-08 19:40:01 -08:00
|
|
|
/*private void initMultiConfigContainers()
|
2019-02-17 08:59:09 -08:00
|
|
|
{
|
|
|
|
//Repair
|
|
|
|
repairableMultiConfigContainer = new MultiConfigContainer<>("repair", CollectionClassType.REPAIR);
|
|
|
|
unloadables.add(repairableMultiConfigContainer);
|
|
|
|
|
|
|
|
//Salvage
|
|
|
|
salvageableMultiConfigContainer = new MultiConfigContainer<>("salvage", CollectionClassType.SALVAGE);
|
|
|
|
unloadables.add(salvageableMultiConfigContainer);
|
2019-03-08 19:40:01 -08:00
|
|
|
}*/
|
2019-02-17 08:59:09 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initializes any managers related to config collections
|
|
|
|
*/
|
2019-04-24 22:52:53 -07:00
|
|
|
private void initCollectionManagers() {
|
2019-02-17 08:59:09 -08:00
|
|
|
// Handles registration of repairables
|
2019-04-02 17:42:35 -07:00
|
|
|
repairableManager = new RepairableManager(getRepairables());
|
|
|
|
unloadables.add(repairableManager);
|
2019-02-17 08:59:09 -08:00
|
|
|
|
|
|
|
// Handles registration of salvageables
|
2019-04-02 17:42:35 -07:00
|
|
|
salvageableManager = new SalvageableManager(getSalvageables());
|
|
|
|
unloadables.add(salvageableManager);
|
2019-04-02 18:59:48 -07:00
|
|
|
|
|
|
|
// Handles registration of bonus drops
|
|
|
|
bonusDropManager = new BonusDropManager();
|
|
|
|
unloadables.add(bonusDropManager);
|
2019-02-17 08:59:09 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all loaded repairables (loaded from all repairable configs)
|
2019-04-24 22:52:53 -07:00
|
|
|
*
|
2019-02-17 08:59:09 -08:00
|
|
|
* @return the currently loaded repairables
|
|
|
|
*/
|
2019-04-24 22:52:53 -07:00
|
|
|
public ArrayList<Repairable> getRepairables() {
|
2019-03-21 23:54:55 -07:00
|
|
|
return getConfigRepair().getConfigRepairablesList();
|
2019-02-17 08:59:09 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all loaded salvageables (loaded from all salvageable configs)
|
2019-04-24 22:52:53 -07:00
|
|
|
*
|
2019-02-17 08:59:09 -08:00
|
|
|
* @return the currently loaded salvageables
|
|
|
|
*/
|
2019-04-24 22:52:53 -07:00
|
|
|
public ArrayList<Salvageable> getSalvageables() {
|
2019-04-02 17:42:35 -07:00
|
|
|
return getConfigSalvage().getConfigSalvageablesList();
|
2019-02-17 08:59:09 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unloads all config options (prepares for reload)
|
|
|
|
*/
|
2019-04-24 22:52:53 -07:00
|
|
|
public void unloadAllConfigsAndRegisters() {
|
2019-02-17 08:59:09 -08:00
|
|
|
//Unload
|
2019-04-24 22:52:53 -07:00
|
|
|
for (Unload unloadable : unloadables) {
|
2019-02-17 08:59:09 -08:00
|
|
|
unloadable.unload();
|
|
|
|
}
|
|
|
|
|
|
|
|
//Clear
|
|
|
|
unloadables.clear();
|
2019-02-21 19:06:59 -08:00
|
|
|
userFiles.clear();
|
2019-02-17 08:59:09 -08:00
|
|
|
}
|
2019-02-17 11:32:53 -08:00
|
|
|
|
2019-02-18 15:17:35 -08:00
|
|
|
/**
|
|
|
|
* Registers an unloadable
|
|
|
|
* Unloadables call unload() on plugin disable to cleanup registries
|
|
|
|
*/
|
2019-04-24 22:52:53 -07:00
|
|
|
public void registerUnloadable(Unload unload) {
|
|
|
|
if (!unloadables.contains(unload))
|
2019-02-18 15:17:35 -08:00
|
|
|
unloadables.add(unload);
|
|
|
|
}
|
|
|
|
|
2019-02-21 19:06:59 -08:00
|
|
|
/**
|
|
|
|
* Registers an unloadable
|
|
|
|
* Unloadables call unload() on plugin disable to cleanup registries
|
|
|
|
*/
|
2019-04-24 22:52:53 -07:00
|
|
|
public void registerUserFile(File userFile) {
|
|
|
|
if (!userFiles.contains(userFile))
|
2019-02-21 19:06:59 -08:00
|
|
|
userFiles.add(userFile);
|
|
|
|
}
|
|
|
|
|
2019-04-02 18:59:48 -07:00
|
|
|
/**
|
|
|
|
* Registers bonus drops from several skill configs
|
|
|
|
*/
|
2019-04-24 22:52:53 -07:00
|
|
|
public void registerBonusDrops() {
|
2019-04-02 21:52:07 -07:00
|
|
|
bonusDropManager.addToWhitelistByNameID(getConfigMining().getBonusDrops());
|
2019-04-02 23:28:12 -07:00
|
|
|
// bonusDropManager.addToWhitelistByNameID(configHerbalism.getBonusDrops());
|
|
|
|
// bonusDropManager.addToWhitelistByNameID(configWoodcutting.getBonusDrops());
|
2019-04-02 21:52:07 -07:00
|
|
|
}
|
|
|
|
|
2019-04-24 22:52:53 -07:00
|
|
|
public void validateConfigs() {
|
2019-04-02 21:52:07 -07:00
|
|
|
|
2019-04-02 18:59:48 -07:00
|
|
|
}
|
|
|
|
|
2019-02-17 11:32:53 -08:00
|
|
|
/*
|
|
|
|
* GETTER BOILER PLATE
|
|
|
|
*/
|
|
|
|
|
2019-02-21 19:06:59 -08:00
|
|
|
/**
|
|
|
|
* Used to back up our zip files real easily
|
2019-04-24 22:52:53 -07:00
|
|
|
*
|
2019-02-21 19:06:59 -08:00
|
|
|
* @return
|
|
|
|
*/
|
2019-04-24 22:52:53 -07:00
|
|
|
public ArrayList<File> getConfigFiles() {
|
2019-02-21 19:06:59 -08:00
|
|
|
return userFiles;
|
|
|
|
}
|
|
|
|
|
2019-04-02 17:42:35 -07:00
|
|
|
public RepairableManager getRepairableManager() {
|
|
|
|
return repairableManager;
|
2019-02-17 11:32:53 -08:00
|
|
|
}
|
|
|
|
|
2019-04-02 17:42:35 -07:00
|
|
|
public SalvageableManager getSalvageableManager() {
|
|
|
|
return salvageableManager;
|
2019-02-17 11:32:53 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
public MainConfig getMainConfig() {
|
|
|
|
return mainConfig;
|
|
|
|
}
|
|
|
|
|
2019-02-21 19:06:59 -08:00
|
|
|
public FishingTreasureConfig getFishingTreasureConfig() {
|
|
|
|
return fishingTreasureConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ExcavationTreasureConfig getExcavationTreasureConfig() {
|
|
|
|
return excavationTreasureConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
public HerbalismTreasureConfig getHerbalismTreasureConfig() {
|
|
|
|
return herbalismTreasureConfig;
|
2019-02-17 11:32:53 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
public AdvancedConfig getAdvancedConfig() {
|
|
|
|
return advancedConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
public PotionConfig getPotionConfig() {
|
|
|
|
return potionConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
public CoreSkillsConfig getCoreSkillsConfig() {
|
|
|
|
return coreSkillsConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
public SoundConfig getSoundConfig() {
|
|
|
|
return soundConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
public RankConfig getRankConfig() {
|
|
|
|
return rankConfig;
|
|
|
|
}
|
2019-02-18 09:08:16 -08:00
|
|
|
|
|
|
|
public ExperienceConfig getExperienceConfig() {
|
|
|
|
return experienceConfig;
|
|
|
|
}
|
2019-02-18 15:35:46 -08:00
|
|
|
|
2019-03-06 16:50:38 -08:00
|
|
|
public ExperienceMapManager getExperienceMapManager() {
|
|
|
|
return experienceMapManager;
|
|
|
|
}
|
2019-03-08 17:54:23 -08:00
|
|
|
|
2019-04-24 22:52:53 -07:00
|
|
|
public ConfigDatabase getConfigDatabase() {
|
|
|
|
return configDatabase.getConfig();
|
|
|
|
}
|
2019-03-13 09:42:57 -07:00
|
|
|
|
2019-04-24 22:52:53 -07:00
|
|
|
public ConfigScoreboard getConfigScoreboard() {
|
|
|
|
return configScoreboard.getConfig();
|
|
|
|
}
|
2019-03-13 13:09:27 -07:00
|
|
|
|
|
|
|
public ConfigLeveling getConfigLeveling() {
|
|
|
|
return configLeveling.getConfig();
|
|
|
|
}
|
2019-03-13 18:34:40 -07:00
|
|
|
|
|
|
|
public ConfigWorldBlacklist getConfigWorldBlacklist() {
|
|
|
|
return configWorldBlacklist.getConfig();
|
|
|
|
}
|
2019-03-14 17:34:13 -07:00
|
|
|
|
|
|
|
public ConfigExploitPrevention getConfigExploitPrevention() {
|
|
|
|
return configExploitPrevention.getConfig();
|
|
|
|
}
|
2019-03-14 18:14:08 -07:00
|
|
|
|
|
|
|
public ConfigMOTD getConfigMOTD() {
|
|
|
|
return configMOTD.getConfig();
|
|
|
|
}
|
2019-03-14 20:06:26 -07:00
|
|
|
|
|
|
|
public ConfigHardcore getConfigHardcore() {
|
|
|
|
return configHardcore.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigMetrics getConfigMetrics() {
|
|
|
|
return configMetrics.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigAuthorAdvertisements getConfigAds() {
|
|
|
|
return configAuthorAdvertisements.getConfig();
|
|
|
|
}
|
2019-03-14 20:30:20 -07:00
|
|
|
|
|
|
|
public ConfigAutomatedBackups getConfigAutomatedBackups() {
|
|
|
|
return configAutomatedBackups.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigCommands getConfigCommands() {
|
|
|
|
return configCommands.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigItems getConfigItems() {
|
|
|
|
return configItems.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigLanguage getConfigLanguage() {
|
|
|
|
return configLanguage.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigParticles getConfigParticles() {
|
|
|
|
return configParticles.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigParty getConfigParty() {
|
|
|
|
return configParty.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigNotifications getConfigNotifications() {
|
|
|
|
return configNotifications.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigSuperAbilities getConfigSuperAbilities() {
|
|
|
|
return configSuperAbilities.getConfig();
|
|
|
|
}
|
2019-03-17 04:44:06 -07:00
|
|
|
|
2019-03-20 11:03:09 -07:00
|
|
|
public HashMap<Material, Integer> getPartyItemWeights() {
|
2019-03-17 04:44:06 -07:00
|
|
|
return partyItemWeights;
|
|
|
|
}
|
|
|
|
|
2019-03-20 11:03:09 -07:00
|
|
|
public HashMap<PartyFeature, Integer> getPartyFeatureUnlocks() {
|
2019-03-17 04:44:06 -07:00
|
|
|
return partyFeatureUnlocks;
|
|
|
|
}
|
2019-03-19 08:56:48 -07:00
|
|
|
|
|
|
|
public ConfigAdmin getConfigAdmin() {
|
|
|
|
return configAdmin.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigMobs getConfigMobs() {
|
|
|
|
return configMobs.getConfig();
|
|
|
|
}
|
2019-03-20 15:53:12 -07:00
|
|
|
|
|
|
|
public ConfigAcrobatics getConfigAcrobatics() {
|
|
|
|
return configAcrobatics.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigAlchemy getConfigAlchemy() {
|
|
|
|
return configAlchemy.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigArchery getConfigArchery() {
|
|
|
|
return configArchery.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigAxes getConfigAxes() {
|
|
|
|
return configAxes.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigExcavation getConfigExcavation() {
|
|
|
|
return configExcavation.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigFishing getConfigFishing() {
|
|
|
|
return configFishing.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigHerbalism getConfigHerbalism() {
|
|
|
|
return configHerbalism.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigMining getConfigMining() {
|
|
|
|
return configMining.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigRepair getConfigRepair() {
|
|
|
|
return configRepair.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigSwords getConfigSwords() {
|
|
|
|
return configSwords.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigTaming getConfigTaming() {
|
|
|
|
return configTaming.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigUnarmed getConfigUnarmed() {
|
|
|
|
return configUnarmed.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigWoodcutting getConfigWoodcutting() {
|
|
|
|
return configWoodcutting.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigSmelting getConfigSmelting() {
|
|
|
|
return configSmelting.getConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConfigSalvage getConfigSalvage() {
|
|
|
|
return configSalvage.getConfig();
|
|
|
|
}
|
2019-03-21 20:16:16 -07:00
|
|
|
|
2019-04-02 18:59:48 -07:00
|
|
|
public BonusDropManager getBonusDropManager() {
|
|
|
|
return bonusDropManager;
|
|
|
|
}
|
|
|
|
|
2019-04-02 23:28:12 -07:00
|
|
|
/**
|
|
|
|
* Checks if this plugin is using retro mode
|
|
|
|
* Retro mode is a 0-1000 skill system
|
|
|
|
* Standard mode is scaled for 1-100
|
2019-04-24 22:52:53 -07:00
|
|
|
*
|
2019-04-02 23:28:12 -07:00
|
|
|
* @return true if retro mode is enabled
|
|
|
|
*/
|
2019-04-24 22:52:53 -07:00
|
|
|
public boolean isRetroMode() {
|
2019-04-02 23:28:12 -07:00
|
|
|
return getConfigLeveling().getConfigSectionLevelingGeneral().getConfigSectionLevelScaling().isRetroModeEnabled();
|
|
|
|
}
|
|
|
|
|
2019-04-24 22:52:53 -07:00
|
|
|
public boolean isBonusDropsEnabled(Material material) {
|
2019-04-02 18:59:48 -07:00
|
|
|
return getBonusDropManager().isBonusDropWhitelisted(material);
|
|
|
|
}
|
|
|
|
|
2019-04-24 22:52:53 -07:00
|
|
|
public double getSkillMaxBonusLevel(SubSkillType subSkillType) {
|
2019-03-21 20:16:16 -07:00
|
|
|
return skillPropertiesManager.getMaxBonusLevel(subSkillType);
|
|
|
|
}
|
|
|
|
|
2019-04-24 22:52:53 -07:00
|
|
|
public double getSkillMaxChance(SubSkillType subSkillType) {
|
2019-03-21 20:16:16 -07:00
|
|
|
return skillPropertiesManager.getMaxChance(subSkillType);
|
|
|
|
}
|
2019-04-09 20:12:52 -07:00
|
|
|
|
|
|
|
public ConfigExperience getConfigExperience() {
|
|
|
|
return configExperience.getConfig();
|
|
|
|
}
|
2019-02-17 08:59:09 -08:00
|
|
|
}
|