Files
LuminolMC/luminol-server/minecraft-patches/features/0019-Do-not-store-tick-count-for-living-entities.patch
2025-02-11 12:06:21 +08:00

34 lines
2.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Fri, 7 Feb 2025 22:25:08 +0800
Subject: [PATCH] Do not store tick count for living entities
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 10b4c6749d173cb6c615f07b98103e2d7812a032..ce77b3263f524a617150ca4177daf06a4d7c4505 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -2488,7 +2488,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (this.maxAirTicks != this.getDefaultMaxAirSupply()) {
compound.putInt("Bukkit.MaxAirSupply", this.getMaxAirSupply());
}
- compound.putInt("Spigot.ticksLived", this.tickCount);
+ //compound.putInt("Spigot.ticksLived", this.tickCount); // Luminol - Do not store tick count for living entities
// CraftBukkit end
Component customName = this.getCustomName();
if (customName != null) {
@@ -2661,10 +2661,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
// CraftBukkit start
// Spigot start
- if (this instanceof net.minecraft.world.entity.LivingEntity) {
+ /*if (this instanceof net.minecraft.world.entity.LivingEntity) { // Luminol - Do not store tick count for living entities
this.tickCount = compound.getInt("Spigot.ticksLived");
- }
- // Spigot end
+ }*/
+ // Spigot end // Luminol - Do not store tick count for living entities
this.persist = !compound.contains("Bukkit.persist") || compound.getBoolean("Bukkit.persist");
this.visibleByDefault = !compound.contains("Bukkit.visibleByDefault") || compound.getBoolean("Bukkit.visibleByDefault");
// SPIGOT-6907: re-implement LivingEntity#setMaximumAir()