2015-02-26 11:40:16 +01:00
|
|
|
From 29e58880faa0e54cc4a10353bb2fb52dae36c60d Mon Sep 17 00:00:00 2001
|
2014-07-21 22:46:54 +02:00
|
|
|
From: DerFlash <bte@freenet.de>
|
|
|
|
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
|
2015-02-26 11:40:16 +01:00
|
|
|
index 8f7d865..d7e610b 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2014-12-13 05:47:57 +01:00
|
|
|
@@ -1198,6 +1198,7 @@ public abstract class Entity implements ICommandListener {
|
2014-07-21 22:46:54 +02:00
|
|
|
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
|
2014-11-28 02:17:45 +01:00
|
|
|
if (this.getCustomName() != null && this.getCustomName().length() > 0) {
|
|
|
|
nbttagcompound.setString("CustomName", this.getCustomName());
|
2014-12-13 05:47:57 +01:00
|
|
|
@@ -1285,6 +1286,8 @@ public abstract class Entity implements ICommandListener {
|
2014-07-21 22:46:54 +02:00
|
|
|
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;
|
|
|
|
--
|
2014-11-28 02:17:45 +01:00
|
|
|
2.1.0
|
2014-07-21 22:46:54 +02:00
|
|
|
|