From 405cbc4ec888793aeba9a41ad77df7508360cfc1 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 2 Jul 2020 11:18:03 +1000 Subject: [PATCH] SPIGOT-5921: Improve setNoDamageTicks for Players By: md_5 --- .../java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 9f027e1f1c..6ee141c687 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/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);