From 64a7a1ad8b3f335145f65a0992e2794df6cb7048 Mon Sep 17 00:00:00 2001 From: Eric Stokes Date: Wed, 13 Jul 2011 18:24:09 -0600 Subject: [PATCH] Add config.yml to the migrator --- .../MultiverseCore/MVConfigMigrator.java | 10 +++++++++- .../MultiverseCore/MultiverseCore.java | 2 -- src/defaults/config.yml | 17 ----------------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/src/com/onarandombox/MultiverseCore/MVConfigMigrator.java b/src/com/onarandombox/MultiverseCore/MVConfigMigrator.java index be8cecb6..6559e155 100644 --- a/src/com/onarandombox/MultiverseCore/MVConfigMigrator.java +++ b/src/com/onarandombox/MultiverseCore/MVConfigMigrator.java @@ -98,8 +98,16 @@ public class MVConfigMigrator { private boolean migrateMainConfig(String name, File oldFolder, File newFolder) { Configuration newConfig = new Configuration(new File(newFolder, "config.yml")); this.core.log(Level.INFO, "Migrating config.yml..."); - Configuration oldConfig = new Configuration(oldFolder); + Configuration oldConfig = new Configuration(new File(oldFolder, "MultiVerse.yml")); oldConfig.load(); + newConfig.setProperty("worldnameprefix", oldConfig.getProperty("prefix")); + newConfig.setProperty("messagecooldown", oldConfig.getProperty("alertcooldown")); + // Default values: + newConfig.setProperty("opfallback", true); + newConfig.setProperty("disableautoheal", false); + newConfig.setProperty("fakepvp", false); + newConfig.setProperty("bedrespawn", true); + newConfig.save(); return true; } } diff --git a/src/com/onarandombox/MultiverseCore/MultiverseCore.java b/src/com/onarandombox/MultiverseCore/MultiverseCore.java index 612be053..de70cce6 100644 --- a/src/com/onarandombox/MultiverseCore/MultiverseCore.java +++ b/src/com/onarandombox/MultiverseCore/MultiverseCore.java @@ -22,8 +22,6 @@ import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.config.Configuration; -import sun.tools.attach.MacosxVirtualMachine; - import com.fernferret.allpay.AllPay; import com.fernferret.allpay.GenericBank; import com.onarandombox.MultiverseCore.command.commands.*; diff --git a/src/defaults/config.yml b/src/defaults/config.yml index f287465d..adb1fee9 100644 --- a/src/defaults/config.yml +++ b/src/defaults/config.yml @@ -1,27 +1,10 @@ # !!!This only applies to worlds being handled by Multiverse!!! # If you don't see it using /mvlist this setting WILL HAVE NO EFFECT -# Valid values are: -# all: If you die in a Nether an attempt will be made to spawn you in the corresponding Normal world, if not you go to defaultspawnworld -# default: If you die in a Nether you will respawn in the world defined below in defaultspawnworld -# none: You will always respawn in the same world you died in -notchrespawnstyle: none - -# Should multivers spawn players at their bed if they've slept there? -# This value will OVERRIDE notchrespawnstyle -bedrespawn: true - -# Used only in notchrespawnstyle, this is the default world players will spawn in if they die. -# If you type some world that does not exist, this will default to your default world. -defaultspawnworld: world # How long to leave in between sending a message to the player. # In Milliseconds - Default is '5000' which is 5 Seconds. messagecooldown: 5000 -# Portal Cooldown, only affects MultiVerse portals. -# In Milliseconds - Default is '5000' which is 5 Seconds. -portalcooldown: 5000 - # If this is set to true, we will prefix the chat with # a colorful world alias if it's present. If not, we simply # show the world's name in white. If this is false Multiverse