From 28d29498df96e65349499fc392d16c07dbe2bde4 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 24 Jun 2025 20:48:59 +0800 Subject: [PATCH] refactor: remove a no need patch --- ...ix-chunk-iteration-self-modification.patch | 42 ------------------- ... 0049-Fix-creative-player-item-pick.patch} | 0 ...50-Fix-entity-portal-teleport-speed.patch} | 0 ...51-Fix-off-tickregion-sync-teleport.patch} | 0 ...ix-uncorrected-death-check-of-folia.patch} | 0 ...-entity-was-moving-to-another-regio.patch} | 0 ...olia-off-region-POI-accessing-issue.patch} | 0 ...reature-spawn-event-unless-some-plu.patch} | 0 ...affinity.patch => 0056-Cpu-affinity.patch} | 0 ...porarily-fix-teleport-yam-and-pitch.patch} | 0 10 files changed, 42 deletions(-) delete mode 100644 luminol-server/minecraft-patches/features/0049-Fix-chunk-iteration-self-modification.patch rename luminol-server/minecraft-patches/features/{0050-Fix-creative-player-item-pick.patch => 0049-Fix-creative-player-item-pick.patch} (100%) rename luminol-server/minecraft-patches/features/{0051-Fix-entity-portal-teleport-speed.patch => 0050-Fix-entity-portal-teleport-speed.patch} (100%) rename luminol-server/minecraft-patches/features/{0052-Fix-off-tickregion-sync-teleport.patch => 0051-Fix-off-tickregion-sync-teleport.patch} (100%) rename luminol-server/minecraft-patches/features/{0053-Fix-uncorrected-death-check-of-folia.patch => 0052-Fix-uncorrected-death-check-of-folia.patch} (100%) rename luminol-server/minecraft-patches/features/{0054-Teleport-async-if-entity-was-moving-to-another-regio.patch => 0053-Teleport-async-if-entity-was-moving-to-another-regio.patch} (100%) rename luminol-server/minecraft-patches/features/{0055-Try-fixing-folia-off-region-POI-accessing-issue.patch => 0054-Try-fixing-folia-off-region-POI-accessing-issue.patch} (100%) rename luminol-server/minecraft-patches/features/{0056-Do-not-fire-pre-creature-spawn-event-unless-some-plu.patch => 0055-Do-not-fire-pre-creature-spawn-event-unless-some-plu.patch} (100%) rename luminol-server/minecraft-patches/features/{0057-Cpu-affinity.patch => 0056-Cpu-affinity.patch} (100%) rename luminol-server/minecraft-patches/features/{0058-Temporarily-fix-teleport-yam-and-pitch.patch => 0057-Temporarily-fix-teleport-yam-and-pitch.patch} (100%) diff --git a/luminol-server/minecraft-patches/features/0049-Fix-chunk-iteration-self-modification.patch b/luminol-server/minecraft-patches/features/0049-Fix-chunk-iteration-self-modification.patch deleted file mode 100644 index 2c75952..0000000 --- a/luminol-server/minecraft-patches/features/0049-Fix-chunk-iteration-self-modification.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MrHua269 -Date: Sun, 25 May 2025 23:05:15 +0800 -Subject: [PATCH] Fix chunk iteration self modification - -We use the old-like logics which is in 1.21.4. -Might fixes: https://github.com/PaperMC/Folia/issues/363 - -diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java -index 3574978c59cacef24657f86c4002c93d5d17af47..c3d20a8dcc0d2764385cff09fe5a65247e863624 100644 ---- a/net/minecraft/server/level/ServerChunkCache.java -+++ b/net/minecraft/server/level/ServerChunkCache.java -@@ -173,14 +173,26 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - // 2. _removes_ are impossible at this stage in the tick - final LevelChunk[] raw = entityTickingChunks.getRawDataUnchecked(); - final int size = entityTickingChunks.size(); foliaProfiler.addCounter(ca.spottedleaf.leafprofiler.LProfilerRegistry.RANDOM_CHUNK_TICK_COUNT, (long)size); // Folia - profiler -+ // Luminol start - Fix chunk iteration self modification - use copy of raw array -+ final LevelChunk[] rawCopy = new LevelChunk[size]; -+ System.arraycopy(raw, 0, rawCopy, 0, size); -+ // Luminol end - -- java.util.Objects.checkFromToIndex(0, size, raw.length); -+ this.level.getServer().moonrise$executeMidTickTasks(); // Luminol - Fix chunk iteration self modification - try executing mid-tick tasks for once chunk system task parsing -+ java.util.Objects.checkFromToIndex(0, size, rawCopy.length); // Luminol - Fix chunk iteration self modification - use copy of raw array - for (int i = 0; i < size; ++i) { -- world.tickChunk(raw[i], randomTickSpeed); -+ // Luminol start - Fix chunk iteration self modification -+ final LevelChunk chunk = rawCopy[i]; -+ -+ if (!chunk.getFullStatus().isOrAfter(FullChunkStatus.ENTITY_TICKING)) { -+ continue; // skip chunks which are not entity ticking(probably downgraded from last iteration) -+ } -+ // Luminol end -+ world.tickChunk(chunk, randomTickSpeed); // Luminol - Fix chunk iteration self modification - use copy of raw array - - // call mid-tick tasks for chunk system - if ((i & 7) == 0) { -- //((ca.spottedleaf.moonrise.patches.chunk_system.server.ChunkSystemMinecraftServer)this.level.getServer()).moonrise$executeMidTickTasks(); // Folia - TODO restore this -+ ((ca.spottedleaf.moonrise.patches.chunk_system.server.ChunkSystemMinecraftServer)this.level.getServer()).moonrise$executeMidTickTasks(); // Folia - TODO restore this // Luminol - Fix chunk iteration self modification - restore mid tasks here - continue; - } - } diff --git a/luminol-server/minecraft-patches/features/0050-Fix-creative-player-item-pick.patch b/luminol-server/minecraft-patches/features/0049-Fix-creative-player-item-pick.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0050-Fix-creative-player-item-pick.patch rename to luminol-server/minecraft-patches/features/0049-Fix-creative-player-item-pick.patch diff --git a/luminol-server/minecraft-patches/features/0051-Fix-entity-portal-teleport-speed.patch b/luminol-server/minecraft-patches/features/0050-Fix-entity-portal-teleport-speed.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0051-Fix-entity-portal-teleport-speed.patch rename to luminol-server/minecraft-patches/features/0050-Fix-entity-portal-teleport-speed.patch diff --git a/luminol-server/minecraft-patches/features/0052-Fix-off-tickregion-sync-teleport.patch b/luminol-server/minecraft-patches/features/0051-Fix-off-tickregion-sync-teleport.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0052-Fix-off-tickregion-sync-teleport.patch rename to luminol-server/minecraft-patches/features/0051-Fix-off-tickregion-sync-teleport.patch diff --git a/luminol-server/minecraft-patches/features/0053-Fix-uncorrected-death-check-of-folia.patch b/luminol-server/minecraft-patches/features/0052-Fix-uncorrected-death-check-of-folia.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0053-Fix-uncorrected-death-check-of-folia.patch rename to luminol-server/minecraft-patches/features/0052-Fix-uncorrected-death-check-of-folia.patch diff --git a/luminol-server/minecraft-patches/features/0054-Teleport-async-if-entity-was-moving-to-another-regio.patch b/luminol-server/minecraft-patches/features/0053-Teleport-async-if-entity-was-moving-to-another-regio.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0054-Teleport-async-if-entity-was-moving-to-another-regio.patch rename to luminol-server/minecraft-patches/features/0053-Teleport-async-if-entity-was-moving-to-another-regio.patch diff --git a/luminol-server/minecraft-patches/features/0055-Try-fixing-folia-off-region-POI-accessing-issue.patch b/luminol-server/minecraft-patches/features/0054-Try-fixing-folia-off-region-POI-accessing-issue.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0055-Try-fixing-folia-off-region-POI-accessing-issue.patch rename to luminol-server/minecraft-patches/features/0054-Try-fixing-folia-off-region-POI-accessing-issue.patch diff --git a/luminol-server/minecraft-patches/features/0056-Do-not-fire-pre-creature-spawn-event-unless-some-plu.patch b/luminol-server/minecraft-patches/features/0055-Do-not-fire-pre-creature-spawn-event-unless-some-plu.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0056-Do-not-fire-pre-creature-spawn-event-unless-some-plu.patch rename to luminol-server/minecraft-patches/features/0055-Do-not-fire-pre-creature-spawn-event-unless-some-plu.patch diff --git a/luminol-server/minecraft-patches/features/0057-Cpu-affinity.patch b/luminol-server/minecraft-patches/features/0056-Cpu-affinity.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0057-Cpu-affinity.patch rename to luminol-server/minecraft-patches/features/0056-Cpu-affinity.patch diff --git a/luminol-server/minecraft-patches/features/0058-Temporarily-fix-teleport-yam-and-pitch.patch b/luminol-server/minecraft-patches/features/0057-Temporarily-fix-teleport-yam-and-pitch.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0058-Temporarily-fix-teleport-yam-and-pitch.patch rename to luminol-server/minecraft-patches/features/0057-Temporarily-fix-teleport-yam-and-pitch.patch