mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-30 12:29:13 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@6ea679eb Allow listening to plugin messages during configuration phase (#12775) PaperMC/Paper@c3be00f0 Always call plugin message dispatch on PlayerConnection PaperMC/Paper@3fec37a9 Move the double call into the dispatch method PaperMC/Paper@108255cb Reduce PlayerLoginEvent alt behavior nag for now (#12782) PaperMC/Paper@2141ca52 Port plugins command to brigadier (#12632) PaperMC/Paper@0cadaefc Fix quitmessage nullability issues (#12783) Purpur Changes: PurpurMC/Purpur@2d8cdd15 Updated Upstream (Paper)
45 lines
2.0 KiB
Diff
45 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: nostalgic853 <yuu8583@proton.me>
|
|
Date: Sun, 20 Nov 2022 00:20:00 +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/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
index 1c5128b0d2984ce47e2fce200790d4b87bcf94c9..9d7591609889c62583a6406e58c38e82d4e5b627 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -3604,4 +3604,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
|
this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerCombatKillPacket(getEntityId(), io.papermc.paper.adventure.PaperAdventure.asVanilla(message)));
|
|
}
|
|
// Purpur end - Death screen API
|
|
+
|
|
+ // Leaf start - KeYi - Player Skull API
|
|
+ @Override
|
|
+ public ItemStack getSkull() {
|
|
+ ItemStack skull = new ItemStack(Material.PLAYER_HEAD, 1);
|
|
+ org.bukkit.inventory.meta.SkullMeta meta = (org.bukkit.inventory.meta.SkullMeta) skull.getItemMeta();
|
|
+
|
|
+ meta.setOwningPlayer(this);
|
|
+ skull.setItemMeta(meta);
|
|
+
|
|
+ return skull;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ @Deprecated(forRemoval = true)
|
|
+ public CompletableFuture<ItemStack> getSkullAsynchronously() {
|
|
+ org.apache.logging.log4j.LogManager.getLogger("Leaf")
|
|
+ .warn("You should not use this method: Player#getSkullAsynchronously(), cause low performance, " +
|
|
+ "and will be removed in the future.");
|
|
+ java.util.concurrent.ExecutorService executorService = java.util.concurrent.Executors.newCachedThreadPool();
|
|
+
|
|
+ CompletableFuture<ItemStack> future = (CompletableFuture<ItemStack>) executorService.submit(this::getSkull);
|
|
+ executorService.shutdown();
|
|
+
|
|
+ return future;
|
|
+ }
|
|
+ // Leaf end - KeYi - Player Skull API
|
|
}
|