mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-24 11:36:11 +01:00
/tpregion now checks for flag rights
This commit is contained in:
parent
7bedf6bb15
commit
a473f47235
@ -51,6 +51,7 @@ worldguard.region.claim
|
||||
|
||||
worldguard.tpregion
|
||||
worldguard.tpregion.spawn
|
||||
worldguard.tpregion.override
|
||||
|
||||
worldguard.buyregion
|
||||
|
||||
|
@ -3,6 +3,8 @@
|
||||
*/
|
||||
package com.sk89q.worldguard.bukkit.commands;
|
||||
|
||||
import com.sk89q.worldguard.LocalPlayer;
|
||||
import com.sk89q.worldguard.bukkit.BukkitPlayer;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardConfiguration;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
@ -39,6 +41,25 @@ public boolean handle(CommandSender sender, String senderName, String command, S
|
||||
RegionManager mgr = cfg.getWorldGuardPlugin().getGlobalRegionManager().getRegionManager(player.getWorld().getName());
|
||||
ProtectedRegion region = mgr.getRegion(id);
|
||||
if (region != null) {
|
||||
|
||||
String flagright = "all";
|
||||
if (spawn) {
|
||||
flagright = region.getFlags().getFlag("spawn", "settings");
|
||||
} else {
|
||||
flagright = region.getFlags().getFlag("teleport", "settings");
|
||||
}
|
||||
|
||||
LocalPlayer lPlayer = BukkitPlayer.wrapPlayer(cfg, player);
|
||||
if (flagright.equals("owner")) {
|
||||
if (!region.isOwner(lPlayer)) {
|
||||
cfg.checkPermission(player, "tpregion.override");
|
||||
}
|
||||
} else if (flagright.equals("meber")) {
|
||||
if (!region.isMember(lPlayer)) {
|
||||
cfg.checkPermission(player, "tpregion.override");
|
||||
}
|
||||
}
|
||||
|
||||
Location location = null;
|
||||
|
||||
if (spawn) {
|
||||
|
Loading…
Reference in New Issue
Block a user