Execute mid tick tasks during tile entity ticking

It was never done here in the past since the old TE management
system was barely functional, and could not handle chunk loading
remotely well
This commit is contained in:
Spottedleaf 2022-02-22 14:42:00 -08:00
parent 172adf699b
commit 9489572907

View File

@ -162,6 +162,18 @@ diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Spigot end
} else if (this.shouldTickBlocksAt(ChunkPos.asLong(tickingblockentity.getPos()))) {
tickingblockentity.tick();
+ // Paper start - execute chunk tasks during tick
+ if ((this.tileTickPosition & 7) == 0) {
+ MinecraftServer.getServer().executeMidTickTasks();
+ }
+ // Paper end - execute chunk tasks during tick
}
}
this.blockEntityTickers.removeAll(toRemove);
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public <T extends Entity> void guardEntityTick(Consumer<T> tickConsumer, T entity) {
try {