#719: Add Player Profile API

Slight changes may occur as this API is stabilized.

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

By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
Bukkit/Spigot
2022-02-03 09:25:35 +11:00
parent e6392d1992
commit 7c667b37d9
7 changed files with 362 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
package org.bukkit.inventory.meta;
import org.bukkit.OfflinePlayer;
import org.bukkit.profile.PlayerProfile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -55,6 +56,29 @@ public interface SkullMeta extends ItemMeta {
*/
boolean setOwningPlayer(@Nullable OfflinePlayer owner);
/**
* Gets the profile of the player who owns the skull. This player profile
* may appear as the texture depending on skull type.
*
* @return the profile of the owning player
*/
@Nullable
PlayerProfile getOwnerProfile();
/**
* Sets the profile of the player who owns the skull. This player profile
* may appear as the texture depending on skull type.
* <p>
* The profile must contain both a unique id and a skin texture. If either
* of these is missing, the profile must contain a name by which the server
* will then attempt to look up the unique id and skin texture.
*
* @param profile the profile of the owning player
* @throws IllegalArgumentException if the profile does not contain the
* necessary information
*/
void setOwnerProfile(@Nullable PlayerProfile profile);
@Override
@NotNull
SkullMeta clone();