All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minestom.server.network.UuidProvider Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
package net.minestom.server.network;

import net.minestom.server.network.player.PlayerConnection;
import org.jetbrains.annotations.NotNull;

import java.util.UUID;

/**
 * Used when you want to provide your own {@link UUID} object for players instead of using the default one.
 * 

* Sets with {@link ConnectionManager#setUuidProvider(UuidProvider)}. */ @FunctionalInterface public interface UuidProvider { /** * Called when a new {@link UUID} is requested. *

* The {@link 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. * * @param playerConnection the connection who requires a new unique id * @param username the username given by the connection * @return the new {@link UUID} for the player */ @NotNull UUID provide(@NotNull PlayerConnection playerConnection, @NotNull String username); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy