Files
KeYiMC/patches/api/0005-Player-Skull-API.patch
7777777-4547 348145c456 Branch develop/1.19.3 backup
2023/1/14
2023-01-27 18:49:11 +08: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 f65a860d09d9f1d5045b2af63a80109e7c1c4ddf..0b275a9d5a3977d44fc79011de8a5c98bdc0cbef 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;
@@ -3063,4 +3066,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
}