#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

@@ -4,6 +4,7 @@ import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.SkullType;
import org.bukkit.block.data.BlockData;
import org.bukkit.profile.PlayerProfile;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -61,6 +62,29 @@ public interface Skull extends TileState {
*/
public void setOwningPlayer(@NotNull OfflinePlayer player);
/**
* 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);
/**
* Gets the rotation of the skull in the world (or facing direction if this
* is a wall mounted skull).