public static boolean isInRegion(Location location) { ApplicableRegionSet regionSet = getRegionSet(location); if (regionSet == null) { return false; } return regionSet.size() != 0; }
public boolean isRegion(Block block) { try { if (wg == null) { return false; } RegionManager manager = wg.getRegionManager(block.getWorld()); ApplicableRegionSet regions = manager.getApplicableRegions(block.getLocation()); return regions.size() > 0; } catch (Exception ex) { return false; } }
ApplicableRegionSet set = regionManager.getApplicableRegions(player.getLocation().toVector().toBlockPoint()); if (set.size() == 0) { if (allowGlobal) { ProtectedRegion global = checkExistingRegion(regionManager, "__global__", true); "You're not standing in a region." + "Specify an ID if you want to select a specific region."); } else if (set.size() > 1) { StringBuilder builder = new StringBuilder(); boolean first = true;
public static boolean playerCanBuild(Player player, Location loc) { if (!enabled) { // No WG hooks so we'll always bypass this check. return false; } World world = loc.getWorld(); Vector pt = toVector(loc); return wg.getRegionManager(world).getApplicableRegions(pt).size() > 0 && wg.canBuild(player, loc); }
if (regions.size() > 0) { event.addWhoisInformation("Current Regions", regionStr);
BlockVector3 vector = BlockVector3.at(location.getX(), location.getY(), location.getZ()); ApplicableRegionSet ars = rm.getApplicableRegions(vector); if (ars.size() > 0) { LinkedList<String> parentNames = new LinkedList<>(); LinkedList<String> regions = new LinkedList<>();
@EventHandler public void canBuild(BuildPermissionEvent event) { ApplicableRegionSet regions = getApplicableRegions(event.getSign().getBlock().getLocation()); if (regions != null && Properties.WORLDGUARD_USE_FLAG) { event.allow(regions.queryState(worldGuard.wrapPlayer(event.getPlayer()), WorldGuardFlags.ENABLE_SHOP) == StateFlag.State.ALLOW); } else { event.allow(regions == null || regions.size() != 0); } }
BlockVector3 vector = BlockVector3.at(l.getX(), l.getY(), l.getZ()); ApplicableRegionSet ars = rm.getApplicableRegions(vector); if (ars.size() > 0) { LinkedList<String> parentNames = new LinkedList<>(); LinkedList<String> regions = new LinkedList<>();
if (set.size() > 0) { player.sendMessage(ChatColor.YELLOW + "Can you build? " + (set.testState(localPlayer, Flags.BUILD) ? "Yes" : "No"));
if (regions.size() > 0) { if (!regions.isOwnerOfAll(player)) { throw new CommandException("This region overlaps with someone else's region.");