mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 06:40:05 +03:00
34 lines
1.5 KiB
Diff
34 lines
1.5 KiB
Diff
From 323c19573e433961712486cae5be22aa3e61d253 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 09fe885aa..1931b02e7 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -1747,6 +1747,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();
|
|
|
|
@@ -1903,6 +1904,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.25.1
|
|
|