diff --git a/gradle.properties b/gradle.properties index 574a40c..38ab919 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group = me.earthme.luminol version = 1.21-R0.1-SNAPSHOT -foliaCommit = 388cdacd1b373031caec202fca400f3fd7898285 +foliaCommit = dafae4f54ad783b33ae60caa5919a5eccf40f930 org.gradle.caching = true org.gradle.parallel = true diff --git a/patches/server/0006-Add-config-for-void-trading.patch b/patches/server/0006-Add-config-for-void-trading.patch index 1e7999e..89ae19f 100644 --- a/patches/server/0006-Add-config-for-void-trading.patch +++ b/patches/server/0006-Add-config-for-void-trading.patch @@ -31,10 +31,10 @@ index 0000000000000000000000000000000000000000..22f3c6c70e4287f1bdd0b18f87f57efe + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 72aa1b66950c1111793dad1583c19ac0d7e5823d..8e94a8abf0fddf1756600c8ed80c0b8b9851ef6f 100644 +index 0166d6bd686d68ffdcc42e908b0d1aa41a3bffdf..b5cb700e2cd1de2f78ad582245208c056fa6fa79 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2818,7 +2818,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -2814,7 +2814,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. // Spigot Start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message // Paper start - Fix merchant inventory not closing on entity removal diff --git a/patches/server/0020-Kaiiju-Don-t-pathfind-outside-region.patch b/patches/server/0019-Kaiiju-Don-t-pathfind-outside-region.patch similarity index 100% rename from patches/server/0020-Kaiiju-Don-t-pathfind-outside-region.patch rename to patches/server/0019-Kaiiju-Don-t-pathfind-outside-region.patch diff --git a/patches/server/0019-Try-fixing-folia-253.patch b/patches/server/0019-Try-fixing-folia-253.patch deleted file mode 100644 index d110f26..0000000 --- a/patches/server/0019-Try-fixing-folia-253.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MrHua269 -Date: Wed, 31 Jul 2024 21:24:06 +0800 -Subject: [PATCH] Try fixing folia #253 - -A solution for https://github.com/PaperMC/Folia/issues/253 ?() - -diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 135fa024d81b962761f0edc6896a2a507b6981f9..9f7a89d07295223689d2d2beb14c4ec78eb6aa3c 100644 ---- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java -+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -452,9 +452,18 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - } - System.arraycopy(raw, 0, regionizedWorldData.iterationCopy, 0, size); // Folia - region threading - -- list = it.unimi.dsi.fastutil.objects.ObjectArrayList.wrap( -+ // Luminol start - Fix issue #253 -+ //Do not wrap as there are some null elements -+ /*list = it.unimi.dsi.fastutil.objects.ObjectArrayList.wrap( - regionizedWorldData.iterationCopy, size // Folia - region threading -- ); -+ );*/ -+ list = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>(size); -+ for (ChunkAndHolder holder : regionizedWorldData.iterationCopy){ -+ if (holder != null){ -+ list.add(holder); -+ } -+ } -+ // Luminol end - } - } finally { profiler.stopTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.CHUNK_TICK_COLLECT_CHUNKS); } // Folia - profiler - // Paper end - chunk tick iteration optimisations -@@ -559,12 +568,12 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon - profiler.startTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.BROADCAST_BLOCK_CHANGES); try { // Folia - profiler - { - final it.unimi.dsi.fastutil.objects.ObjectArrayList chunks = (it.unimi.dsi.fastutil.objects.ObjectArrayList)list; -- final ServerChunkCache.ChunkAndHolder[] raw = chunks.elements(); -+ final Object[] raw = chunks.elements(); // Luminol - Try fixing folia #253 - final int size = chunks.size(); - - Objects.checkFromToIndex(0, size, raw.length); - for (int idx = 0; idx < size; ++idx) { -- final ServerChunkCache.ChunkAndHolder holder = raw[idx]; -+ final ServerChunkCache.ChunkAndHolder holder = (ServerChunkCache.ChunkAndHolder) raw[idx]; - raw[idx] = null; - - holder.holder().broadcastChanges(holder.chunk()); diff --git a/patches/server/0021-Petal-Reduce-sensor-work.patch b/patches/server/0020-Petal-Reduce-sensor-work.patch similarity index 100% rename from patches/server/0021-Petal-Reduce-sensor-work.patch rename to patches/server/0020-Petal-Reduce-sensor-work.patch diff --git a/patches/server/0022-Pufferfish-Cache-climbing-check-for-activation.patch b/patches/server/0021-Pufferfish-Cache-climbing-check-for-activation.patch similarity index 100% rename from patches/server/0022-Pufferfish-Cache-climbing-check-for-activation.patch rename to patches/server/0021-Pufferfish-Cache-climbing-check-for-activation.patch diff --git a/patches/server/0023-Pufferfish-Make-EntityCollisionContext-a-live-repres.patch b/patches/server/0022-Pufferfish-Make-EntityCollisionContext-a-live-repres.patch similarity index 100% rename from patches/server/0023-Pufferfish-Make-EntityCollisionContext-a-live-repres.patch rename to patches/server/0022-Pufferfish-Make-EntityCollisionContext-a-live-repres.patch diff --git a/patches/server/0024-Pufferfish-Improve-fluid-direction-caching.patch b/patches/server/0023-Pufferfish-Improve-fluid-direction-caching.patch similarity index 100% rename from patches/server/0024-Pufferfish-Improve-fluid-direction-caching.patch rename to patches/server/0023-Pufferfish-Improve-fluid-direction-caching.patch diff --git a/patches/server/0025-Pufferfish-Optimize-suffocation.patch b/patches/server/0024-Pufferfish-Optimize-suffocation.patch similarity index 100% rename from patches/server/0025-Pufferfish-Optimize-suffocation.patch rename to patches/server/0024-Pufferfish-Optimize-suffocation.patch diff --git a/patches/server/0026-Pufferfish-Early-return-optimization-for-target-find.patch b/patches/server/0025-Pufferfish-Early-return-optimization-for-target-find.patch similarity index 100% rename from patches/server/0026-Pufferfish-Early-return-optimization-for-target-find.patch rename to patches/server/0025-Pufferfish-Early-return-optimization-for-target-find.patch diff --git a/patches/server/0027-Pufferfish-Reduce-chunk-loading-lookups.patch b/patches/server/0026-Pufferfish-Reduce-chunk-loading-lookups.patch similarity index 100% rename from patches/server/0027-Pufferfish-Reduce-chunk-loading-lookups.patch rename to patches/server/0026-Pufferfish-Reduce-chunk-loading-lookups.patch diff --git a/patches/server/0028-Pufferfish-Fix-Paper-6045-block-goal-shouldn-t-load-.patch b/patches/server/0027-Pufferfish-Fix-Paper-6045-block-goal-shouldn-t-load-.patch similarity index 100% rename from patches/server/0028-Pufferfish-Fix-Paper-6045-block-goal-shouldn-t-load-.patch rename to patches/server/0027-Pufferfish-Fix-Paper-6045-block-goal-shouldn-t-load-.patch diff --git a/patches/server/0029-Pufferfish-Reduce-entity-fluid-lookups-if-no-fluids.patch b/patches/server/0028-Pufferfish-Reduce-entity-fluid-lookups-if-no-fluids.patch similarity index 100% rename from patches/server/0029-Pufferfish-Reduce-entity-fluid-lookups-if-no-fluids.patch rename to patches/server/0028-Pufferfish-Reduce-entity-fluid-lookups-if-no-fluids.patch diff --git a/patches/server/0030-Pufferfish-Only-check-for-spooky-season-once-an-hour.patch b/patches/server/0029-Pufferfish-Only-check-for-spooky-season-once-an-hour.patch similarity index 100% rename from patches/server/0030-Pufferfish-Only-check-for-spooky-season-once-an-hour.patch rename to patches/server/0029-Pufferfish-Only-check-for-spooky-season-once-an-hour.patch diff --git a/patches/server/0031-Pufferfish-Skip-cloning-loot-parameters.patch b/patches/server/0030-Pufferfish-Skip-cloning-loot-parameters.patch similarity index 100% rename from patches/server/0031-Pufferfish-Skip-cloning-loot-parameters.patch rename to patches/server/0030-Pufferfish-Skip-cloning-loot-parameters.patch diff --git a/patches/server/0032-Pufferfish-Entity-TTL.patch b/patches/server/0031-Pufferfish-Entity-TTL.patch similarity index 100% rename from patches/server/0032-Pufferfish-Entity-TTL.patch rename to patches/server/0031-Pufferfish-Entity-TTL.patch diff --git a/patches/server/0033-Pufferfish-Dynamic-Activation-of-Brain.patch b/patches/server/0032-Pufferfish-Dynamic-Activation-of-Brain.patch similarity index 99% rename from patches/server/0033-Pufferfish-Dynamic-Activation-of-Brain.patch rename to patches/server/0032-Pufferfish-Dynamic-Activation-of-Brain.patch index 829b1eb..8589173 100644 --- a/patches/server/0033-Pufferfish-Dynamic-Activation-of-Brain.patch +++ b/patches/server/0032-Pufferfish-Dynamic-Activation-of-Brain.patch @@ -99,10 +99,10 @@ index 0000000000000000000000000000000000000000..12683ec5a5102e45b6171fea0b833ba5 + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 8e94a8abf0fddf1756600c8ed80c0b8b9851ef6f..618e0f585f4edf81246dcae66af63e391bc28658 100644 +index b5cb700e2cd1de2f78ad582245208c056fa6fa79..80123dd30328336b02a5e2e3414ece44ba040ad2 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -809,6 +809,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -805,6 +805,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. this.timings.entityTick.startTiming(); // Spigot profiler.startTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.ENTITY_TICK); try { // Folia - profiler regionizedWorldData.forEachTickingEntity((entity) -> { // Folia - regionised ticking diff --git a/patches/server/0034-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch b/patches/server/0033-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch similarity index 100% rename from patches/server/0034-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch rename to patches/server/0033-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch diff --git a/patches/server/0035-Pufferfish-Reduce-entity-allocations.patch b/patches/server/0034-Pufferfish-Reduce-entity-allocations.patch similarity index 100% rename from patches/server/0035-Pufferfish-Reduce-entity-allocations.patch rename to patches/server/0034-Pufferfish-Reduce-entity-allocations.patch diff --git a/patches/server/0036-Pufferfish-Improve-container-checking-with-a-bitset.patch b/patches/server/0035-Pufferfish-Improve-container-checking-with-a-bitset.patch similarity index 100% rename from patches/server/0036-Pufferfish-Improve-container-checking-with-a-bitset.patch rename to patches/server/0035-Pufferfish-Improve-container-checking-with-a-bitset.patch diff --git a/patches/server/0037-Gale-Variable-entity-wake-up-duration.patch b/patches/server/0036-Gale-Variable-entity-wake-up-duration.patch similarity index 100% rename from patches/server/0037-Gale-Variable-entity-wake-up-duration.patch rename to patches/server/0036-Gale-Variable-entity-wake-up-duration.patch diff --git a/patches/server/0038-Gale-Don-t-load-chunks-to-activate-climbing-entities.patch b/patches/server/0037-Gale-Don-t-load-chunks-to-activate-climbing-entities.patch similarity index 100% rename from patches/server/0038-Gale-Don-t-load-chunks-to-activate-climbing-entities.patch rename to patches/server/0037-Gale-Don-t-load-chunks-to-activate-climbing-entities.patch diff --git a/patches/server/0039-Gale-Optimize-sun-burn-tick.patch b/patches/server/0038-Gale-Optimize-sun-burn-tick.patch similarity index 100% rename from patches/server/0039-Gale-Optimize-sun-burn-tick.patch rename to patches/server/0038-Gale-Optimize-sun-burn-tick.patch diff --git a/patches/server/0040-Gale-Simpler-ShapelessRecipe-comparison-for-vanilla.patch b/patches/server/0039-Gale-Simpler-ShapelessRecipe-comparison-for-vanilla.patch similarity index 100% rename from patches/server/0040-Gale-Simpler-ShapelessRecipe-comparison-for-vanilla.patch rename to patches/server/0039-Gale-Simpler-ShapelessRecipe-comparison-for-vanilla.patch diff --git a/patches/server/0041-Gale-Use-platform-math-functions.patch b/patches/server/0040-Gale-Use-platform-math-functions.patch similarity index 100% rename from patches/server/0041-Gale-Use-platform-math-functions.patch rename to patches/server/0040-Gale-Use-platform-math-functions.patch diff --git a/patches/server/0042-Gale-Skip-entity-move-if-movement-is-zero.patch b/patches/server/0041-Gale-Skip-entity-move-if-movement-is-zero.patch similarity index 100% rename from patches/server/0042-Gale-Skip-entity-move-if-movement-is-zero.patch rename to patches/server/0041-Gale-Skip-entity-move-if-movement-is-zero.patch diff --git a/patches/server/0043-Gale-Optimize-noise-generation.patch b/patches/server/0042-Gale-Optimize-noise-generation.patch similarity index 100% rename from patches/server/0043-Gale-Optimize-noise-generation.patch rename to patches/server/0042-Gale-Optimize-noise-generation.patch diff --git a/patches/server/0044-Gale-Faster-chunk-serialization.patch b/patches/server/0043-Gale-Faster-chunk-serialization.patch similarity index 100% rename from patches/server/0044-Gale-Faster-chunk-serialization.patch rename to patches/server/0043-Gale-Faster-chunk-serialization.patch diff --git a/patches/server/0045-Gale-Reduce-lambda-and-Optional-allocation-in-Entity.patch b/patches/server/0044-Gale-Reduce-lambda-and-Optional-allocation-in-Entity.patch similarity index 100% rename from patches/server/0045-Gale-Reduce-lambda-and-Optional-allocation-in-Entity.patch rename to patches/server/0044-Gale-Reduce-lambda-and-Optional-allocation-in-Entity.patch diff --git a/patches/server/0046-Gale-Replace-throttle-tracker-map-with-optimized-col.patch b/patches/server/0045-Gale-Replace-throttle-tracker-map-with-optimized-col.patch similarity index 100% rename from patches/server/0046-Gale-Replace-throttle-tracker-map-with-optimized-col.patch rename to patches/server/0045-Gale-Replace-throttle-tracker-map-with-optimized-col.patch diff --git a/patches/server/0047-Sparkly-Paper-Optimize-canSee-checks.patch b/patches/server/0046-Sparkly-Paper-Optimize-canSee-checks.patch similarity index 100% rename from patches/server/0047-Sparkly-Paper-Optimize-canSee-checks.patch rename to patches/server/0046-Sparkly-Paper-Optimize-canSee-checks.patch diff --git a/patches/server/0048-SparklyPaper-Skip-MapItem-update-if-the-map-does-not.patch b/patches/server/0047-SparklyPaper-Skip-MapItem-update-if-the-map-does-not.patch similarity index 100% rename from patches/server/0048-SparklyPaper-Skip-MapItem-update-if-the-map-does-not.patch rename to patches/server/0047-SparklyPaper-Skip-MapItem-update-if-the-map-does-not.patch diff --git a/patches/server/0049-Purpur-use-alternative-keep-alive.patch b/patches/server/0048-Purpur-use-alternative-keep-alive.patch similarity index 100% rename from patches/server/0049-Purpur-use-alternative-keep-alive.patch rename to patches/server/0048-Purpur-use-alternative-keep-alive.patch diff --git a/patches/server/0050-KioCG-Chunk-API-and-display-of-chunkhot-in-tpsbar.patch b/patches/server/0049-KioCG-Chunk-API-and-display-of-chunkhot-in-tpsbar.patch similarity index 97% rename from patches/server/0050-KioCG-Chunk-API-and-display-of-chunkhot-in-tpsbar.patch rename to patches/server/0049-KioCG-Chunk-API-and-display-of-chunkhot-in-tpsbar.patch index 85386b1..91fbd5c 100644 --- a/patches/server/0050-KioCG-Chunk-API-and-display-of-chunkhot-in-tpsbar.patch +++ b/patches/server/0049-KioCG-Chunk-API-and-display-of-chunkhot-in-tpsbar.patch @@ -5,17 +5,17 @@ Subject: [PATCH] KioCG Chunk API and display of chunkhot in tpsbar diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java b/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java -index f1cb1ecedf0e183cbf6acf12e2034907a8aa9cdd..43f55231adf4a6b11574bde1ba4dcd2b667611b2 100644 +index 83b052dbf6d21775664b286518f3cef1d86e87d1..c6c5292e96ef610b6edbb9341fda97d4cdec30e3 100644 --- a/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java +++ b/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java -@@ -119,6 +119,7 @@ public final class ChunkSystem { +@@ -113,6 +113,7 @@ public final class ChunkSystem { } public static void onChunkNotTicking(final LevelChunk chunk, final ChunkHolder holder) { + chunk.getChunkHot().clear(); // KioCG - ((ChunkSystemServerLevel)((ServerLevel)chunk.getLevel())).moonrise$getTickingChunks().remove( - ((ChunkSystemLevelChunk)chunk).moonrise$getChunkAndHolder() - ); + chunk.getLevel().getCurrentWorldData().removeTickingChunk(chunk.moonrise$getChunkAndHolder()); // Folia - region threading + } + diff --git a/src/main/java/com/kiocg/ChunkHot.java b/src/main/java/com/kiocg/ChunkHot.java new file mode 100644 index 0000000000000000000000000000000000000000..53b4397997bc9b9b9d88e48304b37a2590161906 @@ -240,10 +240,10 @@ index 05b8f509b119b8166012567f865b99a23ad84ae2..1dce4e4d2a4e03afb38090de9254059a int playerSaveInterval = io.papermc.paper.configuration.GlobalConfiguration.get().playerAutoSave.rate; if (playerSaveInterval < 0) { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 618e0f585f4edf81246dcae66af63e391bc28658..872762938eb234a1143a8c265463407128be76c4 100644 +index 80123dd30328336b02a5e2e3414ece44ba040ad2..6f4d5312c8140e0a49646e4f069b027a9e1bd5ad 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1381,6 +1381,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1377,6 +1377,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. final int timerId = isActive ? entity.getType().tickTimerId : entity.getType().inactiveTickTimerId; final ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle profiler = io.papermc.paper.threadedregions.TickRegionScheduler.getProfiler(); profiler.startTimer(timerId); @@ -252,7 +252,7 @@ index 618e0f585f4edf81246dcae66af63e391bc28658..872762938eb234a1143a8c2654634071 // Folia end - timer try { // Paper end - timings -@@ -1408,6 +1410,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1404,6 +1406,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. } else { entity.inactiveTick(); } // Paper - EAR 2 this.getProfiler().pop(); } finally { timer.stopTiming(); profiler.stopTimer(timerId); } // Paper - timings // Folia - timer @@ -260,7 +260,7 @@ index 618e0f585f4edf81246dcae66af63e391bc28658..872762938eb234a1143a8c2654634071 Iterator iterator = entity.getPassengers().iterator(); while (iterator.hasNext()) { -@@ -1436,6 +1439,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1432,6 +1435,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. final ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle profiler = io.papermc.paper.threadedregions.TickRegionScheduler.getProfiler(); profiler.startTimer(timerId); // Folia end - timer @@ -269,7 +269,7 @@ index 618e0f585f4edf81246dcae66af63e391bc28658..872762938eb234a1143a8c2654634071 try { // Paper end passenger.setOldPosAndRot(); -@@ -1476,6 +1481,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -1472,6 +1477,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. } } finally { timer.stopTiming(); profiler.stopTimer(timerId); }// Paper - EAR2 timings // Folia - timer diff --git a/patches/server/0051-Leaf-Skip-event-if-no-listeners.patch b/patches/server/0050-Leaf-Skip-event-if-no-listeners.patch similarity index 100% rename from patches/server/0051-Leaf-Skip-event-if-no-listeners.patch rename to patches/server/0050-Leaf-Skip-event-if-no-listeners.patch diff --git a/patches/server/0052-Threaded-region-start-tick-and-finished-tick-event.patch b/patches/server/0051-Threaded-region-start-tick-and-finished-tick-event.patch similarity index 100% rename from patches/server/0052-Threaded-region-start-tick-and-finished-tick-event.patch rename to patches/server/0051-Threaded-region-start-tick-and-finished-tick-event.patch diff --git a/patches/server/0053-Fix-MC-2025.patch b/patches/server/0052-Fix-MC-2025.patch similarity index 100% rename from patches/server/0053-Fix-MC-2025.patch rename to patches/server/0052-Fix-MC-2025.patch diff --git a/patches/server/0054-FoliaPR-Add-TPS-From-Region.patch b/patches/server/0053-FoliaPR-Add-TPS-From-Region.patch similarity index 100% rename from patches/server/0054-FoliaPR-Add-TPS-From-Region.patch rename to patches/server/0053-FoliaPR-Add-TPS-From-Region.patch