Package net.glowstone.io
Interface PlayerDataService
- All Known Implementing Classes:
NbtPlayerDataService
public interface PlayerDataService
Provider of I/O for player data.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A piecewise reader for initializing new players. -
Method Summary
Modifier and TypeMethodDescriptionbeginReadingData
(UUID uuid) Begin reading player data for online or offline player loading.CompletableFuture<Collection<org.bukkit.OfflinePlayer>>
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.
-
Method Details
-
beginReadingData
Begin reading player data for online or offline player loading.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.- Parameters:
uuid
- The UUID of the player to read data for.- Returns:
- The
PlayerDataService.PlayerReader
to use.
-
readData
Shorthand method to read data into an existing player entity.- Parameters:
player
- The target player.
-
writeData
Save all data for an online player.- Parameters:
player
- The source player.
-
getOfflinePlayers
CompletableFuture<Collection<org.bukkit.OfflinePlayer>> getOfflinePlayers()Get a collection of all known offline players.Currently online players may or may not be included, but if they are, they will be included in OfflinePlayer form.
- Returns:
- All known offline players.
-