#1002: Add Player Profile API

Slight changes may occur as this API is stabilized.

This PR is based on work previously done by DerFrZocker in #938.

By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
CraftBukkit/Spigot
2022-02-03 09:25:39 +11:00
parent 0190fa68f9
commit 08891a2e2f
11 changed files with 1159 additions and 6 deletions

View File

@@ -119,6 +119,7 @@ import org.bukkit.craftbukkit.conversations.ConversationTracker;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.craftbukkit.map.CraftMapView;
import org.bukkit.craftbukkit.map.RenderData;
import org.bukkit.craftbukkit.profile.CraftPlayerProfile;
import org.bukkit.craftbukkit.scoreboard.CraftScoreboard;
import org.bukkit.craftbukkit.util.CraftChatMessage;
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
@@ -139,6 +140,7 @@ import org.bukkit.map.MapView;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.messaging.StandardMessenger;
import org.bukkit.profile.PlayerProfile;
import org.bukkit.scoreboard.Scoreboard;
@DelegateDeserialization(CraftOfflinePlayer.class)
@@ -188,6 +190,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return server.getPlayer(getUniqueId()) != null;
}
@Override
public PlayerProfile getPlayerProfile() {
return new CraftPlayerProfile(getProfile());
}
@Override
public InetSocketAddress getAddress() {
if (getHandle().connection == null) return null;