mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +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
|
// Set local values that CANNOT be changed by user
|
||||||
this.world = world;
|
this.world = world;
|
||||||
this.name = world.getName();
|
this.name = world.getName();
|
||||||
System.out.println("MVWorld recieved seed: " + seed);
|
|
||||||
this.seed = seed;
|
this.seed = seed;
|
||||||
this.environment = world.getEnvironment();
|
this.environment = world.getEnvironment();
|
||||||
|
|
||||||
|
@ -36,15 +36,12 @@ import org.bukkit.plugin.PluginManager;
|
|||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Random;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
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
|
// Global Multiverse config variable, states whether or not
|
||||||
// Multiverse should stop other plugins from teleporting players
|
// Multiverse should stop other plugins from teleporting players
|
||||||
// to worlds.
|
// to worlds.
|
||||||
@ -116,7 +113,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
|||||||
private DestinationFactory destFactory;
|
private DestinationFactory destFactory;
|
||||||
private SpoutInterface spoutInterface = null;
|
private SpoutInterface spoutInterface = null;
|
||||||
private double allpayversion = 3;
|
private double allpayversion = 3;
|
||||||
private double chversion = 3;
|
private double chversion = 4;
|
||||||
private MVMessaging messaging;
|
private MVMessaging messaging;
|
||||||
|
|
||||||
private File serverFolder = new File(System.getProperty("user.dir"));
|
private File serverFolder = new File(System.getProperty("user.dir"));
|
||||||
@ -631,21 +628,26 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
|||||||
if (world == null) {
|
if (world == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Player> ps = world.getCBWorld().getPlayers();
|
||||||
|
|
||||||
if (useNewSeed) {
|
if (useNewSeed) {
|
||||||
System.out.println("Using a new seed");
|
|
||||||
// Set the worldseed.
|
// Set the worldseed.
|
||||||
if (randomSeed) {
|
if (randomSeed) {
|
||||||
System.out.println("Using a random seed");
|
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
Long newseed = random.nextLong();
|
Long newseed = random.nextLong();
|
||||||
seed = newseed.toString();
|
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)) {
|
if (this.worldManager.deleteWorld(name, false)) {
|
||||||
this.worldManager.loadWorlds(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 true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -36,6 +36,7 @@ public class RegenCommand extends MultiverseCommand {
|
|||||||
Boolean useseed = (!(args.size() == 1));
|
Boolean useseed = (!(args.size() == 1));
|
||||||
Boolean randomseed = (args.size() == 2 && args.get(1).equalsIgnoreCase("-s"));
|
Boolean randomseed = (args.size() == 2 && args.get(1).equalsIgnoreCase("-s"));
|
||||||
String seed = (args.size() == 3) ? args.get(2) : "";
|
String seed = (args.size() == 3) ? args.get(2) : "";
|
||||||
|
|
||||||
Class<?> paramTypes[] = {String.class, Boolean.class, Boolean.class, String.class};
|
Class<?> paramTypes[] = {String.class, Boolean.class, Boolean.class, String.class};
|
||||||
List<Object> objectArgs = new ArrayList<Object>();
|
List<Object> objectArgs = new ArrayList<Object>();
|
||||||
objectArgs.add(args.get(0));
|
objectArgs.add(args.get(0));
|
||||||
|
@ -485,8 +485,6 @@ public class WorldManager implements MVWorldManager {
|
|||||||
seedString = this.configWorlds.getLong("worlds." + worldKey + ".seed") + "";
|
seedString = this.configWorlds.getLong("worlds." + worldKey + ".seed") + "";
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("SEEEEEEEED: " + seedString);
|
|
||||||
|
|
||||||
String generatorString = this.configWorlds.getString("worlds." + worldKey + ".generator");
|
String generatorString = this.configWorlds.getString("worlds." + worldKey + ".generator");
|
||||||
if (environment.equalsIgnoreCase("skylands")) {
|
if (environment.equalsIgnoreCase("skylands")) {
|
||||||
this.plugin.log(Level.WARNING, "Found SKYLANDS world. Not importing automatically, as it won't work atm :(");
|
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