public class PlayerDomain extends Object implements Domain, ChangeTracked
| Constructor and Description |
|---|
PlayerDomain()
Create a new instance.
|
PlayerDomain(PlayerDomain domain)
Create a new instance.
|
PlayerDomain(String[] names)
Deprecated.
names are deprecated in favor of UUIDs in MC 1.7+
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPlayer(LocalPlayer player)
Add the given player to the domain, identified by the player's UUID.
|
void |
addPlayer(String name)
Add the given player to the domain, identified by the player's name.
|
void |
addPlayer(UUID uniqueId)
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 |
contains(String playerName)
Returns true if a domain contains a player.
|
boolean |
contains(UUID uniqueId)
Returns true if a domain contains a player.
|
Set<String> |
getPlayers()
Get the set of player names.
|
Set<UUID> |
getUniqueIds()
Get the set of player UUIDs.
|
boolean |
isDirty()
Tests whether changes have been made.
|
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.
|
int |
size()
Get the number of entries.
|
String |
toString() |
public PlayerDomain()
public PlayerDomain(PlayerDomain domain)
domain - the domain to copy values from@Deprecated public PlayerDomain(String[] names)
names - an array of namespublic void addPlayer(String name)
name - the name of the playerpublic void addPlayer(UUID uniqueId)
uniqueId - the UUID of the playerpublic void addPlayer(LocalPlayer player)
player - the playerpublic void removePlayer(String name)
name - the name of the playerpublic void removePlayer(UUID uuid)
uuid - the UUID of the playerpublic void removePlayer(LocalPlayer player)
player - the playerpublic boolean contains(LocalPlayer player)
Domainpublic Set<String> getPlayers()
public Set<UUID> getUniqueIds()
public boolean contains(UUID uniqueId)
DomainThis method doesn't check for groups!
public boolean contains(String playerName)
DomainThis method doesn't check for groups!
public int size()
Domainpublic void clear()
Domainpublic boolean isDirty()
ChangeTrackedisDirty in interface ChangeTrackedpublic void setDirty(boolean dirty)
ChangeTrackedsetDirty in interface ChangeTrackeddirty - a new dirty stateCopyright © 2015. All Rights Reserved.