Environments no longer default to Normal, Closes #24

This commit is contained in:
Eric Stokes 2011-06-27 21:26:49 -06:00
parent ea45d2675e
commit eceeb72b59
5 changed files with 24 additions and 11 deletions

View File

@ -653,7 +653,7 @@ public class MultiverseCore extends JavaPlugin {
try {
return Environment.valueOf(env);
} catch (IllegalArgumentException e) {
return Environment.NORMAL;
return null;
}
}

View File

@ -44,6 +44,11 @@ public class CreateCommand extends BaseCommand {
}
Environment environment = this.plugin.getEnvFromString(env);
if(environment == null) {
sender.sendMessage(ChatColor.RED + "That is not a valid environment.");
EnvironmentCommand.showEnvironments(sender);
return;
}
sender.sendMessage(ChatColor.AQUA + "Starting world creation...");
if (this.plugin.addWorld(worldName, environment, seed, generator)) {
sender.sendMessage(ChatColor.GREEN + "Complete!");

View File

@ -22,10 +22,10 @@ public class EnvironmentCommand extends BaseCommand{
@Override
public void execute(CommandSender sender, String[] args) {
this.showEnvironments(sender);
EnvironmentCommand.showEnvironments(sender);
}
public void showEnvironments(CommandSender sender) {
public static void showEnvironments(CommandSender sender) {
sender.sendMessage(ChatColor.YELLOW + "Valid Environments are:");
sender.sendMessage(ChatColor.GREEN + "NORMAL");
sender.sendMessage(ChatColor.RED + "NETHER");

View File

@ -38,6 +38,11 @@ public class ImportCommand extends BaseCommand {
String env = args[1];
Environment environment = this.plugin.getEnvFromString(env);
if(environment == null) {
sender.sendMessage(ChatColor.RED + "That is not a valid environment.");
EnvironmentCommand.showEnvironments(sender);
return;
}
if (new File(worldName).exists() && env != null) {
sender.sendMessage(ChatColor.AQUA + "Starting world import...");

View File

@ -1,10 +1,13 @@
# True/False - Whether MultiVerse should handle all respawns on every World including the Default.
# Disable this if you have a form of Respawn Teleportation plugin.
globalrespawn: false
# !!!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
# True/False - Whether MultiVerse should handle all respawns on the MultiVerse Worlds.
# If 'globalrespawn:true' then this will have no effect.
alternaterespawn: true
#
defaultspawnworld: world
# How long to leave in between sending a message to the player.
# In Milliseconds - Default is '5000' which is 5 Seconds.
@ -20,8 +23,8 @@ portalcooldown: 5000
# won't touch your chat
worldnameprefix: true
# If Multiverse does not find permissions should it automattically fall back to
# If Multiverse does not find permissions should it automatically fall back to
# people defined in ops.txt? Remember, if you use ops based permissions
# the awesome Multiverse devs get to decide which commands require op!
# (Which is why we highly recomend a permissions plugin! You shouldn't trust us this much...)
# (Which is why we highly recommend a permissions plugin! You shouldn't trust us this much...)
opfallback: true