Class PlayerRegistry

java.lang.Object
net.pl3x.map.core.registry.Registry<@NotNull Player>
net.pl3x.map.core.player.PlayerRegistry
All Implemented Interfaces:
Iterable<Player>

public class PlayerRegistry extends Registry<@NotNull Player>
Manages player specific data
  • Constructor Details

    • PlayerRegistry

      public PlayerRegistry()
  • Method Details

    • getOrDefault

      @NotNull public @NotNull Player getOrDefault(@NotNull @NotNull UUID uuid, @NotNull @NotNull Supplier<@NotNull Player> supplier)
    • register

      @NotNull public @NotNull Player register(@NotNull @NotNull UUID uuid, @NotNull @NotNull Player player)
    • unregister

      @Nullable public @Nullable Player unregister(@NotNull @NotNull UUID uuid)
    • get

      @Nullable public @Nullable Player get(@NotNull @NotNull UUID uuid)
      Get the registered player by uuid.

      Will return null if no player registered.

      Parameters:
      uuid - player uuid
      Returns:
      registered player or null
    • get

      @Nullable public @Nullable Player get(@NotNull @NotNull String name)
      Get the registered player by name.

      Will return null if no player registered.

      Overrides:
      get in class Registry<@NotNull Player>
      Parameters:
      name - player name
      Returns:
      registered player or null
    • optional

      @NotNull public @NotNull Optional<Player> optional(@NotNull @NotNull UUID uuid)
    • parsePlayers

      @NotNull public @NotNull List<@NotNull Object> parsePlayers()