mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Add SkullMeta.setPlayerProfile API
This allows you to create already filled textures on Skulls to avoid texture lookups which commonly cause rate limit issues with Mojang API
This commit is contained in:
46
Spigot-API-Patches/Add-SkullMeta.setPlayerProfile-API.patch
Normal file
46
Spigot-API-Patches/Add-SkullMeta.setPlayerProfile-API.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 19 Jan 2018 00:29:28 -0500
|
||||
Subject: [PATCH] Add SkullMeta.setPlayerProfile API
|
||||
|
||||
This allows you to create already filled textures on Skulls to avoid texture lookups
|
||||
which commonly cause rate limit issues with Mojang API
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
|
||||
index c60860e1..3eea5909 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.inventory.meta;
|
||||
|
||||
+import com.destroystokyo.paper.profile.PlayerProfile;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
|
||||
+import javax.annotation.Nullable;
|
||||
+
|
||||
/**
|
||||
* Represents a skull ({@link Material#SKULL_ITEM}) that can have an owner.
|
||||
*/
|
||||
@@ -0,0 +0,0 @@ public interface SkullMeta extends ItemMeta {
|
||||
@Deprecated
|
||||
boolean setOwner(String owner);
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Sets this skull to use the supplied Player Profile, which can include textures already prefilled.
|
||||
+ * @param profile The profile to set this Skull to use, or null to clear owner
|
||||
+ */
|
||||
+ void setPlayerProfile(@Nullable PlayerProfile profile);
|
||||
+
|
||||
+ /**
|
||||
+ * If the skull has an owner, per {@link #hasOwner()}, return the owners {@link PlayerProfile}
|
||||
+ * @return The profile of the owner, if set
|
||||
+ */
|
||||
+ @Nullable PlayerProfile getPlayerProfile();
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Gets the owner of the skull.
|
||||
*
|
||||
--
|
Reference in New Issue
Block a user