diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java
index de20dfd1..ab6a9772 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java
@@ -60,6 +60,7 @@ public class MVWorld implements MultiverseWorld {
// Set local values that CANNOT be changed by user
this.world = world;
this.name = world.getName();
+ System.out.println("MVWorld recieved seed: " + seed);
this.seed = seed;
this.environment = world.getEnvironment();
diff --git a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
index 0ab36d71..f8148638 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
@@ -11,6 +11,8 @@ import com.fernferret.allpay.AllPay;
import com.fernferret.allpay.GenericBank;
import com.onarandombox.MultiverseCore.api.Core;
import com.onarandombox.MultiverseCore.api.MVPlugin;
+import com.onarandombox.MultiverseCore.api.MVWorldManager;
+import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.commands.*;
import com.onarandombox.MultiverseCore.destination.*;
import com.onarandombox.MultiverseCore.listeners.MVEntityListener;
@@ -37,6 +39,7 @@ import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
+import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -92,7 +95,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
// Configurations
private FileConfiguration multiverseConfig = null;
- private WorldManager worldManager = new WorldManager(this);
+ private MVWorldManager worldManager = new WorldManager(this);
// Setup the block/player/entity listener.
private MVPlayerListener playerListener = new MVPlayerListener(this);
@@ -234,7 +237,9 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
this.destFactory.registerDestinationType(BedDestination.class, "b");
}
- /** Function to Register all the Events needed. */
+ /**
+ * Function to Register all the Events needed.
+ */
private void registerEvents() {
PluginManager pm = getServer().getPluginManager();
// pm.registerEvent(Event.Type.PLAYER_MOVE, playerListener, Priority.Highest, this); // Low so it acts above any other.
@@ -258,7 +263,9 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
pm.registerEvent(Event.Type.THUNDER_CHANGE, this.weatherListener, Priority.Normal, this);
}
- /** Load the Configuration files OR create the default config files. */
+ /**
+ * Load the Configuration files OR create the default config files.
+ */
public void loadConfigs() {
// Now grab the Configuration Files.
this.multiverseConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "config.yml"));
@@ -284,7 +291,9 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
return this.messaging;
}
- /** Register Multiverse-Core commands to Command Manager. */
+ /**
+ * Register Multiverse-Core commands to Command Manager.
+ */
private void registerCommands() {
// Intro Commands
this.commandHandler.registerCommand(new HelpCommand(this));
@@ -304,6 +313,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
this.commandHandler.registerCommand(new LoadCommand(this));
this.commandHandler.registerCommand(new RemoveCommand(this));
this.commandHandler.registerCommand(new DeleteCommand(this));
+ this.commandHandler.registerCommand(new RegenCommand(this));
this.commandHandler.registerCommand(new ConfirmCommand(this));
// Modification commands
this.commandHandler.registerCommand(new ModifyCommand(this));
@@ -320,7 +330,9 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
this.commandHandler.registerCommand(new CheckCommand(this));
}
- /** What happens when the plugin gets disabled... */
+ /**
+ * What happens when the plugin gets disabled...
+ */
public void onDisable() {
debugLog.close();
this.banker = null;
@@ -356,7 +368,9 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
return this.ph;
}
- /** onCommand */
+ /**
+ * onCommand
+ */
@Override
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
if (!this.isEnabled()) {
@@ -445,7 +459,6 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
* This code should get moved somewhere more appropriate, but for now, it's here.
*
* @param env
- *
* @return
*/
public Environment getEnvFromString(String env) {
@@ -487,12 +500,16 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
return this.pluginCount;
}
- /** Increments the number of plugins that have specifically hooked into core. */
+ /**
+ * Increments the number of plugins that have specifically hooked into core.
+ */
public void incrementPluginCount() {
this.pluginCount += 1;
}
- /** Decrements the number of plugins that have specifically hooked into core. */
+ /**
+ * Decrements the number of plugins that have specifically hooked into core.
+ */
public void decrementPluginCount() {
this.pluginCount -= 1;
}
@@ -563,7 +580,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
return this.spoutInterface;
}
- public WorldManager getMVWorldManager() {
+ public MVWorldManager getMVWorldManager() {
return this.worldManager;
}
@@ -597,10 +614,40 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
* NOT deprecated for the time as queued commands use this.
*
* @param name World to delete
- *
* @return True if success, false if fail.
*/
public Boolean deleteWorld(String name) {
return this.worldManager.deleteWorld(name);
}
+
+ /**
+ * Used by queued commands to delete a world on a delay.
+ *
+ * @param name World to delete
+ * @return True if success, false if fail.
+ */
+ public Boolean regenWorld(String name, Boolean useNewSeed, Boolean randomSeed, String seed) {
+ MultiverseWorld world = this.worldManager.getMVWorld(name);
+ if(world == null) {
+ return false;
+ }
+ if (useNewSeed) {
+ System.out.println("Using a new seed");
+ // Set the worldseed.
+ if(randomSeed) {
+ System.out.println("Using a random seed");
+ Random random = new Random();
+ Long newseed = random.nextLong();
+ seed = newseed.toString();
+ } else {
+ System.out.println("Using " + seed);
+ }
+ ((WorldManager)this.worldManager).getConfigWorlds().set("worlds." + name + "seed", seed);
+ }
+ if (this.worldManager.deleteWorld(name, false)) {
+ this.worldManager.loadWorlds(false);
+ return true;
+ }
+ return false;
+ }
}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/Core.java b/src/main/java/com/onarandombox/MultiverseCore/api/Core.java
index 214589cb..a0bc591e 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/api/Core.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/api/Core.java
@@ -97,5 +97,5 @@ public interface Core {
*
* @return {@link WorldManager}.
*/
- public WorldManager getMVWorldManager();
+ public MVWorldManager getMVWorldManager();
}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/MVWorldManager.java b/src/main/java/com/onarandombox/MultiverseCore/api/MVWorldManager.java
index 37b1e79c..52c77702 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/api/MVWorldManager.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/api/MVWorldManager.java
@@ -10,8 +10,10 @@ package com.onarandombox.MultiverseCore.api;
import com.onarandombox.MultiverseCore.utils.PurgeWorlds;
import org.bukkit.World;
import org.bukkit.World.Environment;
+import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.generator.ChunkGenerator;
+import java.io.File;
import java.util.Collection;
import java.util.List;
@@ -31,7 +33,6 @@ public interface MVWorldManager {
* If the seed is a Long,
* it will be interpreted as such.
* @param generator The Custom generator plugin to use.
- *
* @return True if the world is added, false if not.
*/
public boolean addWorld(String name, Environment env, String seedString, String generator);
@@ -41,16 +42,25 @@ public interface MVWorldManager {
* config and deletes the folder
*
* @param name The name of the world to remove
- *
* @return True if success, false if failure.
*/
public Boolean deleteWorld(String name);
+ /**
+ * Remove the world from the Multiverse list, from the
+ * config and deletes the folder
+ *
+ * @param name The name of the world to remove
+ * @param removeConfig If true(default), we'll remove the entries from the
+ * config. If false, they'll stay and the world may come back.
+ * @return True if success, false if failure.
+ */
+ public Boolean deleteWorld(String name, boolean removeConfig);
+
/**
* Unload a world from Multiverse
*
* @param name Name of the world to unload
- *
* @return True if the world was unloaded, false if not.
*/
public boolean unloadWorld(String name);
@@ -60,7 +70,6 @@ public interface MVWorldManager {
* unloaded with {@link #unloadWorld(String)}.
*
* @param name The name of the world to load
- *
* @return True if success, false if failure.
*/
public boolean loadWorld(String name);
@@ -78,7 +87,6 @@ public interface MVWorldManager {
* @param generator The generator name.
* @param generatorID The generator id.
* @param worldName The worldName to use as the default.
- *
* @return A {@link ChunkGenerator} or null
*/
public ChunkGenerator getChunkGenerator(String generator, String generatorID, String worldName);
@@ -96,7 +104,6 @@ public interface MVWorldManager {
* This will search name AND alias.
*
* @param name The name or alias of the world to get.
- *
* @return A {@link MultiverseWorld} or null.
*/
public MultiverseWorld getMVWorld(String name);
@@ -105,7 +112,6 @@ public interface MVWorldManager {
* Returns a {@link MultiverseWorld} if it exists, and null if it does not.
*
* @param world The Bukkit world to check.
- *
* @return A {@link MultiverseWorld} or null.
*/
public MultiverseWorld getMVWorld(World world);
@@ -114,7 +120,6 @@ public interface MVWorldManager {
* Checks to see if the given name is a valid {@link MultiverseWorld}
*
* @param name The name or alias of the world to check.
- *
* @return True if the world exists, false if not.
*/
public boolean isMVWorld(String name);
@@ -123,7 +128,6 @@ public interface MVWorldManager {
* Checks to see if the given world is a valid {@link MultiverseWorld}
*
* @param world The Bukkit world to check.
- *
* @return True if the world has been loaded into MV2, false if not.
*/
public boolean isMVWorld(World world);
@@ -136,6 +140,13 @@ public interface MVWorldManager {
*/
public void loadWorlds(boolean forceLoad);
+ /**
+ * Loads the Worlds & Settings for any worlds that bukkit loaded before us.
+ *
+ * This way people will _always_ have some worlds in the list.
+ */
+ public void loadDefaultWorlds();
+
/**
* Return the World Purger.
*
@@ -151,5 +162,38 @@ public interface MVWorldManager {
*/
public MultiverseWorld getSpawnWorld();
+ /**
+ * Gets the list of worlds in the config, but unloaded.
+ *
+ * @return A List of worlds as strings.
+ */
public List getUnloadedWorlds();
+
+ /**
+ * This method populates an internal list and needs to be called after multiverse initialization.
+ */
+ public void getDefaultWorldGenerators();
+
+ /**
+ * Load the config from a file.
+ *
+ * @param file The file to load.
+ * @return A loaded configuration.
+ */
+ public FileConfiguration loadWorldConfig(File file);
+
+ /**
+ * Saves the world config to disk.
+ *
+ * @return True if success, false if fail.
+ */
+ public boolean saveWorldsConfig();
+
+ /**
+ * Remove the world from the Multiverse list and from the config
+ *
+ * @param name The name of the world to remove
+ * @return True if success, false if failure.
+ */
+ public boolean removeWorldFromConfig(String name);
}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java
index 22a7e7e3..1d2a8688 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java
@@ -11,7 +11,6 @@ import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination;
import com.onarandombox.MultiverseCore.destination.InvalidDestination;
import com.onarandombox.MultiverseCore.utils.MVPermissions;
-import com.onarandombox.MultiverseCore.utils.WorldManager;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -20,7 +19,6 @@ import org.bukkit.permissions.PermissionDefault;
import java.util.List;
public class CheckCommand extends MultiverseCommand {
- private WorldManager worldManager;
public CheckCommand(MultiverseCore plugin) {
super(plugin);
@@ -33,7 +31,6 @@ public class CheckCommand extends MultiverseCommand {
this.addCommandExample("/mv check " + ChatColor.GREEN + "Rigby90 " + ChatColor.LIGHT_PURPLE + "p:MyPortal");
this.addCommandExample("/mv check " + ChatColor.GREEN + "lithium3141 " + ChatColor.LIGHT_PURPLE + "ow:WarpName");
this.setPermission("multiverse.core.debug", "Checks to see if a player can go to a destination. Prints debug if false.", PermissionDefault.OP);
- this.worldManager = this.plugin.getMVWorldManager();
}
@Override
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java
index c4aa175b..2551ebe0 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java
@@ -8,9 +8,9 @@
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
+import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.utils.LocationManipulation;
-import com.onarandombox.MultiverseCore.utils.WorldManager;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.World;
@@ -22,7 +22,7 @@ import java.text.DecimalFormat;
import java.util.List;
public class CoordCommand extends MultiverseCommand {
- private WorldManager worldManager;
+ private MVWorldManager worldManager;
public CoordCommand(MultiverseCore plugin) {
super(plugin);
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java
index 107a8fb9..0283eb27 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java
@@ -8,6 +8,7 @@
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
+import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.utils.WorldManager;
import com.pneumaticraft.commandhandler.CommandHandler;
import org.bukkit.ChatColor;
@@ -20,7 +21,7 @@ import java.io.File;
import java.util.List;
public class CreateCommand extends MultiverseCommand {
- private WorldManager worldManager;
+ private MVWorldManager worldManager;
public CreateCommand(MultiverseCore plugin) {
super(plugin);
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java
index b601a91f..af7fbd68 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java
@@ -8,7 +8,7 @@
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
-import com.onarandombox.MultiverseCore.utils.WorldManager;
+import com.onarandombox.MultiverseCore.api.MVWorldManager;
import org.bukkit.ChatColor;
import org.bukkit.World.Environment;
import org.bukkit.command.Command;
@@ -20,7 +20,7 @@ import java.io.FilenameFilter;
import java.util.List;
public class ImportCommand extends MultiverseCommand {
- private WorldManager worldManager;
+ private MVWorldManager worldManager;
public ImportCommand(MultiverseCore plugin) {
super(plugin);
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/InfoCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/InfoCommand.java
index 2a9dc33e..dbe27087 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/InfoCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/InfoCommand.java
@@ -9,8 +9,12 @@ package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.FancyText;
+import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
-import com.onarandombox.MultiverseCore.utils.*;
+import com.onarandombox.MultiverseCore.utils.FancyColorScheme;
+import com.onarandombox.MultiverseCore.utils.FancyHeader;
+import com.onarandombox.MultiverseCore.utils.FancyMessage;
+import com.onarandombox.MultiverseCore.utils.LocationManipulation;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
@@ -24,7 +28,7 @@ import java.util.List;
//import com.sun.xml.internal.ws.util.StringUtils;
public class InfoCommand extends MultiverseCommand {
- private WorldManager worldManager;
+ private MVWorldManager worldManager;
public InfoCommand(MultiverseCore plugin) {
super(plugin);
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java
index e4dfed8b..8b82a923 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java
@@ -8,9 +8,9 @@
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
+import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.enums.Action;
-import com.onarandombox.MultiverseCore.utils.WorldManager;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -22,7 +22,7 @@ import java.util.List;
// Anything not in here will only support the SET action
public class ModifyAddCommand extends MultiverseCommand {
- private WorldManager worldManager;
+ private MVWorldManager worldManager;
public ModifyAddCommand(MultiverseCore plugin) {
super(plugin);
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java
index b95e42f0..0bd68fe3 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java
@@ -8,6 +8,7 @@
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
+import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.enums.Action;
import com.onarandombox.MultiverseCore.utils.WorldManager;
@@ -19,7 +20,7 @@ import org.bukkit.permissions.PermissionDefault;
import java.util.List;
public class ModifyClearCommand extends MultiverseCommand {
- private WorldManager worldManager;
+ private MVWorldManager worldManager;
public ModifyClearCommand(MultiverseCore plugin) {
super(plugin);
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java
index e76bf7b8..e15254b2 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java
@@ -8,9 +8,9 @@
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
+import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.enums.Action;
-import com.onarandombox.MultiverseCore.utils.WorldManager;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -19,7 +19,7 @@ import org.bukkit.permissions.PermissionDefault;
import java.util.List;
public class ModifyRemoveCommand extends MultiverseCommand {
- private WorldManager worldManager;
+ private MVWorldManager worldManager;
public ModifyRemoveCommand(MultiverseCore plugin) {
super(plugin);
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java
index db1bbeb6..29a0d8bf 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java
@@ -8,6 +8,7 @@
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
+import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.enums.EnglishChatColor;
import com.onarandombox.MultiverseCore.exceptions.PropertyDoesNotExistException;
@@ -20,7 +21,7 @@ import org.bukkit.permissions.PermissionDefault;
import java.util.List;
public class ModifySetCommand extends MultiverseCommand {
- private WorldManager worldManager;
+ private MVWorldManager worldManager;
public ModifySetCommand(MultiverseCore plugin) {
super(plugin);
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java
index bfc7feda..59ab6059 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java
@@ -8,9 +8,9 @@
package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.MultiverseCore;
+import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.utils.PurgeWorlds;
-import com.onarandombox.MultiverseCore.utils.WorldManager;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -21,7 +21,7 @@ import java.util.Collections;
import java.util.List;
public class PurgeCommand extends MultiverseCommand {
- private WorldManager worldManager;
+ private MVWorldManager worldManager;
public PurgeCommand(MultiverseCore plugin) {
super(plugin);
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java
new file mode 100644
index 00000000..849cd5f8
--- /dev/null
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * Multiverse 2 Copyright (c) the Multiverse Team 2011. *
+ * Multiverse 2 is licensed under the BSD License. *
+ * For more information please check the README.md file included *
+ * with this project. *
+ ******************************************************************************/
+
+package com.onarandombox.MultiverseCore.commands;
+
+import com.onarandombox.MultiverseCore.MultiverseCore;
+import org.bukkit.ChatColor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.permissions.PermissionDefault;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class RegenCommand extends MultiverseCommand {
+
+ public RegenCommand(MultiverseCore plugin) {
+ super(plugin);
+ this.setName("Regenerates a World");
+ this.setCommandUsage("/mv regen" + ChatColor.GREEN + " {WORLD}" + ChatColor.GOLD + " [-s [SEED]]");
+ this.setArgRange(1, 3);
+ this.addKey("mvregen");
+ this.addKey("mv regen");
+ this.addCommandExample("You can use the -s with no args to get a new seed:");
+ this.addCommandExample("/mv regen " + ChatColor.GREEN + "MyWorld" + ChatColor.GOLD + " -s");
+ this.addCommandExample("or specifiy a seed to get that one:");
+ this.addCommandExample("/mv regen " + ChatColor.GREEN + "MyWorld" + ChatColor.GOLD + " -s" + ChatColor.AQUA + " gargamel");
+ this.setPermission("multiverse.core.delete", "Deletes a world on your server. " + ChatColor.RED + "PERMANENTLY.", PermissionDefault.OP);
+ }
+
+ @Override
+ public void runCommand(CommandSender sender, List args) {
+ Boolean useseed = (!(args.size() == 1));
+ Boolean randomseed = (args.size() == 2 && args.get(1).equalsIgnoreCase("-s"));
+ String seed = (args.size() == 3) ? args.get(2) : "";
+ Class> paramTypes[] = {String.class, Boolean.class, Boolean.class, String.class};
+ List