Make /rg list default to own regions if the player doesn't have permission otherwise.

This commit is contained in:
wizjany 2013-08-27 23:20:35 -04:00
parent d47c255168
commit f8ed1a3e3e

View File

@ -750,7 +750,10 @@ public void list(CommandContext args, CommandSender sender) throws CommandExcept
// Check permissions
if (!getPermissionModel(sender).mayList(ownedBy)) {
throw new CommandPermissionsException();
ownedBy = sender.getName(); // assume they only want their own
if (!getPermissionModel(sender).mayList(ownedBy)) {
throw new CommandPermissionsException();
}
}
RegionManager mgr = plugin.getGlobalRegionManager().get(world);