From 2331dad0a0718f731eed4db2e25f7d4bbd4d0873 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 3 Dec 2024 21:03:25 +0100 Subject: [PATCH] Even more work --- ...032-Separate-dimensiondata-executor.patch} | 33 ++++++++++++------- ...-send-Banner-patterns-to-the-client.patch} | 6 ++-- .../1036-Rewrite-dataconverter-system.patch | 0 3 files changed, 24 insertions(+), 15 deletions(-) rename patches/{unapplied/server/1034-Separate-dimensiondata-executor.patch => server/1032-Separate-dimensiondata-executor.patch} (62%) rename patches/{unapplied/server/1035-Always-send-Banner-patterns-to-the-client.patch => server/1033-Always-send-Banner-patterns-to-the-client.patch} (90%) rename patches/{unapplied => }/server/1036-Rewrite-dataconverter-system.patch (100%) diff --git a/patches/unapplied/server/1034-Separate-dimensiondata-executor.patch b/patches/server/1032-Separate-dimensiondata-executor.patch similarity index 62% rename from patches/unapplied/server/1034-Separate-dimensiondata-executor.patch rename to patches/server/1032-Separate-dimensiondata-executor.patch index 40c89f1045..901507d860 100644 --- a/patches/unapplied/server/1034-Separate-dimensiondata-executor.patch +++ b/patches/server/1032-Separate-dimensiondata-executor.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Separate dimensiondata executor diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java -index 276ad77ecb274b6cd454d0f92457964a8eaa5824..1360aa8202542d3d0f32247f1123575fc2c38ff1 100644 +index 1a31024b46a5d7960f1e0f172f8ebcf396dd3139..38ffa1c4c204f73746c4b87127de92b631548eb1 100644 --- a/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java @@ -94,6 +94,7 @@ public class Util { @@ -16,7 +16,7 @@ index 276ad77ecb274b6cd454d0f92457964a8eaa5824..1360aa8202542d3d0f32247f1123575f private static final TracingExecutor DOWNLOAD_POOL = makeIoExecutor("Download-", true); // Paper start - don't submit BLOCKING PROFILE LOOKUPS to the world gen thread public static final ExecutorService PROFILE_EXECUTOR = Executors.newFixedThreadPool(2, new java.util.concurrent.ThreadFactory() { -@@ -260,6 +261,21 @@ public class Util { +@@ -265,6 +266,21 @@ public class Util { })); } @@ -39,15 +39,24 @@ index 276ad77ecb274b6cd454d0f92457964a8eaa5824..1360aa8202542d3d0f32247f1123575f throw t instanceof RuntimeException ? (RuntimeException)t : new RuntimeException(t); } diff --git a/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java b/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java -index d16f124e0371ce943298c8d7d9bfac21e98cf885..8212f2dfba5c2eee5a823b5217fb43dc870d228a 100644 +index 3c3b18e5b419a0f785467c511dcdd65873ad0989..9272c91e0ee489091fdf1fedcf3801c070e9e82a 100644 --- a/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java +++ b/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java -@@ -155,7 +155,7 @@ public class DimensionDataStorage implements AutoCloseable { - } catch (IOException var3) { - LOGGER.error("Could not save data to {}", path.getFileName(), var3); - } -- }, Util.ioPool()); -+ }, Util.DIMENSION_DATA_IO_POOL); // Paper - Separate dimension data IO pool - } - - public void saveAndJoin() { +@@ -139,7 +139,7 @@ public class DimensionDataStorage implements AutoCloseable { + } else { + int i = Util.maxAllowedExecutorThreads(); + int j = map.size(); +- if (j > i) { ++ if (false && j > i) { // Paper - Separate dimension data IO pool; just throw them into the fixed pool queue + this.pendingWriteFuture = this.pendingWriteFuture.thenCompose(object -> { + List> list = new ArrayList<>(i); + int k = Mth.positiveCeilDiv(j, i); +@@ -160,7 +160,7 @@ public class DimensionDataStorage implements AutoCloseable { + v -> CompletableFuture.allOf( + map.entrySet() + .stream() +- .map(entry -> CompletableFuture.runAsync(() -> tryWrite(entry.getKey(), entry.getValue()), Util.ioPool())) ++ .map(entry -> CompletableFuture.runAsync(() -> tryWrite(entry.getKey(), entry.getValue()), Util.DIMENSION_DATA_IO_POOL)) // Paper - Separate dimension data IO pool + .toArray(CompletableFuture[]::new) + ) + ); diff --git a/patches/unapplied/server/1035-Always-send-Banner-patterns-to-the-client.patch b/patches/server/1033-Always-send-Banner-patterns-to-the-client.patch similarity index 90% rename from patches/unapplied/server/1035-Always-send-Banner-patterns-to-the-client.patch rename to patches/server/1033-Always-send-Banner-patterns-to-the-client.patch index a5951afc90..2810d7155c 100644 --- a/patches/unapplied/server/1035-Always-send-Banner-patterns-to-the-client.patch +++ b/patches/server/1033-Always-send-Banner-patterns-to-the-client.patch @@ -9,10 +9,10 @@ flow for them, this is not all too surprising. So, we shall resort to always sending the patterns over the network for update packets. diff --git a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java -index 98bc87fe5d153cc4927f7e1b4a02f61d9dd019a0..9528935a120f7d5a1fdb1a796854478e8a83f833 100644 +index 27fd8b88dc1433c1df1e09604a3cc546bfa0d2b9..1f3e1c7128b9a0f27f2df39a8970050c5313d7a3 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java -@@ -63,7 +63,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable { +@@ -57,7 +57,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable { @Override protected void saveAdditional(CompoundTag nbt, HolderLookup.Provider registries) { super.saveAdditional(nbt, registries); @@ -21,7 +21,7 @@ index 98bc87fe5d153cc4927f7e1b4a02f61d9dd019a0..9528935a120f7d5a1fdb1a796854478e nbt.put("patterns", (Tag) BannerPatternLayers.CODEC.encodeStart(registries.createSerializationContext(NbtOps.INSTANCE), this.patterns).getOrThrow()); } -@@ -95,9 +95,18 @@ public class BannerBlockEntity extends BlockEntity implements Nameable { +@@ -89,9 +89,18 @@ public class BannerBlockEntity extends BlockEntity implements Nameable { return ClientboundBlockEntityDataPacket.create(this); } diff --git a/patches/unapplied/server/1036-Rewrite-dataconverter-system.patch b/patches/server/1036-Rewrite-dataconverter-system.patch similarity index 100% rename from patches/unapplied/server/1036-Rewrite-dataconverter-system.patch rename to patches/server/1036-Rewrite-dataconverter-system.patch