Merge branch 'master' of github.com:Multiverse/Multiverse-Core

This commit is contained in:
Eric Stokes 2011-10-16 09:43:01 -06:00
commit ea920c1252
2 changed files with 5 additions and 6 deletions

View File

@ -256,7 +256,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
public void loadConfigs() {
// Now grab the Configuration Files.
this.multiverseConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "config.yml"));
Configuration coreDefaults = YamlConfiguration.loadConfiguration(this.getClass().getResourceAsStream(File.separator + "defaults" + File.separator + "config.yml"));
Configuration coreDefaults = YamlConfiguration.loadConfiguration(this.getClass().getResourceAsStream("/defaults/config.yml"));
this.multiverseConfig.setDefaults(coreDefaults);
this.multiverseConfig.options().copyDefaults(true);
this.worldManager.loadWorldConfig(new File(getDataFolder(), "worlds.yml"));

View File

@ -197,11 +197,9 @@ public class WorldManager implements MVWorldManager {
*/
public Boolean deleteWorld(String name) {
if (this.plugin.getServer().getWorld(name) != null) {
if (!unloadWorldFromBukkit(name, false)) {
// If the world was loaded, and we couldn't unload it, return false. DON"T DELTEE
return false;
}
if (this.plugin.getServer().getWorld(name) == null) {
// We can only delete loaded worlds
return false;
}
removeWorldFromConfig(name);
try {
@ -225,6 +223,7 @@ public class WorldManager implements MVWorldManager {
this.plugin.log(Level.SEVERE, "rm " + worldFile.getAbsolutePath());
return false;
}
plugin.log(Level.FINER, "deleteWorld(): worldFile: " + worldFile.getAbsolutePath());
boolean deletedWorld = FileUtils.deleteFolder(worldFile);
if (deletedWorld) {
this.plugin.log(Level.INFO, "World " + name + " was DELETED.");