From 851a363fadf897506cc13ae31d3592c3acb520e7 Mon Sep 17 00:00:00 2001 From: EpicPlayerA10 <62206933+EpicPlayerA10@users.noreply.github.com> Date: Tue, 13 Dec 2022 13:24:59 +0100 Subject: [PATCH] Fix death message containing empty string (#8656) Resolves: #8654 --- patches/api/Adventure.patch | 4 ++-- patches/api/PlayerDeathEvent-getItemsToKeep.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index 04716b1ae7..dfc73601d6 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -2624,7 +2624,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.newTotalExp = newTotalExp; this.newLevel = newLevel; this.deathMessage = deathMessage; -+ this.adventure$deathMessage = deathMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper ++ this.adventure$deathMessage = deathMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(deathMessage) : null; // Paper } @NotNull @@ -2662,7 +2662,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Deprecated // Paper public void setDeathMessage(@Nullable String deathMessage) { this.deathMessage = deathMessage; -+ this.adventure$deathMessage = deathMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper ++ this.adventure$deathMessage = deathMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(deathMessage) : null; // Paper } /** diff --git a/patches/api/PlayerDeathEvent-getItemsToKeep.patch b/patches/api/PlayerDeathEvent-getItemsToKeep.patch index 4d387d1cec..fcb8ae679b 100644 --- a/patches/api/PlayerDeathEvent-getItemsToKeep.patch +++ b/patches/api/PlayerDeathEvent-getItemsToKeep.patch @@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this(player, drops, droppedExp, 0, deathMessage); } @@ -0,0 +0,0 @@ public class PlayerDeathEvent extends EntityDeathEvent { - this.adventure$deathMessage = deathMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper + this.adventure$deathMessage = deathMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(deathMessage) : null; // Paper } + @Deprecated // Paper