From 47e052d180e54eaeedbe73468bebb02d8d74350d Mon Sep 17 00:00:00 2001 From: "main()" Date: Sun, 1 Jan 2012 17:22:05 +0100 Subject: [PATCH] Style-fixes. Tons of them. I was too lazy to pack them into different commits. --- config/mv_checks.xml | 6 +- .../MultiverseCore/api/MultiverseWorld.java | 1 + .../commands/AnchorCommand.java | 6 +- .../MultiverseCore/commands/CheckCommand.java | 4 +- .../commands/ConfigCommand.java | 13 ++-- .../commands/ConfirmCommand.java | 3 + .../MultiverseCore/commands/CoordCommand.java | 3 + .../commands/CreateCommand.java | 7 +- .../MultiverseCore/commands/DebugCommand.java | 6 +- .../commands/DeleteCommand.java | 8 ++- .../commands/EnvironmentCommand.java | 8 +++ .../commands/GeneratorCommand.java | 3 + .../MultiverseCore/commands/HelpCommand.java | 10 ++- .../commands/ImportCommand.java | 10 ++- .../MultiverseCore/commands/InfoCommand.java | 18 ++++- .../MultiverseCore/commands/ListCommand.java | 6 +- .../MultiverseCore/commands/LoadCommand.java | 3 + .../commands/ModifyAddCommand.java | 6 +- .../commands/ModifyClearCommand.java | 3 + .../commands/ModifyCommand.java | 10 +++ .../commands/ModifyRemoveCommand.java | 9 ++- .../commands/ModifySetCommand.java | 3 + .../commands/MultiverseCommand.java | 6 ++ .../commands/PaginatedCommand.java | 70 +++++++++++++++++-- .../commands/PaginatedCoreCommand.java | 7 ++ .../MultiverseCore/commands/PurgeCommand.java | 3 + .../MultiverseCore/commands/RegenCommand.java | 11 ++- .../commands/ReloadCommand.java | 3 + .../commands/RemoveCommand.java | 6 +- .../commands/SetSpawnCommand.java | 10 ++- .../MultiverseCore/commands/SleepCommand.java | 3 + .../MultiverseCore/commands/SpawnCommand.java | 6 +- .../MultiverseCore/commands/SpoutCommand.java | 3 + .../commands/TeleportCommand.java | 36 ++++++---- .../commands/UnloadCommand.java | 6 +- .../commands/VersionCommand.java | 6 +- .../MultiverseCore/commands/WhoCommand.java | 3 + 37 files changed, 273 insertions(+), 52 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index 9f276cae..3aedb0f7 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -94,10 +94,11 @@ - + + @@ -121,5 +122,8 @@ + + + diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/MultiverseWorld.java b/src/main/java/com/onarandombox/MultiverseCore/api/MultiverseWorld.java index 72a3b8bd..00eaac12 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/api/MultiverseWorld.java +++ b/src/main/java/com/onarandombox/MultiverseCore/api/MultiverseWorld.java @@ -217,6 +217,7 @@ public interface MultiverseWorld { * Turn pvp on or off. This setting is used to set the world's PVP mode, and thus relies on fakePVP * * @return True if this world has fakepvp on + * @deprecated This is deprecated. */ @Deprecated boolean getFakePVP(); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/AnchorCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/AnchorCommand.java index 9f5c3267..2c220da9 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/AnchorCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/AnchorCommand.java @@ -16,6 +16,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.ArrayList; import java.util.List; +/** + * Allows management of Anchor Destinations. + */ public class AnchorCommand extends PaginatedCoreCommand { public AnchorCommand(MultiverseCore plugin) { @@ -59,7 +62,8 @@ public class AnchorCommand extends PaginatedCoreCommand { if (filterObject.getFilter().length() > 0) { availableAnchors = this.getFilteredItems(availableAnchors, filterObject.getFilter()); if (availableAnchors.size() == 0) { - sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE + "No anchors matched your filter: " + ChatColor.AQUA + filterObject.getFilter()); + sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE + + "No anchors matched your filter: " + ChatColor.AQUA + filterObject.getFilter()); return; } } else { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java index 1d2a8688..9a91013e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java @@ -17,7 +17,9 @@ import org.bukkit.entity.Player; import org.bukkit.permissions.PermissionDefault; import java.util.List; - +/** + * Checks to see if a player can go to a destination. + */ public class CheckCommand extends MultiverseCommand { public CheckCommand(MultiverseCore plugin) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java index 159092aa..3b48e1ce 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java @@ -8,7 +8,6 @@ package com.onarandombox.MultiverseCore.commands; import com.onarandombox.MultiverseCore.MultiverseCore; -import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.enums.ConfigProperty; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; @@ -16,9 +15,10 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; +/** + * Allows you to set Global MV Variables. + */ public class ConfigCommand extends MultiverseCommand { - private MVWorldManager worldManager; - public ConfigCommand(MultiverseCore plugin) { super(plugin); this.setName("Configuration"); @@ -33,7 +33,6 @@ public class ConfigCommand extends MultiverseCommand { this.addCommandExample("/mv config " + ChatColor.GREEN + "debug" + ChatColor.AQUA + " 3"); this.addCommandExample("/mv config " + ChatColor.GREEN + "enforceaccess" + ChatColor.AQUA + " false"); this.setPermission("multiverse.core.config", "Allows you to set Global MV Variables.", PermissionDefault.OP); - this.worldManager = this.plugin.getMVWorldManager(); } @Override @@ -58,7 +57,8 @@ public class ConfigCommand extends MultiverseCommand { this.plugin.getMVConfiguration().set(args.get(0).toLowerCase(), args.get(1)); // Don't forget to set the world! this.plugin.getMVWorldManager().setFirstSpawnWorld(args.get(1)); - } else if (args.get(0).equalsIgnoreCase("messagecooldown") || args.get(0).equalsIgnoreCase("teleportcooldown") || args.get(0).equalsIgnoreCase("debug")) { + } else if (args.get(0).equalsIgnoreCase("messagecooldown") || args.get(0).equalsIgnoreCase("teleportcooldown") + || args.get(0).equalsIgnoreCase("debug")) { try { this.plugin.getMVConfiguration().set(args.get(0).toLowerCase(), Integer.parseInt(args.get(1))); } catch (NumberFormatException e) { @@ -70,7 +70,8 @@ public class ConfigCommand extends MultiverseCommand { try { property = ConfigProperty.valueOf(args.get(0).toLowerCase()); } catch (IllegalArgumentException e) { - sender.sendMessage(ChatColor.RED + "Sorry, " + ChatColor.AQUA + args.get(0) + ChatColor.WHITE + " you can't set " + ChatColor.AQUA + args.get(0)); + sender.sendMessage(ChatColor.RED + "Sorry, " + ChatColor.AQUA + + args.get(0) + ChatColor.WHITE + " you can't set " + ChatColor.AQUA + args.get(0)); sender.sendMessage(ChatColor.GREEN + "Valid values are:"); sender.sendMessage(ConfigProperty.getAllValues()); return; diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ConfirmCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ConfirmCommand.java index bd4ce09b..2a68f353 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ConfirmCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ConfirmCommand.java @@ -13,6 +13,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; +/** + * Confirms actions. + */ public class ConfirmCommand extends MultiverseCommand { public ConfirmCommand(MultiverseCore plugin) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java index 2551ebe0..f2d09887 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java @@ -21,6 +21,9 @@ import org.bukkit.permissions.PermissionDefault; import java.text.DecimalFormat; import java.util.List; +/** + * Returns detailed information on the Players where abouts. + */ public class CoordCommand extends MultiverseCommand { private MVWorldManager worldManager; diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java index a99697e9..0a122d3c 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java @@ -19,6 +19,9 @@ import org.bukkit.permissions.PermissionDefault; import java.io.File; import java.util.List; +/** + * Creates a new world and loads it. + */ public class CreateCommand extends MultiverseCommand { private MVWorldManager worldManager; @@ -47,8 +50,8 @@ public class CreateCommand extends MultiverseCommand { String seed = CommandHandler.getFlag("-s", args); String generator = CommandHandler.getFlag("-g", args); boolean useSpawnAdjust = true; - for(String s : args) { - if(s.equalsIgnoreCase("-n")) { + for (String s : args) { + if (s.equalsIgnoreCase("-n")) { useSpawnAdjust = false; } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java index a633f89b..83f7cdd5 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java @@ -15,6 +15,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; import java.util.logging.Level; +/** + * Enables debug-information. + */ public class DebugCommand extends MultiverseCommand { public DebugCommand(MultiverseCore plugin) { @@ -42,7 +45,8 @@ public class DebugCommand extends MultiverseCommand { } MultiverseCore.GlobalDebug = debugLevel; } catch (NumberFormatException e) { - sender.sendMessage(ChatColor.RED + "Error" + ChatColor.WHITE + " setting debug level. Please use a number 0-3 " + ChatColor.AQUA + "(3 being many many messages!)"); + sender.sendMessage(ChatColor.RED + "Error" + ChatColor.WHITE + + " setting debug level. Please use a number 0-3 " + ChatColor.AQUA + "(3 being many many messages!)"); } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/DeleteCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/DeleteCommand.java index 14805d94..05ada3a8 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/DeleteCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/DeleteCommand.java @@ -15,6 +15,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.ArrayList; import java.util.List; +/** + * Deletes worlds. + */ public class DeleteCommand extends MultiverseCommand { public DeleteCommand(MultiverseCore plugin) { @@ -30,8 +33,9 @@ public class DeleteCommand extends MultiverseCommand { @Override public void runCommand(CommandSender sender, List args) { - Class paramTypes[] = {String.class}; + Class[] paramTypes = {String.class}; List objectArgs = new ArrayList(args); - this.plugin.getCommandHandler().queueCommand(sender, "mvdelete", "deleteWorld", objectArgs, paramTypes, ChatColor.GREEN + "World Deleted!", ChatColor.RED + "World could NOT be deleted!"); + this.plugin.getCommandHandler().queueCommand(sender, "mvdelete", "deleteWorld", objectArgs, + paramTypes, ChatColor.GREEN + "World Deleted!", ChatColor.RED + "World could NOT be deleted!"); } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/EnvironmentCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/EnvironmentCommand.java index 3bbdf863..5612340c 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/EnvironmentCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/EnvironmentCommand.java @@ -14,6 +14,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; +/** + * Lists valid known environments. + */ public class EnvironmentCommand extends MultiverseCommand { public EnvironmentCommand(MultiverseCore plugin) { @@ -29,6 +32,11 @@ public class EnvironmentCommand extends MultiverseCommand { this.setPermission("multiverse.core.list.environments", "Lists valid known environments.", PermissionDefault.OP); } + /** + * Shows all valid known environments to a {@link CommandSender}. + * + * @param sender The {@link CommandSender}. + */ public static void showEnvironments(CommandSender sender) { sender.sendMessage(ChatColor.YELLOW + "Valid Environments are:"); sender.sendMessage(ChatColor.GREEN + "NORMAL"); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/GeneratorCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/GeneratorCommand.java index 9ff679ce..bc09e24f 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/GeneratorCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/GeneratorCommand.java @@ -17,6 +17,9 @@ import java.util.ArrayList; import java.util.List; import java.util.logging.Level; +/** + * Returns a list of loaded generator plugins. + */ public class GeneratorCommand extends MultiverseCommand { public GeneratorCommand(MultiverseCore plugin) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/HelpCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/HelpCommand.java index 579ea3e2..26c1faef 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/HelpCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/HelpCommand.java @@ -18,6 +18,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.ArrayList; import java.util.List; +/** + * Displays a nice help menu. + */ public class HelpCommand extends PaginatedCoreCommand { public HelpCommand(MultiverseCore plugin) { @@ -50,8 +53,8 @@ public class HelpCommand extends PaginatedCoreCommand { } else if (c.getCommandUsage().matches("(?i).*" + filter + ".*")) { filtered.add(c); } else { - for(String example : c.getCommandExamples()) { - if(example.matches("(?i).*" + filter + ".*")) { + for (String example : c.getCommandExamples()) { + if (example.matches("(?i).*" + filter + ".*")) { filtered.add(c); break; } @@ -76,7 +79,8 @@ public class HelpCommand extends PaginatedCoreCommand { if (filterObject.getFilter().length() > 0) { availableCommands = this.getFilteredItems(availableCommands, filterObject.getFilter()); if (availableCommands.size() == 0) { - sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE + "No commands matched your filter: " + ChatColor.AQUA + filterObject.getFilter()); + sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE + + "No commands matched your filter: " + ChatColor.AQUA + filterObject.getFilter()); return; } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java index cb76f1a7..87ff747f 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java @@ -23,6 +23,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +/** + * Imports a new world of the specified type. + */ public class ImportCommand extends MultiverseCommand { private MVWorldManager worldManager; @@ -115,7 +118,8 @@ public class ImportCommand extends MultiverseCommand { // Make sure we don't already know about this world. if (this.worldManager.isMVWorld(worldName)) { - sender.sendMessage(ChatColor.GREEN + "Multiverse" + ChatColor.WHITE + " already knows about '" + ChatColor.AQUA + worldName + ChatColor.WHITE + "'!"); + sender.sendMessage(ChatColor.GREEN + "Multiverse" + ChatColor.WHITE + + " already knows about '" + ChatColor.AQUA + worldName + ChatColor.WHITE + "'!"); return; } @@ -123,8 +127,8 @@ public class ImportCommand extends MultiverseCommand { String generator = CommandHandler.getFlag("-g", args); boolean useSpawnAdjust = true; - for(String s : args) { - if(s.equalsIgnoreCase("-n")) { + for (String s : args) { + if (s.equalsIgnoreCase("-n")) { useSpawnAdjust = false; } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/InfoCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/InfoCommand.java index 2a50c024..2a4c3e54 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/InfoCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/InfoCommand.java @@ -27,6 +27,9 @@ import java.util.List; // Will use when we can compile with JDK 6 //import com.sun.xml.internal.ws.util.StringUtils; +/** + * Returns detailed information about a world. + */ public class InfoCommand extends MultiverseCommand { private MVWorldManager worldManager; @@ -116,7 +119,8 @@ public class InfoCommand extends MultiverseCommand { message.add(new FancyMessage("Spawn Location: ", LocationManipulation.strCoords(spawn), colors)); message.add(new FancyMessage("World Scale: ", world.getScaling() + "", colors)); if (world.getPrice() > 0) { - message.add(new FancyMessage("Price to enter this world: ", this.plugin.getBank().getFormattedAmount(p, world.getPrice(), world.getCurrency()), colors)); + message.add(new FancyMessage("Price to enter this world: ", + this.plugin.getBank().getFormattedAmount(p, world.getPrice(), world.getCurrency()), colors)); } else { message.add(new FancyMessage("Price to enter this world: ", ChatColor.GREEN + "FREE!", colors)); } @@ -150,7 +154,8 @@ public class InfoCommand extends MultiverseCommand { message.add(new FancyMessage("Bukkit Setting: ", world.getCBWorld().getAllowMonsters() + "", colors)); if (world.getMonsterList().size() > 0) { if (world.canMonstersSpawn()) { - message.add(new FancyMessage("Monsters that" + ChatColor.RED + " CAN NOT " + ChatColor.GREEN + "spawn: ", toCommaSeperated(world.getMonsterList()), colors)); + message.add(new FancyMessage("Monsters that" + ChatColor.RED + " CAN NOT " + + ChatColor.GREEN + "spawn: ", toCommaSeperated(world.getMonsterList()), colors)); } else { message.add(new FancyMessage("Monsters that" + ChatColor.GREEN + " CAN SPAWN: ", toCommaSeperated(world.getMonsterList()), colors)); } @@ -166,7 +171,8 @@ public class InfoCommand extends MultiverseCommand { message.add(new FancyMessage("Bukkit Setting: ", world.getCBWorld().getAllowAnimals() + "", colors)); if (world.getMonsterList().size() > 0) { if (world.canMonstersSpawn()) { - message.add(new FancyMessage("Animals that" + ChatColor.RED + " CAN NOT " + ChatColor.GREEN + "spawn: ", toCommaSeperated(world.getAnimalList()), colors)); + message.add(new FancyMessage("Animals that" + ChatColor.RED + " CAN NOT " + + ChatColor.GREEN + "spawn: ", toCommaSeperated(world.getAnimalList()), colors)); } else { message.add(new FancyMessage("Animals that" + ChatColor.GREEN + " CAN SPAWN: ", toCommaSeperated(world.getAnimalList()), colors)); } @@ -194,6 +200,12 @@ public class InfoCommand extends MultiverseCommand { return result; } + /** + * Gets a "positive" or "negative" {@link ChatColor}. + * + * @param positive Whether this {@link ChatColor} should be "positive". + * @return The {@link ChatColor}. + */ protected ChatColor getChatColor(boolean positive) { return positive ? ChatColor.GREEN : ChatColor.RED; } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java index 33a78d53..8df221a6 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java @@ -18,6 +18,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.ArrayList; import java.util.List; +/** + * Displays a listing of all worlds that a player can enter. + */ public class ListCommand extends PaginatedCoreCommand { public ListCommand(MultiverseCore plugin) { @@ -99,7 +102,8 @@ public class ListCommand extends PaginatedCoreCommand { if (filterObject.getFilter().length() > 0) { availableWorlds = this.getFilteredItems(availableWorlds, filterObject.getFilter()); if (availableWorlds.size() == 0) { - sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE + "No worlds matched your filter: " + ChatColor.AQUA + filterObject.getFilter()); + sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE + + "No worlds matched your filter: " + ChatColor.AQUA + filterObject.getFilter()); return; } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/LoadCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/LoadCommand.java index 4c9dbeec..4a96ef36 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/LoadCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/LoadCommand.java @@ -15,6 +15,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; +/** + * Loads a world into Multiverse. + */ public class LoadCommand extends MultiverseCommand { public LoadCommand(MultiverseCore plugin) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java index 8b82a923..0113fc06 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java @@ -21,6 +21,9 @@ import java.util.List; // This will contain all the properties that support the ADD/REMOVE // Anything not in here will only support the SET action +/** + * Used to modify various aspects of worlds. + */ public class ModifyAddCommand extends MultiverseCommand { private MVWorldManager worldManager; @@ -78,7 +81,8 @@ public class ModifyAddCommand extends MultiverseCommand { } if (world.addToVariable(property, value)) { - sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + value + ChatColor.WHITE + " was " + ChatColor.GREEN + "added to " + ChatColor.GREEN + property); + sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + + value + ChatColor.WHITE + " was " + ChatColor.GREEN + "added to " + ChatColor.GREEN + property); } else { sender.sendMessage(value + " could not be added to " + property); } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java index 586006d3..ba29ea2c 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java @@ -18,6 +18,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; +/** + * Removes all values from a world-property. + */ public class ModifyClearCommand extends MultiverseCommand { private MVWorldManager worldManager; diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyCommand.java index d87a65f4..cdf317fe 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyCommand.java @@ -19,6 +19,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +/** + * Used to modify various aspects of worlds. + */ public class ModifyCommand extends MultiverseCommand { public ModifyCommand(MultiverseCore plugin) { @@ -42,6 +45,13 @@ public class ModifyCommand extends MultiverseCommand { this.setPermission(modify); } + /** + * Validates the specified action. + * + * @param action The {@link Action}. + * @param property The property. + * @return Whether this action is valid. + */ protected static boolean validateAction(Action action, String property) { if (action != Action.Set) { try { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java index e15254b2..7e57365a 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java @@ -18,6 +18,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; +/** + * Removes values from a world-property. + */ public class ModifyRemoveCommand extends MultiverseCommand { private MVWorldManager worldManager; @@ -78,9 +81,11 @@ public class ModifyRemoveCommand extends MultiverseCommand { return; } if (world.removeFromVariable(property, value)) { - sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + value + ChatColor.WHITE + " was " + ChatColor.RED + "removed from " + ChatColor.GREEN + property); + sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + value + ChatColor.WHITE + + " was " + ChatColor.RED + "removed from " + ChatColor.GREEN + property); } else { - sender.sendMessage(ChatColor.RED + "There was an error removing " + ChatColor.GRAY + value + ChatColor.WHITE + " from " + ChatColor.GOLD + property); + sender.sendMessage(ChatColor.RED + "There was an error removing " + ChatColor.GRAY + + value + ChatColor.WHITE + " from " + ChatColor.GOLD + property); } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java index 7ffc5cc0..e8b0a7a7 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java @@ -19,6 +19,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; +/** + * Used to set world-properties. + */ public class ModifySetCommand extends MultiverseCommand { private MVWorldManager worldManager; diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/MultiverseCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/MultiverseCommand.java index 9db29dcf..b49444fa 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/MultiverseCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/MultiverseCommand.java @@ -13,8 +13,14 @@ import org.bukkit.command.CommandSender; import java.util.List; +/** + * A generic Multiverse-command. + */ public abstract class MultiverseCommand extends Command { + /** + * The reference to the core. + */ protected MultiverseCore plugin; public MultiverseCommand(MultiverseCore plugin) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/PaginatedCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/PaginatedCommand.java index 2e316001..c3ddf09b 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/PaginatedCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/PaginatedCommand.java @@ -14,28 +14,60 @@ import org.bukkit.plugin.java.JavaPlugin; import java.util.List; +/** + * A generic paginated command. + * @param The type of items on the page. + */ public abstract class PaginatedCommand extends Command { - protected int itemsPerPage = 9; - + private static final int DEFAULT_ITEMS_PER_PAGE = 9; + /** + * The number of items per page. + */ + protected int itemsPerPage = DEFAULT_ITEMS_PER_PAGE; public PaginatedCommand(JavaPlugin plugin) { super(plugin); } + /** + * Set the number of items per page. + * + * @param items The new number of items per page. + */ protected void setItemsPerPage(int items) { itemsPerPage = items; } + /** + * Gets filtered items. + * @param availableItems All available items. + * @param filter The filter-{@link String}. + * @return A list of items that match the filter. + */ protected abstract List getFilteredItems(List availableItems, String filter); + /** + * Constructs a single string from a list of strings. + * + * @param list The {@link List} of strings. + * @return A single {@link String}. + */ protected String stitchThisString(List list) { - String returnstr = ""; + StringBuilder builder = new StringBuilder(); for (String s : list) { - returnstr += s + " "; + builder.append(s); + builder.append(' '); } - return returnstr; + return builder.toString(); } + /** + * Shows a page. + * + * @param page The number of the page to show. + * @param sender The {@link CommandSender} that wants to see the page. + * @param cmds The items that should be displayed on the page. + */ protected void showPage(int page, CommandSender sender, List cmds) { // Ensure the page is at least 1. page = (page <= 0) ? 1 : page; @@ -52,8 +84,20 @@ public abstract class PaginatedCommand extends Command { } } + /** + * Converts an item into a string. + * + * @param item The item. + * @return A {@link String}. + */ protected abstract String getItemText(T item); + /** + * Constructs a {@link FilterObject} from a {@link List} of arguments. + * + * @param args The {@link List} of arguments. + * @return The {@link FilterObject}. + */ protected FilterObject getPageAndFilter(List args) { int page = 1; @@ -80,6 +124,9 @@ public abstract class PaginatedCommand extends Command { return new FilterObject(page, filter); } + /** + * "Key-Object" containing information about the page and the filter that were requested. + */ protected class FilterObject { private Integer page; private String filter; @@ -89,14 +136,27 @@ public abstract class PaginatedCommand extends Command { this.filter = filter; } + /** + * Gets the page. + * @return The page. + */ public Integer getPage() { return this.page; } + /** + * Sets the page. + * + * @param page The new page. + */ public void setPage(int page) { this.page = page; } + /** + * Gets the filter. + * @return The filter. + */ public String getFilter() { return this.filter; } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/PaginatedCoreCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/PaginatedCoreCommand.java index 9488d2e8..7071311a 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/PaginatedCoreCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/PaginatedCoreCommand.java @@ -9,7 +9,14 @@ package com.onarandombox.MultiverseCore.commands; import com.onarandombox.MultiverseCore.MultiverseCore; +/** + * A generic paginated Multiverse-command. + * @param The type of items on the page. + */ public abstract class PaginatedCoreCommand extends PaginatedCommand { + /** + * The reference to the core. + */ protected MultiverseCore plugin; public PaginatedCoreCommand(MultiverseCore plugin) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java index 59ab6059..89950d5b 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java @@ -20,6 +20,9 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +/** + * Removes a type of mob from a world. + */ public class PurgeCommand extends MultiverseCommand { private MVWorldManager worldManager; diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java index d7cc364a..c93e36a7 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java @@ -15,6 +15,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.ArrayList; import java.util.List; +/** + * Regenerates a world. + */ public class RegenCommand extends MultiverseCommand { public RegenCommand(MultiverseCore plugin) { @@ -28,7 +31,8 @@ public class RegenCommand extends MultiverseCommand { this.addCommandExample("/mv regen " + ChatColor.GREEN + "MyWorld" + ChatColor.GOLD + " -s"); this.addCommandExample("or specifiy a seed to get that one:"); this.addCommandExample("/mv regen " + ChatColor.GREEN + "MyWorld" + ChatColor.GOLD + " -s" + ChatColor.AQUA + " gargamel"); - this.setPermission("multiverse.core.delete", "Deletes a world on your server. " + ChatColor.RED + "PERMANENTLY.", PermissionDefault.OP); + this.setPermission("multiverse.core.regen", "Regenerates a world on your server. The previous state will be lost " + + ChatColor.RED + "PERMANENTLY.", PermissionDefault.OP); } @Override @@ -37,12 +41,13 @@ public class RegenCommand extends MultiverseCommand { Boolean randomseed = (args.size() == 2 && args.get(1).equalsIgnoreCase("-s")); 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 objectArgs = new ArrayList(); objectArgs.add(args.get(0)); objectArgs.add(useseed); objectArgs.add(randomseed); objectArgs.add(seed); - this.plugin.getCommandHandler().queueCommand(sender, "mvregen", "regenWorld", objectArgs, paramTypes, ChatColor.GREEN + "World Regenerated!", ChatColor.RED + "World could NOT be regenerated!"); + this.plugin.getCommandHandler().queueCommand(sender, "mvregen", "regenWorld", objectArgs, + paramTypes, ChatColor.GREEN + "World Regenerated!", ChatColor.RED + "World could NOT be regenerated!"); } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java index d4776a04..3481a4ea 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java @@ -16,6 +16,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.ArrayList; import java.util.List; +/** + * Reloads worlds.yml and config.yml. + */ public class ReloadCommand extends MultiverseCommand { public ReloadCommand(MultiverseCore plugin) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java index 2324dfa1..ff24e740 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java @@ -14,6 +14,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; +/** + * Unloads a world and removes it from the config. + */ public class RemoveCommand extends MultiverseCommand { public RemoveCommand(MultiverseCore plugin) { @@ -24,7 +27,8 @@ public class RemoveCommand extends MultiverseCommand { this.addKey("mvremove"); this.addKey("mv remove"); this.addCommandExample("/mv remove " + ChatColor.GREEN + "MyWorld"); - this.setPermission("multiverse.core.remove", "Unloads a world from Multiverse and removes it from worlds.yml, this does NOT DELETE the world folder.", PermissionDefault.OP); + this.setPermission("multiverse.core.remove", + "Unloads a world from Multiverse and removes it from worlds.yml, this does NOT DELETE the world folder.", PermissionDefault.OP); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/SetSpawnCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/SetSpawnCommand.java index 62e13b2e..ba8863e9 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/SetSpawnCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/SetSpawnCommand.java @@ -20,6 +20,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; +/** + * Sets the spawn for a world. + */ public class SetSpawnCommand extends MultiverseCommand { public SetSpawnCommand(MultiverseCore plugin) { super(plugin); @@ -40,6 +43,11 @@ public class SetSpawnCommand extends MultiverseCommand { setWorldSpawn(sender); } + /** + * Does the actual spawn-setting-work. + * + * @param sender The {@link CommandSender} that's setting the spawn. + */ protected void setWorldSpawn(CommandSender sender) { if (sender instanceof Player) { Player p = (Player) sender; @@ -49,7 +57,7 @@ public class SetSpawnCommand extends MultiverseCommand { if (foundWorld != null) { foundWorld.setSpawnLocation(p.getLocation()); BlockSafety bs = new BlockSafety(); - if(!bs.playerCanSpawnHereSafely(p.getLocation()) && foundWorld.getAdjustSpawn()) { + if (!bs.playerCanSpawnHereSafely(p.getLocation()) && foundWorld.getAdjustSpawn()) { sender.sendMessage("It looks like that location would normally be unsafe. But I trust you."); sender.sendMessage("I'm turning off the Safe-T-Teleporter for spawns to this world."); sender.sendMessage("If you want this turned back on just do:"); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/SleepCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/SleepCommand.java index c550b7c5..08156d20 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/SleepCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/SleepCommand.java @@ -14,6 +14,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; +/** + * Takes the player to the latest bed he's slept in. + */ public class SleepCommand extends MultiverseCommand { public SleepCommand(MultiverseCore plugin) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/SpawnCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/SpawnCommand.java index 3cef0446..80620b78 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/SpawnCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/SpawnCommand.java @@ -18,11 +18,15 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; +/** + * Teleports a player to the spawn. + */ public class SpawnCommand extends MultiverseCommand { public SpawnCommand(MultiverseCore plugin) { super(plugin); - Permission otherPerm = new Permission("multiverse.core.spawn.other", "Teleports another player to the spawn of the world they are in.", PermissionDefault.OP); + Permission otherPerm = new Permission("multiverse.core.spawn.other", + "Teleports another player to the spawn of the world they are in.", PermissionDefault.OP); this.setName("Spawn"); this.setCommandUsage("/mv spawn" + ChatColor.GOLD + " [PLAYER]"); this.setArgRange(0, 1); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/SpoutCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/SpoutCommand.java index 75a0d2d6..5642fd63 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/SpoutCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/SpoutCommand.java @@ -19,6 +19,9 @@ import org.getspout.spoutapi.player.SpoutPlayer; import java.util.List; +/** + * Edit a world with spout. + */ public class SpoutCommand extends MultiverseCommand { public SpoutCommand(MultiverseCore plugin) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java index fb0b888d..7e8f2212 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java @@ -29,6 +29,9 @@ import java.util.ArrayList; import java.util.List; import java.util.logging.Level; +/** + * Used to teleport players. + */ public class TeleportCommand extends MultiverseCommand { private SafeTTeleporter playerTeleporter; @@ -45,6 +48,8 @@ public class TeleportCommand extends MultiverseCommand { this.setPermission(menu); } + private static final int UNSAFE_TELEPORT_EXPIRE_DELAY = 15; + @Override public void runCommand(CommandSender sender, List args) { // Check if the command was sent from a Player. @@ -77,7 +82,9 @@ public class TeleportCommand extends MultiverseCommand { String[] cannonSpeed = destinationName.split("-"); try { double speed = Double.parseDouble(cannonSpeed[1]); - destinationName = "ca:" + teleportee.getWorld().getName() + ":" + teleportee.getLocation().getX() + "," + teleportee.getLocation().getY() + "," + teleportee.getLocation().getZ() + ":" + teleportee.getLocation().getPitch() + ":" + teleportee.getLocation().getYaw() + ":" + speed; + destinationName = "ca:" + teleportee.getWorld().getName() + ":" + teleportee.getLocation().getX() + + "," + teleportee.getLocation().getY() + "," + teleportee.getLocation().getZ() + ":" + + teleportee.getLocation().getPitch() + ":" + teleportee.getLocation().getYaw() + ":" + speed; } catch (Exception e) { destinationName = "i:invalid"; } @@ -107,14 +114,17 @@ public class TeleportCommand extends MultiverseCommand { if (teleportee.equals(teleporter)) { teleporter.sendMessage("Doesn't look like you're allowed to go " + ChatColor.RED + "there..."); } else { - teleporter.sendMessage("Doesn't look like you're allowed to send " + ChatColor.GOLD + teleportee.getName() + ChatColor.WHITE + " to " + ChatColor.RED + "there..."); + teleporter.sendMessage("Doesn't look like you're allowed to send " + ChatColor.GOLD + + teleportee.getName() + ChatColor.WHITE + " to " + ChatColor.RED + "there..."); } return; } else if (teleporter != null && !this.plugin.getMVPerms().canTravelFromLocation(teleporter, d.getLocation(teleportee))) { if (teleportee.equals(teleporter)) { - teleporter.sendMessage("DOH! Doesn't look like you can get to " + ChatColor.RED + "THERE from " + ChatColor.GREEN + ((Player) teleporter).getWorld().getName()); + teleporter.sendMessage("DOH! Doesn't look like you can get to " + ChatColor.RED + + "THERE from " + ChatColor.GREEN + ((Player) teleporter).getWorld().getName()); } else { - teleporter.sendMessage("DOH! Doesn't look like " + ChatColor.GREEN + ((Player) teleporter).getWorld().getName() + " can get to " + ChatColor.RED + "THERE from where they are..."); + teleporter.sendMessage("DOH! Doesn't look like " + ChatColor.GREEN + ((Player) teleporter).getWorld().getName() + + " can get to " + ChatColor.RED + "THERE from where they are..."); } return; } @@ -149,7 +159,7 @@ public class TeleportCommand extends MultiverseCommand { if (result == TeleportResult.FAIL_UNSAFE) { this.plugin.log(Level.FINE, "Could not teleport " + teleportee.getName() + " to " + LocationManipulation.strCoordsRaw(d.getLocation(teleportee))); this.plugin.log(Level.FINE, "Queueing Command"); - Class paramTypes[] = {CommandSender.class, Player.class, Location.class}; + Class[] paramTypes = {CommandSender.class, Player.class, Location.class}; List items = new ArrayList(); items.add(teleporter); items.add(teleportee); @@ -158,24 +168,26 @@ public class TeleportCommand extends MultiverseCommand { if (!teleportee.equals(teleporter)) { player = teleportee.getName(); } - String message = ChatColor.GREEN + "Multiverse" + ChatColor.WHITE + " did not teleport " + ChatColor.AQUA + player + ChatColor.WHITE + " to " + ChatColor.DARK_AQUA + d.getName() + ChatColor.WHITE + " because it was unsafe."; - this.plugin.getCommandHandler().queueCommand(sender, "mvteleport", "teleportPlayer", items, paramTypes, message, "Would you like to try anyway?", "", "", 15); - } else { - // Player was teleported successfully (or the tp event was fired I should say); - + String message = ChatColor.GREEN + "Multiverse" + ChatColor.WHITE + " did not teleport " + + ChatColor.AQUA + player + ChatColor.WHITE + " to " + ChatColor.DARK_AQUA + d.getName() + ChatColor.WHITE + " because it was unsafe."; + this.plugin.getCommandHandler().queueCommand(sender, "mvteleport", "teleportPlayer", items, + paramTypes, message, "Would you like to try anyway?", "", "", UNSAFE_TELEPORT_EXPIRE_DELAY); } + // else: Player was teleported successfully (or the tp event was fired I should say) } private boolean checkSendPermissions(CommandSender teleporter, Player teleportee, MVDestination destination) { MVMessaging message = this.plugin.getMessaging(); if (teleporter.equals(teleportee)) { if (!this.plugin.getMVPerms().hasPermission(teleporter, "multiverse.teleport.self." + destination.getIdentifier(), true)) { - message.sendMessages(teleporter, new String[]{"You don't have permission to teleport yourself to a " + ChatColor.GREEN + destination.getType() + " Destination.", ChatColor.RED + " (multiverse.teleport.self." + destination.getIdentifier() + ")"}); + message.sendMessages(teleporter, new String[]{"You don't have permission to teleport yourself to a " + ChatColor.GREEN + + destination.getType() + " Destination.", ChatColor.RED + " (multiverse.teleport.self." + destination.getIdentifier() + ")"}); return false; } } else { if (!this.plugin.getMVPerms().hasPermission(teleporter, "multiverse.teleport.other." + destination.getIdentifier(), true)) { - message.sendMessages(teleporter, new String[]{"You don't have permission to teleport another player to a " + ChatColor.GREEN + destination.getType() + " Destination.", ChatColor.RED + " (multiverse.teleport.other." + destination.getIdentifier() + ")"}); + message.sendMessages(teleporter, new String[]{"You don't have permission to teleport another player to a " + ChatColor.GREEN + + destination.getType() + " Destination.", ChatColor.RED + " (multiverse.teleport.other." + destination.getIdentifier() + ")"}); return false; } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java index f49abe88..52f92c6c 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java @@ -15,6 +15,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; +/** + * Unloads worlds from Multiverse. + */ public class UnloadCommand extends MultiverseCommand { public UnloadCommand(MultiverseCore plugin) { @@ -24,7 +27,8 @@ public class UnloadCommand extends MultiverseCommand { this.setArgRange(1, 1); this.addKey("mvunload"); this.addKey("mv unload"); - this.setPermission("multiverse.core.unload", "Unloads a world from Multiverse. This does NOT remove the world folder. This does NOT remove it from the config file.", PermissionDefault.OP); + this.setPermission("multiverse.core.unload", + "Unloads a world from Multiverse. This does NOT remove the world folder. This does NOT remove it from the config file.", PermissionDefault.OP); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java index 990462ef..bca60c17 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java @@ -21,6 +21,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.List; import java.util.logging.Level; +/** + * Dumps version info to the console. + */ public class VersionCommand extends MultiverseCommand { public VersionCommand(MultiverseCore plugin) { @@ -31,7 +34,8 @@ public class VersionCommand extends MultiverseCommand { this.addKey("mv version"); this.addKey("mvv"); this.addKey("mvversion"); - this.setPermission("multiverse.core.version", "Dumps version info to the console, optionally to pastie.org with -p or pastebin.com with a -b.", PermissionDefault.TRUE); + this.setPermission("multiverse.core.version", + "Dumps version info to the console, optionally to pastie.org with -p or pastebin.com with a -b.", PermissionDefault.TRUE); } private String pasteBinBuffer = ""; diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/WhoCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/WhoCommand.java index 6e19f216..ffef9604 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/WhoCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/WhoCommand.java @@ -18,6 +18,9 @@ import org.bukkit.permissions.PermissionDefault; import java.util.ArrayList; import java.util.List; +/** + * States who is in what world. + */ public class WhoCommand extends MultiverseCommand { private MVWorldManager worldManager;