本文整理匯總了Java中com.sk89q.worldguard.protection.regions.ProtectedRegion.isOwner方法的典型用法代碼示例。如果您正苦於以下問題:Java ProtectedRegion.isOwner方法的具體用法?Java ProtectedRegion.isOwner怎麽用?Java ProtectedRegion.isOwner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sk89q.worldguard.protection.regions.ProtectedRegion
的用法示例。
在下文中一共展示了ProtectedRegion.isOwner方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCommandProcess
import com.sk89q.worldguard.protection.regions.ProtectedRegion; //導入方法依賴的package包/類
@EventHandler
void onCommandProcess(PlayerCommandPreprocessEvent e) {
Player p = e.getPlayer();
ProtectedRegion region = Hooks.getWorldguard().getRegionManager(p.getWorld()).getRegion(TerrenosManager.getTerrenoIdByBlock(e.getPlayer().getLocation().getBlock()));
if (region == null || !region.getId().contains("-")) return;
String[] s = region.getId().split("-");
if (!region.isOwner(e.getPlayer().getName()) && !region.isMember(e.getPlayer().getName())) {
for (String cmd : Utils.getComandosBloqueados(s[0], s[1])) {
if (e.getMessage().startsWith(cmd)) {
p.sendMessage(Utils.getMensagem("comando_bloqueado"));
e.setCancelled(true);
break;
}
}
}
}
示例2: isAllowed
import com.sk89q.worldguard.protection.regions.ProtectedRegion; //導入方法依賴的package包/類
public boolean isAllowed(LocalPlayer localplayer, ProtectedRegion region) {
if (region.isOwner(localplayer) || region.isOwner(localplayer.getName())) {
return true;
} else if (region.getId().toLowerCase().equals(localplayer.getName().toLowerCase())) {
return true;
} else if (region.getId().toLowerCase().contains(localplayer.getName().toLowerCase() + "//")) {
return true;
} else if (region.isOwner("*")) {
return true;
}
if (localplayer.hasPermission("fawe.worldguard.member")) {
if (region.isMember(localplayer) || region.isMember(localplayer.getName())) {
return true;
} else if (region.isMember("*")) {
return true;
}
}
return false;
}
示例3: getTerrenoNome
import com.sk89q.worldguard.protection.regions.ProtectedRegion; //導入方法依賴的package包/類
public static String getTerrenoNome(Player p) {
for (ProtectedRegion pr : wg.getRegionManager(p.getWorld()).getApplicableRegions(p.getLocation())) {
if (pr.isOwner(wg.wrapPlayer(p)) && pr.getId().contains("-")) {
return pr.getId().split("-")[1];
}
}
return "";
}
示例4: checkBlock
import com.sk89q.worldguard.protection.regions.ProtectedRegion; //導入方法依賴的package包/類
private boolean checkBlock(Player player, Block block) {
if (player.hasPermission("umagic.bypass")) return true;
RegionManager regionManager = getWorldGuard().getRegionManager(block.getWorld());
ApplicableRegionSet applicableRegionSet = regionManager.getApplicableRegions(block.getLocation());
if (applicableRegionSet.getRegions().isEmpty()) {
getActionMessage().message(player, "" + ChatColor.RED + ChatColor.BOLD
+ "The " + ChatColor.AQUA + ChatColor.BOLD + "Magical Hoe"
+ ChatColor.RED + ChatColor.BOLD + " can only be used in regions!");
return false;
}
for (ProtectedRegion region : applicableRegionSet.getRegions()) {
boolean isOwner = region.isOwner(getWorldGuard().wrapPlayer(player));
boolean isMember = region.isMember(getWorldGuard().wrapPlayer(player));
if (!isOwner) if (!isMember) {
getActionMessage().message(player, "" + ChatColor.RED + ChatColor.BOLD
+ "You are not an owner or member of this region!");
return false;
}
}
return true;
}
示例5: isInYourRegion
import com.sk89q.worldguard.protection.regions.ProtectedRegion; //導入方法依賴的package包/類
public static boolean isInYourRegion(Player p) {
for (ProtectedRegion pr : wg.getRegionManager(p.getWorld()).getApplicableRegions(p.getLocation())) {
return pr.isOwner(wg.wrapPlayer(p));
}
return false;
}
示例6: checkBlock
import com.sk89q.worldguard.protection.regions.ProtectedRegion; //導入方法依賴的package包/類
public boolean checkBlock(Player player, Block block) {
if (player.hasPermission("chest.bypass")) return true;
RegionManager regionManager = ChestInit.getWorldGuard().getRegionManager(block.getWorld());
ApplicableRegionSet applicableRegionSet = regionManager.getApplicableRegions(block.getLocation());
if (applicableRegionSet.getRegions().isEmpty()) return false;
for (ProtectedRegion r : applicableRegionSet.getRegions())
if (!r.isOwner(ChestInit.getWorldGuard().wrapPlayer(player))) return false;
return true;
}