Interface MachinePlayers


@NonExtendable public interface MachinePlayers
The MachinePlayers of the server (D37): MachineEngine.get().players().
  • Method Details

    • get

      @NotNull @NotNull MachinePlayer get(@NotNull @NotNull org.bukkit.entity.Player player)
      The data of an online player; present from their PlayerJoinEvent (at LOWEST priority) until their PlayerQuitEvent (at MONITOR).
      Throws:
      IllegalStateException - if the player is not online or MachineEngine has not loaded their data
    • find

      @NotNull @NotNull Optional<MachinePlayer> find(@NotNull @NotNull UUID uuid)
      The data of an online player, if loaded.
    • online

      @NotNull @NotNull Collection<MachinePlayer> 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 with saveOffline(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

      @NotNull @NotNull CompletableFuture<Void> saveOffline(@NotNull @NotNull MachinePlayer player)
      Saves data returned by loadOffline(UUID) for an offline player.
    • storage

      @NotNull @NotNull PlayerDataStorage storage()
      The storage chosen in players.storage.