PaperMC/CraftBukkit-Patches/0061-Save-ticks-lived-to-nbttag.patch

31 lines
1.6 KiB
Diff
Raw Normal View History

2015-05-25 14:05:40 +02:00
From 7a845c3b5215c05f955a4a69511428b35bc245ec 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
2015-02-28 12:36:22 +01:00
index 5cf3833..5e1e695 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
2015-02-28 12:36:22 +01:00
@@ -1191,6 +1191,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
2014-11-28 02:17:45 +01:00
if (this.getCustomName() != null && this.getCustomName().length() > 0) {
nbttagcompound.setString("CustomName", this.getCustomName());
2015-02-28 12:36:22 +01:00
@@ -1282,6 +1283,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;
--
2015-05-09 22:23:26 +02:00
2.1.4