2019-01-05 16:21:07 +11:00
|
|
|
From 058cc999e3d4117c782fecc05f8714015ff4e43a 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-01-05 16:21:07 +11:00
|
|
|
index 02e338887..7ee65ce10 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
|
2018-12-26 08:00:00 +11:00
|
|
|
@@ -1545,6 +1545,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
|
2014-04-12 14:18:37 +10: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
|
2018-07-15 10:00:00 +10:00
|
|
|
IChatBaseComponent ichatbasecomponent = this.getCustomName();
|
|
|
|
|
2018-12-26 08:00:00 +11:00
|
|
|
@@ -1696,6 +1697,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;
|
|
|
|
--
|
2018-11-14 14:20:34 +11:00
|
|
|
2.19.1
|
2014-04-12 14:18:37 +10:00
|
|
|
|