diff --git a/nbproject/project.properties b/nbproject/project.properties index f743ded..d3cf9b7 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -26,7 +26,7 @@ dist.jar=${dist.dir}/TotalFreedomMod.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= -file.reference.bukkit-0.0.1-SNAPSHOT.jar=C:\\github\\bukkit-0.0.1-SNAPSHOT.jar +file.reference.bukkit-0.0.1-SNAPSHOT.jar=C:\\github\\Bukkit\\target\\bukkit-0.0.1-SNAPSHOT.jar file.reference.MobDisguise.jar=C:\\github\\MobDisguise\\dist\\MobDisguise.jar includes=** jar.compress=false diff --git a/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java b/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java index b4d5f5f..f313138 100644 --- a/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java +++ b/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java @@ -72,7 +72,7 @@ public class TotalFreedomMod extends JavaPlugin @Override public void onEnable() { - loadConfig(); + loadTFMConfig(); registerEventHandlers(); @@ -219,8 +219,10 @@ public class TotalFreedomMod extends JavaPlugin return removed; } - private void loadConfig() + private void loadTFMConfig() { + log.info("[Total Freedom Mod] Loading configuration..."); + createDefaultConfiguration("config.yml"); FileConfiguration config = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "config.yml")); @@ -259,13 +261,15 @@ public class TotalFreedomMod extends JavaPlugin File actual = new File(getDataFolder(), name); if (!actual.exists()) { + log.info("[Total Freedom Mod]: Loading default configuration file: " + name); InputStream input = null; try { JarFile file = new JarFile(getFile()); - ZipEntry copy = file.getEntry("src/" + name); + ZipEntry copy = file.getEntry(name); if (copy == null) { + log.severe("[TotalFreedomMod]: Unable to read default configuration: " + name); return; } input = file.getInputStream(copy); @@ -280,6 +284,7 @@ public class TotalFreedomMod extends JavaPlugin try { + getDataFolder().mkdirs(); output = new FileOutputStream(actual); byte[] buf = new byte[8192]; int length = 0; @@ -288,11 +293,11 @@ public class TotalFreedomMod extends JavaPlugin output.write(buf, 0, length); } - log.info("[TotalFreedomMod]: Default configuration file written: " + name); + log.info("[Total Freedom Mod]: Default configuration file written: " + name); } catch (IOException ioex) { - log.severe("[TotalFreedomMod]: Unable to write default configuration: " + name); + log.log(Level.SEVERE, "[Total Freedom Mod]: Unable to write default configuration: " + name, ioex); } finally {