From 747897f79b6e89ba4898be538b8bf8a9b765c8bb Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 21 Apr 2023 18:59:04 +1000 Subject: [PATCH] #375: Add accessors to Wither's invulnerability ticks By: Matthew --- .../org/bukkit/craftbukkit/entity/CraftWither.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java index 592c7a6022..be80058b37 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java @@ -61,4 +61,16 @@ public class CraftWither extends CraftMonster implements Wither { Entity target = getHandle().getLevel().getEntity(entityId); return (target != null) ? (LivingEntity) target.getBukkitEntity() : null; } + + @Override + public int getInvulnerabilityTicks() { + return getHandle().getInvulnerableTicks(); + } + + @Override + public void setInvulnerabilityTicks(int ticks) { + Preconditions.checkArgument(ticks >= 0, "ticks must be >=0"); + + getHandle().setInvulnerableTicks(ticks); + } }