Files
KeYiMC/patches/api/0007-Player-Skull-API.patch
2022-11-29 05:29:56 -05:00

44 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: nostalgic853 <yuu8583@proton.me>
Date: Sun, 20 Nov 2022 00:20:01 +0800
Subject: [PATCH] Player Skull API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index d54ba266d4dc772d844b1fffed0092a2d92e0eb1..ba8ac0aaa321d389b2186ad5d7c7759f7956723f 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3,6 +3,9 @@ package org.bukkit.entity;
import java.net.InetSocketAddress;
import java.util.Collection;
import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Future;
+
import com.destroystokyo.paper.ClientOption; // Paper
import com.destroystokyo.paper.Title; // Paper
import net.kyori.adventure.text.Component;
@@ -3073,4 +3076,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
void sendDeathScreen(@NotNull Component message, @Nullable Entity killer);
// Purpur end
+
+ // KeYi start
+ /**
+ * Get a skull item of a player.
+ * This method runs on main thread, which may freeze the server.
+ *
+ * @return A ItemStack of the skull of the player
+ */
+ ItemStack getSkull();
+
+ /**
+ * Get a skull item of a player.
+ * This method runs on main thread, which may freeze the server.
+ *
+ * @return A CompletableFuture the of ItemStack of the skull of the player
+ */
+ CompletableFuture<ItemStack> getSkullAsynchronously();
+ // KeYi end
}