| 
									
										
										
										
											2018-07-19 05:42:43 +01:00
										 |  |  | From 956b151ae68497ff34ebf1f4dc540cc88754f276 Mon Sep 17 00:00:00 2001 | 
					
						
							| 
									
										
										
										
											2018-01-19 00:38:49 -05:00
										 |  |  | 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
 | 
					
						
							| 
									
										
										
										
											2018-07-14 21:53:17 -04:00
										 |  |  | index 15c1dfd9..a458000f 100644
 | 
					
						
							| 
									
										
										
										
											2018-01-19 00:38:49 -05:00
										 |  |  | --- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
 | 
					
						
							|  |  |  | +++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
 | 
					
						
							| 
									
										
										
										
											2018-07-14 21:53:17 -04:00
										 |  |  | @@ -1,7 +1,10 @@
 | 
					
						
							| 
									
										
										
										
											2018-01-19 00:38:49 -05:00
										 |  |  |  package org.bukkit.inventory.meta; | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  | +import com.destroystokyo.paper.profile.PlayerProfile;
 | 
					
						
							| 
									
										
										
										
											2018-07-14 21:53:17 -04:00
										 |  |  | +import javax.annotation.Nullable;
 | 
					
						
							| 
									
										
										
										
											2018-01-19 00:38:49 -05:00
										 |  |  |  import org.bukkit.OfflinePlayer; | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  | +
 | 
					
						
							|  |  |  |  /** | 
					
						
							| 
									
										
										
										
											2018-07-14 21:53:17 -04:00
										 |  |  |   * Represents a skull that can have an owner. | 
					
						
							| 
									
										
										
										
											2018-01-19 00:38:49 -05:00
										 |  |  |   */ | 
					
						
							| 
									
										
										
										
											2018-07-14 21:53:17 -04:00
										 |  |  | @@ -36,6 +39,20 @@ public interface SkullMeta extends ItemMeta {
 | 
					
						
							| 
									
										
										
										
											2018-01-19 00:38:49 -05:00
										 |  |  |      @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. | 
					
						
							|  |  |  |       * | 
					
						
							|  |  |  | -- 
 | 
					
						
							| 
									
										
										
										
											2018-07-14 21:53:17 -04:00
										 |  |  | 2.18.0 | 
					
						
							| 
									
										
										
										
											2018-01-19 00:38:49 -05:00
										 |  |  | 
 |