本文整理汇总了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;
}