Contents
Class DiskPlayerStorageProvider.DiskPlayerStorage
java.lang.Object
com.hypixel.hytale.server.core.universe.playerdata.DiskPlayerStorageProvider.DiskPlayerStorage
- All Implemented Interfaces:
PlayerStorage
- Enclosing class:
DiskPlayerStorageProvider
public static class DiskPlayerStorageProvider.DiskPlayerStorage
extends Object
implements PlayerStorage
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a set of all player UUIDs stored in this PlayerStorage.Loads the player data for the given UUID.Removes the player data for the given UUID.save(UUID uuid, Holder<EntityStore> holder, boolean required) Saves the player data for the given UUID.update(UUID uuid, Consumer<Holder<EntityStore>> modifier) Atomically loads player data, applies a modification, and saves it back.
-
Field Details
-
FILE_EXTENSION
- See Also:
-
-
Constructor Details
-
DiskPlayerStorage
-
-
Method Details
-
load
Description copied from interface:PlayerStorageLoads the player data for the given UUID.- Specified by:
loadin interfacePlayerStorage- Parameters:
uuid- TheUUIDof the player to load.- Returns:
- a
CompletableFuturethat will be completed with aHoldercontaining theEntityStore.
-
save
@Nonnull public CompletableFuture<Void> save(@Nonnull UUID uuid, @Nonnull Holder<EntityStore> holder, boolean required) Description copied from interface:PlayerStorageSaves the player data for the given UUID.- Specified by:
savein interfacePlayerStorage- Parameters:
uuid- TheUUIDof the player to save.holder- AHoldercontaining theEntityStoreto save.required- Whether the save should be forced or not- Returns:
- a
CompletableFuturethat will be completed when the save operation is done.
-
update
@Nonnull public CompletableFuture<Void> update(@Nonnull UUID uuid, @Nonnull Consumer<Holder<EntityStore>> modifier) Description copied from interface:PlayerStorageAtomically loads player data, applies a modification, and saves it back.The entire load-modify-save is performed as a single storage operation, ensuring proper coordination with backup locking and other concurrent saves.
- Specified by:
updatein interfacePlayerStorage- Parameters:
uuid- TheUUIDof the player to update.modifier- A consumer that modifies the loadedHolder.- Returns:
- a
CompletableFuturethat will be completed when the update is done.
-
remove
Description copied from interface:PlayerStorageRemoves the player data for the given UUID.- Specified by:
removein interfacePlayerStorage- Parameters:
uuid- TheUUIDof the player to remove.- Returns:
- a
CompletableFuturethat will be completed when the remove operation is done.
-
getPlayers
Description copied from interface:PlayerStorageGets a set of all player UUIDs stored in this PlayerStorage.- Specified by:
getPlayersin interfacePlayerStorage- Returns:
- a
SetofUUIDs representing all stored players. - Throws:
IOException- if an I/O error occurs while retrieving the player UUIDs.
-