From fda6b31f06cba665446246ee51c40d0518b2e9f0 Mon Sep 17 00:00:00 2001 From: Aki Tensai Date: Sat, 9 Jul 2011 02:13:02 -0600 Subject: [PATCH 1/4] Consistant punctuation on descriptions of commands. /mvspawn's description altered Testing my ability to commit changes on GitHub. --- .../command/commands/CreateCommand.java | 12 +++++----- .../command/commands/EnvironmentCommand.java | 8 +++---- .../command/commands/HelpCommand.java | 6 ++--- .../command/commands/ImportCommand.java | 8 +++---- .../command/commands/ListCommand.java | 14 ++++++------ .../command/commands/ModifyAddCommand.java | 20 ++++++++--------- .../command/commands/ModifyClearCommand.java | 16 +++++++------- .../command/commands/ModifyRemoveCommand.java | 18 +++++++-------- .../command/commands/ModifySetCommand.java | 18 +++++++-------- .../command/commands/SpawnCommand.java | 6 ++--- .../command/commands/WhoCommand.java | 22 +++++++++---------- 11 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/com/onarandombox/MultiverseCore/command/commands/CreateCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/CreateCommand.java index 809d48f4..924c124f 100644 --- a/src/com/onarandombox/MultiverseCore/command/commands/CreateCommand.java +++ b/src/com/onarandombox/MultiverseCore/command/commands/CreateCommand.java @@ -11,20 +11,20 @@ import com.onarandombox.MultiverseCore.command.BaseCommand; import com.onarandombox.MultiverseCore.command.CommandManager; public class CreateCommand extends BaseCommand { - + public CreateCommand(MultiverseCore plugin) { super(plugin); this.name = "Create World"; - this.description = "Creates a new world of the specified type"; + this.description = "Creates a new world of the specified type."; this.usage = "/mvcreate" + ChatColor.GREEN + " {NAME} {ENV}" + ChatColor.GOLD + " -s [SEED] -g [GENERATOR[:ID]]"; this.minArgs = 2; this.maxArgs = 6; this.identifiers.add("mvcreate"); this.permission = "multiverse.world.create"; this.requiresOp = true; - + } - + @Override public void execute(CommandSender sender, String[] args) { if (args.length % 2 != 0) { @@ -35,13 +35,13 @@ public class CreateCommand extends BaseCommand { String env = args[1]; String seed = CommandManager.getFlag("-s", args); String generator = CommandManager.getFlag("-g", args); - + if (new File(worldName).exists() || this.plugin.isMVWorld(worldName)) { sender.sendMessage(ChatColor.RED + "A Folder/World already exists with this name!"); sender.sendMessage(ChatColor.RED + "If you are confident it is a world you can import with /mvimport"); return; } - + Environment environment = this.plugin.getEnvFromString(env); if (environment == null) { sender.sendMessage(ChatColor.RED + "That is not a valid environment."); diff --git a/src/com/onarandombox/MultiverseCore/command/commands/EnvironmentCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/EnvironmentCommand.java index d93d61b2..f1faa748 100644 --- a/src/com/onarandombox/MultiverseCore/command/commands/EnvironmentCommand.java +++ b/src/com/onarandombox/MultiverseCore/command/commands/EnvironmentCommand.java @@ -7,11 +7,11 @@ import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.command.BaseCommand; public class EnvironmentCommand extends BaseCommand{ - + public EnvironmentCommand(MultiverseCore plugin) { super(plugin); this.name = "List Environments"; - this.description = "Lists valid known environments"; + this.description = "Lists valid known environments."; this.usage = "/mvenv"; this.minArgs = 0; this.maxArgs = 0; @@ -24,12 +24,12 @@ public class EnvironmentCommand extends BaseCommand{ public void execute(CommandSender sender, String[] args) { EnvironmentCommand.showEnvironments(sender); } - + public static void showEnvironments(CommandSender sender) { sender.sendMessage(ChatColor.YELLOW + "Valid Environments are:"); sender.sendMessage(ChatColor.GREEN + "NORMAL"); sender.sendMessage(ChatColor.RED + "NETHER"); sender.sendMessage(ChatColor.AQUA + "SKYLANDS"); } - + } diff --git a/src/com/onarandombox/MultiverseCore/command/commands/HelpCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/HelpCommand.java index e502a624..f7693fc2 100644 --- a/src/com/onarandombox/MultiverseCore/command/commands/HelpCommand.java +++ b/src/com/onarandombox/MultiverseCore/command/commands/HelpCommand.java @@ -1,6 +1,6 @@ /** * Copyright (C) 2011 DThielke - * + * * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/ or send a letter to * Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. @@ -22,7 +22,7 @@ public class HelpCommand extends BaseCommand { public HelpCommand(MultiverseCore plugin) { super(plugin); this.name = "Help"; - this.description = "Displays the help menu"; + this.description = "Displays the help menu."; this.usage = ChatColor.AQUA + "/mv help " + ChatColor.GOLD + "[page#]"; this.minArgs = 0; this.maxArgs = 1; @@ -61,7 +61,7 @@ public class HelpCommand extends BaseCommand { } for (int c = start; c < end; c++) { BaseCommand cmd = commands.get(c); - + sender.sendMessage(ChatColor.AQUA + " " + cmd.getUsage()); } diff --git a/src/com/onarandombox/MultiverseCore/command/commands/ImportCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/ImportCommand.java index 3b1d3e1e..5da06305 100644 --- a/src/com/onarandombox/MultiverseCore/command/commands/ImportCommand.java +++ b/src/com/onarandombox/MultiverseCore/command/commands/ImportCommand.java @@ -14,7 +14,7 @@ public class ImportCommand extends BaseCommand { public ImportCommand(MultiverseCore plugin) { super(plugin); this.name = "Import World"; - this.description = "Imports a new world of the specified type"; + this.description = "Imports a new world of the specified type."; this.usage = "/mvimport" + ChatColor.GREEN + " {NAME} {ENV} " + ChatColor.GOLD + "[GENERATOR[:ID]]"; this.minArgs = 2; this.maxArgs = 3; @@ -30,12 +30,12 @@ public class ImportCommand extends BaseCommand { sender.sendMessage(ChatColor.RED + "Multiverse already knows about this world!"); return; } - + String generator = null; if(args.length == 3) { generator = args[2]; } - + String env = args[1]; Environment environment = this.plugin.getEnvFromString(env); if(environment == null) { @@ -43,7 +43,7 @@ public class ImportCommand extends BaseCommand { EnvironmentCommand.showEnvironments(sender); return; } - + if (new File(worldName).exists() && env != null) { sender.sendMessage(ChatColor.AQUA + "Starting world import..."); this.plugin.addWorld(worldName, environment, null, generator); diff --git a/src/com/onarandombox/MultiverseCore/command/commands/ListCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/ListCommand.java index 518c0c5f..16628124 100644 --- a/src/com/onarandombox/MultiverseCore/command/commands/ListCommand.java +++ b/src/com/onarandombox/MultiverseCore/command/commands/ListCommand.java @@ -10,11 +10,11 @@ import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.command.BaseCommand; public class ListCommand extends BaseCommand { - + public ListCommand(MultiverseCore plugin) { super(plugin); this.name = "World Listing"; - this.description = "Displays a listing of all worlds that you can enter"; + this.description = "Displays a listing of all worlds that you can enter."; this.usage = "/mvlist"; this.minArgs = 0; this.maxArgs = 0; @@ -22,21 +22,21 @@ public class ListCommand extends BaseCommand { this.permission = "multiverse.world.list"; this.requiresOp = false; } - + @Override public void execute(CommandSender sender, String[] args) { Player p = null; if (sender instanceof Player) { p = (Player) sender; } - + String output = ChatColor.LIGHT_PURPLE + "Worlds which you can view:\n"; for (MVWorld world : this.plugin.getMVWorlds()) { - + if (p != null && (!this.plugin.ph.canEnterWorld(p, world.getCBWorld()))) { continue; } - + ChatColor color = ChatColor.GOLD; Environment env = world.getEnvironment(); if (env == Environment.NETHER) { @@ -51,7 +51,7 @@ public class ListCommand extends BaseCommand { worldName = world.getAliasColor() + world.getAlias() + ChatColor.WHITE; } output += ChatColor.WHITE + worldName + " - " + color + world.getEnvironment() + " \n"; - + } String[] response = output.split("\n"); for (String msg : response) { diff --git a/src/com/onarandombox/MultiverseCore/command/commands/ModifyAddCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/ModifyAddCommand.java index 29a9a5c1..8286ef30 100644 --- a/src/com/onarandombox/MultiverseCore/command/commands/ModifyAddCommand.java +++ b/src/com/onarandombox/MultiverseCore/command/commands/ModifyAddCommand.java @@ -14,11 +14,11 @@ import com.onarandombox.MultiverseCore.command.BaseCommand; // Anything not in here will only support the SET action public class ModifyAddCommand extends BaseCommand { - + public ModifyAddCommand(MultiverseCore plugin) { super(plugin); this.name = "Modify a World (Add a value)"; - this.description = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used"; + this.description = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used."; this.usage = "/mvmodify " + ChatColor.GREEN + "ADD {VALUE} {PROPERTY}" + ChatColor.GOLD + " [WORLD] "; this.minArgs = 3; this.maxArgs = 4; @@ -26,7 +26,7 @@ public class ModifyAddCommand extends BaseCommand { this.permission = "multiverse.world.modify"; this.requiresOp = true; } - + @Override public void execute(CommandSender sender, String[] args) { // We NEED a world from the command line @@ -34,7 +34,7 @@ public class ModifyAddCommand extends BaseCommand { if (!(sender instanceof Player)) { p = (Player) sender; } - + if (args.length == 3 && p == null) { sender.sendMessage("From the command line, WORLD is required."); sender.sendMessage(this.description); @@ -42,33 +42,33 @@ public class ModifyAddCommand extends BaseCommand { sender.sendMessage("Nothing changed."); return; } - + MVWorld world; String value = args[1]; String property = args[2]; - + if (args.length == 3) { world = this.plugin.getMVWorld(p.getWorld().getName()); } else { world = this.plugin.getMVWorld(args[3]); } - + if (world == null) { sender.sendMessage("That world does not exist!"); return; } - + if (!ModifyCommand.validateAction(Action.Add, property)) { sender.sendMessage("Sorry, you can't ADD to " + property); sender.sendMessage("Please visit our wiki for more information: URLGOESHERE FERNFERRET DON'T FORGET IT!"); return; } - + if (world.addToList(property, value)) { sender.sendMessage(value + " was added to " + property); } else { sender.sendMessage(value + " could not be added to " + property); } - + } } diff --git a/src/com/onarandombox/MultiverseCore/command/commands/ModifyClearCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/ModifyClearCommand.java index 7bb69b5c..95a69c5d 100644 --- a/src/com/onarandombox/MultiverseCore/command/commands/ModifyClearCommand.java +++ b/src/com/onarandombox/MultiverseCore/command/commands/ModifyClearCommand.java @@ -9,11 +9,11 @@ import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.command.BaseCommand; public class ModifyClearCommand extends BaseCommand { - + public ModifyClearCommand(MultiverseCore plugin) { super(plugin); this.name = "Modify a World (Clear a property)"; - this.description = "Removes all values from a property. This will work on properties that contain lists"; + this.description = "Removes all values from a property. This will work on properties that contain lists."; this.usage = "/mvmodify" + ChatColor.GREEN + " CLEAR {PROPERTY}" + ChatColor.GOLD + " [WORLD] "; this.minArgs = 2; this.maxArgs = 3; @@ -21,7 +21,7 @@ public class ModifyClearCommand extends BaseCommand { this.permission = "multiverse.world.modify"; this.requiresOp = true; } - + @Override public void execute(CommandSender sender, String[] args) { // We NEED a world from the command line @@ -36,21 +36,21 @@ public class ModifyClearCommand extends BaseCommand { sender.sendMessage("Nothing changed."); return; } - + MVWorld world; String property = args[1]; - + if (args.length == 2) { world = this.plugin.getMVWorld(p.getWorld().getName()); } else { world = this.plugin.getMVWorld(args[2]); } - + if (world == null) { sender.sendMessage("That world does not exist!"); return; } - + if (!ModifyCommand.validateAction(Action.Clear, property)) { sender.sendMessage("Sorry, you can't use CLEAR with " + property); sender.sendMessage("Please visit our wiki for more information: URLGOESHERE FERNFERRET DON'T FORGET IT!"); @@ -62,5 +62,5 @@ public class ModifyClearCommand extends BaseCommand { sender.sendMessage(property + " was NOT cleared."); } } - + } diff --git a/src/com/onarandombox/MultiverseCore/command/commands/ModifyRemoveCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/ModifyRemoveCommand.java index 18421cb9..c5334b44 100644 --- a/src/com/onarandombox/MultiverseCore/command/commands/ModifyRemoveCommand.java +++ b/src/com/onarandombox/MultiverseCore/command/commands/ModifyRemoveCommand.java @@ -9,11 +9,11 @@ import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.command.BaseCommand; public class ModifyRemoveCommand extends BaseCommand { - + public ModifyRemoveCommand(MultiverseCore plugin) { super(plugin); this.name = "Modify a World"; - this.description = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used"; + this.description = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used."; this.usage = "/mvmodify" + ChatColor.GREEN + "REMOVE {PROPERTY} {VALUE}" + ChatColor.GOLD + " [WORLD] "; this.minArgs = 3; this.maxArgs = 4; @@ -22,7 +22,7 @@ public class ModifyRemoveCommand extends BaseCommand { this.permission = "multiverse.world.modify"; this.requiresOp = true; } - + @Override public void execute(CommandSender sender, String[] args) { // We NEED a world from the command line @@ -30,7 +30,7 @@ public class ModifyRemoveCommand extends BaseCommand { if (!(sender instanceof Player)) { p = (Player) sender; } - + if (args.length == 3 && p == null) { sender.sendMessage("From the command line, WORLD is required."); sender.sendMessage(this.description); @@ -38,22 +38,22 @@ public class ModifyRemoveCommand extends BaseCommand { sender.sendMessage("Nothing changed."); return; } - + MVWorld world; String value = args[1]; String property = args[2]; - + if (args.length == 3) { world = this.plugin.getMVWorld(p.getWorld().getName()); } else { world = this.plugin.getMVWorld(args[3]); } - + if (world == null) { sender.sendMessage("That world does not exist!"); return; } - + if (!ModifyCommand.validateAction(Action.Remove, property)) { sender.sendMessage("Sorry, you can't REMOVE anything from" + property); sender.sendMessage("Please visit our wiki for more information: URLGOESHERE FERNFERRET DON'T FORGET IT!"); @@ -65,5 +65,5 @@ public class ModifyRemoveCommand extends BaseCommand { sender.sendMessage(value + " could not be removed from " + property); } } - + } diff --git a/src/com/onarandombox/MultiverseCore/command/commands/ModifySetCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/ModifySetCommand.java index 0e42f949..a837c902 100644 --- a/src/com/onarandombox/MultiverseCore/command/commands/ModifySetCommand.java +++ b/src/com/onarandombox/MultiverseCore/command/commands/ModifySetCommand.java @@ -9,11 +9,11 @@ import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.command.BaseCommand; public class ModifySetCommand extends BaseCommand { - + public ModifySetCommand(MultiverseCore plugin) { super(plugin); this.name = "Modify a World (Set a value)"; - this.description = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used"; + this.description = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used."; this.usage = "/mvmodify" + ChatColor.GREEN + " SET {PROPERTY} {VALUE}" + ChatColor.GOLD + " [WORLD] "; this.minArgs = 3; this.maxArgs = 4; @@ -21,7 +21,7 @@ public class ModifySetCommand extends BaseCommand { this.permission = "multiverse.world.modify"; this.requiresOp = true; } - + @Override public void execute(CommandSender sender, String[] args) { // We NEED a world from the command line @@ -29,7 +29,7 @@ public class ModifySetCommand extends BaseCommand { if (!(sender instanceof Player)) { p = (Player) sender; } - + if (args.length == 3 && p == null) { sender.sendMessage("From the command line, WORLD is required."); sender.sendMessage(this.description); @@ -37,22 +37,22 @@ public class ModifySetCommand extends BaseCommand { sender.sendMessage("Nothing changed."); return; } - + MVWorld world; String value = args[1]; String property = args[2]; - + if (args.length == 3) { world = this.plugin.getMVWorld(p.getWorld().getName()); } else { world = this.plugin.getMVWorld(args[3]); } - + if (world == null) { sender.sendMessage("That world does not exist!"); return; } - + if (!ModifyCommand.validateAction(Action.Set, property)) { sender.sendMessage("Sorry, you can't SET " + property); sender.sendMessage("Please visit our wiki for more information: URLGOESHERE FERNFERRET DON'T FORGET IT!"); @@ -64,5 +64,5 @@ public class ModifySetCommand extends BaseCommand { sender.sendMessage("There was an error setting " + property); } } - + } diff --git a/src/com/onarandombox/MultiverseCore/command/commands/SpawnCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/SpawnCommand.java index e196c10f..fa0016e8 100644 --- a/src/com/onarandombox/MultiverseCore/command/commands/SpawnCommand.java +++ b/src/com/onarandombox/MultiverseCore/command/commands/SpawnCommand.java @@ -8,11 +8,11 @@ import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.command.BaseCommand; public class SpawnCommand extends BaseCommand { - + public SpawnCommand(MultiverseCore plugin) { super(plugin); this.name = "Spawn"; - this.description = "Transports the player to the that player's current world Spawn Point."; + this.description = "Teleports target player to the Spawn Point of the world they are in."; this.usage = "/mvspawn" + ChatColor.GOLD + " [PLAYER]"; this.minArgs = 0; this.maxArgs = 1; @@ -20,7 +20,7 @@ public class SpawnCommand extends BaseCommand { this.permission = "multiverse.world.spawn.self"; this.requiresOp = false; } - + @Override public void execute(CommandSender sender, String[] args) { Player commandSender = null; diff --git a/src/com/onarandombox/MultiverseCore/command/commands/WhoCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/WhoCommand.java index c8ee1238..18de506b 100644 --- a/src/com/onarandombox/MultiverseCore/command/commands/WhoCommand.java +++ b/src/com/onarandombox/MultiverseCore/command/commands/WhoCommand.java @@ -14,11 +14,11 @@ import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.command.BaseCommand; public class WhoCommand extends BaseCommand { - + public WhoCommand(MultiverseCore plugin) { super(plugin); this.name = "Who"; - this.description = "States who is in what world"; + this.description = "States who is in what world."; this.usage = "/mvwho" + ChatColor.GOLD + " [WORLD]"; this.minArgs = 0; this.maxArgs = 1; @@ -26,7 +26,7 @@ public class WhoCommand extends BaseCommand { this.permission = "multiverse.world.list.who"; this.requiresOp = false; } - + @Override public void execute(CommandSender sender, String[] args) { // If this command was sent from a Player then we need to check Permissions @@ -34,9 +34,9 @@ public class WhoCommand extends BaseCommand { if (sender instanceof Player) { p = (Player) sender; } - + List worlds = new ArrayList(); - + if (args.length > 0) { if (this.plugin.isMVWorld(args[0])) { worlds.add(this.plugin.getMVWorld(args[0])); @@ -47,17 +47,17 @@ public class WhoCommand extends BaseCommand { } else { worlds = new ArrayList(this.plugin.getMVWorlds()); } - + for (MVWorld world : worlds) { if (!(this.plugin.isMVWorld(world.getName()))) { continue; } - + World w = this.plugin.getServer().getWorld(world.getName()); if (p != null && (!this.plugin.ph.canEnterWorld(p, w))) { continue; } - + ChatColor color = ChatColor.GOLD; Environment env = world.getEnvironment(); if (env == Environment.NETHER) { @@ -68,7 +68,7 @@ public class WhoCommand extends BaseCommand { color = ChatColor.AQUA; } List players = w.getPlayers(); - + String result = ""; if (players.size() <= 0) { result = "Empty"; @@ -82,10 +82,10 @@ public class WhoCommand extends BaseCommand { worldName = world.getAlias(); color = world.getAliasColor(); } - + sender.sendMessage(color + worldName + ChatColor.WHITE + " - " + result); } return; } - + } From 6a6d1a2a10fa3b66a261265b1dcbf222df06a1c4 Mon Sep 17 00:00:00 2001 From: Aki Tensai Date: Sat, 16 Jul 2011 13:59:32 -0600 Subject: [PATCH 2/4] Altered punctuation on several command's descriptions. Teleport's description altered to state it sends the provided player, or self if no player specified. --- .../MultiverseCore/commands/EnvironmentCommand.java | 2 +- src/com/onarandombox/MultiverseCore/commands/HelpCommand.java | 2 +- .../onarandombox/MultiverseCore/commands/ModifyAddCommand.java | 2 +- .../MultiverseCore/commands/ModifyClearCommand.java | 2 +- .../MultiverseCore/commands/ModifyRemoveCommand.java | 2 +- .../onarandombox/MultiverseCore/commands/ModifySetCommand.java | 2 +- src/com/onarandombox/MultiverseCore/commands/ReloadCommand.java | 2 +- .../onarandombox/MultiverseCore/commands/TeleportCommand.java | 2 +- src/com/onarandombox/MultiverseCore/commands/WhoCommand.java | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/com/onarandombox/MultiverseCore/commands/EnvironmentCommand.java b/src/com/onarandombox/MultiverseCore/commands/EnvironmentCommand.java index aa3add29..abdfc3a5 100644 --- a/src/com/onarandombox/MultiverseCore/commands/EnvironmentCommand.java +++ b/src/com/onarandombox/MultiverseCore/commands/EnvironmentCommand.java @@ -13,7 +13,7 @@ public class EnvironmentCommand extends Command { public EnvironmentCommand(MultiverseCore plugin) { super(plugin); this.commandName = "List Environments"; - this.commandDesc = "Lists valid known environments"; + this.commandDesc = "Lists valid known environments."; this.commandUsage = "/mvenv"; this.minimumArgLength = 0; this.maximumArgLength = 0; diff --git a/src/com/onarandombox/MultiverseCore/commands/HelpCommand.java b/src/com/onarandombox/MultiverseCore/commands/HelpCommand.java index 4a609e10..663606ce 100644 --- a/src/com/onarandombox/MultiverseCore/commands/HelpCommand.java +++ b/src/com/onarandombox/MultiverseCore/commands/HelpCommand.java @@ -18,7 +18,7 @@ public class HelpCommand extends Command { public HelpCommand(JavaPlugin plugin) { super(plugin); this.commandName = "Get Help with Multiverse"; - this.commandDesc = "Displays a nice help menu"; + this.commandDesc = "Displays a nice help menu."; this.commandUsage = "/mv " + ChatColor.GOLD + "[PAGE #]"; this.minimumArgLength = 0; this.maximumArgLength = 1; diff --git a/src/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java b/src/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java index b843d51c..8df38759 100644 --- a/src/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java +++ b/src/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java @@ -18,7 +18,7 @@ public class ModifyAddCommand extends Command { public ModifyAddCommand(MultiverseCore plugin) { super(plugin); this.commandName = "Modify a World (Add a value)"; - this.commandDesc = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used"; + this.commandDesc = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used."; this.commandUsage = "/mvmodify " + ChatColor.GREEN + "ADD {VALUE} {PROPERTY}" + ChatColor.GOLD + " [WORLD] "; this.minimumArgLength = 2; this.maximumArgLength = 3; diff --git a/src/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java b/src/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java index 93193017..baf52af3 100644 --- a/src/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java +++ b/src/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java @@ -15,7 +15,7 @@ public class ModifyClearCommand extends Command { public ModifyClearCommand(MultiverseCore plugin) { super(plugin); this.commandName = "Modify a World (Clear a property)"; - this.commandDesc = "Removes all values from a property. This will work on properties that contain lists"; + this.commandDesc = "Removes all values from a property. This will work on properties that contain lists."; this.commandUsage = "/mvmodify" + ChatColor.GREEN + " CLEAR {PROPERTY}" + ChatColor.GOLD + " [WORLD] "; this.minimumArgLength = 1; this.maximumArgLength = 2; diff --git a/src/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java b/src/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java index 85bea4be..468d5a07 100644 --- a/src/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java +++ b/src/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java @@ -15,7 +15,7 @@ public class ModifyRemoveCommand extends Command { public ModifyRemoveCommand(MultiverseCore plugin) { super(plugin); this.commandName = "Modify a World"; - this.commandDesc = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used"; + this.commandDesc = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used."; this.commandUsage = "/mvmodify" + ChatColor.GREEN + "REMOVE {PROPERTY} {VALUE}" + ChatColor.GOLD + " [WORLD]"; this.minimumArgLength = 2; this.maximumArgLength = 3; diff --git a/src/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java b/src/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java index 3718e9fe..22685520 100644 --- a/src/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java +++ b/src/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java @@ -15,7 +15,7 @@ public class ModifySetCommand extends Command { public ModifySetCommand(MultiverseCore plugin) { super(plugin); this.commandName = "Modify a World (Set a value)"; - this.commandDesc = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used"; + this.commandDesc = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used."; this.commandUsage = "/mvmodify" + ChatColor.GREEN + " set {PROPERTY} {VALUE}" + ChatColor.GOLD + " [WORLD]"; this.minimumArgLength = 2; this.maximumArgLength = 3; diff --git a/src/com/onarandombox/MultiverseCore/commands/ReloadCommand.java b/src/com/onarandombox/MultiverseCore/commands/ReloadCommand.java index aa58ba2d..efe8198d 100644 --- a/src/com/onarandombox/MultiverseCore/commands/ReloadCommand.java +++ b/src/com/onarandombox/MultiverseCore/commands/ReloadCommand.java @@ -13,7 +13,7 @@ public class ReloadCommand extends Command { public ReloadCommand(MultiverseCore plugin) { super(plugin); this.commandName = "Reload"; - this.commandDesc = "Reloads worlds.yml and config.yml"; + this.commandDesc = "Reloads worlds.yml and config.yml."; this.commandUsage = "/mvreload"; this.minimumArgLength = 0; this.maximumArgLength = 0; diff --git a/src/com/onarandombox/MultiverseCore/commands/TeleportCommand.java b/src/com/onarandombox/MultiverseCore/commands/TeleportCommand.java index 1a2a8c35..81833262 100644 --- a/src/com/onarandombox/MultiverseCore/commands/TeleportCommand.java +++ b/src/com/onarandombox/MultiverseCore/commands/TeleportCommand.java @@ -21,7 +21,7 @@ public class TeleportCommand extends Command { public TeleportCommand(MultiverseCore plugin) { super(plugin); this.commandName = "Teleport"; - this.commandDesc = "Teleports you to a different world."; + this.commandDesc = "Teleports target player to a different world. If no player is specified, teleports you instead."; this.commandUsage = "/mvtp " + ChatColor.GOLD + "[PLAYER]" + ChatColor.GREEN + " {WORLD}"; this.minimumArgLength = 1; this.maximumArgLength = 2; diff --git a/src/com/onarandombox/MultiverseCore/commands/WhoCommand.java b/src/com/onarandombox/MultiverseCore/commands/WhoCommand.java index c7c0892f..e1424f02 100644 --- a/src/com/onarandombox/MultiverseCore/commands/WhoCommand.java +++ b/src/com/onarandombox/MultiverseCore/commands/WhoCommand.java @@ -18,7 +18,7 @@ public class WhoCommand extends Command { public WhoCommand(MultiverseCore plugin) { super(plugin); this.commandName = "Who"; - this.commandDesc = "States who is in what world"; + this.commandDesc = "States who is in what world."; this.commandUsage = "/mvwho" + ChatColor.GOLD + " [WORLD]"; this.minimumArgLength = 0; this.maximumArgLength = 1; From 2a7504c044162f50e82a135b54e1c202a1318d43 Mon Sep 17 00:00:00 2001 From: Aki Tensai Date: Sat, 16 Jul 2011 14:06:45 -0600 Subject: [PATCH 3/4] Attempting to get my local to get rid of old files. --- .../command/commands/CreateCommand.java | 60 ------------ .../command/commands/HelpCommand.java | 71 --------------- .../command/commands/ModifyAddCommand.java | 74 --------------- .../command/commands/ModifyClearCommand.java | 66 -------------- .../command/commands/ModifyRemoveCommand.java | 69 -------------- .../command/commands/ModifySetCommand.java | 68 -------------- .../command/commands/SpawnCommand.java | 57 ------------ .../command/commands/WhoCommand.java | 91 ------------------- 8 files changed, 556 deletions(-) delete mode 100644 src/com/onarandombox/MultiverseCore/command/commands/CreateCommand.java delete mode 100644 src/com/onarandombox/MultiverseCore/command/commands/HelpCommand.java delete mode 100644 src/com/onarandombox/MultiverseCore/command/commands/ModifyAddCommand.java delete mode 100644 src/com/onarandombox/MultiverseCore/command/commands/ModifyClearCommand.java delete mode 100644 src/com/onarandombox/MultiverseCore/command/commands/ModifyRemoveCommand.java delete mode 100644 src/com/onarandombox/MultiverseCore/command/commands/ModifySetCommand.java delete mode 100644 src/com/onarandombox/MultiverseCore/command/commands/SpawnCommand.java delete mode 100644 src/com/onarandombox/MultiverseCore/command/commands/WhoCommand.java diff --git a/src/com/onarandombox/MultiverseCore/command/commands/CreateCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/CreateCommand.java deleted file mode 100644 index 924c124f..00000000 --- a/src/com/onarandombox/MultiverseCore/command/commands/CreateCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.onarandombox.MultiverseCore.command.commands; - -import java.io.File; - -import org.bukkit.ChatColor; -import org.bukkit.World.Environment; -import org.bukkit.command.CommandSender; - -import com.onarandombox.MultiverseCore.MultiverseCore; -import com.onarandombox.MultiverseCore.command.BaseCommand; -import com.onarandombox.MultiverseCore.command.CommandManager; - -public class CreateCommand extends BaseCommand { - - public CreateCommand(MultiverseCore plugin) { - super(plugin); - this.name = "Create World"; - this.description = "Creates a new world of the specified type."; - this.usage = "/mvcreate" + ChatColor.GREEN + " {NAME} {ENV}" + ChatColor.GOLD + " -s [SEED] -g [GENERATOR[:ID]]"; - this.minArgs = 2; - this.maxArgs = 6; - this.identifiers.add("mvcreate"); - this.permission = "multiverse.world.create"; - this.requiresOp = true; - - } - - @Override - public void execute(CommandSender sender, String[] args) { - if (args.length % 2 != 0) { - sender.sendMessage("You must preface your SEED with -s OR your GENERATOR with -g. Type /mv for help"); - return; - } - String worldName = args[0]; - String env = args[1]; - String seed = CommandManager.getFlag("-s", args); - String generator = CommandManager.getFlag("-g", args); - - if (new File(worldName).exists() || this.plugin.isMVWorld(worldName)) { - sender.sendMessage(ChatColor.RED + "A Folder/World already exists with this name!"); - sender.sendMessage(ChatColor.RED + "If you are confident it is a world you can import with /mvimport"); - return; - } - - 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!"); - } else { - sender.sendMessage(ChatColor.RED + "FAILED."); - } - return; - } - -} diff --git a/src/com/onarandombox/MultiverseCore/command/commands/HelpCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/HelpCommand.java deleted file mode 100644 index f7693fc2..00000000 --- a/src/com/onarandombox/MultiverseCore/command/commands/HelpCommand.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (C) 2011 DThielke - * - * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. - * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/ or send a letter to - * Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. - **/ - -package com.onarandombox.MultiverseCore.command.commands; - -import java.util.List; - -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; - -import com.onarandombox.MultiverseCore.MultiverseCore; -import com.onarandombox.MultiverseCore.command.BaseCommand; - -public class HelpCommand extends BaseCommand { - private static final int CMDS_PER_PAGE = 8; - - public HelpCommand(MultiverseCore plugin) { - super(plugin); - this.name = "Help"; - this.description = "Displays the help menu."; - this.usage = ChatColor.AQUA + "/mv help " + ChatColor.GOLD + "[page#]"; - this.minArgs = 0; - this.maxArgs = 1; - this.identifiers.add("mv"); - this.identifiers.add("mv help"); - this.permission = "multiverse.help"; - this.requiresOp = false; - } - - @Override - public void execute(CommandSender sender, String[] args) { - int page = 0; - if (args.length != 0) { - try { - page = Integer.parseInt(args[0]) - 1; - } catch (NumberFormatException e) { - } - } - - // Get only the commands this player has access to - List commands = this.plugin.getCommandManager().getCommands(sender); - - int numPages = commands.size() / CMDS_PER_PAGE; - if (commands.size() % CMDS_PER_PAGE != 0) { - numPages++; - } - - if (page >= numPages || page < 0) { - page = 0; - } - sender.sendMessage(ChatColor.GREEN + "-----[ " + ChatColor.WHITE + this.plugin.getTag().replace("[", "").replace("]", "") + " Help <" + (page + 1) + "/" + numPages + ">" + ChatColor.GREEN + " ]-----"); - int start = page * CMDS_PER_PAGE; - int end = start + CMDS_PER_PAGE; - if (end > commands.size()) { - end = commands.size(); - } - for (int c = start; c < end; c++) { - BaseCommand cmd = commands.get(c); - - sender.sendMessage(ChatColor.AQUA + " " + cmd.getUsage()); - } - - sender.sendMessage(ChatColor.GREEN + "For more info on a particular command, type '/ ?'"); - } - -} diff --git a/src/com/onarandombox/MultiverseCore/command/commands/ModifyAddCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/ModifyAddCommand.java deleted file mode 100644 index 8286ef30..00000000 --- a/src/com/onarandombox/MultiverseCore/command/commands/ModifyAddCommand.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.onarandombox.MultiverseCore.command.commands; - -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.onarandombox.MultiverseCore.MVWorld; -import com.onarandombox.MultiverseCore.MultiverseCore; -import com.onarandombox.MultiverseCore.command.BaseCommand; - - - -// This will contain all the properties that support the ADD/REMOVE -// Anything not in here will only support the SET action - -public class ModifyAddCommand extends BaseCommand { - - public ModifyAddCommand(MultiverseCore plugin) { - super(plugin); - this.name = "Modify a World (Add a value)"; - this.description = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used."; - this.usage = "/mvmodify " + ChatColor.GREEN + "ADD {VALUE} {PROPERTY}" + ChatColor.GOLD + " [WORLD] "; - this.minArgs = 3; - this.maxArgs = 4; - this.identifiers.add("mvmodify add"); - this.permission = "multiverse.world.modify"; - this.requiresOp = true; - } - - @Override - public void execute(CommandSender sender, String[] args) { - // We NEED a world from the command line - Player p = null; - if (!(sender instanceof Player)) { - p = (Player) sender; - } - - if (args.length == 3 && p == null) { - sender.sendMessage("From the command line, WORLD is required."); - sender.sendMessage(this.description); - sender.sendMessage(this.usage); - sender.sendMessage("Nothing changed."); - return; - } - - MVWorld world; - String value = args[1]; - String property = args[2]; - - if (args.length == 3) { - world = this.plugin.getMVWorld(p.getWorld().getName()); - } else { - world = this.plugin.getMVWorld(args[3]); - } - - if (world == null) { - sender.sendMessage("That world does not exist!"); - return; - } - - if (!ModifyCommand.validateAction(Action.Add, property)) { - sender.sendMessage("Sorry, you can't ADD to " + property); - sender.sendMessage("Please visit our wiki for more information: URLGOESHERE FERNFERRET DON'T FORGET IT!"); - return; - } - - if (world.addToList(property, value)) { - sender.sendMessage(value + " was added to " + property); - } else { - sender.sendMessage(value + " could not be added to " + property); - } - - } -} diff --git a/src/com/onarandombox/MultiverseCore/command/commands/ModifyClearCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/ModifyClearCommand.java deleted file mode 100644 index 95a69c5d..00000000 --- a/src/com/onarandombox/MultiverseCore/command/commands/ModifyClearCommand.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.onarandombox.MultiverseCore.command.commands; - -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.onarandombox.MultiverseCore.MVWorld; -import com.onarandombox.MultiverseCore.MultiverseCore; -import com.onarandombox.MultiverseCore.command.BaseCommand; - -public class ModifyClearCommand extends BaseCommand { - - public ModifyClearCommand(MultiverseCore plugin) { - super(plugin); - this.name = "Modify a World (Clear a property)"; - this.description = "Removes all values from a property. This will work on properties that contain lists."; - this.usage = "/mvmodify" + ChatColor.GREEN + " CLEAR {PROPERTY}" + ChatColor.GOLD + " [WORLD] "; - this.minArgs = 2; - this.maxArgs = 3; - this.identifiers.add("mvmodify clear"); - this.permission = "multiverse.world.modify"; - this.requiresOp = true; - } - - @Override - public void execute(CommandSender sender, String[] args) { - // We NEED a world from the command line - Player p = null; - if (!(sender instanceof Player)) { - p = (Player) sender; - } - if (args.length == 2 && p == null) { - sender.sendMessage("From the command line, WORLD is required."); - sender.sendMessage(this.description); - sender.sendMessage(this.usage); - sender.sendMessage("Nothing changed."); - return; - } - - MVWorld world; - String property = args[1]; - - if (args.length == 2) { - world = this.plugin.getMVWorld(p.getWorld().getName()); - } else { - world = this.plugin.getMVWorld(args[2]); - } - - if (world == null) { - sender.sendMessage("That world does not exist!"); - return; - } - - if (!ModifyCommand.validateAction(Action.Clear, property)) { - sender.sendMessage("Sorry, you can't use CLEAR with " + property); - sender.sendMessage("Please visit our wiki for more information: URLGOESHERE FERNFERRET DON'T FORGET IT!"); - return; - } - if (world.clearList(property)) { - sender.sendMessage(property + " was cleared. It contains 0 values now."); - } else { - sender.sendMessage(property + " was NOT cleared."); - } - } - -} diff --git a/src/com/onarandombox/MultiverseCore/command/commands/ModifyRemoveCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/ModifyRemoveCommand.java deleted file mode 100644 index c5334b44..00000000 --- a/src/com/onarandombox/MultiverseCore/command/commands/ModifyRemoveCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.onarandombox.MultiverseCore.command.commands; - -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.onarandombox.MultiverseCore.MVWorld; -import com.onarandombox.MultiverseCore.MultiverseCore; -import com.onarandombox.MultiverseCore.command.BaseCommand; - -public class ModifyRemoveCommand extends BaseCommand { - - public ModifyRemoveCommand(MultiverseCore plugin) { - super(plugin); - this.name = "Modify a World"; - this.description = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used."; - this.usage = "/mvmodify" + ChatColor.GREEN + "REMOVE {PROPERTY} {VALUE}" + ChatColor.GOLD + " [WORLD] "; - this.minArgs = 3; - this.maxArgs = 4; - this.identifiers.add("mvmodify remove"); - this.identifiers.add("mvmodify r"); - this.permission = "multiverse.world.modify"; - this.requiresOp = true; - } - - @Override - public void execute(CommandSender sender, String[] args) { - // We NEED a world from the command line - Player p = null; - if (!(sender instanceof Player)) { - p = (Player) sender; - } - - if (args.length == 3 && p == null) { - sender.sendMessage("From the command line, WORLD is required."); - sender.sendMessage(this.description); - sender.sendMessage(this.usage); - sender.sendMessage("Nothing changed."); - return; - } - - MVWorld world; - String value = args[1]; - String property = args[2]; - - if (args.length == 3) { - world = this.plugin.getMVWorld(p.getWorld().getName()); - } else { - world = this.plugin.getMVWorld(args[3]); - } - - if (world == null) { - sender.sendMessage("That world does not exist!"); - return; - } - - if (!ModifyCommand.validateAction(Action.Remove, property)) { - sender.sendMessage("Sorry, you can't REMOVE anything from" + property); - sender.sendMessage("Please visit our wiki for more information: URLGOESHERE FERNFERRET DON'T FORGET IT!"); - return; - } - if (world.removeFromList(property, value)) { - sender.sendMessage(value + " was removed from " + property); - } else { - sender.sendMessage(value + " could not be removed from " + property); - } - } - -} diff --git a/src/com/onarandombox/MultiverseCore/command/commands/ModifySetCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/ModifySetCommand.java deleted file mode 100644 index a837c902..00000000 --- a/src/com/onarandombox/MultiverseCore/command/commands/ModifySetCommand.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.onarandombox.MultiverseCore.command.commands; - -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.onarandombox.MultiverseCore.MVWorld; -import com.onarandombox.MultiverseCore.MultiverseCore; -import com.onarandombox.MultiverseCore.command.BaseCommand; - -public class ModifySetCommand extends BaseCommand { - - public ModifySetCommand(MultiverseCore plugin) { - super(plugin); - this.name = "Modify a World (Set a value)"; - this.description = "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used."; - this.usage = "/mvmodify" + ChatColor.GREEN + " SET {PROPERTY} {VALUE}" + ChatColor.GOLD + " [WORLD] "; - this.minArgs = 3; - this.maxArgs = 4; - this.identifiers.add("mvmodify set"); - this.permission = "multiverse.world.modify"; - this.requiresOp = true; - } - - @Override - public void execute(CommandSender sender, String[] args) { - // We NEED a world from the command line - Player p = null; - if (!(sender instanceof Player)) { - p = (Player) sender; - } - - if (args.length == 3 && p == null) { - sender.sendMessage("From the command line, WORLD is required."); - sender.sendMessage(this.description); - sender.sendMessage(this.usage); - sender.sendMessage("Nothing changed."); - return; - } - - MVWorld world; - String value = args[1]; - String property = args[2]; - - if (args.length == 3) { - world = this.plugin.getMVWorld(p.getWorld().getName()); - } else { - world = this.plugin.getMVWorld(args[3]); - } - - if (world == null) { - sender.sendMessage("That world does not exist!"); - return; - } - - if (!ModifyCommand.validateAction(Action.Set, property)) { - sender.sendMessage("Sorry, you can't SET " + property); - sender.sendMessage("Please visit our wiki for more information: URLGOESHERE FERNFERRET DON'T FORGET IT!"); - return; - } - if (world.setVariable(property, value)) { - sender.sendMessage("Property " + property + " was set to " + value); - } else { - sender.sendMessage("There was an error setting " + property); - } - } - -} diff --git a/src/com/onarandombox/MultiverseCore/command/commands/SpawnCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/SpawnCommand.java deleted file mode 100644 index fa0016e8..00000000 --- a/src/com/onarandombox/MultiverseCore/command/commands/SpawnCommand.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.onarandombox.MultiverseCore.command.commands; - -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.onarandombox.MultiverseCore.MultiverseCore; -import com.onarandombox.MultiverseCore.command.BaseCommand; - -public class SpawnCommand extends BaseCommand { - - public SpawnCommand(MultiverseCore plugin) { - super(plugin); - this.name = "Spawn"; - this.description = "Teleports target player to the Spawn Point of the world they are in."; - this.usage = "/mvspawn" + ChatColor.GOLD + " [PLAYER]"; - this.minArgs = 0; - this.maxArgs = 1; - this.identifiers.add("mvspawn"); - this.permission = "multiverse.world.spawn.self"; - this.requiresOp = false; - } - - @Override - public void execute(CommandSender sender, String[] args) { - Player commandSender = null; - if (sender instanceof Player) { - commandSender = (Player) sender; - } - // If a persons name was passed in, you must be A. the console, or B have permissions - if (args.length == 1) { - if(commandSender != null && !this.plugin.ph.hasPermission(commandSender, "multiverse.world.spawn.other", true)) { - sender.sendMessage("You don't have permission to teleport another player to spawn."); - return; - } - Player target = this.plugin.getServer().getPlayer(args[0]); - if (target != null) { - target.sendMessage("Teleporting to this world's spawn..."); - target.teleport(target.getWorld().getSpawnLocation()); - if (commandSender != null) { - target.sendMessage("You were teleported by: " + ChatColor.YELLOW + commandSender.getName()); - } else { - target.sendMessage("You were teleported by: " + ChatColor.LIGHT_PURPLE + "the console"); - } - } else { - sender.sendMessage(args[0] + " is not logged on right now!"); - } - } else { - if (commandSender != null) { - commandSender.sendMessage("Teleporting to this world's spawn..."); - commandSender.teleport(commandSender.getWorld().getSpawnLocation()); - } else { - sender.sendMessage("From the console, you must provide a PLAYER."); - } - } - } -} diff --git a/src/com/onarandombox/MultiverseCore/command/commands/WhoCommand.java b/src/com/onarandombox/MultiverseCore/command/commands/WhoCommand.java deleted file mode 100644 index 18de506b..00000000 --- a/src/com/onarandombox/MultiverseCore/command/commands/WhoCommand.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.onarandombox.MultiverseCore.command.commands; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.ChatColor; -import org.bukkit.World; -import org.bukkit.World.Environment; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.onarandombox.MultiverseCore.MVWorld; -import com.onarandombox.MultiverseCore.MultiverseCore; -import com.onarandombox.MultiverseCore.command.BaseCommand; - -public class WhoCommand extends BaseCommand { - - public WhoCommand(MultiverseCore plugin) { - super(plugin); - this.name = "Who"; - this.description = "States who is in what world."; - this.usage = "/mvwho" + ChatColor.GOLD + " [WORLD]"; - this.minArgs = 0; - this.maxArgs = 1; - this.identifiers.add("mvwho"); - this.permission = "multiverse.world.list.who"; - this.requiresOp = false; - } - - @Override - public void execute(CommandSender sender, String[] args) { - // If this command was sent from a Player then we need to check Permissions - Player p = null; - if (sender instanceof Player) { - p = (Player) sender; - } - - List worlds = new ArrayList(); - - if (args.length > 0) { - if (this.plugin.isMVWorld(args[0])) { - worlds.add(this.plugin.getMVWorld(args[0])); - } else { - sender.sendMessage(ChatColor.RED + "World does not exist"); - return; - } - } else { - worlds = new ArrayList(this.plugin.getMVWorlds()); - } - - for (MVWorld world : worlds) { - if (!(this.plugin.isMVWorld(world.getName()))) { - continue; - } - - World w = this.plugin.getServer().getWorld(world.getName()); - if (p != null && (!this.plugin.ph.canEnterWorld(p, w))) { - continue; - } - - ChatColor color = ChatColor.GOLD; - Environment env = world.getEnvironment(); - if (env == Environment.NETHER) { - color = ChatColor.RED; - } else if (env == Environment.NORMAL) { - color = ChatColor.GREEN; - } else if (env == Environment.SKYLANDS) { - color = ChatColor.AQUA; - } - List players = w.getPlayers(); - - String result = ""; - if (players.size() <= 0) { - result = "Empty"; - } else { - for (Player player : players) { - result += player.getName() + " "; - } - } - String worldName = world.getName(); - if(world.getAlias() != null && world.getAlias().length() > 0) { - worldName = world.getAlias(); - color = world.getAliasColor(); - } - - sender.sendMessage(color + worldName + ChatColor.WHITE + " - " + result); - } - return; - } - -} From 0cd86d7212bdbfadc527f2dc70c01abd31dac999 Mon Sep 17 00:00:00 2001 From: Aki Tensai Date: Sat, 16 Jul 2011 14:36:00 -0600 Subject: [PATCH 4/4] /mvspawn's description altered --- src/com/onarandombox/MultiverseCore/commands/SpawnCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/onarandombox/MultiverseCore/commands/SpawnCommand.java b/src/com/onarandombox/MultiverseCore/commands/SpawnCommand.java index 01cb2da2..eebf6250 100644 --- a/src/com/onarandombox/MultiverseCore/commands/SpawnCommand.java +++ b/src/com/onarandombox/MultiverseCore/commands/SpawnCommand.java @@ -14,7 +14,7 @@ public class SpawnCommand extends Command { public SpawnCommand(MultiverseCore plugin) { super(plugin); this.commandName = "Spawn"; - this.commandDesc = "Transports the player to the that player's current world Spawn Point."; + this.commandDesc = "Teleports target player to the Spawn Point of the world they are in."; this.commandUsage = "/mvspawn" + ChatColor.GOLD + " [PLAYER]"; this.minimumArgLength = 0; this.maximumArgLength = 1;