diff options
author | feildmaster <admin@feildmaster.com> | 2012-07-04 15:12:29 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-07-04 15:12:29 -0500 |
commit | dba9349ed45bd92bad934427c29c7be95acd6d25 (patch) | |
tree | 33483266eb8e76876ef86fb615f849bc801755a0 /src | |
parent | d7272f42efe17e370000dacea5e52bf6ce94bfd4 (diff) | |
download | craftbukkit-dba9349ed45bd92bad934427c29c7be95acd6d25.tar craftbukkit-dba9349ed45bd92bad934427c29c7be95acd6d25.tar.gz craftbukkit-dba9349ed45bd92bad934427c29c7be95acd6d25.tar.lz craftbukkit-dba9349ed45bd92bad934427c29c7be95acd6d25.tar.xz craftbukkit-dba9349ed45bd92bad934427c29c7be95acd6d25.zip |
Factor invulnerableTicks into getNoDamageTicks. Fixes BUKKIT-1324
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 9 |
1 files changed, 9 insertions, 0 deletions
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; + } + } } |