2015-09-01 08:07:28 +00:00
|
|
|
From 2952e571862ec9c07862a9bab3409cad2493f4ea Mon Sep 17 00:00:00 2001
|
2014-07-21 20:46:54 +00: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-09-01 08:07:28 +00:00
|
|
|
index bf3ce15..b96c6d6 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2015-09-01 08:07:28 +00:00
|
|
|
@@ -1192,6 +1192,7 @@ public abstract class Entity implements ICommandListener {
|
2014-07-21 20:46:54 +00: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 01:17:45 +00:00
|
|
|
if (this.getCustomName() != null && this.getCustomName().length() > 0) {
|
|
|
|
nbttagcompound.setString("CustomName", this.getCustomName());
|
2015-09-01 08:07:28 +00:00
|
|
|
@@ -1283,6 +1284,8 @@ public abstract class Entity implements ICommandListener {
|
2014-07-21 20:46:54 +00: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;
|
|
|
|
--
|
2015-05-09 20:23:26 +00:00
|
|
|
2.1.4
|
2014-07-21 20:46:54 +00:00
|
|
|
|