mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-18 15:17:36 +01:00
Allow '/region info' for existing but now illegally-named regions. Thanks Moo0.
This commit is contained in:
parent
e0066e6173
commit
2b56247e21
@ -404,13 +404,12 @@ public static void info(CommandContext args, WorldGuardPlugin plugin,
|
|||||||
id = args.getString(1).toLowerCase();
|
id = args.getString(1).toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ProtectedRegion.isValidId(id)) {
|
|
||||||
throw new CommandException("Invalid region ID specified!");
|
|
||||||
}
|
|
||||||
|
|
||||||
RegionManager mgr = plugin.getGlobalRegionManager().get(world);
|
RegionManager mgr = plugin.getGlobalRegionManager().get(world);
|
||||||
|
|
||||||
if (!mgr.hasRegion(id)) {
|
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.");
|
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
|
sender.sendMessage(ChatColor.YELLOW + "Region: " + id
|
||||||
+ ChatColor.GRAY + " (type: " + region.getTypeName() + ")");
|
+ 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());
|
sender.sendMessage(ChatColor.BLUE + "Priority: " + region.getPriority());
|
||||||
|
|
||||||
StringBuilder s = new StringBuilder();
|
StringBuilder s = new StringBuilder();
|
||||||
|
Loading…
Reference in New Issue
Block a user