Separate tick count to ensure vanilla parity (#12077)

This commit is contained in:
Creeam
2025-02-16 11:46:37 -08:00
committed by GitHub
parent b9023b5dc3
commit a3781ff3be
8 changed files with 54 additions and 46 deletions

View File

@@ -460,7 +460,7 @@
}
public void resetEmptyTime() {
@@ -746,18 +_,45 @@
@@ -746,18 +_,46 @@
}
}
@@ -487,6 +487,7 @@
entity.setOldPosAndRot();
ProfilerFiller profilerFiller = Profiler.get();
entity.tickCount++;
+ entity.totalEntityAge++; // Paper - age-like counter for all entities
profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString());
profilerFiller.incrementCounter("tickNonPassenger");
entity.tick();
@@ -506,7 +507,12 @@
}
private void tickPassenger(Entity ridingEntity, Entity passengerEntity) {
@@ -770,6 +_,7 @@
@@ -766,10 +_,12 @@
} else if (passengerEntity instanceof Player || this.entityTickList.contains(passengerEntity)) {
passengerEntity.setOldPosAndRot();
passengerEntity.tickCount++;
+ passengerEntity.totalEntityAge++; // Paper - age-like counter for all entities
ProfilerFiller profilerFiller = Profiler.get();
profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(passengerEntity.getType()).toString());
profilerFiller.incrementCounter("tickPassenger");
passengerEntity.rideTick();