Package net.glowstone.util.bans
Class UuidListFile
java.lang.Object
net.glowstone.util.bans.JsonListFile
net.glowstone.util.bans.UuidListFile
Common management for whitelist and ops list files.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.glowstone.util.bans.JsonListFile
JsonListFile.BaseEntry
-
Field Summary
Fields inherited from class net.glowstone.util.bans.JsonListFile
entries
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(org.bukkit.OfflinePlayer player) If the given player is not already on this list, adds that player and saves the change to disk.boolean
containsProfile
(GlowPlayerProfile profile) Checks whether the player with a given UUID is in this list.boolean
containsUuid
(UUID uuid) Searches for a UUID.Returns aGlowPlayerProfile
for each player whose UUID is in the list file.void
load()
Reloads from the file.protected JsonListFile.BaseEntry
Deserialize an entry from JSON format.void
remove
(GlowPlayerProfile profile) If the given player is on this list, removes that player and saves the change to disk.Methods inherited from class net.glowstone.util.bans.JsonListFile
save
-
Constructor Details
-
UuidListFile
-
-
Method Details
-
load
public void load()Description copied from class:JsonListFile
Reloads from the file.- Overrides:
load
in classJsonListFile
-
getProfiles
Returns aGlowPlayerProfile
for each player whose UUID is in the list file.- Returns:
- a list of
GlowPlayerProfile
instances
-
containsUuid
Searches for a UUID.- Parameters:
uuid
- the UUID to search for- Returns:
- true if the UUID is present; false otherwise
-
containsProfile
Checks whether the player with a given UUID is in this list.- Parameters:
profile
- the player whose UUID will be looked up- Returns:
- whether the player is on this list
-
add
public void add(org.bukkit.OfflinePlayer player) If the given player is not already on this list, adds that player and saves the change to disk.- Parameters:
player
- the player to add
-
remove
If the given player is on this list, removes that player and saves the change to disk.- Parameters:
profile
- the player to remove
-
readEntry
Description copied from class:JsonListFile
Deserialize an entry from JSON format.- Specified by:
readEntry
in classJsonListFile
- Parameters:
map
- The JSON object to read from.- Returns:
- The finished Entry.
-