mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-30 20:54:44 +02:00
DynamicSettingsManager - Handles platform specific datasets
Converts datasets from the config into ready to use platform specific ones Currently only supports Bukkit, that will change later Expect API breakages if you hook into this class
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
//package com.gmail.nossr50.util;
|
||||
//
|
||||
//import com.gmail.nossr50.config.MainConfig;
|
||||
//import com.gmail.nossr50.config.mods.CustomArmorConfig;
|
||||
//import com.gmail.nossr50.config.mods.CustomBlockConfig;
|
||||
//import com.gmail.nossr50.config.mods.CustomEntityConfig;
|
||||
//import com.gmail.nossr50.config.mods.CustomToolConfig;
|
||||
//import com.gmail.nossr50.dumpster.mods.CustomArmorConfig;
|
||||
//import com.gmail.nossr50.dumpster.mods.CustomBlockConfig;
|
||||
//import com.gmail.nossr50.dumpster.mods.CustomEntityConfig;
|
||||
//import com.gmail.nossr50.dumpster.mods.CustomToolConfig;
|
||||
//import com.gmail.nossr50.datatypes.mods.CustomBlock;
|
||||
//import com.gmail.nossr50.datatypes.mods.CustomEntity;
|
||||
//import com.gmail.nossr50.datatypes.mods.CustomTool;
|
||||
|
@ -0,0 +1,31 @@
|
||||
//package com.gmail.nossr50.dumpster.mods;
|
||||
//
|
||||
//public class ArmorConfigManager {
|
||||
// //TODO: Commented out until modded servers appear again
|
||||
// /*public ArmorConfigManager() {
|
||||
// Pattern middlePattern = Pattern.compile("armor\\.(?:.+)\\.yml");
|
||||
// Pattern startPattern = Pattern.compile("(?:.+)\\.armor\\.yml");
|
||||
// //File dataFolder = new File(McmmoCore.getModDataFolderPath());
|
||||
// File dataFolder = new File(mcMMO.p.getModDirectory());
|
||||
// File vanilla = new File(dataFolder, "armor.default.yml");
|
||||
// ModManager modManager = mcMMO.getModManager();
|
||||
//
|
||||
// if (!vanilla.exists()) {
|
||||
// mcMMO.p.saveResource(vanilla.getParentFile().getName() + File.separator + "armor.default.yml", false);
|
||||
// }
|
||||
//
|
||||
// for (String fileName : dataFolder.list()) {
|
||||
// if (!middlePattern.matcher(fileName).matches() && !startPattern.matcher(fileName).matches()) {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// File file = new File(dataFolder, fileName);
|
||||
//
|
||||
// if (file.isDirectory()) {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// modManager.registerCustomArmor(new CustomArmorConfig(fileName));
|
||||
// }
|
||||
// }*/
|
||||
//}
|
@ -0,0 +1,31 @@
|
||||
//package com.gmail.nossr50.dumpster.mods;
|
||||
//
|
||||
//public class BlockConfigManager {
|
||||
// //TODO: Commented out until modded servers appear again
|
||||
// /*public BlockConfigManager() {
|
||||
// Pattern middlePattern = Pattern.compile("blocks\\.(?:.+)\\.yml");
|
||||
// Pattern startPattern = Pattern.compile("(?:.+)\\.blocks\\.yml");
|
||||
// //File dataFolder = new File(McmmoCore.getModDataFolderPath());
|
||||
// File dataFolder = new File(mcMMO.getModDirectory());
|
||||
// File vanilla = new File(dataFolder, "blocks.default.yml");
|
||||
// ModManager modManager = mcMMO.getModManager();
|
||||
//
|
||||
// if (!vanilla.exists()) {
|
||||
// mcMMO.p.saveResource(vanilla.getParentFile().getName() + File.separator + "blocks.default.yml", false);
|
||||
// }
|
||||
//
|
||||
// for (String fileName : dataFolder.list()) {
|
||||
// if (!middlePattern.matcher(fileName).matches() && !startPattern.matcher(fileName).matches()) {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// File file = new File(dataFolder, fileName);
|
||||
//
|
||||
// if (file.isDirectory()) {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// modManager.registerCustomBlocks(new CustomBlockConfig(fileName));
|
||||
// }
|
||||
// }*/
|
||||
//}
|
@ -0,0 +1,111 @@
|
||||
//package com.gmail.nossr50.dumpster.mods;
|
||||
//
|
||||
//import com.gmail.nossr50.config.ConfigCollection;
|
||||
//import com.gmail.nossr50.datatypes.skills.ItemMaterialCategory;
|
||||
//import com.gmail.nossr50.mcMMO;
|
||||
//import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
||||
//import com.gmail.nossr50.skills.repair.repairables.RepairableFactory;
|
||||
//import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
//import org.bukkit.Material;
|
||||
//import org.bukkit.configuration.ConfigurationSection;
|
||||
//import org.bukkit.inventory.ItemStack;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.List;
|
||||
//import java.util.Set;
|
||||
//
|
||||
//public class CustomArmorConfig extends ConfigCollection {
|
||||
// public List<Material> customBoots = new ArrayList<Material>();
|
||||
// public List<Material> customChestplates = new ArrayList<Material>();
|
||||
// public List<Material> customHelmets = new ArrayList<Material>();
|
||||
// public List<Material> customLeggings = new ArrayList<Material>();
|
||||
// public List<Repairable> repairables = new ArrayList<Repairable>();
|
||||
// private boolean needsUpdate = false;
|
||||
//
|
||||
// protected CustomArmorConfig(String fileName) {
|
||||
// //super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName, false);
|
||||
// super(mcMMO.p.getDataFolder().getPath() + "mods", fileName, false); register();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * The version of this config
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public double getConfigVersion() {
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void register() {
|
||||
// loadArmor("Boots", customBoots);
|
||||
// loadArmor("Chestplates", customChestplates);
|
||||
// loadArmor("Helmets", customHelmets);
|
||||
// loadArmor("Leggings", customLeggings);
|
||||
//
|
||||
// if (needsUpdate) {
|
||||
// needsUpdate = false;
|
||||
// backup();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void loadArmor(String armorType, List<Material> materialList) {
|
||||
// if (needsUpdate) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// ConfigurationSection armorSection = config.getConfigurationSection(armorType);
|
||||
//
|
||||
// if (armorSection == null) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// Set<String> armorConfigSet = armorSection.getKeys(false);
|
||||
//
|
||||
// for (String armorName : armorConfigSet) {
|
||||
// if (config.contains(armorType + "." + armorName + "." + ".ID")) {
|
||||
// needsUpdate = true;
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// Material armorMaterial = Material.matchMaterial(armorName);
|
||||
//
|
||||
// if (armorMaterial == null) {
|
||||
// plugin.getLogger().warning("Invalid material name. This item will be skipped. - " + armorName);
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// boolean repairable = getBooleanValue(armorType + "." + armorName + ".Repairable");
|
||||
// Material repairMaterial = Material.matchMaterial(getStringValue(armorType + "." + armorName + ".Repair_Material", ""));
|
||||
//
|
||||
// if (repairable && (repairMaterial == null)) {
|
||||
// plugin.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + armorName);
|
||||
// repairable = false;
|
||||
// }
|
||||
//
|
||||
// if (repairable) {
|
||||
// byte repairData = (byte) getIntValue(armorType + "." + armorName + ".Repair_Material_Data_Value", -1);
|
||||
// int repairQuantity = SkillUtils.getRepairAndSalvageQuantities(new ItemStack(armorMaterial), repairMaterial, repairData);
|
||||
//
|
||||
// if (repairQuantity == 0) {
|
||||
// repairQuantity = getIntValue(armorType + "." + armorName + ".Repair_Material_Quantity", 2);
|
||||
// }
|
||||
//
|
||||
// String repairItemName = getStringValue(armorType + "." + armorName + ".Repair_Material_Pretty_Name");
|
||||
// int repairMinimumLevel = getIntValue(armorType + "." + armorName + ".Repair_MinimumLevel", 0);
|
||||
// double repairXpMultiplier = getDoubleValue(armorType + "." + armorName + ".Repair_XpMultiplier", 1);
|
||||
//
|
||||
// short durability = armorMaterial.getMaxDurability();
|
||||
//
|
||||
// if (durability == 0) {
|
||||
// durability = (short) getIntValue(armorType + "." + armorName + ".Durability", 70);
|
||||
// }
|
||||
//
|
||||
// repairables.add(RepairableFactory.getRepairable(armorMaterial, repairMaterial, repairData, repairItemName, repairMinimumLevel, repairQuantity, durability, ConfigItemCategory.ARMOR, ItemMaterialCategory.OTHER, repairXpMultiplier));
|
||||
// }
|
||||
//
|
||||
// materialList.add(armorMaterial);
|
||||
// }
|
||||
// }
|
||||
//}
|
@ -0,0 +1,99 @@
|
||||
//package com.gmail.nossr50.dumpster.mods;
|
||||
//
|
||||
//import com.gmail.nossr50.config.ConfigCollection;
|
||||
//import com.gmail.nossr50.datatypes.mods.CustomBlock;
|
||||
//import com.gmail.nossr50.mcMMO;
|
||||
//import org.bukkit.Material;
|
||||
//import org.bukkit.configuration.ConfigurationSection;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.HashMap;
|
||||
//import java.util.List;
|
||||
//import java.util.Set;
|
||||
//
|
||||
//public class CustomBlockConfig extends ConfigCollection {
|
||||
// public List<Material> customExcavationBlocks = new ArrayList<>();
|
||||
// public List<Material> customHerbalismBlocks = new ArrayList<>();
|
||||
// public List<Material> customMiningBlocks = new ArrayList<>();
|
||||
// public List<Material> customOres = new ArrayList<>();
|
||||
// public List<Material> customLogs = new ArrayList<>();
|
||||
// public List<Material> customLeaves = new ArrayList<>();
|
||||
// public List<Material> customAbilityBlocks = new ArrayList<>();
|
||||
// public HashMap<Material, CustomBlock> customBlockMap = new HashMap<>();
|
||||
// private boolean needsUpdate = false;
|
||||
//
|
||||
// protected CustomBlockConfig(String fileName) {
|
||||
// //super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName, false);
|
||||
// super(mcMMO.p.getDataFolder().getPath() + "mods", fileName, false);
|
||||
// register();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void register() {
|
||||
// loadBlocks("Excavation", customExcavationBlocks);
|
||||
// loadBlocks("Herbalism", customHerbalismBlocks);
|
||||
// loadBlocks("Mining", customMiningBlocks);
|
||||
// loadBlocks("Woodcutting", null);
|
||||
// loadBlocks("Ability_Blocks", customAbilityBlocks);
|
||||
//
|
||||
// if (needsUpdate) {
|
||||
// needsUpdate = false;
|
||||
// backup();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void loadBlocks(String skillType, List<Material> blockList) {
|
||||
// if (needsUpdate) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// ConfigurationSection skillSection = config.getConfigurationSection(skillType);
|
||||
//
|
||||
// if (skillSection == null) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// Set<String> skillConfigSet = skillSection.getKeys(false);
|
||||
//
|
||||
// for (String blockName : skillConfigSet) {
|
||||
// if (config.contains(skillType + "." + blockName + ".Drop_Item")) {
|
||||
// needsUpdate = true;
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// String[] blockInfo = blockName.split("[|]");
|
||||
//
|
||||
// Material blockMaterial = Material.matchMaterial(blockInfo[0]);
|
||||
//
|
||||
// if (blockMaterial == null) {
|
||||
// plugin.getLogger().warning("Invalid material name. This item will be skipped. - " + blockInfo[0]);
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// if (blockList != null) {
|
||||
// blockList.add(blockMaterial);
|
||||
// }
|
||||
//
|
||||
// if (skillType.equals("Ability_Blocks")) {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// int xp = getIntValue(skillType + "." + blockName + ".XP_Gain");
|
||||
// int smeltingXp = 0;
|
||||
//
|
||||
// if (skillType.equals("Mining") && getBooleanValue(skillType + "." + blockName + ".Is_Ore")) {
|
||||
// customOres.add(blockMaterial);
|
||||
// smeltingXp = getIntValue(skillType + "." + blockName + ".Smelting_XP_Gain", xp / 10);
|
||||
// } else if (skillType.equals("Woodcutting")) {
|
||||
// if (getBooleanValue(skillType + "." + blockName + ".Is_Log")) {
|
||||
// customLogs.add(blockMaterial);
|
||||
// } else {
|
||||
// customLeaves.add(blockMaterial);
|
||||
// xp = 0; // Leaves don't grant XP
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// customBlockMap.put(blockMaterial, new CustomBlock(xp, getBooleanValue(skillType + "." + blockName + ".Double_Drops_Enabled"), smeltingXp));
|
||||
// }
|
||||
// }
|
||||
//}
|
@ -0,0 +1,63 @@
|
||||
//
|
||||
//package com.gmail.nossr50.dumpster.mods;
|
||||
//
|
||||
//import com.gmail.nossr50.config.Config;
|
||||
//import com.gmail.nossr50.datatypes.mods.CustomEntity;
|
||||
//import com.gmail.nossr50.mcMMO;
|
||||
//import org.apache.commons.lang.ClassUtils;
|
||||
//import org.bukkit.Material;
|
||||
//import org.bukkit.inventory.ItemStack;
|
||||
//
|
||||
//import java.util.HashMap;
|
||||
//
|
||||
//public class CustomEntityConfig extends Config {
|
||||
// public HashMap<String, CustomEntity> customEntityClassMap = new HashMap<String, CustomEntity>();
|
||||
// public HashMap<String, CustomEntity> customEntityTypeMap = new HashMap<String, CustomEntity>();
|
||||
//
|
||||
// protected CustomEntityConfig(String fileName) {
|
||||
// //super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName, false);
|
||||
// super(mcMMO.p.getDataFolder().getPath() + "mods", fileName, false);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void loadKeys() {
|
||||
// if (config.getConfigurationSection("Hostile") != null) {
|
||||
// backup();
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// for (String entityName : config.getKeys(false)) {
|
||||
// Class<?> clazz = null;
|
||||
// String className = getStringValue(entityName + ".Class", "");
|
||||
//
|
||||
// try {
|
||||
// clazz = ClassUtils.getClass(className);
|
||||
// } catch (ClassNotFoundException e) {
|
||||
// plugin.getLogger().warning("Invalid class (" + className + ") detected for " + entityName + ".");
|
||||
// plugin.getLogger().warning("This custom entity may not function properly.");
|
||||
// }
|
||||
//
|
||||
// String entityTypeName = entityName.replace("_", ".");
|
||||
// double xpMultiplier = getDoubleValue(entityName + ".XP_Multiplier", 1.0D);
|
||||
//
|
||||
// boolean canBeTamed = getBooleanValue(entityName + ".Tameable");
|
||||
// int tamingXp = getIntValue(entityName + ".Taming_XP");
|
||||
//
|
||||
// boolean canBeSummoned = getBooleanValue(entityName + ".CanBeSummoned");
|
||||
// Material callOfTheWildMaterial = Material.matchMaterial(getStringValue(entityName + ".COTW_Material", ""));
|
||||
// byte callOfTheWildData = (byte) getIntValue(entityName + ".COTW_Material_Data");
|
||||
// int callOfTheWildAmount = getIntValue(entityName + ".COTW_Material_Amount");
|
||||
//
|
||||
// if (canBeSummoned && (callOfTheWildMaterial == null || callOfTheWildAmount == 0)) {
|
||||
// plugin.getLogger().warning("Incomplete Call of the Wild information. This entity will not be able to be summoned by Call of the Wild.");
|
||||
// canBeSummoned = false;
|
||||
// }
|
||||
//
|
||||
// CustomEntity entity = new CustomEntity(xpMultiplier, canBeTamed, tamingXp, canBeSummoned, (canBeSummoned ? new ItemStack(callOfTheWildMaterial) : null), callOfTheWildAmount);
|
||||
//
|
||||
// customEntityTypeMap.put(entityTypeName, entity);
|
||||
// customEntityClassMap.put(clazz == null ? null : clazz.getName(), entity);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//*/
|
@ -0,0 +1,102 @@
|
||||
package com.gmail.nossr50.dumpster.mods;
|
||||
|
||||
/*
|
||||
public class CustomToolConfig extends Config {
|
||||
//TODO: Disabled until modded servers come back
|
||||
public List<Material> customAxes = new ArrayList<Material>();
|
||||
public List<Material> customBows = new ArrayList<Material>();
|
||||
public List<Material> customHoes = new ArrayList<Material>();
|
||||
public List<Material> customPickaxes = new ArrayList<Material>();
|
||||
public List<Material> customShovels = new ArrayList<Material>();
|
||||
public List<Material> customSwords = new ArrayList<Material>();
|
||||
public HashMap<Material, CustomTool> customToolMap = new HashMap<Material, CustomTool>();
|
||||
public List<Repairable> repairables = new ArrayList<Repairable>();
|
||||
private boolean needsUpdate = false;
|
||||
|
||||
protected CustomToolConfig(String fileName) {
|
||||
//super(McmmoCore.getDataFolderPath().getPath() + "mods", fileName, false);
|
||||
super(mcMMO.p.getDataFolder().getPath() + "mods", fileName, false);
|
||||
loadKeys();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadKeys() {
|
||||
loadTool("Axes", customAxes);
|
||||
loadTool("Bows", customBows);
|
||||
loadTool("Hoes", customHoes);
|
||||
loadTool("Pickaxes", customPickaxes);
|
||||
loadTool("Shovels", customShovels);
|
||||
loadTool("Swords", customSwords);
|
||||
|
||||
if (needsUpdate) {
|
||||
needsUpdate = false;
|
||||
backup();
|
||||
}
|
||||
}
|
||||
|
||||
private void loadTool(String toolType, List<Material> materialList) {
|
||||
if (needsUpdate) {
|
||||
return;
|
||||
}
|
||||
|
||||
ConfigurationSection toolSection = config.getConfigurationSection(toolType);
|
||||
|
||||
if (toolSection == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Set<String> toolConfigSet = toolSection.getKeys(false);
|
||||
|
||||
for (String toolName : toolConfigSet) {
|
||||
if (config.contains(toolType + "." + toolName + "." + ".ID")) {
|
||||
needsUpdate = true;
|
||||
return;
|
||||
}
|
||||
|
||||
Material toolMaterial = Material.matchMaterial(toolName);
|
||||
|
||||
if (toolMaterial == null) {
|
||||
plugin.getLogger().warning("Invalid material name. This item will be skipped. - " + toolName);
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean repairable = getBooleanValue(toolType + "." + toolName + ".Repairable");
|
||||
Material repairMaterial = Material.matchMaterial(getStringValue(toolType + "." + toolName + ".Repair_Material", ""));
|
||||
|
||||
if (repairable && (repairMaterial == null)) {
|
||||
plugin.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + toolName);
|
||||
repairable = false;
|
||||
}
|
||||
|
||||
if (repairable) {
|
||||
byte repairData = (byte) getIntValue(toolType + "." + toolName + ".Repair_Material_Data_Value", -1);
|
||||
int repairQuantity = SkillUtils.getRepairAndSalvageQuantities(new ItemStack(toolMaterial), repairMaterial, repairData);
|
||||
|
||||
if (repairQuantity == 0) {
|
||||
repairQuantity = getIntValue(toolType + "." + toolName + ".Repair_Material_Quantity", 2);
|
||||
}
|
||||
|
||||
String repairItemName = getStringValue(toolType + "." + toolName + ".Repair_Material_Pretty_Name");
|
||||
int repairMinimumLevel = getIntValue(toolType + "." + toolName + ".Repair_MinimumLevel", 0);
|
||||
double repairXpMultiplier = getDoubleValue(toolType + "." + toolName + ".Repair_XpMultiplier", 1);
|
||||
|
||||
short durability = toolMaterial.getMaxDurability();
|
||||
|
||||
if (durability == 0) {
|
||||
durability = (short) getIntValue(toolType + "." + toolName + ".Durability", 60);
|
||||
}
|
||||
|
||||
repairables.add(RepairableFactory.getRepairable(toolMaterial, repairMaterial, repairData, repairItemName, repairMinimumLevel, repairQuantity, durability, ItemType.TOOL, ItemMaterialCategory.OTHER, repairXpMultiplier));
|
||||
}
|
||||
|
||||
double multiplier = getDoubleValue(toolType + "." + toolName + ".XP_Modifier", 1.0);
|
||||
boolean abilityEnabled = getBooleanValue(toolType + "." + toolName + ".Ability_Enabled", true);
|
||||
int tier = getIntValue(toolType + "." + toolName + ".Tier", 1);
|
||||
|
||||
CustomTool tool = new CustomTool(tier, abilityEnabled, multiplier);
|
||||
|
||||
materialList.add(toolMaterial);
|
||||
customToolMap.put(toolMaterial, tool);
|
||||
}
|
||||
}
|
||||
}*/
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
package com.gmail.nossr50.dumpster.mods;
|
||||
|
||||
|
||||
public class EntityConfigManager {
|
||||
//TODO: Commented out until modded servers appear again
|
||||
*/
|
||||
/*public EntityConfigManager(mcMMO plugin) {
|
||||
Pattern middlePattern = Pattern.compile("entities\\.(?:.+)\\.yml");
|
||||
Pattern startPattern = Pattern.compile("(?:.+)\\.entities\\.yml");
|
||||
File dataFolder = new File(mcMMO.getModDirectory());
|
||||
File vanilla = new File(dataFolder, "entities.default.yml");
|
||||
ModManager modManager = mcMMO.getModManager();
|
||||
|
||||
if (!vanilla.exists()) {
|
||||
plugin.saveResource(vanilla.getParentFile().getName() + File.separator + "entities.default.yml", false);
|
||||
}
|
||||
|
||||
for (String fileName : dataFolder.list()) {
|
||||
if (!middlePattern.matcher(fileName).matches() && !startPattern.matcher(fileName).matches()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
File file = new File(dataFolder, fileName);
|
||||
|
||||
if (file.isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
modManager.registerCustomEntities(new CustomEntityConfig(fileName));
|
||||
}
|
||||
}*//*
|
||||
|
||||
}
|
||||
*/
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
package com.gmail.nossr50.dumpster.mods;
|
||||
|
||||
|
||||
public class ToolConfigManager {
|
||||
//TODO: Commented out until modded servers appear again
|
||||
*/
|
||||
/*public ToolConfigManager(mcMMO plugin) {
|
||||
Pattern middlePattern = Pattern.compile("tools\\.(?:.+)\\.yml");
|
||||
Pattern startPattern = Pattern.compile("(?:.+)\\.tools\\.yml");
|
||||
File dataFolder = new File(mcMMO.getModDirectory());
|
||||
File vanilla = new File(dataFolder, "tools.default.yml");
|
||||
ModManager modManager = mcMMO.getModManager();
|
||||
|
||||
if (!vanilla.exists()) {
|
||||
plugin.saveResource(vanilla.getParentFile().getName() + File.separator + "tools.default.yml", false);
|
||||
}
|
||||
|
||||
for (String fileName : dataFolder.list()) {
|
||||
if (!middlePattern.matcher(fileName).matches() && !startPattern.matcher(fileName).matches()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
File file = new File(dataFolder, fileName);
|
||||
|
||||
if (file.isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
modManager.registerCustomTools(new CustomToolConfig(fileName));
|
||||
}
|
||||
}*//*
|
||||
|
||||
}
|
||||
*/
|
Reference in New Issue
Block a user