From 79ded7a8cad4cd6837283a5e2a6f64705a25ef4d Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 27 Dec 2018 11:37:19 +1100 Subject: [PATCH] SPIGOT-1811: Death message not shown on respawn screen --- nms-patches/EntityLiving.patch | 2 +- .../java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nms-patches/EntityLiving.patch b/nms-patches/EntityLiving.patch index 2d7a54d832..63e1349454 100644 --- a/nms-patches/EntityLiving.patch +++ b/nms-patches/EntityLiving.patch @@ -368,7 +368,7 @@ + player.setRealHealth(f); + } + -+ player.updateScaledHealth(); ++ player.updateScaledHealth(false); + return; + } + // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 675d5a4eab..b72fd02217 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1467,6 +1467,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void updateScaledHealth() { + updateScaledHealth(true); + } + + public void updateScaledHealth(boolean sendHealth) { AttributeMapServer attributemapserver = (AttributeMapServer) getHandle().getAttributeMap(); Collection set = attributemapserver.c(); // PAIL: Rename @@ -1475,7 +1479,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // SPIGOT-3813: Attributes before health if (getHandle().playerConnection != null) { getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateAttributes(getHandle().getId(), set)); - sendHealthUpdate(); + if (sendHealth) { + sendHealthUpdate(); + } } getHandle().getDataWatcher().set(EntityLiving.HEALTH, (float) getScaledHealth());