This commit is contained in:
boy0001 2015-02-04 00:17:51 +11:00
parent c3dfc4efb5
commit 2ba9590238
2 changed files with 17 additions and 1 deletions

View File

@ -81,6 +81,18 @@ public class FlagCmd extends SubCommand {
PlayerFunctions.sendMessage(player, C.COMMAND_SYNTAX, "/plot flag info <flag>");
return false;
}
AbstractFlag af = FlagManager.getFlag(args[1]);
if (af == null) {
PlayerFunctions.sendMessage(player, C.NOT_VALID_FLAG);
PlayerFunctions.sendMessage(player, C.COMMAND_SYNTAX, "/plot flag info <flag>");
return false;
}
// flag key
PlayerFunctions.sendMessage(player, C.FLAG_KEY, af.getKey());
// flag type
PlayerFunctions.sendMessage(player, C.FLAG_TYPE, af.value.getClass().getSimpleName());
// Flag type description
PlayerFunctions.sendMessage(player, C.FLAG_DESC, af.getValueDesc());
PlayerFunctions.sendMessage(player, "&cNot implemented.");
}
case "set": {
@ -208,7 +220,7 @@ public class FlagCmd extends SubCommand {
}
HashMap<String, ArrayList<String>> flags = new HashMap<>();
for (AbstractFlag af : FlagManager.getFlags()) {
String type = af.value.getClass().toString().replaceAll("Value", "");
String type = af.value.getClass().getSimpleName().replaceAll("Value", "");
if (!flags.containsKey(type)) {
flags.put(type, new ArrayList<String>());
}

View File

@ -385,6 +385,10 @@ public enum C {
/*
* Flag
*/
FLAG_KEY("&cKey: %s"),
FLAG_TYPE("&cType: %s"),
FLAG_DESC("&cDesc: %s"),
NEED_KEY("&cPossible values: &6%values%"),
NOT_VALID_FLAG("&cThat is not a valid flag"),
NOT_VALID_VALUE("&cFlag values must be alphanumerical"),