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 TypeMethodDescriptionvoidaddAll(DefaultDomain other)Add all the entries from another domain.voidAdd the name of the group to the domain.voidaddPlayer(LocalPlayer player)Add the given player to the domain, identified by the player's UUID.voidAdd the given player to the domain, identified by the player's name.voidAdd the given player to the domain, identified by the player's UUID.voidclear()Remove all entries.booleancontains(LocalPlayer player)Returns true if a domain contains a player.booleanReturns true if a domain contains a player.booleanReturns 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.booleanisDirty()Tests whether changes have been made.voidvoidremoveAll(DefaultDomain other)Remove all the entries from another domain.voidremoveGroup(String name)Remove the given group from the domain.voidremovePlayer(LocalPlayer player)Remove the given player from the domain, identified by either the player's name, the player's unique ID, or both.voidremovePlayer(String name)Remove the given player from the domain, identified by the player's name.voidremovePlayer(UUID uuid)Remove the given player from the domain, identified by the player's UUID.voidsetDirty(boolean dirty)Set whether changes have been made.voidsetGroupDomain(GroupDomain groupDomain)Set a new group domain.voidsetPlayerDomain(PlayerDomain playerDomain)Set a new player domain.intsize()Get the number of entries.toPlayersString(com.sk89q.worldguard.util.profile.cache.ProfileCache cache)toString()com.sk89q.worldedit.util.formatting.text.ComponenttoUserFriendlyComponent(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:DomainReturns true if a domain contains a player. -
contains
Description copied from interface:DomainReturns true if a domain contains a player.This method doesn't check for groups!
-
contains
Description copied from interface:DomainReturns true if a domain contains a player.This method doesn't check for groups!
-
size
public int size()Description copied from interface:DomainGet the number of entries. -
clear
public void clear()Description copied from interface:DomainRemove all entries. -
removeAll
public void removeAll() -
toPlayersString
-
toPlayersString
public String toPlayersString(@Nullable com.sk89q.worldguard.util.profile.cache.ProfileCache cache) -
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:ChangeTrackedTests whether changes have been made.- Specified by:
isDirtyin interfaceChangeTracked- Returns:
- true if changes have been made
-
setDirty
public void setDirty(boolean dirty)Description copied from interface:ChangeTrackedSet whether changes have been made.- Specified by:
setDirtyin interfaceChangeTracked- Parameters:
dirty- a new dirty state
-
toString
-