some fixes for /region flag

This commit is contained in:
Redecouverte 2011-02-25 18:53:28 +01:00
parent dcd379bce7
commit 23fa7a89ad
2 changed files with 5 additions and 5 deletions

View File

@ -81,6 +81,7 @@ public boolean handle(CommandSender sender, String senderName, String command, S
if (nfo == null) {
sender.sendMessage(ChatColor.RED + "Unknown flag specified.");
return true;
}
boolean validValue = false;
@ -158,6 +159,7 @@ public boolean handle(CommandSender sender, String senderName, String command, S
} else {
player.sendMessage(ChatColor.RED + "You must set the " + nameStr + " location inside the region it belongs to.");
return true;
}
} else if (valueStr.equals("delete")) {
@ -182,7 +184,7 @@ public boolean handle(CommandSender sender, String senderName, String command, S
String fullFlagname = nameStr;
if (subnameStr != null) {
nameStr += " " + subnameStr;
fullFlagname += " " + subnameStr;
}
if (!validValue) {

View File

@ -58,13 +58,11 @@ public static enum FlagValueType { STRING, BOOLEAN, INT, FLOAT, DOUBLE, STATE, L
flagList.add(new FlagInfo("waterflow", null, FlagValueType.STATE, "states", "waterflow"));
flagList.add(new FlagInfo("iconomy", "buyable", FlagValueType.BOOLEAN, "iconomy", "buyable"));
flagList.add(new FlagInfo("iconomy", "price", FlagValueType.INT, "iconomy", "price"));
flagList.add(new FlagInfo("spawn", "", FlagValueType.LOCATION, "spawn", ""));
flagList.add(new FlagInfo("teleport", "", FlagValueType.LOCATION, "teleport", ""));
flagList.add(new FlagInfo("spawn", "*", FlagValueType.LOCATION, "spawn", ""));
flagList.add(new FlagInfo("teleport", "*", FlagValueType.LOCATION, "teleport", ""));
}
public static FlagInfo getFlagInfo(String name, String subName) {
System.out.println(name + " " + subName);
for (FlagInfo nfo : flagList) {
if (name.equals(nfo.name)) {