Fix mcMMO saving copies of config files into the main server directory instead of the correct place

This commit is contained in:
nossr50
2021-04-09 10:19:34 -07:00
parent 6d057c577e
commit c1c32cb1fd
13 changed files with 64 additions and 49 deletions

View File

@@ -3,6 +3,7 @@ package com.gmail.nossr50.config.mods;
import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.datatypes.skills.ItemType;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.skills.repair.repairables.RepairableFactory;
import org.bukkit.Material;
@@ -62,7 +63,7 @@ public class CustomArmorConfig extends ConfigLoader {
Material armorMaterial = Material.matchMaterial(armorName);
if (armorMaterial == null) {
plugin.getLogger().warning("Invalid material name. This item will be skipped. - " + armorName);
mcMMO.p.getLogger().warning("Invalid material name. This item will be skipped. - " + armorName);
continue;
}
@@ -70,7 +71,7 @@ public class CustomArmorConfig extends ConfigLoader {
Material repairMaterial = Material.matchMaterial(config.getString(armorType + "." + armorName + ".Repair_Material", ""));
if (repairable && (repairMaterial == null)) {
plugin.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + armorName);
mcMMO.p.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + armorName);
repairable = false;
}

View File

@@ -2,6 +2,7 @@ package com.gmail.nossr50.config.mods;
import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.datatypes.mods.CustomBlock;
import com.gmail.nossr50.mcMMO;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
@@ -66,7 +67,7 @@ public class CustomBlockConfig extends ConfigLoader {
Material blockMaterial = Material.matchMaterial(blockInfo[0]);
if (blockMaterial == null) {
plugin.getLogger().warning("Invalid material name. This item will be skipped. - " + blockInfo[0]);
mcMMO.p.getLogger().warning("Invalid material name. This item will be skipped. - " + blockInfo[0]);
continue;
}

View File

@@ -2,6 +2,7 @@ package com.gmail.nossr50.config.mods;
import com.gmail.nossr50.config.ConfigLoader;
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;
@@ -32,8 +33,8 @@ public class CustomEntityConfig extends ConfigLoader {
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.");
mcMMO.p.getLogger().warning("Invalid class (" + className + ") detected for " + entityName + ".");
mcMMO.p.getLogger().warning("This custom entity may not function properly.");
}
String entityTypeName = entityName.replace("_", ".");
@@ -48,7 +49,7 @@ public class CustomEntityConfig extends ConfigLoader {
int callOfTheWildAmount = config.getInt(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.");
mcMMO.p.getLogger().warning("Incomplete Call of the Wild information. This entity will not be able to be summoned by Call of the Wild.");
canBeSummoned = false;
}

View File

@@ -4,6 +4,7 @@ import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.datatypes.mods.CustomTool;
import com.gmail.nossr50.datatypes.skills.ItemType;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.skills.repair.repairables.RepairableFactory;
import org.bukkit.Material;
@@ -70,7 +71,7 @@ public class CustomToolConfig extends ConfigLoader {
Material toolMaterial = Material.matchMaterial(toolName);
if (toolMaterial == null) {
plugin.getLogger().warning("Invalid material name. This item will be skipped. - " + toolName);
mcMMO.p.getLogger().warning("Invalid material name. This item will be skipped. - " + toolName);
continue;
}
@@ -78,7 +79,7 @@ public class CustomToolConfig extends ConfigLoader {
Material repairMaterial = Material.matchMaterial(config.getString(toolType + "." + toolName + ".Repair_Material", ""));
if (repairable && (repairMaterial == null)) {
plugin.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + toolName);
mcMMO.p.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + toolName);
repairable = false;
}