Interface MachinePlayers
@NonExtendable
public interface MachinePlayers
The
MachinePlayers of the server (D37): MachineEngine.get().players().-
Method Summary
Modifier and TypeMethodDescription@NotNull Optional<MachinePlayer> The data of an online player, if loaded.@NotNull MachinePlayerget(@NotNull org.bukkit.entity.Player player) The data of an online player; present from theirPlayerJoinEvent(atLOWESTpriority) until theirPlayerQuitEvent(atMONITOR).@NotNull CompletableFuture<Optional<MachinePlayer>> loadOffline(@NotNull UUID uuid) The data of a player who may be offline: the online data if they are online, else what the storage holds.@NotNull Collection<MachinePlayer> online()Players whose data is loaded.@NotNull CompletableFuture<Void> saveOffline(@NotNull MachinePlayer player) Saves data returned byloadOffline(UUID)for an offline player.@NotNull PlayerDataStoragestorage()The storage chosen inplayers.storage.
-
Method Details
-
get
The data of an online player; present from theirPlayerJoinEvent(atLOWESTpriority) until theirPlayerQuitEvent(atMONITOR).- Throws:
IllegalStateException- if the player is not online or MachineEngine has not loaded their data
-
find
The data of an online player, if loaded. -
online
Players whose data is loaded. -
loadOffline
@NotNull @NotNull CompletableFuture<Optional<MachinePlayer>> loadOffline(@NotNull @NotNull UUID uuid) The data of a player who may be offline: the online data if they are online, else what the storage holds. Changes to offline data are saved withsaveOffline(MachinePlayer); a player who joins meanwhile gets the stored data, so save before they can join.- Returns:
- empty when the storage cannot read offline players (the default PDC storage)
-
saveOffline
Saves data returned byloadOffline(UUID)for an offline player. -
storage
The storage chosen inplayers.storage.
-