Package com.sk89q.worldguard.domains
Class DefaultDomain
java.lang.Object
com.sk89q.worldguard.domains.DefaultDomain
- All Implemented Interfaces:
Domain
,ChangeTracked
A combination of a
PlayerDomain
and a GroupDomain
.-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new domain.DefaultDomain
(DefaultDomain existing) Create a new domain from an existing one, making a copy of all values. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAll
(DefaultDomain other) Add all the entries from another domain.void
Add the name of the group to the domain.void
addPlayer
(LocalPlayer player) Add the given player to the domain, identified by the player's UUID.void
Add the given player to the domain, identified by the player's name.void
Add the given player to the domain, identified by the player's UUID.void
clear()
Remove all entries.boolean
contains
(LocalPlayer player) Returns true if a domain contains a player.boolean
Returns true if a domain contains a player.boolean
Returns true if a domain contains a player.Set the domain that holds the groups.Get the set of group names.Get the domain that holds the players.Get the set of player names.Get the set of player UUIDs.boolean
isDirty()
Tests whether changes have been made.void
void
removeAll
(DefaultDomain other) Remove all the entries from another domain.void
removeGroup
(String name) Remove the given group from the domain.void
removePlayer
(LocalPlayer player) Remove the given player from the domain, identified by either the player's name, the player's unique ID, or both.void
removePlayer
(String name) Remove the given player from the domain, identified by the player's name.void
removePlayer
(UUID uuid) Remove the given player from the domain, identified by the player's UUID.void
setDirty
(boolean dirty) Set whether changes have been made.void
setGroupDomain
(GroupDomain groupDomain) Set a new group domain.void
setPlayerDomain
(PlayerDomain playerDomain) Set a new player domain.int
size()
Get the number of entries.toPlayersString
(com.sk89q.worldguard.util.profile.cache.ProfileCache cache) toString()
com.sk89q.worldedit.util.formatting.text.Component
toUserFriendlyComponent
(com.sk89q.worldguard.util.profile.cache.ProfileCache cache) toUserFriendlyString
(com.sk89q.worldguard.util.profile.cache.ProfileCache cache)
-
Constructor Details
-
DefaultDomain
public DefaultDomain()Create a new domain. -
DefaultDomain
Create a new domain from an existing one, making a copy of all values.- Parameters:
existing
- the other domain to copy values from
-
-
Method Details
-
getPlayerDomain
Get the domain that holds the players.- Returns:
- a domain
-
setPlayerDomain
Set a new player domain.- Parameters:
playerDomain
- a domain
-
getGroupDomain
Set the domain that holds the groups.- Returns:
- a domain
-
setGroupDomain
Set a new group domain.- Parameters:
groupDomain
- a domain
-
addPlayer
Add the given player to the domain, identified by the player's name.- Parameters:
name
- the name of the player
-
removePlayer
Remove the given player from the domain, identified by the player's name.- Parameters:
name
- the name of the player
-
removePlayer
Remove the given player from the domain, identified by the player's UUID.- Parameters:
uuid
- the UUID of the player
-
addPlayer
Add the given player to the domain, identified by the player's UUID.- Parameters:
uniqueId
- the UUID of the player
-
removePlayer
Remove the given player from the domain, identified by either the player's name, the player's unique ID, or both.- Parameters:
player
- the player
-
addPlayer
Add the given player to the domain, identified by the player's UUID.- Parameters:
player
- the player
-
addAll
Add all the entries from another domain.- Parameters:
other
- the other domain
-
removeAll
Remove all the entries from another domain.- Parameters:
other
- the other domain
-
getPlayers
Get the set of player names.- Returns:
- the set of player names
-
getUniqueIds
Get the set of player UUIDs.- Returns:
- the set of player UUIDs
-
addGroup
Add the name of the group to the domain.- Parameters:
name
- the name of the group.
-
removeGroup
Remove the given group from the domain.- Parameters:
name
- the name of the group
-
getGroups
Get the set of group names.- Returns:
- the set of group names
-
contains
Description copied from interface:Domain
Returns true if a domain contains a player. -
contains
Description copied from interface:Domain
Returns true if a domain contains a player.This method doesn't check for groups!
-
contains
Description copied from interface:Domain
Returns true if a domain contains a player.This method doesn't check for groups!
-
size
public int size()Description copied from interface:Domain
Get the number of entries. -
clear
public void clear()Description copied from interface:Domain
Remove all entries. -
removeAll
public void removeAll() -
toPlayersString
-
toPlayersString
-
toGroupsString
-
toUserFriendlyString
-
toUserFriendlyString
-
toUserFriendlyComponent
public com.sk89q.worldedit.util.formatting.text.Component toUserFriendlyComponent(@Nullable com.sk89q.worldguard.util.profile.cache.ProfileCache cache) -
isDirty
public boolean isDirty()Description copied from interface:ChangeTracked
Tests whether changes have been made.- Specified by:
isDirty
in interfaceChangeTracked
- Returns:
- true if changes have been made
-
setDirty
public void setDirty(boolean dirty) Description copied from interface:ChangeTracked
Set whether changes have been made.- Specified by:
setDirty
in interfaceChangeTracked
- Parameters:
dirty
- a new dirty state
-
toString
-