From 9489572907e4e8960020592fabade3510773d62e Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 22 Feb 2022 14:42:00 -0800 Subject: [PATCH] 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 --- patches/server/Execute-chunk-tasks-mid-tick.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patches/server/Execute-chunk-tasks-mid-tick.patch b/patches/server/Execute-chunk-tasks-mid-tick.patch index 9aba6f8d0..8f95ce816 100644 --- a/patches/server/Execute-chunk-tasks-mid-tick.patch +++ b/patches/server/Execute-chunk-tasks-mid-tick.patch @@ -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 void guardEntityTick(Consumer tickConsumer, T entity) { try {