spigot/CraftBukkit-Patches/0037-Save-ticks-lived-to-nbttag.patch

31 lines
1.4 KiB
Diff
Raw Normal View History

2020-09-11 07:00:00 +10:00
From a1879207c1b63b2d728f306643817e6e8bdf592c 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-09-11 07:00:00 +10:00
index 9082cd514..40fb10500 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-08-26 18:38:43 +10:00
@@ -1473,6 +1473,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
if (!this.persist) {
nbttagcompound.setBoolean("Bukkit.persist", this.persist);
}
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-08-26 18:38:43 +10:00
@@ -1618,6 +1619,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;
--
2.25.1
2014-04-12 14:18:37 +10:00