Files
Purpur/patches/api/0046-Add-death-screen-API.patch
granny cc43efdd44 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@3fd1502 Add missing deprecation (#8886)
PaperMC/Paper@773dd72 Updated Upstream (Bukkit/CraftBukkit) (#9739)
2023-09-22 19:33:54 -07:00

37 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MelnCat <melncatuwu@gmail.com>
Date: Fri, 23 Sep 2022 18:35:28 -0700
Subject: [PATCH] Add death screen API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 11ef2a302586e276a11360caa7d75101939988ab..d3d5d2c78cc4ee36beaa355ef7e61ef13332abab 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3391,5 +3391,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Clears all debug block highlights
*/
void clearBlockHighlights();
+
+ /**
+ * Sends a player the death screen with a specified death message.
+ *
+ * @param message The death message to show the player
+ */
+ void sendDeathScreen(@NotNull net.kyori.adventure.text.Component message);
+
+ /**
+ * Sends a player the death screen with a specified death message,
+ * along with the entity that caused the death.
+ *
+ * @param message The death message to show the player
+ * @param killer The entity that killed the player
+ * @deprecated Use {@link #sendDeathScreen(net.kyori.adventure.text.Component)} instead, as 1.20 removed the killer ID from the packet.
+ */
+ @Deprecated(since = "1.20")
+ default void sendDeathScreen(@NotNull net.kyori.adventure.text.Component message, @Nullable Entity killer) {
+ sendDeathScreen(message);
+ }
// Purpur end
}