9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00

Correct optimize-block-entities config name to keep consistency

Co-Authored-By: Pascalpex <68245106+Pascalpex@users.noreply.github.com>
This commit is contained in:
Dreeam
2025-06-10 12:26:14 +08:00
parent 985513a2f7
commit b4ad51dbb5
6 changed files with 40 additions and 27 deletions

View File

@@ -1,11 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Taiyou06 <kaandindar21@gmail.com> From: Taiyou06 <kaandindar21@gmail.com>
Date: Thu, 8 May 2025 13:30:07 +0200 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 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 --- a/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/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 @@ -72,7 +72,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -13,7 +13,7 @@ index 546fb78339c005ed71142cb3c894f816b8c72d08..e6eab6929b08503c49debbbd25497ffe
} }
}; };
- private final Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> tickersInLevel = Maps.newHashMap(); - private final Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> tickersInLevel = Maps.newHashMap();
+ private final Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> 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<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> 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 boolean loaded;
public final ServerLevel level; // CraftBukkit - type public final ServerLevel level; // CraftBukkit - type
@Nullable @Nullable

View File

@@ -1,11 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Taiyou06 <kaandindar21@gmail.com> From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Mon, 9 Jun 2025 12:00:57 +0200 Date: Mon, 9 Jun 2025 02:46:34 -0700
Subject: [PATCH] Paper: Fix infinite loop in RegionFile IO 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 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 --- a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
+++ b/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 { @@ -1143,7 +1143,7 @@ public final class MoonriseRegionFileIO {
@@ -13,7 +21,7 @@ index 60ed8cff397c964323fbda203ebfab3c7c9a873b..32ee1d3a0ae67738a65545e6a0046a12
} }
- if (compoundTag == null) { - 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 // need to re-try from the start
this.scheduleReadIO(); this.scheduleReadIO();
return; return;

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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.""", Whether to optimize player movement processing by skipping unnecessary edge checks and avoiding redundant view distance updates.""",
""" """
是否优化玩家移动处理,跳过不必要的边缘检查并避免冗余的视距更新。""")); 是否优化玩家移动处理,跳过不必要的边缘检查并避免冗余的视距更新。"""));
} }
} }

View File

@@ -15,7 +15,7 @@ public class ReduceChunkSourceUpdates extends ConfigModules {
public void onLoaded() { public void onLoaded() {
enabled = config.getBoolean(getBasePath() + ".enabled", enabled, enabled = config.getBoolean(getBasePath() + ".enabled", enabled,
config.pickStringRegionBased( config.pickStringRegionBased(
"Reduces chunk source updates on inter-chunk player moves. (Recommended to enable)", "Reduces chunk source updates on inter-chunk player moves.",
"减少玩家跨区块移动时的区块源更新。" "减少玩家跨区块移动时的区块源更新。"
) )
); );