papermc/CraftBukkit-Patches/0054-Save-ticks-lived-to-nbttag.patch

31 lines
1.6 KiB
Diff
Raw Normal View History

2016-02-29 21:33:06 +00:00
From f788b71da021723020948f5fc4bf3f4607f16570 Mon Sep 17 00:00:00 2001
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
2016-02-29 21:33:06 +00:00
index 1eec160..5955732 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
2016-02-29 21:33:06 +00:00
@@ -1292,6 +1292,7 @@ public abstract class Entity implements ICommandListener {
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
2016-02-29 21:33:06 +00:00
if (this.getCustomName() != null && !this.getCustomName().isEmpty()) {
2014-11-28 01:17:45 +00:00
nbttagcompound.setString("CustomName", this.getCustomName());
2016-02-29 21:33:06 +00:00
@@ -1428,6 +1429,8 @@ public abstract class Entity implements ICommandListener {
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;
--
2016-02-29 21:33:06 +00:00
2.5.0