#375: Add accessors to Wither's invulnerability ticks

This commit is contained in:
Matthew 2023-04-21 18:59:04 +10:00 committed by md_5
parent bfd8b1ac82
commit 63cad7f840
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -61,4 +61,16 @@ public class CraftWither extends CraftMonster implements Wither {
Entity target = getHandle().getLevel().getEntity(entityId); Entity target = getHandle().getLevel().getEntity(entityId);
return (target != null) ? (LivingEntity) target.getBukkitEntity() : null; 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);
}
} }