mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-24 01:19:25 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@1f93f566 [ci/skip] Improve getPotentialBedLocation deprecation (#12857) PaperMC/Paper@6fb36e34 Replace compileOnly with implementation for test visibility (#12841) PaperMC/Paper@aa4ef067 Update DataConverter constants for 1.21.8 PaperMC/Paper@f7c59f91 Fix broken resource pack API when configured in configuration stage (#12866) PaperMC/Paper@0dad7f15 Add Bee#set/getTimeSinceSting() methods (#12792) PaperMC/Paper@782ce950 Allow forcing break effects when using breakNaturally (#12734) PaperMC/Paper@a2d37f12 Remove invalid team colors nicely (#12874) PaperMC/Paper@617e5a46 Update to configurate 4.2.0 (#12869) PaperMC/Paper@602ea9f0 Restore previous PlayerToggleSneakEvent behaviour (#12815) PaperMC/Paper@c8a8c0ef feat(plugin): make Plugin extend Namespaced (#12867)
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 aed79c57a691eb9a100e566c4d1163181af0b360..17d519244b0d08829e28e9047134b8bee9cde81f 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -3701,4 +3701,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
|
|
}
|