2020-11-03 07:00:00 +11:00
|
|
|
From a9cb1af62b6f9d4767635047cddb53b7878e1e44 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
|
2020-11-03 07:00:00 +11:00
|
|
|
index c8a999904..c56ac6722 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
|
2020-09-19 17:51:05 +10:00
|
|
|
@@ -1477,6 +1477,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
|
|
|
|
if (this.persistentInvisibility) {
|
|
|
|
nbttagcompound.setBoolean("Bukkit.invisible", this.persistentInvisibility);
|
2020-08-26 18:38:43 +10:00
|
|
|
}
|
2014-04-12 14:18:37 +10:00
|
|
|
+ nbttagcompound.setInt("Spigot.ticksLived", this.ticksLived);
|
|
|
|
// CraftBukkit end
|
2018-07-15 10:00:00 +10:00
|
|
|
IChatBaseComponent ichatbasecomponent = this.getCustomName();
|
|
|
|
|
2020-09-19 17:51:05 +10:00
|
|
|
@@ -1622,6 +1623,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;
|
|
|
|
--
|
2020-05-09 18:48:11 +10:00
|
|
|
2.25.1
|
2014-04-12 14:18:37 +10:00
|
|
|
|