From f8bbc30435056066686a5d76904e6791c71d859b Mon Sep 17 00:00:00 2001 From: themode Date: Tue, 1 Sep 2020 23:37:12 +0200 Subject: [PATCH] Added PlayerProvider comment --- .../minestom/server/network/ConnectionManager.java | 2 +- .../net/minestom/server/network/PlayerProvider.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minestom/server/network/ConnectionManager.java b/src/main/java/net/minestom/server/network/ConnectionManager.java index 373d07677..08e3e044f 100644 --- a/src/main/java/net/minestom/server/network/ConnectionManager.java +++ b/src/main/java/net/minestom/server/network/ConnectionManager.java @@ -255,7 +255,7 @@ public final class ConnectionManager { * @param connection the new player 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); } diff --git a/src/main/java/net/minestom/server/network/PlayerProvider.java b/src/main/java/net/minestom/server/network/PlayerProvider.java index 66becd3de..d854ccb50 100644 --- a/src/main/java/net/minestom/server/network/PlayerProvider.java +++ b/src/main/java/net/minestom/server/network/PlayerProvider.java @@ -7,5 +7,14 @@ import java.util.UUID; @FunctionalInterface 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); }