public class NbtPlayerDataService extends Object implements PlayerDataService
PlayerDataService.PlayerReader
Constructor and Description |
---|
NbtPlayerDataService(GlowServer server,
File playerDir) |
Modifier and Type | Method and Description |
---|---|
PlayerDataService.PlayerReader |
beginReadingData(UUID uuid)
Begin reading player data for online or offline player loading.
|
CompletableFuture<Collection<org.bukkit.OfflinePlayer>> |
getOfflinePlayers()
Get a collection of all known offline players.
|
void |
readData(GlowPlayer player)
Shorthand method to read data into an existing player entity.
|
void |
writeData(GlowPlayer player)
Save all data for an online player.
|
public NbtPlayerDataService(GlowServer server, File playerDir)
public CompletableFuture<Collection<org.bukkit.OfflinePlayer>> getOfflinePlayers()
PlayerDataService
Currently online players may or may not be included, but if they are, they will be included in OfflinePlayer form.
getOfflinePlayers
in interface PlayerDataService
public PlayerDataService.PlayerReader beginReadingData(UUID uuid)
PlayerDataService
Some attributes may be read before or without constructing a player entity, see PlayerDataService.PlayerReader
for more information.
When finished with the PlayerReader, PlayerDataService.PlayerReader.close()
should be called.
beginReadingData
in interface PlayerDataService
uuid
- The UUID of the player to read data for.PlayerDataService.PlayerReader
to use.public void readData(GlowPlayer player)
PlayerDataService
readData
in interface PlayerDataService
player
- The target player.public void writeData(GlowPlayer player)
PlayerDataService
writeData
in interface PlayerDataService
player
- The source player.Copyright © 2021. All rights reserved.