diff --git a/leaf-server/minecraft-patches/features/0164-Optimise-BlockEntities-tickersInLevel.patch b/leaf-server/minecraft-patches/features/0164-Optimize-BlockEntities-tickersInLevel.patch similarity index 81% rename from leaf-server/minecraft-patches/features/0164-Optimise-BlockEntities-tickersInLevel.patch rename to leaf-server/minecraft-patches/features/0164-Optimize-BlockEntities-tickersInLevel.patch index 1ad19b8d..ae5d6817 100644 --- a/leaf-server/minecraft-patches/features/0164-Optimise-BlockEntities-tickersInLevel.patch +++ b/leaf-server/minecraft-patches/features/0164-Optimize-BlockEntities-tickersInLevel.patch @@ -1,11 +1,11 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Taiyou06 Date: Thu, 8 May 2025 13:30:07 +0200 -Subject: [PATCH] Optimise BlockEntities tickersInLevel +Subject: [PATCH] Optimize BlockEntities tickersInLevel diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java -index 546fb78339c005ed71142cb3c894f816b8c72d08..e6eab6929b08503c49debbbd25497ffedad438e1 100644 +index 546fb78339c005ed71142cb3c894f816b8c72d08..a90bf0d80ae4dac9b19b8e467b402917cc19a271 100644 --- a/net/minecraft/world/level/chunk/LevelChunk.java +++ b/net/minecraft/world/level/chunk/LevelChunk.java @@ -72,7 +72,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p @@ -13,7 +13,7 @@ index 546fb78339c005ed71142cb3c894f816b8c72d08..e6eab6929b08503c49debbbd25497ffe } }; - private final Map tickersInLevel = Maps.newHashMap(); -+ private final Map tickersInLevel = org.dreeam.leaf.config.modules.opt.OptimiseBlockEntities.enabled ? new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>() : Maps.newHashMap(); // Leaf - Optimise BlockEntities tickersInLevel ++ private final Map tickersInLevel = org.dreeam.leaf.config.modules.opt.OptimizeBlockEntities.enabled ? new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>() : Maps.newHashMap(); // Leaf - Optimise BlockEntities tickersInLevel public boolean loaded; public final ServerLevel level; // CraftBukkit - type @Nullable diff --git a/leaf-server/minecraft-patches/features/0192-Paper-Fix-infinite-loop-in-RegionFile-IO.patch b/leaf-server/minecraft-patches/features/0192-Paper-Fix-infinite-loop-in-RegionFile-IO.patch index 64550a29..8efc83f0 100644 --- a/leaf-server/minecraft-patches/features/0192-Paper-Fix-infinite-loop-in-RegionFile-IO.patch +++ b/leaf-server/minecraft-patches/features/0192-Paper-Fix-infinite-loop-in-RegionFile-IO.patch @@ -1,11 +1,19 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Taiyou06 -Date: Mon, 9 Jun 2025 12:00:57 +0200 +From: Spottedleaf +Date: Mon, 9 Jun 2025 02:46:34 -0700 Subject: [PATCH] Paper: Fix infinite loop in RegionFile IO +Original license: GPLv3 +Original project: https://github.com/PaperMC/Paper + +https://github.com/PaperMC/Paper/commit/519e4224b1ba73a99c58c8fc53aab003eb6af37a + +If an exception is thrown during decompress then the read process +would be started again, which of course would eventually throw in +the decompress process. diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java -index 60ed8cff397c964323fbda203ebfab3c7c9a873b..32ee1d3a0ae67738a65545e6a0046a12fb940fa4 100644 +index 60ed8cff397c964323fbda203ebfab3c7c9a873b..88207a3afd0260f572c7f54003d566c2c1cb1633 100644 --- a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java +++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java @@ -1143,7 +1143,7 @@ public final class MoonriseRegionFileIO { @@ -13,7 +21,7 @@ index 60ed8cff397c964323fbda203ebfab3c7c9a873b..32ee1d3a0ae67738a65545e6a0046a12 } - if (compoundTag == null) { -+ if (throwable == null && compoundTag == null) { ++ if (throwable == null && compoundTag == null) { // Paper - Fix infinite loop in RegionFile IO // need to re-try from the start this.scheduleReadIO(); return; diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/OptimiseBlockEntities.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/OptimiseBlockEntities.java deleted file mode 100644 index e1ddf5eb..00000000 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/OptimiseBlockEntities.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.dreeam.leaf.config.modules.opt; - -import org.dreeam.leaf.config.ConfigModules; -import org.dreeam.leaf.config.EnumConfigCategory; - -public class OptimiseBlockEntities extends ConfigModules { - - public String getBasePath() { - return EnumConfigCategory.PERF.getBaseKeyName(); - } - - public static boolean enabled = true; - - @Override - public void onLoaded() { - enabled = config.getBoolean(getBasePath() + ".optimise-block-entities", enabled); - } -} diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/OptimizeBlockEntities.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/OptimizeBlockEntities.java new file mode 100644 index 00000000..4e76dea4 --- /dev/null +++ b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/OptimizeBlockEntities.java @@ -0,0 +1,24 @@ +package org.dreeam.leaf.config.modules.opt; + +import org.dreeam.leaf.config.ConfigModules; +import org.dreeam.leaf.config.EnumConfigCategory; + +public class OptimizeBlockEntities extends ConfigModules { + + public String getBasePath() { + return EnumConfigCategory.PERF.getBaseKeyName(); + } + + public static boolean enabled = true; + + @Override + public void onLoaded() { + // Transfer old config + Boolean optimiseBlockEntities = config.getBoolean(getBasePath() + ".optimise-block-entities"); + if (optimiseBlockEntities != null && optimiseBlockEntities) { + enabled = true; + } + + enabled = config.getBoolean(getBasePath() + ".optimize-block-entities", enabled); + } +} diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/OptimizePlayerMovementProcessing.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/OptimizePlayerMovementProcessing.java index 3f407850..f8016d34 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/OptimizePlayerMovementProcessing.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/OptimizePlayerMovementProcessing.java @@ -17,6 +17,5 @@ public class OptimizePlayerMovementProcessing extends ConfigModules { Whether to optimize player movement processing by skipping unnecessary edge checks and avoiding redundant view distance updates.""", """ 是否优化玩家移动处理,跳过不必要的边缘检查并避免冗余的视距更新。""")); - } } diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/ReduceChunkSourceUpdates.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/ReduceChunkSourceUpdates.java index e89a0ad2..77fb1a41 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/ReduceChunkSourceUpdates.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/ReduceChunkSourceUpdates.java @@ -15,7 +15,7 @@ public class ReduceChunkSourceUpdates extends ConfigModules { public void onLoaded() { enabled = config.getBoolean(getBasePath() + ".enabled", enabled, config.pickStringRegionBased( - "Reduces chunk source updates on inter-chunk player moves. (Recommended to enable)", + "Reduces chunk source updates on inter-chunk player moves.", "减少玩家跨区块移动时的区块源更新。" ) );