From 4a9a0705b636f7359bf2a5cfe752b4408f6d7bdc Mon Sep 17 00:00:00 2001 From: DerFlash Date: Tue, 9 Jul 2013 00:11:12 +0200 Subject: [PATCH] Save ticks lived to nbttag diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index 5cf3833..5e1e695 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1191,6 +1191,7 @@ public abstract class Entity implements ICommandListener { nbttagcompound.setLong("WorldUUIDLeast", this.world.getDataManager().getUUID().getLeastSignificantBits()); nbttagcompound.setLong("WorldUUIDMost", this.world.getDataManager().getUUID().getMostSignificantBits()); nbttagcompound.setInt("Bukkit.updateLevel", CURRENT_LEVEL); + nbttagcompound.setInt("Spigot.ticksLived", this.ticksLived); // CraftBukkit end if (this.getCustomName() != null && this.getCustomName().length() > 0) { nbttagcompound.setString("CustomName", this.getCustomName()); @@ -1282,6 +1283,8 @@ public abstract class Entity implements ICommandListener { if (this instanceof EntityLiving) { EntityLiving entity = (EntityLiving) this; + this.ticksLived = nbttagcompound.getInt("Spigot.ticksLived"); + // Reset the persistence for tamed animals if (entity instanceof EntityTameableAnimal && !isLevelAtLeast(nbttagcompound, 2) && !nbttagcompound.getBoolean("PersistenceRequired")) { EntityInsentient entityinsentient = (EntityInsentient) entity; -- 2.1.0