mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-25 12:05:14 +01:00
Cleanup CreateCommand, almost looks pretty now.
This commit is contained in:
parent
3651972901
commit
5223bef9d0
@ -1,8 +1,6 @@
|
||||
package com.onarandombox.MultiverseCore.command.commands;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.World.Environment;
|
||||
@ -13,9 +11,6 @@ import com.onarandombox.MultiverseCore.command.BaseCommand;
|
||||
|
||||
public class CreateCommand extends BaseCommand {
|
||||
|
||||
private final String envNameArray[] = { "NETHER", "NORMAL", "SKYLANDS", "SKYLAND", "HELL" };
|
||||
private final HashSet<String> envNames = new HashSet<String>(Arrays.asList(envNameArray));
|
||||
|
||||
public CreateCommand(MultiverseCore plugin) {
|
||||
super(plugin);
|
||||
name = "Create World";
|
||||
@ -45,19 +40,8 @@ public class CreateCommand extends BaseCommand {
|
||||
sender.sendMessage(ChatColor.RED + "If you are confident it is a world you can import with /mvimport");
|
||||
return;
|
||||
}
|
||||
|
||||
Environment environment = null;
|
||||
// Don't reference the enum directly as there aren't that many, and we can be more forgiving to users this way
|
||||
if (env.equalsIgnoreCase("HELL"))
|
||||
env = "NETHER";
|
||||
|
||||
if (env.equalsIgnoreCase("SKYLAND") || env.equalsIgnoreCase("STARWARS"))
|
||||
env = "SKYLANDS";
|
||||
try {
|
||||
environment = Environment.valueOf(env);
|
||||
} catch (IllegalArgumentException e) {
|
||||
sender.sendMessage(ChatColor.RED + "Environment type " + env + " does not exist!");
|
||||
// TODO: Show the player the mvenvironments command.
|
||||
Environment environment = plugin.getEnvFromString(env, sender);
|
||||
if(environment == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user