mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00
33 lines
1.6 KiB
Diff
33 lines
1.6 KiB
Diff
From e8962e06bc7027e318fc59ea38de68fd3eefc9fa 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 912cade1c..e83db7454 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -1936,6 +1936,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();
|
|
|
|
@@ -2094,6 +2095,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");
|
|
this.visibleByDefault = !nbttagcompound.contains("Bukkit.visibleByDefault") || nbttagcompound.getBoolean("Bukkit.visibleByDefault");
|
|
// SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
|
--
|
|
2.40.1
|
|
|