Added PlayerProvider comment

This commit is contained in:
themode 2020-09-01 23:37:12 +02:00
parent eff5d0b5e0
commit f8bbc30435
2 changed files with 11 additions and 2 deletions

View File

@ -255,7 +255,7 @@ public final class ConnectionManager {
* @param connection the new player connection * @param connection the new player connection
*/ */
public void createPlayer(UUID uuid, String username, PlayerConnection connection) { public void createPlayer(UUID uuid, String username, PlayerConnection connection) {
final Player player = getPlayerProvider().getPlayer(uuid, username, connection); final Player player = getPlayerProvider().createPlayer(uuid, username, connection);
createPlayer(player); createPlayer(player);
} }

View File

@ -7,5 +7,14 @@ import java.util.UUID;
@FunctionalInterface @FunctionalInterface
public interface PlayerProvider { public interface PlayerProvider {
Player getPlayer(UUID uuid, String username, PlayerConnection connection);
/**
* Should create a new {@link Player} object based on his data
*
* @param uuid the player {@link UUID}
* @param username the player username
* @param connection the player connection
* @return a newly create {@link Player} object
*/
Player createPlayer(UUID uuid, String username, PlayerConnection connection);
} }