Made the mvm commands prettier/more informative.

This commit is contained in:
Eric Stokes 2011-08-01 20:53:06 -06:00
parent dbdc6d91d2
commit 4a478d159b
5 changed files with 7 additions and 9 deletions

View File

@ -3,7 +3,6 @@ package com.onarandombox.MultiverseCore.commands;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
@ -90,9 +89,7 @@ public class HelpCommand extends MultiverseCommand {
private List<Command> getFilteredCommands(List<Command> availableCommands, String filter) {
List<Command> filtered = new ArrayList<Command>();
Pattern regex = Pattern.compile("regex", Pattern.CASE_INSENSITIVE);
for (Command c : availableCommands) {
if (stitchThisString(c.getKeys()).matches("(?i).*" + filter + ".*")) {
filtered.add(c);

View File

@ -65,7 +65,7 @@ public class ModifyAddCommand extends MultiverseCommand {
}
if (world.addToList(property, value)) {
sender.sendMessage(value + " was added to " + 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);
}

View File

@ -60,8 +60,9 @@ public class ModifyClearCommand extends MultiverseCommand {
}
if (world.clearList(property)) {
sender.sendMessage(property + " was cleared. It contains 0 values now.");
sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + property + ChatColor.WHITE + " was " + ChatColor.GREEN + "CLEARED" + ChatColor.WHITE + ". It contains " + ChatColor.LIGHT_PURPLE + "0" + ChatColor.WHITE + " values now.");
} else {
sender.sendMessage(property + " was NOT cleared.");
sender.sendMessage(ChatColor.RED + "Error: " + ChatColor.GOLD + property + ChatColor.WHITE + " was " + ChatColor.GOLD + "NOT" + ChatColor.WHITE + " cleared.");
}
}

View File

@ -65,9 +65,9 @@ public class ModifyRemoveCommand extends MultiverseCommand {
return;
}
if (world.removeFromList(property, value)) {
sender.sendMessage(value + " was removed from " + property);
sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + value + ChatColor.WHITE + " was " + ChatColor.RED + "removed from " + ChatColor.GREEN + property);
} else {
sender.sendMessage(value + " could not be removed from " + property);
sender.sendMessage(ChatColor.RED + "There was an error removing " + ChatColor.GRAY + value + ChatColor.WHITE + " from " + ChatColor.GOLD + property);
}
}

View File

@ -63,7 +63,7 @@ public class ModifySetCommand extends MultiverseCommand {
if ((property.equalsIgnoreCase("aliascolor") || property.equalsIgnoreCase("color")) && !world.isValidAliasColor(value)) {
sender.sendMessage(value + " is not a valid color. Please see our Github Wiki for the complete color list.");
} else if (world.setVariable(property, value)) {
sender.sendMessage(ChatColor.GREEN + "Success!" + ChatColor.WHITE + "Property " + ChatColor.AQUA + property + ChatColor.WHITE + " was set to " + ChatColor.GREEN + value);
sender.sendMessage(ChatColor.GREEN + "Success!" + ChatColor.WHITE + " Property " + ChatColor.AQUA + property + ChatColor.WHITE + " was set to " + ChatColor.GREEN + value);
} else {
sender.sendMessage(ChatColor.RED + "There was an error setting " + ChatColor.GRAY + property);
}