From dc7c3c61fa061c87eca5d158f1f1c369620622b6 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 2 Jul 2020 11:18:03 +1000 Subject: [PATCH] SPIGOT-5921: Improve setNoDamageTicks for Players --- .../java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 9f027e1f1c..6ee141c687 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1399,6 +1399,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } + @Override + public void setNoDamageTicks(int ticks) { + super.setNoDamageTicks(ticks); + getHandle().invulnerableTicks = ticks; // SPIGOT-5921: Update both for players, like the getter above + } + @Override public void setFlySpeed(float value) { validateSpeed(value);