Java Code Examples for com.sk89q.worldguard.domains.DefaultDomain#addPlayer()
The following examples show how to use
com.sk89q.worldguard.domains.DefaultDomain#addPlayer() .
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: 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 2
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 3
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 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: 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 6
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; }