From af1838305cbb1b1c79bb059d9399b8d0bcd73112 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Tue, 11 Oct 2011 02:23:10 +0100 Subject: [PATCH] Implemented entity age methods --- .../org/bukkit/craftbukkit/entity/CraftEntity.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 8865216180..0651ed600d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/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; + } }