Get mod config file resources properly

Fixes #1870 for real
This commit is contained in:
TfT_02 2014-02-16 23:31:34 +01:00
parent 8a284c50a2
commit 0a6735110f
4 changed files with 16 additions and 16 deletions

View File

@ -1,11 +1,11 @@
package com.gmail.nossr50.config.mods; package com.gmail.nossr50.config.mods;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ModManager;
import java.io.File; import java.io.File;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ModManager;
public class ArmorConfigManager { public class ArmorConfigManager {
public ArmorConfigManager(mcMMO plugin) { public ArmorConfigManager(mcMMO plugin) {
Pattern middlePattern = Pattern.compile("armor\\.(?:.+)\\.yml"); Pattern middlePattern = Pattern.compile("armor\\.(?:.+)\\.yml");
@ -15,7 +15,7 @@ public class ArmorConfigManager {
ModManager modManager = mcMMO.getModManager(); ModManager modManager = mcMMO.getModManager();
if (!vanilla.exists()) { if (!vanilla.exists()) {
plugin.saveResource(plugin.getDataFolder().getName() + File.separator + "armor.default.yml", false); plugin.saveResource(vanilla.getParentFile().getName() + File.separator + "armor.default.yml", false);
} }
for (String fileName : dataFolder.list()) { for (String fileName : dataFolder.list()) {

View File

@ -1,11 +1,11 @@
package com.gmail.nossr50.config.mods; package com.gmail.nossr50.config.mods;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ModManager;
import java.io.File; import java.io.File;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ModManager;
public class BlockConfigManager { public class BlockConfigManager {
public BlockConfigManager(mcMMO plugin) { public BlockConfigManager(mcMMO plugin) {
Pattern middlePattern = Pattern.compile("blocks\\.(?:.+)\\.yml"); Pattern middlePattern = Pattern.compile("blocks\\.(?:.+)\\.yml");
@ -15,7 +15,7 @@ public class BlockConfigManager {
ModManager modManager = mcMMO.getModManager(); ModManager modManager = mcMMO.getModManager();
if (!vanilla.exists()) { if (!vanilla.exists()) {
plugin.saveResource(plugin.getDataFolder().getName() + File.separator + "blocks.default.yml", false); plugin.saveResource(vanilla.getParentFile().getName() + File.separator + "blocks.default.yml", false);
} }
for (String fileName : dataFolder.list()) { for (String fileName : dataFolder.list()) {

View File

@ -1,11 +1,11 @@
package com.gmail.nossr50.config.mods; package com.gmail.nossr50.config.mods;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ModManager;
import java.io.File; import java.io.File;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ModManager;
public class EntityConfigManager { public class EntityConfigManager {
public EntityConfigManager(mcMMO plugin) { public EntityConfigManager(mcMMO plugin) {
Pattern middlePattern = Pattern.compile("entities\\.(?:.+)\\.yml"); Pattern middlePattern = Pattern.compile("entities\\.(?:.+)\\.yml");
@ -15,7 +15,7 @@ public class EntityConfigManager {
ModManager modManager = mcMMO.getModManager(); ModManager modManager = mcMMO.getModManager();
if (!vanilla.exists()) { if (!vanilla.exists()) {
plugin.saveResource(plugin.getDataFolder().getName() + File.separator + "entities.default.yml", false); plugin.saveResource(vanilla.getParentFile().getName() + File.separator + "entities.default.yml", false);
} }
for (String fileName : dataFolder.list()) { for (String fileName : dataFolder.list()) {

View File

@ -1,11 +1,11 @@
package com.gmail.nossr50.config.mods; package com.gmail.nossr50.config.mods;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ModManager;
import java.io.File; import java.io.File;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.ModManager;
public class ToolConfigManager { public class ToolConfigManager {
public ToolConfigManager(mcMMO plugin) { public ToolConfigManager(mcMMO plugin) {
Pattern middlePattern = Pattern.compile("tools\\.(?:.+)\\.yml"); Pattern middlePattern = Pattern.compile("tools\\.(?:.+)\\.yml");
@ -15,7 +15,7 @@ public class ToolConfigManager {
ModManager modManager = mcMMO.getModManager(); ModManager modManager = mcMMO.getModManager();
if (!vanilla.exists()) { if (!vanilla.exists()) {
plugin.saveResource(plugin.getDataFolder().getName() + File.separator + "tools.default.yml", false); plugin.saveResource(vanilla.getParentFile().getName() + File.separator + "tools.default.yml", false);
} }
for (String fileName : dataFolder.list()) { for (String fileName : dataFolder.list()) {