From e2369da5025c06e70a82421d8ed58f338532ac44 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Tue, 11 Oct 2011 02:23:10 +0100 Subject: [PATCH] Implemented entity age methods By: Nathan Adams --- .../org/bukkit/craftbukkit/entity/CraftEntity.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 8865216180..0651ed600d 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -286,4 +286,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return result; } + + public int getTicksLived() { + return getHandle().ticksLived; + } + + public void setTicksLived(int value) { + if (value <= 0) { + throw new IllegalArgumentException("Age must be at least 1 tick"); + } + getHandle().ticksLived = value; + } }