Class WGClaim
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UUIDA constant used to represent the "server" owner for admin claims. -
Constructor Summary
ConstructorsConstructorDescriptionWGClaim(com.sk89q.worldguard.protection.regions.ProtectedRegion region, org.bukkit.World world) Constructs a new WGClaim instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddManager(UUID player) Adds a manager to this claim.voidaddPlayerPermissions(UUID player, ClaimPermission permission) Adds the specified permission for the given player to this claim.voidClears all managers from this claim.voidClears all player permissions from this claim.voiddropPlayerPermissions(UUID player) Removes the specified player's permissions from this claim.intgetArea()Calculates and returns the area of this claim.Returns the child claims of this claim.getId()Returns the unique identifier of this claim.getOwner()Returns the owner of this claim.Returns the owner's name of this claim.Returns the parent claim of this claim.org.bukkit.WorldgetWorld()Returns the world in which this claim is located.intgetX()Returns the X-coordinate of the claim's minimum point.intgetY()Returns the Y-coordinate of the claim's minimum point.intgetZ()Returns the Z-coordinate of the claim's minimum point.booleanDetermines whether this claim is an admin claim.booleanIndicates whether this claim is a parent claim.booleanIndicates whether this claim is a subclaim.booleanIndicates whether this claim is considered "wilderness".voidremoveManager(UUID player) Removes a manager from this claim.voidsetInheritPermissions(boolean inherit) Sets whether this claim should inherit permissions from its parent.
-
Field Details
-
SERVER_UUID
A constant used to represent the "server" owner for admin claims.
-
-
Constructor Details
-
WGClaim
public WGClaim(com.sk89q.worldguard.protection.regions.ProtectedRegion region, org.bukkit.World world) Constructs a new WGClaim instance.- Parameters:
region- the WorldGuard ProtectedRegion representing the claim.world- the Bukkit World in which the claim exists.
-
-
Method Details
-
getId
-
getArea
-
getWorld
-
getX
-
getY
-
getZ
-
isAdminClaim
public boolean isAdminClaim()Determines whether this claim is an admin claim.A claim is considered an admin claim if it has no owners.
- Specified by:
isAdminClaimin interfaceIClaim- Returns:
trueif the region has no owners,falseotherwise.
-
getChildren
Returns the child claims of this claim.WorldGuard does not support child claims in this implementation, so an empty list is returned.
- Specified by:
getChildrenin interfaceIClaim- Returns:
- an empty iterable.
-
isWilderness
public boolean isWilderness()Indicates whether this claim is considered "wilderness".In this implementation, WorldGuard regions are never considered wilderness.
- Specified by:
isWildernessin interfaceIClaim- Returns:
falsealways.
-
isSubClaim
public boolean isSubClaim()Indicates whether this claim is a subclaim.Not supported in this implementation.
- Specified by:
isSubClaimin interfaceIClaim- Returns:
false.
-
isParentClaim
public boolean isParentClaim()Indicates whether this claim is a parent claim.Every WorldGuard region is treated as a parent claim in this implementation.
- Specified by:
isParentClaimin interfaceIClaim- Returns:
truealways.
-
getParent
-
dropPlayerPermissions
Removes the specified player's permissions from this claim.This is done by removing the player's name from the region's members list.
- Specified by:
dropPlayerPermissionsin interfaceIClaim- Parameters:
player- the UUID of the player whose permissions should be removed.
-
addPlayerPermissions
Adds the specified permission for the given player to this claim.For this implementation, all permissions are granted by adding the player's name to the region's members list.
- Specified by:
addPlayerPermissionsin interfaceIClaim- Parameters:
player- the UUID of the player.permission- the claim permission to add.
-
clearPlayerPermissions
public void clearPlayerPermissions()Clears all player permissions from this claim.This is done by clearing the entire members list of the region.
- Specified by:
clearPlayerPermissionsin interfaceIClaim
-
removeManager
Removes a manager from this claim.Not supported in this implementation.
- Specified by:
removeManagerin interfaceIClaim- Parameters:
player- the UUID of the player to remove as manager.
-
addManager
Adds a manager to this claim.Not supported in this implementation.
- Specified by:
addManagerin interfaceIClaim- Parameters:
player- the UUID of the player to add as manager.
-
clearManagers
public void clearManagers()Clears all managers from this claim.Not supported in this implementation.
- Specified by:
clearManagersin interfaceIClaim
-
getOwner
Returns the owner of this claim.If the region has no owners, this method returns the constant
SERVER_UUIDto indicate an admin claim. Otherwise, it returns the first owner's UUID. -
getOwnerName
Returns the owner's name of this claim.If this is an admin claim, returns "SERVER". Otherwise, it attempts to look up the owner's name via Bukkit's OfflinePlayer; if not found, returns "Unknown".
- Specified by:
getOwnerNamein interfaceIClaim- Returns:
- the owner's name as a String.
-
setInheritPermissions
public void setInheritPermissions(boolean inherit) Sets whether this claim should inherit permissions from its parent.Not supported in this implementation.
- Specified by:
setInheritPermissionsin interfaceIClaim- Parameters:
inherit- iftrue, the claim should inherit permissions (ignored).
-