Class WGClaim
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UUID
A 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 TypeMethodDescriptionvoid
addManager
(UUID player) Adds a manager to this claim.void
addPlayerPermissions
(UUID player, ClaimPermission permission) Adds the specified permission for the given player to this claim.void
Clears all managers from this claim.void
Clears all player permissions from this claim.void
dropPlayerPermissions
(UUID player) Removes the specified player's permissions from this claim.int
getArea()
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.World
getWorld()
Returns the world in which this claim is located.int
getX()
Returns the X-coordinate of the claim's minimum point.int
getY()
Returns the Y-coordinate of the claim's minimum point.int
getZ()
Returns the Z-coordinate of the claim's minimum point.boolean
Determines whether this claim is an admin claim.boolean
Indicates whether this claim is a parent claim.boolean
Indicates whether this claim is a subclaim.boolean
Indicates whether this claim is considered "wilderness".void
removeManager
(UUID player) Removes a manager from this claim.void
setInheritPermissions
(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:
isAdminClaim
in interfaceIClaim
- Returns:
true
if the region has no owners,false
otherwise.
-
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:
getChildren
in 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:
isWilderness
in interfaceIClaim
- Returns:
false
always.
-
isSubClaim
public boolean isSubClaim()Indicates whether this claim is a subclaim.Not supported in this implementation.
- Specified by:
isSubClaim
in 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:
isParentClaim
in interfaceIClaim
- Returns:
true
always.
-
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:
dropPlayerPermissions
in 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:
addPlayerPermissions
in 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:
clearPlayerPermissions
in interfaceIClaim
-
removeManager
Removes a manager from this claim.Not supported in this implementation.
- Specified by:
removeManager
in 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:
addManager
in 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:
clearManagers
in interfaceIClaim
-
getOwner
Returns the owner of this claim.If the region has no owners, this method returns the constant
SERVER_UUID
to 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:
getOwnerName
in 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:
setInheritPermissions
in interfaceIClaim
- Parameters:
inherit
- iftrue
, the claim should inherit permissions (ignored).
-