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

View File

@ -58,14 +58,12 @@ 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("waterflow", null, FlagValueType.STATE, "states", "waterflow"));
flagList.add(new FlagInfo("iconomy", "buyable", FlagValueType.BOOLEAN, "iconomy", "buyable")); flagList.add(new FlagInfo("iconomy", "buyable", FlagValueType.BOOLEAN, "iconomy", "buyable"));
flagList.add(new FlagInfo("iconomy", "price", FlagValueType.INT, "iconomy", "price")); flagList.add(new FlagInfo("iconomy", "price", FlagValueType.INT, "iconomy", "price"));
flagList.add(new FlagInfo("spawn", "", FlagValueType.LOCATION, "spawn", "")); flagList.add(new FlagInfo("spawn", "*", FlagValueType.LOCATION, "spawn", ""));
flagList.add(new FlagInfo("teleport", "", FlagValueType.LOCATION, "teleport", "")); flagList.add(new FlagInfo("teleport", "*", FlagValueType.LOCATION, "teleport", ""));
} }
public static FlagInfo getFlagInfo(String name, String subName) { public static FlagInfo getFlagInfo(String name, String subName) {
System.out.println(name + " " + subName);
for (FlagInfo nfo : flagList) { for (FlagInfo nfo : flagList) {
if (name.equals(nfo.name)) { if (name.equals(nfo.name)) {
if (subName == null && nfo.subName == null) { if (subName == null && nfo.subName == null) {