2019-04-27 10:30:04 +10:00
|
|
|
From e038db9878537faf98d596aaa8e384967b2f5694 Mon Sep 17 00:00:00 2001
|
2014-04-12 14:18:37 +10: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
|
2019-04-27 10:30:04 +10:00
|
|
|
index 85808bd4d..575715220 100644
|
2014-04-12 14:18:37 +10:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2019-04-27 10:30:04 +10:00
|
|
|
@@ -1473,6 +1473,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
|
2019-04-23 12:00:00 +10:00
|
|
|
nbttagcompound.setLong("WorldUUIDLeast", ((WorldServer) this.world).getDataManager().getUUID().getLeastSignificantBits());
|
|
|
|
nbttagcompound.setLong("WorldUUIDMost", ((WorldServer) this.world).getDataManager().getUUID().getMostSignificantBits());
|
2014-04-12 14:18:37 +10:00
|
|
|
nbttagcompound.setInt("Bukkit.updateLevel", CURRENT_LEVEL);
|
|
|
|
+ nbttagcompound.setInt("Spigot.ticksLived", this.ticksLived);
|
|
|
|
// CraftBukkit end
|
2018-07-15 10:00:00 +10:00
|
|
|
IChatBaseComponent ichatbasecomponent = this.getCustomName();
|
|
|
|
|
2019-04-27 10:30:04 +10:00
|
|
|
@@ -1624,6 +1625,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
|
2014-04-12 14:18:37 +10: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;
|
|
|
|
--
|
2019-04-23 09:33:25 +10:00
|
|
|
2.20.1
|
2014-04-12 14:18:37 +10:00
|
|
|
|