mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00
33 lines
1.5 KiB
Diff
33 lines
1.5 KiB
Diff
From 4667cd7613d03b3a57c0696f6cce13ca3ad9f174 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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index e3751b64a..0de06abed 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -1802,6 +1802,7 @@ public abstract class Entity implements INamableTileEntity, EntityAccess, IComma
|
|
if (maxAirTicks != getDefaultMaxAirSupply()) {
|
|
nbttagcompound.putInt("Bukkit.MaxAirSupply", getMaxAirSupply());
|
|
}
|
|
+ nbttagcompound.putInt("Spigot.ticksLived", this.tickCount);
|
|
// CraftBukkit end
|
|
IChatBaseComponent ichatbasecomponent = this.getCustomName();
|
|
|
|
@@ -1960,6 +1961,11 @@ public abstract class Entity implements INamableTileEntity, EntityAccess, IComma
|
|
}
|
|
|
|
// CraftBukkit start
|
|
+ // Spigot start
|
|
+ if (this instanceof EntityLiving) {
|
|
+ this.tickCount = nbttagcompound.getInt("Spigot.ticksLived");
|
|
+ }
|
|
+ // Spigot end
|
|
this.persist = !nbttagcompound.contains("Bukkit.persist") || nbttagcompound.getBoolean("Bukkit.persist");
|
|
// SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
|
if (nbttagcompound.contains("Bukkit.MaxAirSupply")) {
|
|
--
|
|
2.34.1
|
|
|