2023-06-08 17:32:29 +10:00
|
|
|
From e8962e06bc7027e318fc59ea38de68fd3eefc9fa Mon Sep 17 00:00:00 2001
|
2014-04-12 14:18:37 +10:00
|
|
|
From: DerFlash <bte@freenet.de>
|
|
|
|
Date: Tue, 9 Jul 2013 00:11:12 +0200
|
|
|
|
Subject: [PATCH] Save ticks lived to nbttag
|
|
|
|
|
|
|
|
|
2021-03-16 09:00:00 +11:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
2023-06-08 01:30:00 +10:00
|
|
|
index 912cade1c..e83db7454 100644
|
2021-03-16 09:00:00 +11:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2023-06-08 01:30:00 +10:00
|
|
|
@@ -1936,6 +1936,7 @@ public abstract class Entity implements INamableTileEntity, EntityAccess, IComma
|
2022-01-23 09:11:06 +11:00
|
|
|
if (maxAirTicks != getDefaultMaxAirSupply()) {
|
|
|
|
nbttagcompound.putInt("Bukkit.MaxAirSupply", getMaxAirSupply());
|
2020-08-26 18:38:43 +10:00
|
|
|
}
|
2021-11-22 09:00:00 +11:00
|
|
|
+ nbttagcompound.putInt("Spigot.ticksLived", this.tickCount);
|
2014-04-12 14:18:37 +10:00
|
|
|
// CraftBukkit end
|
2018-07-15 10:00:00 +10:00
|
|
|
IChatBaseComponent ichatbasecomponent = this.getCustomName();
|
|
|
|
|
2023-06-08 01:30:00 +10:00
|
|
|
@@ -2094,6 +2095,11 @@ public abstract class Entity implements INamableTileEntity, EntityAccess, IComma
|
2022-05-03 23:13:49 +10:00
|
|
|
}
|
2014-04-12 14:18:37 +10:00
|
|
|
|
2022-05-03 23:13:49 +10:00
|
|
|
// CraftBukkit start
|
|
|
|
+ // Spigot start
|
|
|
|
+ if (this instanceof EntityLiving) {
|
2021-06-11 15:00:00 +10:00
|
|
|
+ this.tickCount = nbttagcompound.getInt("Spigot.ticksLived");
|
2022-05-03 23:13:49 +10:00
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
|
|
|
this.persist = !nbttagcompound.contains("Bukkit.persist") || nbttagcompound.getBoolean("Bukkit.persist");
|
2023-03-04 09:42:36 +11:00
|
|
|
this.visibleByDefault = !nbttagcompound.contains("Bukkit.visibleByDefault") || nbttagcompound.getBoolean("Bukkit.visibleByDefault");
|
2022-05-03 23:13:49 +10:00
|
|
|
// SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
2014-04-12 14:18:37 +10:00
|
|
|
--
|
2023-06-08 01:30:00 +10:00
|
|
|
2.40.1
|
2014-04-12 14:18:37 +10:00
|
|
|
|