diff --git a/Spigot-Server-Patches/0390-Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/0390-Asynchronous-chunk-IO-and-loading.patch index 76cb500e43..53c93a4791 100644 --- a/Spigot-Server-Patches/0390-Asynchronous-chunk-IO-and-loading.patch +++ b/Spigot-Server-Patches/0390-Asynchronous-chunk-IO-and-loading.patch @@ -1,4 +1,4 @@ -From 69897be16837751a2d87f41c6fb978442000b145 Mon Sep 17 00:00:00 2001 +From e3c9ff6e47758371f5ee677cede836b6756b5af9 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sat, 13 Jul 2019 09:23:10 -0700 Subject: [PATCH] Asynchronous chunk IO and loading @@ -121,7 +121,7 @@ tasks required to be executed by the chunk load task (i.e lighting and some poi tasks). diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -index 27ce4a82..30bafb21 100644 +index 27ce4a828e..30bafb214b 100644 --- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java @@ -61,6 +61,17 @@ public class WorldTimingsHandler { @@ -161,7 +161,7 @@ index 27ce4a82..30bafb21 100644 public static Timing getTickList(WorldServer worldserver, String timingsType) { diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index dbd14399..6916ed30 100644 +index dbd1439970..6916ed30c4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -1,5 +1,6 @@ @@ -237,7 +237,7 @@ index dbd14399..6916ed30 100644 + } } diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java -index 23626bef..1edcecd2 100644 +index 23626bef3a..1edcecd2ee 100644 --- a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java @@ -9,6 +9,7 @@ import java.util.concurrent.Executors; @@ -318,7 +318,7 @@ index 23626bef..1edcecd2 100644 diff --git a/src/main/java/com/destroystokyo/paper/io/IOUtil.java b/src/main/java/com/destroystokyo/paper/io/IOUtil.java new file mode 100644 -index 00000000..5af0ac3d +index 0000000000..5af0ac3d9e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/IOUtil.java @@ -0,0 +1,62 @@ @@ -386,7 +386,7 @@ index 00000000..5af0ac3d +} diff --git a/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java new file mode 100644 -index 00000000..4f10a831 +index 0000000000..4f10a8311e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java @@ -0,0 +1,661 @@ @@ -1053,7 +1053,7 @@ index 00000000..4f10a831 +} diff --git a/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java b/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java new file mode 100644 -index 00000000..97f2e433 +index 0000000000..97f2e433c4 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java @@ -0,0 +1,277 @@ @@ -1336,7 +1336,7 @@ index 00000000..97f2e433 +} diff --git a/src/main/java/com/destroystokyo/paper/io/QueueExecutorThread.java b/src/main/java/com/destroystokyo/paper/io/QueueExecutorThread.java new file mode 100644 -index 00000000..ee906b59 +index 0000000000..ee906b594b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/QueueExecutorThread.java @@ -0,0 +1,241 @@ @@ -1583,7 +1583,7 @@ index 00000000..ee906b59 +} diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java new file mode 100644 -index 00000000..305da478 +index 0000000000..305da47868 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java @@ -0,0 +1,149 @@ @@ -1738,7 +1738,7 @@ index 00000000..305da478 +} diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java new file mode 100644 -index 00000000..60312b85 +index 0000000000..60312b85f9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java @@ -0,0 +1,112 @@ @@ -1856,7 +1856,7 @@ index 00000000..60312b85 +} diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTask.java new file mode 100644 -index 00000000..1dfa8abf +index 0000000000..1dfa8abfd8 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTask.java @@ -0,0 +1,40 @@ @@ -1902,7 +1902,7 @@ index 00000000..1dfa8abf +} diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java new file mode 100644 -index 00000000..2b20c159 +index 0000000000..2b20c159f6 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java @@ -0,0 +1,492 @@ @@ -2399,7 +2399,7 @@ index 00000000..2b20c159 + +} diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 262055fc..68bac9a3 100644 +index 262055fccd..68bac9a3c0 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -297,11 +297,137 @@ public class ChunkProviderServer extends IChunkProvider { @@ -2569,7 +2569,7 @@ index 262055fc..68bac9a3 100644 } finally { playerChunkMap.callbackExecutor.run(); diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 8816c90e..1298a07d 100644 +index 8816c90e2d..1298a07dc7 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -6,6 +6,7 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet; @@ -2834,7 +2834,7 @@ index 8816c90e..1298a07d 100644 nbttagcompound1.set("PostProcessing", a(ichunkaccess.l())); diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java -index 134a4f0b..40ce30cd 100644 +index 134a4f0b7d..40ce30cdc2 100644 --- a/src/main/java/net/minecraft/server/ChunkStatus.java +++ b/src/main/java/net/minecraft/server/ChunkStatus.java @@ -153,6 +153,7 @@ public class ChunkStatus { @@ -2870,7 +2870,7 @@ index 134a4f0b..40ce30cd 100644 return this.c() >= chunkstatus.c(); } diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -index 7e5ece9d..cfe43e88 100644 +index 7e5ece9d50..cfe43e882e 100644 --- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java @@ -91,7 +91,7 @@ public abstract class IAsyncTaskHandler implements Mailbox { @@ -3894,7 +3894,7 @@ index 4cf28bc2..6e0d0a54 100644 public static TicketType a(String s, Comparator comparator) { return new TicketType<>(s, comparator, 0L); diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java -index c999f8c9..b59ef1a6 100644 +index c999f8c9bf..b59ef1a633 100644 --- a/src/main/java/net/minecraft/server/VillagePlace.java +++ b/src/main/java/net/minecraft/server/VillagePlace.java @@ -24,8 +24,16 @@ public class VillagePlace extends RegionFileSection { @@ -3983,7 +3983,7 @@ index c999f8c9..b59ef1a6 100644 HAS_SPACE(VillagePlaceRecord::d), IS_OCCUPIED(VillagePlaceRecord::e), ANY((villageplacerecord) -> { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index e3913952..b967f6a1 100644 +index e3913952d9..3db0ad0a46 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -82,6 +82,79 @@ public class WorldServer extends World { @@ -4075,17 +4075,21 @@ index e3913952..b967f6a1 100644 } // CraftBukkit start -@@ -1675,7 +1750,7 @@ public class WorldServer extends World { +@@ -1675,7 +1750,11 @@ public class WorldServer extends World { } MCUtil.getSpiralOutChunks(spawn, radiusInBlocks >> 4).forEach(pair -> { - getChunkProvider().getChunkAtMainThread(pair.x, pair.z); -+ getChunkProvider().getChunkAtAsynchronously(pair.x, pair.z, true, (c) -> {}); ++ if (com.destroystokyo.paper.PaperConfig.asyncChunks) { ++ getChunkProvider().getChunkAtAsynchronously(pair.x, pair.z, true, (c) -> {}); ++ } else { ++ getChunkProvider().getChunkAtMainThread(pair.x, pair.z); ++ } }); } public void removeTicketsForSpawn(int radiusInBlocks, BlockPosition spawn) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a71bb865..1d275520 100644 +index a71bb86508..1d275520fb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -554,22 +554,23 @@ public class CraftWorld implements World { @@ -4146,7 +4150,7 @@ index a71bb865..1d275520 100644 // Spigot start @Override diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 07936eeb..5bdcdcf9 100644 +index 07936eeba2..5bdcdcf9e8 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -6,6 +6,7 @@ import java.lang.management.ThreadInfo; @@ -4166,5 +4170,5 @@ index 07936eeb..5bdcdcf9 100644 log.log( Level.SEVERE, "------------------------------" ); // -- -2.25.1.windows.1 +2.25.1