From dba9349ed45bd92bad934427c29c7be95acd6d25 Mon Sep 17 00:00:00 2001 From: feildmaster Date: Wed, 4 Jul 2012 15:12:29 -0500 Subject: Factor invulnerableTicks into getNoDamageTicks. Fixes BUKKIT-1324 --- src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index b3da75ef..c2f38d0a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -850,4 +850,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getHandle().abilities.canFly = value; getHandle().updateAbilities(); } + + @Override + public int getNoDamageTicks() { + if (getHandle().invulnerableTicks > 0) { + return Math.max(getHandle().invulnerableTicks, getHandle().noDamageTicks); + } else { + return getHandle().noDamageTicks; + } + } } -- cgit v1.2.3