mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-18 16:35:25 +01:00
new config system pt 4
This commit is contained in:
parent
df101e54b1
commit
41b484b1c3
@ -6,3 +6,7 @@ This file is just going to take note of all the caveats of mcMMO code as I abstr
|
|||||||
2) mcMMO uses a a global reference of its Plugin class for Bukkit in order to schedule tasks
|
2) mcMMO uses a a global reference of its Plugin class for Bukkit in order to schedule tasks
|
||||||
|
|
||||||
3) Need to configure the logger
|
3) Need to configure the logger
|
||||||
|
|
||||||
|
4) Safety check the hardcore/vampirism commands
|
||||||
|
|
||||||
|
5) Tweak configs to not do any string operations
|
@ -10,7 +10,7 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ConfigSerializable
|
//@ConfigSerializable
|
||||||
public class AdvancedConfig extends ConfigurableLoader {
|
public class AdvancedConfig extends ConfigurableLoader {
|
||||||
|
|
||||||
public static final String SKILLS = "Skills";
|
public static final String SKILLS = "Skills";
|
||||||
|
@ -43,15 +43,18 @@ public abstract class ConfigurableLoader implements DefaultKeys, VersionedConfig
|
|||||||
/* CONFIG MANAGER */
|
/* CONFIG MANAGER */
|
||||||
private ConfigurationLoader<CommentedConfigurationNode> configManager;
|
private ConfigurationLoader<CommentedConfigurationNode> configManager;
|
||||||
|
|
||||||
//TODO: Needed?
|
public ConfigurableLoader(String pathToParentFolder, String relativePath) {
|
||||||
//private ConfigurationLoader<CommentedConfigurationNode> configManager;
|
//TODO: Check if this works...
|
||||||
|
this(new File(pathToParentFolder), relativePath);
|
||||||
|
System.out.println("mcMMO Debug: Don't forget to check if loading config file by string instead of File works...");
|
||||||
|
}
|
||||||
|
|
||||||
public ConfigurableLoader(File pathToDataFolder, String relativePath) {
|
public ConfigurableLoader(File pathToParentFolder, String relativePath) {
|
||||||
/*
|
/*
|
||||||
* These must be at the top
|
* These must be at the top
|
||||||
*/
|
*/
|
||||||
mkdirDefaults(); // Make our default config dir
|
mkdirDefaults(); // Make our default config dir
|
||||||
DIRECTORY_DATA_FOLDER = pathToDataFolder; //Data Folder for our plugin
|
DIRECTORY_DATA_FOLDER = pathToParentFolder; //Data Folder for our plugin
|
||||||
FILE_RELATIVE_PATH = relativePath; //Relative path to config from a parent folder
|
FILE_RELATIVE_PATH = relativePath; //Relative path to config from a parent folder
|
||||||
|
|
||||||
//Attempt IO Operations
|
//Attempt IO Operations
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
package com.gmail.nossr50.core.config;
|
package com.gmail.nossr50.core.config;
|
||||||
|
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.SubSkillType;
|
import com.gmail.nossr50.core.McmmoCore;
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.subskills.AbstractSubSkill;
|
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||||
|
import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class RankConfig extends AutoUpdateConfigLoader {
|
public class RankConfig extends ConfigurableLoader {
|
||||||
private static RankConfig instance;
|
private static RankConfig instance;
|
||||||
|
|
||||||
public RankConfig() {
|
public RankConfig() {
|
||||||
super("skillranks.yml");
|
super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"skillranks.yml");
|
||||||
validate();
|
validate();
|
||||||
this.instance = this;
|
this.instance = this;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package com.gmail.nossr50.core.config;
|
package com.gmail.nossr50.core.config;
|
||||||
|
|
||||||
import com.gmail.nossr50.util.sounds.SoundType;
|
import com.gmail.nossr50.core.McmmoCore;
|
||||||
|
import com.gmail.nossr50.core.util.sounds.SoundType;
|
||||||
|
|
||||||
public class SoundConfig extends AutoUpdateConfigLoader {
|
public class SoundConfig extends ConfigurableLoader {
|
||||||
private static SoundConfig instance;
|
private static SoundConfig instance;
|
||||||
|
|
||||||
public SoundConfig() {
|
public SoundConfig() {
|
||||||
super("sounds.yml");
|
super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "sounds.yml");
|
||||||
validate();
|
validate();
|
||||||
this.instance = this;
|
this.instance = this;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.gmail.nossr50.core.config;
|
package com.gmail.nossr50.core.config;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.core.McmmoCore;
|
||||||
import org.bukkit.World;
|
import com.gmail.nossr50.core.mcmmo.world.World;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -12,10 +12,8 @@ import java.util.ArrayList;
|
|||||||
public class WorldBlacklist {
|
public class WorldBlacklist {
|
||||||
private static ArrayList<String> blacklist;
|
private static ArrayList<String> blacklist;
|
||||||
private final String blackListFileName = "world_blacklist.txt";
|
private final String blackListFileName = "world_blacklist.txt";
|
||||||
private mcMMO plugin;
|
|
||||||
|
|
||||||
public WorldBlacklist(mcMMO plugin) {
|
public WorldBlacklist() {
|
||||||
this.plugin = plugin;
|
|
||||||
blacklist = new ArrayList<>();
|
blacklist = new ArrayList<>();
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
@ -32,7 +30,8 @@ public class WorldBlacklist {
|
|||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
//Make the blacklist file if it doesn't exist
|
//Make the blacklist file if it doesn't exist
|
||||||
File blackListFile = new File(plugin.getDataFolder() + File.separator + blackListFileName);
|
//TODO: Check if this works
|
||||||
|
File blackListFile = new File(McmmoCore.getDataFolderPath().getAbsoluteFile() + File.separator + blackListFileName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!blackListFile.exists())
|
if (!blackListFile.exists())
|
||||||
@ -70,6 +69,6 @@ public class WorldBlacklist {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin.getLogger().info(blacklist.size() + " entries in mcMMO World Blacklist");
|
McmmoCore.getLogger().info(blacklist.size() + " entries in mcMMO World Blacklist");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,21 @@
|
|||||||
package com.gmail.nossr50.core.config.experience;
|
package com.gmail.nossr50.core.config.experience;
|
||||||
|
|
||||||
import com.gmail.nossr50.core.config.AutoUpdateConfigLoader;
|
import com.gmail.nossr50.core.McmmoCore;
|
||||||
import com.gmail.nossr50.core.mcmmo.experience.FormulaType;
|
import com.gmail.nossr50.core.config.ConfigurableLoader;
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.MaterialType;
|
import com.gmail.nossr50.core.datatypes.experience.FormulaType;
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.PrimarySkillType;
|
import com.gmail.nossr50.core.skills.MaterialType;
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.alchemy.PotionStage;
|
import com.gmail.nossr50.core.skills.PotionStage;
|
||||||
import com.gmail.nossr50.util.StringUtils;
|
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||||
import org.bukkit.Material;
|
import com.gmail.nossr50.core.util.StringUtils;
|
||||||
import org.bukkit.block.data.BlockData;
|
|
||||||
import org.bukkit.boss.BarColor;
|
|
||||||
import org.bukkit.boss.BarStyle;
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ExperienceConfig extends AutoUpdateConfigLoader {
|
public class ExperienceConfig extends ConfigurableLoader {
|
||||||
private static ExperienceConfig instance;
|
private static ExperienceConfig instance;
|
||||||
|
|
||||||
private ExperienceConfig() {
|
private ExperienceConfig() {
|
||||||
super("experience.yml");
|
super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"experience.yml");
|
||||||
validate();
|
validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.gmail.nossr50.core.config.mods;
|
package com.gmail.nossr50.core.config.mods;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.core.util.ModManager;
|
||||||
import com.gmail.nossr50.util.ModManager;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.gmail.nossr50.core.config.mods;
|
package com.gmail.nossr50.core.config.mods;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.core.McmmoCore;
|
||||||
import com.gmail.nossr50.core.config.ConfigLoader;
|
import com.gmail.nossr50.core.config.ConfigLoader;
|
||||||
|
import com.gmail.nossr50.core.config.ConfigurableLoader;
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.ItemType;
|
import com.gmail.nossr50.core.mcmmo.skills.ItemType;
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.MaterialType;
|
import com.gmail.nossr50.core.mcmmo.skills.MaterialType;
|
||||||
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
||||||
@ -14,7 +16,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class CustomArmorConfig extends ConfigLoader {
|
public class CustomArmorConfig extends ConfigurableLoader {
|
||||||
public List<Material> customBoots = new ArrayList<Material>();
|
public List<Material> customBoots = new ArrayList<Material>();
|
||||||
public List<Material> customChestplates = new ArrayList<Material>();
|
public List<Material> customChestplates = new ArrayList<Material>();
|
||||||
public List<Material> customHelmets = new ArrayList<Material>();
|
public List<Material> customHelmets = new ArrayList<Material>();
|
||||||
@ -23,7 +25,7 @@ public class CustomArmorConfig extends ConfigLoader {
|
|||||||
private boolean needsUpdate = false;
|
private boolean needsUpdate = false;
|
||||||
|
|
||||||
protected CustomArmorConfig(String fileName) {
|
protected CustomArmorConfig(String fileName) {
|
||||||
super("mods", fileName);
|
super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName);
|
||||||
loadKeys();
|
loadKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.gmail.nossr50.core.config.mods;
|
package com.gmail.nossr50.core.config.mods;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.core.McmmoCore;
|
||||||
import com.gmail.nossr50.core.config.ConfigLoader;
|
import com.gmail.nossr50.core.config.ConfigLoader;
|
||||||
|
import com.gmail.nossr50.core.config.ConfigurableLoader;
|
||||||
import com.gmail.nossr50.core.mcmmo.mods.CustomBlock;
|
import com.gmail.nossr50.core.mcmmo.mods.CustomBlock;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
@ -10,7 +12,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class CustomBlockConfig extends ConfigLoader {
|
public class CustomBlockConfig extends ConfigurableLoader {
|
||||||
public List<Material> customExcavationBlocks = new ArrayList<>();
|
public List<Material> customExcavationBlocks = new ArrayList<>();
|
||||||
public List<Material> customHerbalismBlocks = new ArrayList<>();
|
public List<Material> customHerbalismBlocks = new ArrayList<>();
|
||||||
public List<Material> customMiningBlocks = new ArrayList<>();
|
public List<Material> customMiningBlocks = new ArrayList<>();
|
||||||
@ -22,7 +24,7 @@ public class CustomBlockConfig extends ConfigLoader {
|
|||||||
private boolean needsUpdate = false;
|
private boolean needsUpdate = false;
|
||||||
|
|
||||||
protected CustomBlockConfig(String fileName) {
|
protected CustomBlockConfig(String fileName) {
|
||||||
super("mods", fileName);
|
super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName);
|
||||||
loadKeys();
|
loadKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.gmail.nossr50.core.config.mods;
|
package com.gmail.nossr50.core.config.mods;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.core.McmmoCore;
|
||||||
import com.gmail.nossr50.core.config.ConfigLoader;
|
import com.gmail.nossr50.core.config.ConfigLoader;
|
||||||
|
import com.gmail.nossr50.core.config.ConfigurableLoader;
|
||||||
import com.gmail.nossr50.core.mcmmo.mods.CustomEntity;
|
import com.gmail.nossr50.core.mcmmo.mods.CustomEntity;
|
||||||
import org.apache.commons.lang.ClassUtils;
|
import org.apache.commons.lang.ClassUtils;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -8,12 +10,12 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class CustomEntityConfig extends ConfigLoader {
|
public class CustomEntityConfig extends ConfigurableLoader {
|
||||||
public HashMap<String, CustomEntity> customEntityClassMap = new HashMap<String, CustomEntity>();
|
public HashMap<String, CustomEntity> customEntityClassMap = new HashMap<String, CustomEntity>();
|
||||||
public HashMap<String, CustomEntity> customEntityTypeMap = new HashMap<String, CustomEntity>();
|
public HashMap<String, CustomEntity> customEntityTypeMap = new HashMap<String, CustomEntity>();
|
||||||
|
|
||||||
protected CustomEntityConfig(String fileName) {
|
protected CustomEntityConfig(String fileName) {
|
||||||
super("mods", fileName);
|
super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName);
|
||||||
loadKeys();
|
loadKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.gmail.nossr50.core.config.mods;
|
package com.gmail.nossr50.core.config.mods;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.core.McmmoCore;
|
||||||
import com.gmail.nossr50.core.config.ConfigLoader;
|
import com.gmail.nossr50.core.config.ConfigLoader;
|
||||||
|
import com.gmail.nossr50.core.config.ConfigurableLoader;
|
||||||
import com.gmail.nossr50.core.mcmmo.mods.CustomTool;
|
import com.gmail.nossr50.core.mcmmo.mods.CustomTool;
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.ItemType;
|
import com.gmail.nossr50.core.mcmmo.skills.ItemType;
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.MaterialType;
|
import com.gmail.nossr50.core.mcmmo.skills.MaterialType;
|
||||||
@ -16,7 +18,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class CustomToolConfig extends ConfigLoader {
|
public class CustomToolConfig extends ConfigurableLoader {
|
||||||
public List<Material> customAxes = new ArrayList<Material>();
|
public List<Material> customAxes = new ArrayList<Material>();
|
||||||
public List<Material> customBows = new ArrayList<Material>();
|
public List<Material> customBows = new ArrayList<Material>();
|
||||||
public List<Material> customHoes = new ArrayList<Material>();
|
public List<Material> customHoes = new ArrayList<Material>();
|
||||||
@ -28,7 +30,7 @@ public class CustomToolConfig extends ConfigLoader {
|
|||||||
private boolean needsUpdate = false;
|
private boolean needsUpdate = false;
|
||||||
|
|
||||||
protected CustomToolConfig(String fileName) {
|
protected CustomToolConfig(String fileName) {
|
||||||
super("mods", fileName);
|
super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName);
|
||||||
loadKeys();
|
loadKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
package com.gmail.nossr50.core.config.party;
|
package com.gmail.nossr50.core.config.party;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.core.McmmoCore;
|
||||||
import com.gmail.nossr50.core.config.ConfigLoader;
|
import com.gmail.nossr50.core.config.ConfigLoader;
|
||||||
|
import com.gmail.nossr50.core.config.ConfigurableLoader;
|
||||||
import com.gmail.nossr50.util.StringUtils;
|
import com.gmail.nossr50.util.StringUtils;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
public class ItemWeightConfig extends ConfigLoader {
|
public class ItemWeightConfig extends ConfigurableLoader {
|
||||||
private static ItemWeightConfig instance;
|
private static ItemWeightConfig instance;
|
||||||
|
|
||||||
private ItemWeightConfig() {
|
private ItemWeightConfig() {
|
||||||
super("itemweights.yml");
|
super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "itemweights.yml");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemWeightConfig getInstance() {
|
public static ItemWeightConfig getInstance() {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.gmail.nossr50.core.config.skills.alchemy;
|
package com.gmail.nossr50.core.config.skills.alchemy;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.core.McmmoCore;
|
||||||
|
import com.gmail.nossr50.core.config.ConfigurableLoader;
|
||||||
import com.gmail.nossr50.core.mcmmo.colors.ChatColor;
|
import com.gmail.nossr50.core.mcmmo.colors.ChatColor;
|
||||||
import com.gmail.nossr50.core.mcmmo.item.ItemStack;
|
import com.gmail.nossr50.core.mcmmo.item.ItemStack;
|
||||||
import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotion;
|
import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotion;
|
||||||
@ -10,7 +12,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class PotionConfig extends ConfigLoader {
|
public class PotionConfig extends ConfigurableLoader {
|
||||||
private static PotionConfig instance;
|
private static PotionConfig instance;
|
||||||
|
|
||||||
private List<ItemStack> concoctionsIngredientsTierOne = new ArrayList<ItemStack>();
|
private List<ItemStack> concoctionsIngredientsTierOne = new ArrayList<ItemStack>();
|
||||||
@ -25,7 +27,7 @@ public class PotionConfig extends ConfigLoader {
|
|||||||
private Map<String, AlchemyPotion> potionMap = new HashMap<String, AlchemyPotion>();
|
private Map<String, AlchemyPotion> potionMap = new HashMap<String, AlchemyPotion>();
|
||||||
|
|
||||||
private PotionConfig() {
|
private PotionConfig() {
|
||||||
super("potions.yml");
|
super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"potions.yml");
|
||||||
loadKeys();
|
loadKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.gmail.nossr50.config.skills.repair;
|
package com.gmail.nossr50.config.skills.repair;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.ConfigLoader;
|
import com.gmail.nossr50.config.ConfigLoader;
|
||||||
|
import com.gmail.nossr50.core.config.ConfigurableLoader;
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.ItemType;
|
import com.gmail.nossr50.core.mcmmo.skills.ItemType;
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.MaterialType;
|
import com.gmail.nossr50.core.mcmmo.skills.MaterialType;
|
||||||
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
||||||
@ -15,7 +16,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class RepairConfig extends ConfigLoader {
|
public class RepairConfig extends ConfigurableLoader {
|
||||||
private List<Repairable> repairables;
|
private List<Repairable> repairables;
|
||||||
|
|
||||||
public RepairConfig(String fileName) {
|
public RepairConfig(String fileName) {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.gmail.nossr50.config.skills.salvage;
|
package com.gmail.nossr50.config.skills.salvage;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.ConfigLoader;
|
import com.gmail.nossr50.config.ConfigLoader;
|
||||||
|
import com.gmail.nossr50.core.McmmoCore;
|
||||||
|
import com.gmail.nossr50.core.config.ConfigurableLoader;
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.ItemType;
|
import com.gmail.nossr50.core.mcmmo.skills.ItemType;
|
||||||
import com.gmail.nossr50.core.mcmmo.skills.MaterialType;
|
import com.gmail.nossr50.core.mcmmo.skills.MaterialType;
|
||||||
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
||||||
@ -15,11 +17,11 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class SalvageConfig extends ConfigLoader {
|
public class SalvageConfig extends ConfigurableLoader {
|
||||||
private List<Salvageable> salvageables;
|
private List<Salvageable> salvageables;
|
||||||
|
|
||||||
public SalvageConfig(String fileName) {
|
public SalvageConfig(String fileName) {
|
||||||
super(fileName);
|
super(McmmoCore.getDataFolderPath().getAbsoluteFile(), fileName);
|
||||||
loadKeys();
|
loadKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.gmail.nossr50.config.skills.salvage;
|
package com.gmail.nossr50.core.config.skills.salvage;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
|
||||||
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -31,7 +31,7 @@ public class SalvageConfigManager {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
SalvageConfig salvageConfig = new SalvageConfig(fileName);
|
com.gmail.nossr50.config.skills.salvage.SalvageConfig salvageConfig = new com.gmail.nossr50.config.skills.salvage.SalvageConfig(fileName);
|
||||||
salvageables.addAll(salvageConfig.getLoadedSalvageables());
|
salvageables.addAll(salvageConfig.getLoadedSalvageables());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,18 @@
|
|||||||
package com.gmail.nossr50.core.config.treasure;
|
package com.gmail.nossr50.core.config.treasure;
|
||||||
|
|
||||||
import com.gmail.nossr50.core.config.ConfigLoader;
|
import com.gmail.nossr50.core.McmmoCore;
|
||||||
import com.gmail.nossr50.util.EnchantmentUtils;
|
import com.gmail.nossr50.core.config.ConfigurableLoader;
|
||||||
import com.gmail.nossr50.util.StringUtils;
|
import com.gmail.nossr50.core.mcmmo.colors.ChatColor;
|
||||||
import org.bukkit.ChatColor;
|
import com.gmail.nossr50.core.mcmmo.item.ItemStack;
|
||||||
import org.bukkit.Material;
|
import com.gmail.nossr50.core.skills.treasure.*;
|
||||||
import org.bukkit.Tag;
|
import com.gmail.nossr50.core.util.EnchantmentUtils;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import com.gmail.nossr50.core.util.StringUtils;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
|
||||||
import org.bukkit.inventory.meta.PotionMeta;
|
|
||||||
import org.bukkit.potion.PotionData;
|
|
||||||
import org.bukkit.potion.PotionType;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TreasureConfig extends ConfigLoader {
|
public class TreasureConfig extends ConfigurableLoader {
|
||||||
|
|
||||||
private static TreasureConfig instance;
|
private static TreasureConfig instance;
|
||||||
|
|
||||||
@ -32,7 +25,7 @@ public class TreasureConfig extends ConfigLoader {
|
|||||||
public HashMap<Rarity, List<EnchantmentTreasure>> fishingEnchantments = new HashMap<Rarity, List<EnchantmentTreasure>>();
|
public HashMap<Rarity, List<EnchantmentTreasure>> fishingEnchantments = new HashMap<Rarity, List<EnchantmentTreasure>>();
|
||||||
|
|
||||||
private TreasureConfig() {
|
private TreasureConfig() {
|
||||||
super("treasures.yml");
|
super(McmmoCore.getDataFolderPath().getAbsoluteFile(),"treasures.yml");
|
||||||
loadKeys();
|
loadKeys();
|
||||||
validate();
|
validate();
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,10 @@ package com.gmail.nossr50.core.util.random;
|
|||||||
|
|
||||||
import com.gmail.nossr50.core.config.AdvancedConfig;
|
import com.gmail.nossr50.core.config.AdvancedConfig;
|
||||||
import com.gmail.nossr50.core.data.UserManager;
|
import com.gmail.nossr50.core.data.UserManager;
|
||||||
|
import com.gmail.nossr50.core.mcmmo.entity.Player;
|
||||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||||
import com.gmail.nossr50.core.util.Permissions;
|
import com.gmail.nossr50.core.util.Permissions;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
public class RandomChanceSkill implements RandomChanceExecution {
|
public class RandomChanceSkill implements RandomChanceExecution {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user