com.sk89q.worldguard.domains.DefaultDomain Java Examples
The following examples show how to use
com.sk89q.worldguard.domains.DefaultDomain.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WorldGuardHandler7_beta_1.java From AreaShop with GNU General Public License v3.0 | 6 votes |
/** * Build a DefaultDomain from a RegionAccessSet. * @param regionAccessSet RegionAccessSet to read * @return DefaultDomain containing the entities from the RegionAccessSet */ private DefaultDomain buildDomain(RegionAccessSet regionAccessSet) { DefaultDomain owners = new DefaultDomain(); for(String playerName : regionAccessSet.getPlayerNames()) { owners.addPlayer(playerName); } for(UUID uuid : regionAccessSet.getPlayerUniqueIds()) { owners.addPlayer(uuid); } for(String group : regionAccessSet.getGroupNames()) { owners.addGroup(group); } return owners; }
Example #2
Source File: WorldGuardHandler5.java From AreaShop with GNU General Public License v3.0 | 6 votes |
/** * Build a DefaultDomain from a RegionAccessSet. * @param regionAccessSet RegionAccessSet to read * @return DefaultDomain containing the entities from the RegionAccessSet */ private DefaultDomain buildDomain(RegionAccessSet regionAccessSet) { DefaultDomain owners = new DefaultDomain(); for(String playerName : regionAccessSet.getPlayerNames()) { owners.addPlayer(playerName); } // Add by name since UUIDs were not yet supported for(UUID uuid : regionAccessSet.getPlayerUniqueIds()) { OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(uuid); if(offlinePlayer != null && offlinePlayer.getName() != null) { owners.addPlayer(offlinePlayer.getName()); } } for(String group : regionAccessSet.getGroupNames()) { owners.addGroup(group); } return owners; }
Example #3
Source File: WorldGuardHandler7_beta_2.java From AreaShop with GNU General Public License v3.0 | 6 votes |
/** * Build a DefaultDomain from a RegionAccessSet. * @param regionAccessSet RegionAccessSet to read * @return DefaultDomain containing the entities from the RegionAccessSet */ private DefaultDomain buildDomain(RegionAccessSet regionAccessSet) { DefaultDomain owners = new DefaultDomain(); for(String playerName : regionAccessSet.getPlayerNames()) { owners.addPlayer(playerName); } for(UUID uuid : regionAccessSet.getPlayerUniqueIds()) { owners.addPlayer(uuid); } for(String group : regionAccessSet.getGroupNames()) { owners.addGroup(group); } return owners; }
Example #4
Source File: FastAsyncWorldEditWorldGuardHandler.java From AreaShop with GNU General Public License v3.0 | 6 votes |
/** * Build a DefaultDomain from a RegionAccessSet. * @param regionAccessSet RegionAccessSet to read * @return DefaultDomain containing the entities from the RegionAccessSet */ private DefaultDomain buildDomain(RegionAccessSet regionAccessSet) { DefaultDomain owners = new DefaultDomain(); for(String playerName : regionAccessSet.getPlayerNames()) { owners.addPlayer(playerName); } for(UUID uuid : regionAccessSet.getPlayerUniqueIds()) { owners.addPlayer(uuid); } for(String group : regionAccessSet.getGroupNames()) { owners.addGroup(group); } return owners; }
Example #5
Source File: WorldGuardHandler6.java From AreaShop with GNU General Public License v3.0 | 6 votes |
/** * Build a DefaultDomain from a RegionAccessSet. * @param regionAccessSet RegionAccessSet to read * @return DefaultDomain containing the entities from the RegionAccessSet */ private DefaultDomain buildDomain(RegionAccessSet regionAccessSet) { DefaultDomain owners = new DefaultDomain(); for(String playerName : regionAccessSet.getPlayerNames()) { owners.addPlayer(playerName); } for(UUID uuid : regionAccessSet.getPlayerUniqueIds()) { owners.addPlayer(uuid); } for(String group : regionAccessSet.getGroupNames()) { owners.addGroup(group); } return owners; }
Example #6
Source File: WorldGuardHandler6.java From AreaShop with GNU General Public License v3.0 | 5 votes |
@Override public void setOwners(ProtectedRegion region, RegionAccessSet regionAccessSet) { DefaultDomain defaultDomain = buildDomain(regionAccessSet); if(!region.getOwners().toUserFriendlyString().equals(defaultDomain.toUserFriendlyString())) { region.setOwners(defaultDomain); } }
Example #7
Source File: WorldGuardHandler7_beta_1.java From AreaShop with GNU General Public License v3.0 | 5 votes |
@Override public void setMembers(ProtectedRegion region, RegionAccessSet regionAccessSet) { DefaultDomain defaultDomain = buildDomain(regionAccessSet); if(!region.getMembers().toUserFriendlyString().equals(defaultDomain.toUserFriendlyString())) { region.setMembers(defaultDomain); } }
Example #8
Source File: WorldGuardHandler7_beta_1.java From AreaShop with GNU General Public License v3.0 | 5 votes |
@Override public void setOwners(ProtectedRegion region, RegionAccessSet regionAccessSet) { DefaultDomain defaultDomain = buildDomain(regionAccessSet); if(!region.getOwners().toUserFriendlyString().equals(defaultDomain.toUserFriendlyString())) { region.setOwners(defaultDomain); } }
Example #9
Source File: FastAsyncWorldEditWorldGuardHandler.java From AreaShop with GNU General Public License v3.0 | 5 votes |
@Override public void setMembers(ProtectedRegion region, RegionAccessSet regionAccessSet) { DefaultDomain defaultDomain = buildDomain(regionAccessSet); if(!region.getMembers().toUserFriendlyString().equals(defaultDomain.toUserFriendlyString())) { region.setMembers(defaultDomain); } }
Example #10
Source File: FastAsyncWorldEditWorldGuardHandler.java From AreaShop with GNU General Public License v3.0 | 5 votes |
@Override public void setOwners(ProtectedRegion region, RegionAccessSet regionAccessSet) { DefaultDomain defaultDomain = buildDomain(regionAccessSet); if(!region.getOwners().toUserFriendlyString().equals(defaultDomain.toUserFriendlyString())) { region.setOwners(defaultDomain); } }
Example #11
Source File: WorldGuardHandler6.java From AreaShop with GNU General Public License v3.0 | 5 votes |
@Override public void setMembers(ProtectedRegion region, RegionAccessSet regionAccessSet) { DefaultDomain defaultDomain = buildDomain(regionAccessSet); if(!region.getMembers().toUserFriendlyString().equals(defaultDomain.toUserFriendlyString())) { region.setMembers(defaultDomain); } }
Example #12
Source File: WorldGuard6Hook.java From Skript with GNU General Public License v3.0 | 5 votes |
@Override protected boolean init() { supportsUUIDs = Skript.methodExists(DefaultDomain.class, "getUniqueIds"); // Manually load syntaxes for regions, because we're in module package try { Skript.getAddonInstance().loadClasses("ch.njol.skript.hooks.regions"); } catch (IOException e) { Skript.exception(e); return false; } return super.init(); }
Example #13
Source File: WorldGuardHandler7_beta_2.java From AreaShop with GNU General Public License v3.0 | 5 votes |
@Override public void setMembers(ProtectedRegion region, RegionAccessSet regionAccessSet) { DefaultDomain defaultDomain = buildDomain(regionAccessSet); if(!region.getMembers().toUserFriendlyString().equals(defaultDomain.toUserFriendlyString())) { region.setMembers(defaultDomain); } }
Example #14
Source File: WorldGuardHandler7_beta_2.java From AreaShop with GNU General Public License v3.0 | 5 votes |
@Override public void setOwners(ProtectedRegion region, RegionAccessSet regionAccessSet) { DefaultDomain defaultDomain = buildDomain(regionAccessSet); if(!region.getOwners().toUserFriendlyString().equals(defaultDomain.toUserFriendlyString())) { region.setOwners(defaultDomain); } }
Example #15
Source File: WorldGuardHandler5.java From AreaShop with GNU General Public License v3.0 | 5 votes |
@Override public void setMembers(ProtectedRegion region, RegionAccessSet regionAccessSet) { DefaultDomain defaultDomain = buildDomain(regionAccessSet); if(!region.getMembers().toUserFriendlyString().equals(defaultDomain.toUserFriendlyString())) { region.setMembers(defaultDomain); } }
Example #16
Source File: WorldGuardHandler5.java From AreaShop with GNU General Public License v3.0 | 5 votes |
@Override public void setOwners(ProtectedRegion region, RegionAccessSet regionAccessSet) { DefaultDomain defaultDomain = buildDomain(regionAccessSet); if(!region.getOwners().toUserFriendlyString().equals(defaultDomain.toUserFriendlyString())) { region.setOwners(defaultDomain); } }
Example #17
Source File: WorldGuard7FAWEHook.java From Skript with GNU General Public License v3.0 | 5 votes |
@Override protected boolean init() { supportsUUIDs = Skript.methodExists(DefaultDomain.class, "getUniqueIds"); // Manually load syntaxes for regions, because we're in module package try { Skript.getAddonInstance().loadClasses("ch.njol.skript.hooks.regions"); } catch (IOException e) { Skript.exception(e); return false; } return super.init(); }
Example #18
Source File: WorldGuardHandler.java From uSkyBlock with GNU General Public License v3.0 | 4 votes |
private static ProtectedCuboidRegion setRegionFlags(IslandInfo islandConfig, String regionName) { Location islandLocation = islandConfig.getIslandLocation(); BlockVector3 minPoint = getProtectionVectorRight(islandLocation); BlockVector3 maxPoint = getProtectionVectorLeft(islandLocation); if (regionName != null && regionName.endsWith("nether")) { minPoint = minPoint.withY(6); maxPoint = maxPoint.withY(120); } ProtectedCuboidRegion region = new ProtectedCuboidRegion(regionName, minPoint, maxPoint); final DefaultDomain owners = new DefaultDomain(); DefaultDomain members = new DefaultDomain(); for (UUID member : islandConfig.getMemberUUIDs()) { owners.addPlayer(member); } for (UUID trust : islandConfig.getTrusteeUUIDs()) { members.addPlayer(trust); } region.setOwners(owners); region.setMembers(members); region.setPriority(100); if (uSkyBlock.getInstance().getConfig().getBoolean("worldguard.entry-message", true)) { if (owners.size() == 0) { region.setFlag(Flags.GREET_MESSAGE, tr("\u00a74** You are entering a protected - but abandoned - island area.")); } else { region.setFlag(Flags.GREET_MESSAGE, tr("\u00a7d** You are entering \u00a7b{0}''s \u00a7disland.", islandConfig.getLeader())); } } else { region.setFlag(Flags.GREET_MESSAGE, null); } if (uSkyBlock.getInstance().getConfig().getBoolean("worldguard.exit-message", true)) { if (owners.size() == 0) { region.setFlag(Flags.FAREWELL_MESSAGE, tr("\u00a74** You are leaving an abandoned island.")); } else { region.setFlag(Flags.FAREWELL_MESSAGE, tr("\u00a7d** You are leaving \u00a7b{0}''s \u00a7disland.", islandConfig.getLeader())); } } else { region.setFlag(Flags.FAREWELL_MESSAGE, null); } region.setFlag(Flags.PVP, null); boolean isLocked = islandConfig.isLocked(); updateLockStatus(region, isLocked); return region; }