mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 02:25:41 +01:00
Bump API version to 8, Remove junk, Update CommandHandler (Closes #267)
This commit is contained in:
parent
d2a5898e53
commit
6afbd1d13d
@ -1 +1 @@
|
||||
Subproject commit 05cb1a3d6200e16869f4f36c697e431549bd5d18
|
||||
Subproject commit 086a3e7789b2dfc6f1078d18453931355c9ef877
|
@ -60,7 +60,6 @@ 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();
|
||||
|
||||
|
@ -36,15 +36,12 @@ import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
||||
private final static int Protocol = 7;
|
||||
private final static int Protocol = 8;
|
||||
// Global Multiverse config variable, states whether or not
|
||||
// Multiverse should stop other plugins from teleporting players
|
||||
// to worlds.
|
||||
@ -116,7 +113,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
||||
private DestinationFactory destFactory;
|
||||
private SpoutInterface spoutInterface = null;
|
||||
private double allpayversion = 3;
|
||||
private double chversion = 3;
|
||||
private double chversion = 4;
|
||||
private MVMessaging messaging;
|
||||
|
||||
private File serverFolder = new File(System.getProperty("user.dir"));
|
||||
@ -628,24 +625,29 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
||||
*/
|
||||
public Boolean regenWorld(String name, Boolean useNewSeed, Boolean randomSeed, String seed) {
|
||||
MultiverseWorld world = this.worldManager.getMVWorld(name);
|
||||
if(world == null) {
|
||||
if (world == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
List<Player> ps = world.getCBWorld().getPlayers();
|
||||
|
||||
if (useNewSeed) {
|
||||
System.out.println("Using a new seed");
|
||||
// Set the worldseed.
|
||||
if(randomSeed) {
|
||||
System.out.println("Using a random seed");
|
||||
if (randomSeed) {
|
||||
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);
|
||||
((WorldManager) this.worldManager).getConfigWorlds().set("worlds." + name + ".seed", seed);
|
||||
}
|
||||
if (this.worldManager.deleteWorld(name, false)) {
|
||||
this.worldManager.loadWorlds(false);
|
||||
SafeTTeleporter teleporter = this.getTeleporter();
|
||||
Location newSpawn = this.getServer().getWorld(name).getSpawnLocation();
|
||||
// Send all players that were in the old world, BACK to it!
|
||||
for (Player p : ps) {
|
||||
teleporter.safelyTeleport(null, p, newSpawn, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -36,6 +36,7 @@ public class RegenCommand extends MultiverseCommand {
|
||||
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<Object> objectArgs = new ArrayList<Object>();
|
||||
objectArgs.add(args.get(0));
|
||||
|
@ -485,8 +485,6 @@ public class WorldManager implements MVWorldManager {
|
||||
seedString = this.configWorlds.getLong("worlds." + worldKey + ".seed") + "";
|
||||
}
|
||||
|
||||
System.out.println("SEEEEEEEED: " + seedString);
|
||||
|
||||
String generatorString = this.configWorlds.getString("worlds." + worldKey + ".generator");
|
||||
if (environment.equalsIgnoreCase("skylands")) {
|
||||
this.plugin.log(Level.WARNING, "Found SKYLANDS world. Not importing automatically, as it won't work atm :(");
|
||||
|
Loading…
Reference in New Issue
Block a user