9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/patches/api/0007-KeYi-Player-Skull-API.patch

47 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] KeYi: Player Skull API
Original license: MIT
Original project: https://github.com/KeYiMC/KeYi
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index a9f119ea2a006158429a90d67517ccc74a0027ac..69ba1660dae4ac69ec4e92f94dd6f95e9f70427d 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -9,6 +9,10 @@ import java.util.Date;
import java.util.Map;
import java.util.UUID;
import org.bukkit.BanEntry;
+// Leaf start - KeYi - Player Skull API
+import java.util.concurrent.CompletableFuture;
+import net.kyori.adventure.text.Component;
+// Leaf start - KeYi
import org.bukkit.DyeColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
@@ -3840,4 +3844,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
sendDeathScreen(message);
}
// Purpur end
+
+ // Leaf start - KeYi - Player Skull API
+ /**
+ * Get a skull item of a player.
+ * This method runs on main thread, which may freeze the server.
+ *
+ * @return A skull ItemStack 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 of the skull ItemStack of the player
+ */
+ CompletableFuture<ItemStack> getSkullAsynchronously();
+ // Leaf end - KeYi
}