Allow '/region info' for existing but now illegally-named regions. Thanks Moo0.

This commit is contained in:
Wizjany 2011-08-20 02:22:45 -04:00
parent e0066e6173
commit 2b56247e21

View File

@ -404,13 +404,12 @@ public static void info(CommandContext args, WorldGuardPlugin plugin,
id = args.getString(1).toLowerCase();
}
if (!ProtectedRegion.isValidId(id)) {
throw new CommandException("Invalid region ID specified!");
}
RegionManager mgr = plugin.getGlobalRegionManager().get(world);
if (!mgr.hasRegion(id)) {
if (!ProtectedRegion.isValidId(id)) {
throw new CommandException("Invalid region ID specified!");
}
throw new CommandException("A region with ID '" + id + "' doesn't exist.");
}
@ -433,6 +432,10 @@ public static void info(CommandContext args, WorldGuardPlugin plugin,
sender.sendMessage(ChatColor.YELLOW + "Region: " + id
+ ChatColor.GRAY + " (type: " + region.getTypeName() + ")");
if (!ProtectedRegion.isValidId(id)) {
sender.sendMessage(ChatColor.RED + "This region has an invalid ID. "
+ "Please ask the owner to delete it and recreate it.");
}
sender.sendMessage(ChatColor.BLUE + "Priority: " + region.getPriority());
StringBuilder s = new StringBuilder();