mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-19 15:48:10 +01:00
Added region/role-based permissions to /region teleport.
This commit is contained in:
parent
c5b1089c96
commit
b01b2cce9b
@ -1072,6 +1072,15 @@ public void teleport(CommandContext args, CommandSender sender) throws CommandEx
|
|||||||
throw new CommandException("A region with ID '" + id + "' doesn't exist.");
|
throw new CommandException("A region with ID '" + id + "' doesn't exist.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LocalPlayer localPlayer = plugin.wrapPlayer(player);
|
||||||
|
if (region.isOwner(localPlayer)) {
|
||||||
|
plugin.checkPermission(sender, "worldguard.region.teleport.own." + id.toLowerCase());
|
||||||
|
} else if (region.isMember(localPlayer)) {
|
||||||
|
plugin.checkPermission(sender, "worldguard.region.teleport.member." + id.toLowerCase());
|
||||||
|
} else {
|
||||||
|
plugin.checkPermission(sender, "worldguard.region.teleport." + id.toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
final Location teleportLocation = region.getFlag(DefaultFlag.TELE_LOC);
|
final Location teleportLocation = region.getFlag(DefaultFlag.TELE_LOC);
|
||||||
if (teleportLocation == null) {
|
if (teleportLocation == null) {
|
||||||
throw new CommandException("The region has no teleport point associated.");
|
throw new CommandException("The region has no teleport point associated.");
|
||||||
|
Loading…
Reference in New Issue
Block a user