Bump config, Add workaround for spout issue.

Closes #355, Closes #149, Closes #349

This adds a new config var: firstspawnoverride that defaults to true.
You should disable this if you don't want mv to do your spawning (if
you have Spout, a warning will print and it will be disabled
automatically. The firstspawn feature will NOT work with spout at this
time.) When the spout bug is fixed, someone should open an issue. I
will not be monitoring this :)
This commit is contained in:
Eric Stokes 2011-12-30 20:14:44 -07:00
parent 9fa29bcde7
commit 9f12f6362b
6 changed files with 36 additions and 10 deletions

View File

@ -59,6 +59,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
public static boolean PrefixChat;
public static boolean DisplayPermErrors;
public static boolean TeleportIntercept;
public static boolean FirstSpawnOverride;
public static Map<String, String> teleportQueue = new HashMap<String, String>();
private AnchorManager anchorManager = new AnchorManager(this);
@ -222,6 +223,19 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
this.log(Level.SEVERE, "Your configs were not loaded. Very little will function in Multiverse.");
}
this.anchorManager.loadAnchors();
// Now set the firstspawnworld (after the worlds are loaded):
// Default as the server.props world.
this.worldManager.setFirstSpawnWorld(this.multiverseConfig.getString("firstspawnworld", getDefaultWorldName()));
// We have to set this one here, if it's not present, we don't know the name of the default world.
// and this one won't be in the defaults yml file.
this.multiverseConfig.set("firstspawnworld", this.worldManager.getFirstSpawnWorld().getName());
// A test that had no worlds loaded was being run. This should never happen in production
this.saveMVConfig();
// Check to see if spout was already loaded (most likely):
if (this.getServer().getPluginManager().getPlugin("Spout") != null) {
this.log(Level.INFO, "Spout integration enabled.");
}
}
private boolean validateAllpay() {
@ -325,10 +339,10 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
EnforceAccess = this.multiverseConfig.getBoolean("enforceaccess", false);
EnforceGameModes = this.multiverseConfig.getBoolean("enforcegamemodes", true);
PrefixChat = this.multiverseConfig.getBoolean("worldnameprefix", true);
DisplayPermErrors = this.multiverseConfig.getBoolean("displaypermerrors", true);
TeleportIntercept = this.multiverseConfig.getBoolean("teleportintercept", true);
// Default as the server.props world.
this.worldManager.setFirstSpawnWorld(this.multiverseConfig.getString("firstspawnworld", getDefaultWorldName()));
// Should MV do the first spawn stuff?
FirstSpawnOverride = this.multiverseConfig.getBoolean("firstspawnoverride", true);
// Should permissions errors display to users?
DisplayPermErrors = this.multiverseConfig.getBoolean("displaypermerrors", true);
this.messaging = new MVMessaging(this);
this.messaging.setCooldown(this.multiverseConfig.getInt("messagecooldown", 5000));
@ -657,6 +671,12 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
public void setSpout() {
this.spoutInterface = new SpoutInterface();
this.commandHandler.registerCommand(new SpoutCommand(this));
if (FirstSpawnOverride) {
this.log(Level.WARNING, "the config value 'firstspawnworld' will have NO effect!!!");
this.log(Level.WARNING, " --FernFerret");
FirstSpawnOverride = false;
this.multiverseConfig.set("firstspawnoverride", false);
}
}
public SpoutInterface getSpout() {

View File

@ -8,7 +8,7 @@
package com.onarandombox.MultiverseCore.enums;
public enum ConfigProperty {
messagecooldown, teleportcooldown, worldnameprefix, enforcegamemodes, enforceaccess, displaypermerrors, debug, firstworldspawn, teleportintercept;
messagecooldown, teleportcooldown, worldnameprefix, enforcegamemodes, enforceaccess, displaypermerrors, debug, firstspawnworld, teleportintercept, firstspawnoverride;
public static String getAllValues() {
String buffer = "";

View File

@ -12,7 +12,6 @@ import org.bukkit.entity.Player;
import org.bukkit.event.Event;
public class MVRespawnEvent extends Event {
private static final long serialVersionUID = -2991894063331856687L;
private Player player;
private Location location;
private String respawnMethod;

View File

@ -107,9 +107,10 @@ public class MVPlayerListener extends PlayerListener {
Player p = event.getPlayer();
if (!p.hasPlayedBefore()) {
this.plugin.log(Level.FINE, "Player joined first!");
this.plugin.log(Level.FINE, "Loc: " + worldManager.getFirstSpawnWorld().getSpawnLocation());
// This will override other spawn plugins atm :(
this.spawnNewPlayer(p);
if(MultiverseCore.FirstSpawnOverride) {
this.plugin.log(Level.FINE, "Moving NEW player to(firstspawnoverride): " + worldManager.getFirstSpawnWorld().getSpawnLocation());
this.spawnNewPlayer(p);
}
return;
} else {
this.plugin.log(Level.FINE, "Player joined AGAIN!");

View File

@ -214,7 +214,12 @@ public class WorldManager implements MVWorldManager {
if (world == null) {
// If the spawn world was unloaded, get the default world
this.plugin.log(Level.WARNING, "The world specified as the spawn world (" + this.firstSpawn + ") did not exist!!");
return this.getMVWorld(this.plugin.getServer().getWorlds().get(0));
try {
return this.getMVWorld(this.plugin.getServer().getWorlds().get(0));
} catch (IndexOutOfBoundsException e) {
// This should only happen in tests.
return null;
}
}
return world;
}

View File

@ -8,6 +8,7 @@ worldnameprefix: true
enforceaccess: true
enforcegamemodes: true
bedrespawn: true
version: 2.4
version: 2.5
displaypermerrors: true
teleportintercept: true
firstspawnoverride: true