2025-06-18 01:15:00 +10:00
|
|
|
From 283bbf61e23ff4f490359a1cc0ee55340c0ebed2 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
|
2025-06-18 01:15:00 +10:00
|
|
|
index 68a1b95c4..8d8daa044 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
|
2025-06-18 01:15:00 +10:00
|
|
|
@@ -2305,6 +2305,7 @@ public abstract class Entity implements SyncedDataHolder, INamableTileEntity, En
|
2022-01-23 09:11:06 +11:00
|
|
|
if (maxAirTicks != getDefaultMaxAirSupply()) {
|
2025-06-18 01:15:00 +10:00
|
|
|
valueoutput.putInt("Bukkit.MaxAirSupply", getMaxAirSupply());
|
2020-08-26 18:38:43 +10:00
|
|
|
}
|
2025-06-18 01:15:00 +10:00
|
|
|
+ valueoutput.putInt("Spigot.ticksLived", this.tickCount);
|
2014-04-12 14:18:37 +10:00
|
|
|
// CraftBukkit end
|
2025-06-18 01:15:00 +10:00
|
|
|
valueoutput.storeNullable("CustomName", ComponentSerialization.CODEC, this.getCustomName());
|
|
|
|
if (this.isCustomNameVisible()) {
|
|
|
|
@@ -2429,6 +2430,11 @@ public abstract class Entity implements SyncedDataHolder, INamableTileEntity, En
|
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) {
|
2025-06-18 01:15:00 +10:00
|
|
|
+ this.tickCount = valueinput.getIntOr("Spigot.ticksLived", this.tickCount);
|
2022-05-03 23:13:49 +10:00
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
2025-06-18 01:15:00 +10:00
|
|
|
this.persist = valueinput.getBooleanOr("Bukkit.persist", this.persist);
|
|
|
|
this.visibleByDefault = valueinput.getBooleanOr("Bukkit.visibleByDefault", this.visibleByDefault);
|
2022-05-03 23:13:49 +10:00
|
|
|
// SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
2014-04-12 14:18:37 +10:00
|
|
|
--
|
2025-03-26 03:05:00 +11:00
|
|
|
2.49.0
|
2014-04-12 14:18:37 +10:00
|
|
|
|