Interface UuidProvider

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface UuidProvider
Used when you want to provide your own UUID object for players instead of using the default one.

Sets with ConnectionManager.setUuidProvider(UuidProvider).

  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull UUID
    provide(@NotNull PlayerConnection playerConnection, @NotNull String username)
    Called when a new UUID is requested.
  • Method Details

    • provide

      @NotNull @NotNull UUID provide(@NotNull @NotNull PlayerConnection playerConnection, @NotNull @NotNull String username)
      Called when a new UUID is requested.

      The UUID does not need to be persistent between restart, but being sure that all players have a different one is good practice. Otherwise, undefined behavior can happen.

      Parameters:
      playerConnection - the connection who requires a new unique id
      username - the username given by the connection
      Returns:
      the new UUID for the player