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

Paper Changes:
PaperMC/Paper@990be16 Iterate over entity array copy for entity scheduler
PaperMC/Paper@3f6c4b0 Add event for player editing sign (#9300)
PaperMC/Paper@7103f81 Only tick item frames if players can see it (#9377)
PaperMC/Paper@cf0f013 Avoid duplicate death event call for armorstands (#9223)
PaperMC/Paper@8582999 Deprecate duplicate chat completion methods (#9401)
PaperMC/Paper@e4b40dd Fix entity selectors while spectating (#9402)
PaperMC/Paper@82cd69f [ci skip] Update Repo style and change project url in README (#9407)
PaperMC/Paper@2c9c5e4 Fix replenishable container entities save/load existing contents (#9417)
PaperMC/Paper@437e8da Improve command function perm level checks (#9411)
PaperMC/Paper@225c950 Hotfix double entity removal making entity scheduler retire call
PaperMC/Paper@fead63e Add option to disable NoteBlock and Tripwire updates (#9368)

Pufferfish Changes:
pufferfish-gg/Pufferfish@50f3124 Updated Upstream (Paper)
pufferfish-gg/Pufferfish@5673490 Add option to suppress null ID disconnections in logs
pufferfish-gg/Pufferfish@1e911fb Fix issue with that last patch
2023-06-30 12:37:27 -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 3dd1cde47e7d3ed0cb5b6c06c071a827b4175359..5b0035bf5edf15a5ee4528d0933f78d9d586fa2f 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3239,5 +3239,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
}