diff --git a/patches/unapplied/server/Correctly-handle-recursion-for-chunkholder-updates.patch b/patches/server/Correctly-handle-recursion-for-chunkholder-updates.patch similarity index 92% rename from patches/unapplied/server/Correctly-handle-recursion-for-chunkholder-updates.patch rename to patches/server/Correctly-handle-recursion-for-chunkholder-updates.patch index 21af0416d0..5970a60371 100644 --- a/patches/unapplied/server/Correctly-handle-recursion-for-chunkholder-updates.patch +++ b/patches/server/Correctly-handle-recursion-for-chunkholder-updates.patch @@ -17,7 +17,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + protected long updateCount; // Paper - correctly handle recursion protected void updateFutures(ChunkMap chunkStorage, Executor executor) { - io.papermc.paper.util.TickThread.ensureTickThread("Async ticket level update"); // Paper + long updateCount = ++this.updateCount; // Paper - correctly handle recursion ChunkStatus chunkstatus = ChunkHolder.getStatus(this.oldTicketLevel); ChunkStatus chunkstatus1 = ChunkHolder.getStatus(this.ticketLevel); @@ -34,4 +33,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - correctly handle recursion } // CraftBukkit end - CompletableFuture completablefuture; + diff --git a/patches/unapplied/server/Do-not-allow-ticket-level-changes-while-unloading-pl.patch b/patches/server/Do-not-allow-ticket-level-changes-while-unloading-pl.patch similarity index 95% rename from patches/unapplied/server/Do-not-allow-ticket-level-changes-while-unloading-pl.patch rename to patches/server/Do-not-allow-ticket-level-changes-while-unloading-pl.patch index 6d9604b554..ee7cf93730 100644 --- a/patches/unapplied/server/Do-not-allow-ticket-level-changes-while-unloading-pl.patch +++ b/patches/server/Do-not-allow-ticket-level-changes-while-unloading-pl.patch @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + boolean unloadingPlayerChunk = false; // Paper - do not allow ticket level changes while unloading chunks public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) { - super(new File(session.getDimensionPath(world.dimension()), "region"), dataFixer, dsync); + super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); this.visibleChunkMap = this.updatingChunkMap.clone(); @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -53,9 +53,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource { + } public boolean runDistanceManagerUpdates() { - if (distanceManager.delayDistanceManagerTick) return false; // Paper - Chunk priority + if (this.chunkMap.unloadingPlayerChunk) { net.minecraft.server.MinecraftServer.LOGGER.fatal("Cannot tick distance manager while unloading playerchunks", new Throwable()); throw new IllegalStateException("Cannot tick distance manager while unloading playerchunks"); } // Paper boolean flag = this.distanceManager.runAllUpdates(this.chunkMap); boolean flag1 = this.chunkMap.promoteChunkMap(); diff --git a/patches/unapplied/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch similarity index 98% rename from patches/unapplied/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch rename to patches/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch index 35a62c6cf2..90b9df4727 100644 --- a/patches/unapplied/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch +++ b/patches/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch @@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - special close for unloaded inventory public void doCloseContainer() { - this.containerMenu.removed((Player) this); + this.containerMenu.removed(this); diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/patches/unapplied/server/Fix-chunks-refusing-to-unload-at-low-TPS.patch b/patches/server/Fix-chunks-refusing-to-unload-at-low-TPS.patch similarity index 97% rename from patches/unapplied/server/Fix-chunks-refusing-to-unload-at-low-TPS.patch rename to patches/server/Fix-chunks-refusing-to-unload-at-low-TPS.patch index 345a36fd72..6561511508 100644 --- a/patches/unapplied/server/Fix-chunks-refusing-to-unload-at-low-TPS.patch +++ b/patches/server/Fix-chunks-refusing-to-unload-at-low-TPS.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - chunk.unpackTicks(); + return chunk; }); - }, (runnable) -> { diff --git a/patches/server/Make-CallbackExecutor-strict-again.patch b/patches/server/Make-CallbackExecutor-strict-again.patch index ff5c90ad43..7266cf0c7f 100644 --- a/patches/server/Make-CallbackExecutor-strict-again.patch +++ b/patches/server/Make-CallbackExecutor-strict-again.patch @@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - revert CB changes + org.spigotmc.AsyncCatcher.catchOp("Callback Executor execute"); + if (this.queued != null) { -+ MinecraftServer.LOGGER.fatal("Failed to schedule runnable", new IllegalStateException("Already queued")); ++ net.minecraft.server.MinecraftServer.LOGGER.fatal("Failed to schedule runnable", new IllegalStateException("Already queued")); + throw new IllegalStateException("Already queued"); + } + this.queued = runnable; diff --git a/patches/unapplied/server/Separate-lookup-locking-from-state-access-in-UserCac.patch b/patches/server/Separate-lookup-locking-from-state-access-in-UserCac.patch similarity index 100% rename from patches/unapplied/server/Separate-lookup-locking-from-state-access-in-UserCac.patch rename to patches/server/Separate-lookup-locking-from-state-access-in-UserCac.patch diff --git a/todo.txt b/todo.txt index 63c052e7a1..3cb70d5d28 100644 --- a/todo.txt +++ b/todo.txt @@ -23,3 +23,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 initial = blockState.getCollisionShape(world, mutableBlockPos, context).collide(axis3, box.move((double)(-mutableBlockPos.getX()), (double)(-mutableBlockPos.getY()), (double)(-mutableBlockPos.getZ())), initial); if (Math.abs(initial) < 1.0E-7D) { + + +check ChunkHolder#updateFutures async catcher