PaperMC/Spigot-Server-Patches/0389-Mark-entities-as-being-ticked-when-notifying-navigat.patch
Spottedleaf 49fdb18206
Timings changes (#3044)
* Timings changes

- Increment entity tick count only when an entity ticks
- Remove chunk inhabited timer
- Try finally entity timings

* Add activated entity ticks

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-03-19 02:03:32 -04:00

29 lines
1.1 KiB
Diff

From 2c601e0789d5d74301bd9154f2438d97e0ae95b6 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 28 Jul 2019 00:51:11 +0100
Subject: [PATCH] Mark entities as being ticked when notifying navigation
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 85c96467c1..5063544a44 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1396,6 +1396,7 @@ public class WorldServer extends World {
VoxelShape voxelshape1 = iblockdata1.getCollisionShape(this, blockposition);
if (VoxelShapes.c(voxelshape, voxelshape1, OperatorBoolean.NOT_SAME)) {
+ boolean wasTicking = this.tickingEntities; this.tickingEntities = true; // Paper
Iterator iterator = this.navigators.iterator();
while (iterator.hasNext()) {
@@ -1406,6 +1407,7 @@ public class WorldServer extends World {
}
}
+ this.tickingEntities = wasTicking; // Paper
}
}
--
2.25.2