From 0f6e3ac870b683cf494b8819ebc68ae92e7399e2 Mon Sep 17 00:00:00 2001 From: MrHua269 Date: Sat, 8 Mar 2025 09:58:16 +0800 Subject: [PATCH] Add experiment config for entity to clean memory value which is not belong to current tickregion & Fix a series issue around entity memory typed GlobalPos --- ...onfig-for-entity-to-clean-memory-val.patch | 53 ++++++++++++ ...-entity-was-moving-to-another-regio.patch} | 2 +- ...olia-off-region-POI-accessing-issue.patch} | 0 ...-Force-disable-builtin-spark-plugin.patch} | 0 ...5-for-temporary-hopper-behavior-fix.patch} | 0 ...eck-if-the-block-is-not-belong-to-c.patch} | 2 +- ...ix-uncorrected-death-check-of-folia.patch} | 0 ...ue-around-entity-memory-typed-Global.patch | 85 +++++++++++++++++++ ...aiiju-Don-t-pathfind-outside-region.patch} | 0 ...ju-Vanilla-end-portal-teleportation.patch} | 2 +- ...iju-Entity-tick-and-removal-limiter.patch} | 0 ...5-Purpur-Use-alternative-keep-alive.patch} | 0 ...6-Purpur-Lobotomize-stuck-villagers.patch} | 0 ...ch => 0027-Petal-Reduce-sensor-work.patch} | 0 ...Cache-climbing-check-for-activation.patch} | 0 ...erfish-Reduce-chunk-loading-lookups.patch} | 0 ...30-Gale-Use-platform-math-functions.patch} | 0 ...le-Variable-entity-wake-up-duration.patch} | 0 ...kip-entity-move-if-movement-is-zero.patch} | 2 +- ...ttributes-with-optimized-collection.patch} | 0 ...0034-Gale-Optimize-noise-generation.patch} | 0 ...SparklyPaper-Optimize-canSee-checks.patch} | 0 ...-distanceToSqr-call-in-ServerEntity.patch} | 0 ...Secure-seed-and-matter-seed-command.patch} | 0 ...-api.patch => 0038-Tick-regions-api.patch} | 0 ...issing-teleportation-apis-for-folia.patch} | 2 +- ...ves-Disable-moved-wrongly-threshold.patch} | 0 ...ect-Collision-Behavior-for-Block-Sh.patch} | 0 ... 0042-Raytracing-tracker-experiment.patch} | 2 +- ...rpur-Barrels-and-enderchests-6-rows.patch} | 0 ... => 0044-Configurable-tripwire-dupe.patch} | 0 ...eCleanupEntityBrainMemoryConfig.java.patch | 25 ++++++ 32 files changed, 169 insertions(+), 6 deletions(-) create mode 100644 luminol-server/minecraft-patches/features/0014-Add-experiment-config-for-entity-to-clean-memory-val.patch rename luminol-server/minecraft-patches/features/{0014-Teleport-async-if-entity-was-moving-to-another-regio.patch => 0015-Teleport-async-if-entity-was-moving-to-another-regio.patch} (96%) rename luminol-server/minecraft-patches/features/{0015-Try-fixing-folia-off-region-POI-accessing-issue.patch => 0016-Try-fixing-folia-off-region-POI-accessing-issue.patch} (100%) rename luminol-server/minecraft-patches/features/{0016-Force-disable-builtin-spark-plugin.patch => 0017-Force-disable-builtin-spark-plugin.patch} (100%) rename luminol-server/minecraft-patches/features/{0017-Merge-Paper-11945-for-temporary-hopper-behavior-fix.patch => 0018-Merge-Paper-11945-for-temporary-hopper-behavior-fix.patch} (100%) rename luminol-server/minecraft-patches/features/{0018-Skip-collision-check-if-the-block-is-not-belong-to-c.patch => 0019-Skip-collision-check-if-the-block-is-not-belong-to-c.patch} (94%) rename luminol-server/minecraft-patches/features/{0019-Fix-uncorrected-death-check-of-folia.patch => 0020-Fix-uncorrected-death-check-of-folia.patch} (100%) create mode 100644 luminol-server/minecraft-patches/features/0021-Fix-a-series-issue-around-entity-memory-typed-Global.patch rename luminol-server/minecraft-patches/features/{0020-Kaiiju-Don-t-pathfind-outside-region.patch => 0022-Kaiiju-Don-t-pathfind-outside-region.patch} (100%) rename luminol-server/minecraft-patches/features/{0021-Kaiiju-Vanilla-end-portal-teleportation.patch => 0023-Kaiiju-Vanilla-end-portal-teleportation.patch} (98%) rename luminol-server/minecraft-patches/features/{0022-Kaiiju-Entity-tick-and-removal-limiter.patch => 0024-Kaiiju-Entity-tick-and-removal-limiter.patch} (100%) rename luminol-server/minecraft-patches/features/{0023-Purpur-Use-alternative-keep-alive.patch => 0025-Purpur-Use-alternative-keep-alive.patch} (100%) rename luminol-server/minecraft-patches/features/{0024-Purpur-Lobotomize-stuck-villagers.patch => 0026-Purpur-Lobotomize-stuck-villagers.patch} (100%) rename luminol-server/minecraft-patches/features/{0025-Petal-Reduce-sensor-work.patch => 0027-Petal-Reduce-sensor-work.patch} (100%) rename luminol-server/minecraft-patches/features/{0026-Pufferfish-Cache-climbing-check-for-activation.patch => 0028-Pufferfish-Cache-climbing-check-for-activation.patch} (100%) rename luminol-server/minecraft-patches/features/{0027-Pufferfish-Reduce-chunk-loading-lookups.patch => 0029-Pufferfish-Reduce-chunk-loading-lookups.patch} (100%) rename luminol-server/minecraft-patches/features/{0028-Gale-Use-platform-math-functions.patch => 0030-Gale-Use-platform-math-functions.patch} (100%) rename luminol-server/minecraft-patches/features/{0029-Gale-Variable-entity-wake-up-duration.patch => 0031-Gale-Variable-entity-wake-up-duration.patch} (100%) rename luminol-server/minecraft-patches/features/{0030-Gale-Skip-entity-move-if-movement-is-zero.patch => 0032-Gale-Skip-entity-move-if-movement-is-zero.patch} (94%) rename luminol-server/minecraft-patches/features/{0031-Gale-Replace-AI-attributes-with-optimized-collection.patch => 0033-Gale-Replace-AI-attributes-with-optimized-collection.patch} (100%) rename luminol-server/minecraft-patches/features/{0032-Gale-Optimize-noise-generation.patch => 0034-Gale-Optimize-noise-generation.patch} (100%) rename luminol-server/minecraft-patches/features/{0033-SparklyPaper-Optimize-canSee-checks.patch => 0035-SparklyPaper-Optimize-canSee-checks.patch} (100%) rename luminol-server/minecraft-patches/features/{0034-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch => 0036-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch} (100%) rename luminol-server/minecraft-patches/features/{0035-Leaf-Secure-seed-and-matter-seed-command.patch => 0037-Leaf-Secure-seed-and-matter-seed-command.patch} (100%) rename luminol-server/minecraft-patches/features/{0036-Tick-regions-api.patch => 0038-Tick-regions-api.patch} (100%) rename luminol-server/minecraft-patches/features/{0037-Add-missing-teleportation-apis-for-folia.patch => 0039-Add-missing-teleportation-apis-for-folia.patch} (99%) rename luminol-server/minecraft-patches/features/{0038-Leaves-Disable-moved-wrongly-threshold.patch => 0040-Leaves-Disable-moved-wrongly-threshold.patch} (100%) rename luminol-server/minecraft-patches/features/{0039-Leaves-Fix-Incorrect-Collision-Behavior-for-Block-Sh.patch => 0041-Leaves-Fix-Incorrect-Collision-Behavior-for-Block-Sh.patch} (100%) rename luminol-server/minecraft-patches/features/{0040-Raytracing-tracker-experiment.patch => 0042-Raytracing-tracker-experiment.patch} (98%) rename luminol-server/minecraft-patches/features/{0041-Purpur-Barrels-and-enderchests-6-rows.patch => 0043-Purpur-Barrels-and-enderchests-6-rows.patch} (100%) rename luminol-server/minecraft-patches/features/{0042-Configurable-tripwire-dupe.patch => 0044-Configurable-tripwire-dupe.patch} (100%) create mode 100644 luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/ForceCleanupEntityBrainMemoryConfig.java.patch diff --git a/luminol-server/minecraft-patches/features/0014-Add-experiment-config-for-entity-to-clean-memory-val.patch b/luminol-server/minecraft-patches/features/0014-Add-experiment-config-for-entity-to-clean-memory-val.patch new file mode 100644 index 0000000..03540dc --- /dev/null +++ b/luminol-server/minecraft-patches/features/0014-Add-experiment-config-for-entity-to-clean-memory-val.patch @@ -0,0 +1,53 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MrHua269 +Date: Sat, 8 Mar 2025 09:56:15 +0800 +Subject: [PATCH] Add experiment config for entity to clean memory value which + is not belong to current tickregion + + +diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java +index 65b2b3ece213d901cdd585093e2fafcd2ef4a7cd..d61fba01feecce3610cd390f490d3097c5db19c4 100644 +--- a/net/minecraft/world/entity/ai/Brain.java ++++ b/net/minecraft/world/entity/ai/Brain.java +@@ -399,7 +399,7 @@ public class Brain { + } + + public void tick(ServerLevel level, E entity) { +- this.forgetOutdatedMemories(); ++ this.forgetOutdatedMemories(entity); // Luminol - Add config to force clean entity memory that don't belong to current tick region + this.tickSensors(level, entity); + this.startEachNonRunningBehavior(level, entity); + this.tickEachRunningBehavior(level, entity); +@@ -411,10 +411,31 @@ public class Brain { + } + } + +- private void forgetOutdatedMemories() { ++ private void forgetOutdatedMemories(E owner) { // Luminol - Add config to force clean entity memory that don't belong to current tick region + for (Entry, Optional>> entry : this.memories.entrySet()) { + if (entry.getValue().isPresent()) { + ExpirableValue expirableValue = (ExpirableValue)entry.getValue().get(); ++ // Luminol start - Add config to force clean entity memory that don't belong to current tick region ++ final Object value = expirableValue.getValue(); ++ final net.minecraft.world.level.Level ownerLevel = owner.level(); ++ ++ // type: entity ++ if (me.earthme.luminol.config.modules.experiment.ForceCleanupEntityBrainMemoryConfig.enabledForEntity && value instanceof LivingEntity entity) { ++ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) { ++ this.eraseMemory(entry.getKey()); ++ continue; ++ } ++ } ++ ++ // type: block_pos ++ if (me.earthme.luminol.config.modules.experiment.ForceCleanupEntityBrainMemoryConfig.enabledForBlockPos && value instanceof net.minecraft.core.BlockPos blockPos) { ++ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(ownerLevel, blockPos)) { ++ this.eraseMemory(entry.getKey()); ++ continue; ++ } ++ } ++ // Luminol end ++ + if (expirableValue.hasExpired()) { + this.eraseMemory(entry.getKey()); + } diff --git a/luminol-server/minecraft-patches/features/0014-Teleport-async-if-entity-was-moving-to-another-regio.patch b/luminol-server/minecraft-patches/features/0015-Teleport-async-if-entity-was-moving-to-another-regio.patch similarity index 96% rename from luminol-server/minecraft-patches/features/0014-Teleport-async-if-entity-was-moving-to-another-regio.patch rename to luminol-server/minecraft-patches/features/0015-Teleport-async-if-entity-was-moving-to-another-regio.patch index 5255cd7..6cfcc79 100644 --- a/luminol-server/minecraft-patches/features/0014-Teleport-async-if-entity-was-moving-to-another-regio.patch +++ b/luminol-server/minecraft-patches/features/0015-Teleport-async-if-entity-was-moving-to-another-regio.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Teleport async if entity was moving to another region at once diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 0a7d6172d42f4b0395aa448b1c1d9fb8eaa4bf7a..b5a535cbcf592ef210981334128365ff5bc68e92 100644 +index cc8efa162fbe7ce6a91629239bf18d7b6b096a8a..4026d465687604965f105ded21a8206fd52bd375 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -1100,6 +1100,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/luminol-server/minecraft-patches/features/0015-Try-fixing-folia-off-region-POI-accessing-issue.patch b/luminol-server/minecraft-patches/features/0016-Try-fixing-folia-off-region-POI-accessing-issue.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0015-Try-fixing-folia-off-region-POI-accessing-issue.patch rename to luminol-server/minecraft-patches/features/0016-Try-fixing-folia-off-region-POI-accessing-issue.patch diff --git a/luminol-server/minecraft-patches/features/0016-Force-disable-builtin-spark-plugin.patch b/luminol-server/minecraft-patches/features/0017-Force-disable-builtin-spark-plugin.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0016-Force-disable-builtin-spark-plugin.patch rename to luminol-server/minecraft-patches/features/0017-Force-disable-builtin-spark-plugin.patch diff --git a/luminol-server/minecraft-patches/features/0017-Merge-Paper-11945-for-temporary-hopper-behavior-fix.patch b/luminol-server/minecraft-patches/features/0018-Merge-Paper-11945-for-temporary-hopper-behavior-fix.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0017-Merge-Paper-11945-for-temporary-hopper-behavior-fix.patch rename to luminol-server/minecraft-patches/features/0018-Merge-Paper-11945-for-temporary-hopper-behavior-fix.patch diff --git a/luminol-server/minecraft-patches/features/0018-Skip-collision-check-if-the-block-is-not-belong-to-c.patch b/luminol-server/minecraft-patches/features/0019-Skip-collision-check-if-the-block-is-not-belong-to-c.patch similarity index 94% rename from luminol-server/minecraft-patches/features/0018-Skip-collision-check-if-the-block-is-not-belong-to-c.patch rename to luminol-server/minecraft-patches/features/0019-Skip-collision-check-if-the-block-is-not-belong-to-c.patch index e74bb78..cf60e49 100644 --- a/luminol-server/minecraft-patches/features/0018-Skip-collision-check-if-the-block-is-not-belong-to-c.patch +++ b/luminol-server/minecraft-patches/features/0019-Skip-collision-check-if-the-block-is-not-belong-to-c.patch @@ -13,7 +13,7 @@ Related to mojang's bug fix: https://bugs.mojang.com/browse/MC-92875 diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index b5a535cbcf592ef210981334128365ff5bc68e92..477b71c94461ab504b3955437d0f7acb312ed33f 100644 +index 4026d465687604965f105ded21a8206fd52bd375..b324bea291e3a50cc20d1b380c13c586d56781c0 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -1676,6 +1676,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/luminol-server/minecraft-patches/features/0019-Fix-uncorrected-death-check-of-folia.patch b/luminol-server/minecraft-patches/features/0020-Fix-uncorrected-death-check-of-folia.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0019-Fix-uncorrected-death-check-of-folia.patch rename to luminol-server/minecraft-patches/features/0020-Fix-uncorrected-death-check-of-folia.patch diff --git a/luminol-server/minecraft-patches/features/0021-Fix-a-series-issue-around-entity-memory-typed-Global.patch b/luminol-server/minecraft-patches/features/0021-Fix-a-series-issue-around-entity-memory-typed-Global.patch new file mode 100644 index 0000000..21f1876 --- /dev/null +++ b/luminol-server/minecraft-patches/features/0021-Fix-a-series-issue-around-entity-memory-typed-Global.patch @@ -0,0 +1,85 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MrHua269 +Date: Sat, 8 Mar 2025 09:55:40 +0800 +Subject: [PATCH] Fix a series issue around entity memory typed GlobalPos and + WalkTarget + + +diff --git a/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java b/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java +index 2664d72c3b6906d0505df2e63c0e5075eba9461b..f03c3c512ea48c2a89eebae62484922d28e4f831 100644 +--- a/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java ++++ b/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java +@@ -69,6 +69,11 @@ public class BehaviorUtils { + } + + public static void setWalkAndLookTargetMemories(LivingEntity entity, PositionTracker positionTracker, float speedModifier, int closeEnoughDist) { ++ // Luminol - Do not set walk target if target position is out of current tick region ++ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity.level(), positionTracker.currentBlockPosition())) { ++ return; ++ } ++ // Luminol end + WalkTarget walkTarget = new WalkTarget(positionTracker, speedModifier, closeEnoughDist); + entity.getBrain().setMemory(MemoryModuleType.LOOK_TARGET, positionTracker); + entity.getBrain().setMemory(MemoryModuleType.WALK_TARGET, walkTarget); +diff --git a/net/minecraft/world/entity/ai/behavior/SleepInBed.java b/net/minecraft/world/entity/ai/behavior/SleepInBed.java +index bc6a5cacd67d46e0beb97adf30d98c1034be1a44..dd35eef062c36a409b6d3e701664db504c4c7631 100644 +--- a/net/minecraft/world/entity/ai/behavior/SleepInBed.java ++++ b/net/minecraft/world/entity/ai/behavior/SleepInBed.java +@@ -42,6 +42,12 @@ public class SleepInBed extends Behavior { + } + } + ++ // Luminol - Prevent off-tick-region chunk operations ++ final net.minecraft.world.level.Level currentLevel = owner.level(); ++ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(currentLevel, globalPos.pos())) { ++ return false; ++ } ++ // Luminol -end + BlockState blockState = level.getBlockStateIfLoaded(globalPos.pos()); // Paper - Prevent sync chunk loads when villagers try to find beds + if (blockState == null) { return false; } // Paper - Prevent sync chunk loads when villagers try to find beds + return globalPos.pos().closerToCenterThan(owner.position(), 2.0) && blockState.is(BlockTags.BEDS) && !blockState.getValue(BedBlock.OCCUPIED); +diff --git a/net/minecraft/world/entity/animal/allay/AllayAi.java b/net/minecraft/world/entity/animal/allay/AllayAi.java +index 36a9887f8be04c5c3fda6d926d819a9e5b2a79f2..5681592bdeb050d875c4c5d0dfaf6e015beb1c74 100644 +--- a/net/minecraft/world/entity/animal/allay/AllayAi.java ++++ b/net/minecraft/world/entity/animal/allay/AllayAi.java +@@ -114,6 +114,17 @@ public class AllayAi { + Optional memory = brain.getMemory(MemoryModuleType.LIKED_NOTEBLOCK_POSITION); + if (memory.isPresent()) { + GlobalPos globalPos = memory.get(); ++ // Luminol start - Do not like item if they were out of current tickregion ++ final Level targetLevel = entity.level().getServer().getLevel(globalPos.dimension()); ++ final BlockPos targetPos = globalPos.pos(); ++ ++ // thread checks ++ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(targetLevel, targetPos)) { ++ brain.eraseMemory(MemoryModuleType.LIKED_NOTEBLOCK_POSITION); // The memory value is not being belong to current tick region anymore ++ return Optional.empty(); ++ } ++ // Luminol end ++ + if (shouldDepositItemsAtLikedNoteblock(entity, brain, globalPos)) { + return Optional.of(new BlockPosTracker(globalPos.pos().above())); + } +diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java +index 62ca7871d1e5d0fe611948ad43e44c23fdc2d3f8..cd0fc85fbefce4669b4cb637ec3b2628da57adbf 100644 +--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java ++++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java +@@ -257,7 +257,17 @@ public class Sniffer extends Animal { + + private boolean canDig(BlockPos pos) { + return this.level().getBlockState(pos).is(BlockTags.SNIFFER_DIGGABLE_BLOCK) +- && this.getExploredPositions().noneMatch(globalPos -> GlobalPos.of(this.level().dimension(), pos).equals(globalPos)) ++ && this.getExploredPositions().noneMatch(globalPos -> { // Luminol start - Do not pathfind out of tickregion ++ // thread checks ++ final Level targetLevel = net.minecraft.server.MinecraftServer.getServer().getLevel(globalPos.dimension()); ++ final BlockPos targetPos = globalPos.pos(); ++ ++ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(targetLevel, targetPos)) { ++ return false; ++ } ++ ++ return GlobalPos.of(this.level().dimension(), pos).equals(globalPos); // Original logic ++ }) // Luminol end + && Optional.ofNullable(this.getNavigation().createPath(pos, 1)).map(Path::canReach).orElse(false); + } + diff --git a/luminol-server/minecraft-patches/features/0020-Kaiiju-Don-t-pathfind-outside-region.patch b/luminol-server/minecraft-patches/features/0022-Kaiiju-Don-t-pathfind-outside-region.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0020-Kaiiju-Don-t-pathfind-outside-region.patch rename to luminol-server/minecraft-patches/features/0022-Kaiiju-Don-t-pathfind-outside-region.patch diff --git a/luminol-server/minecraft-patches/features/0021-Kaiiju-Vanilla-end-portal-teleportation.patch b/luminol-server/minecraft-patches/features/0023-Kaiiju-Vanilla-end-portal-teleportation.patch similarity index 98% rename from luminol-server/minecraft-patches/features/0021-Kaiiju-Vanilla-end-portal-teleportation.patch rename to luminol-server/minecraft-patches/features/0023-Kaiiju-Vanilla-end-portal-teleportation.patch index 00094ed..a8dfecb 100644 --- a/luminol-server/minecraft-patches/features/0021-Kaiiju-Vanilla-end-portal-teleportation.patch +++ b/luminol-server/minecraft-patches/features/0023-Kaiiju-Vanilla-end-portal-teleportation.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Kaiiju Vanilla end portal teleportation diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 477b71c94461ab504b3955437d0f7acb312ed33f..35e413b7b2f8465946b2cc8651560c6899898458 100644 +index b324bea291e3a50cc20d1b380c13c586d56781c0..46460af3ebd76d7475aa7a7cbe55203a40f1c323 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -4281,14 +4281,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/luminol-server/minecraft-patches/features/0022-Kaiiju-Entity-tick-and-removal-limiter.patch b/luminol-server/minecraft-patches/features/0024-Kaiiju-Entity-tick-and-removal-limiter.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0022-Kaiiju-Entity-tick-and-removal-limiter.patch rename to luminol-server/minecraft-patches/features/0024-Kaiiju-Entity-tick-and-removal-limiter.patch diff --git a/luminol-server/minecraft-patches/features/0023-Purpur-Use-alternative-keep-alive.patch b/luminol-server/minecraft-patches/features/0025-Purpur-Use-alternative-keep-alive.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0023-Purpur-Use-alternative-keep-alive.patch rename to luminol-server/minecraft-patches/features/0025-Purpur-Use-alternative-keep-alive.patch diff --git a/luminol-server/minecraft-patches/features/0024-Purpur-Lobotomize-stuck-villagers.patch b/luminol-server/minecraft-patches/features/0026-Purpur-Lobotomize-stuck-villagers.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0024-Purpur-Lobotomize-stuck-villagers.patch rename to luminol-server/minecraft-patches/features/0026-Purpur-Lobotomize-stuck-villagers.patch diff --git a/luminol-server/minecraft-patches/features/0025-Petal-Reduce-sensor-work.patch b/luminol-server/minecraft-patches/features/0027-Petal-Reduce-sensor-work.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0025-Petal-Reduce-sensor-work.patch rename to luminol-server/minecraft-patches/features/0027-Petal-Reduce-sensor-work.patch diff --git a/luminol-server/minecraft-patches/features/0026-Pufferfish-Cache-climbing-check-for-activation.patch b/luminol-server/minecraft-patches/features/0028-Pufferfish-Cache-climbing-check-for-activation.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0026-Pufferfish-Cache-climbing-check-for-activation.patch rename to luminol-server/minecraft-patches/features/0028-Pufferfish-Cache-climbing-check-for-activation.patch diff --git a/luminol-server/minecraft-patches/features/0027-Pufferfish-Reduce-chunk-loading-lookups.patch b/luminol-server/minecraft-patches/features/0029-Pufferfish-Reduce-chunk-loading-lookups.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0027-Pufferfish-Reduce-chunk-loading-lookups.patch rename to luminol-server/minecraft-patches/features/0029-Pufferfish-Reduce-chunk-loading-lookups.patch diff --git a/luminol-server/minecraft-patches/features/0028-Gale-Use-platform-math-functions.patch b/luminol-server/minecraft-patches/features/0030-Gale-Use-platform-math-functions.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0028-Gale-Use-platform-math-functions.patch rename to luminol-server/minecraft-patches/features/0030-Gale-Use-platform-math-functions.patch diff --git a/luminol-server/minecraft-patches/features/0029-Gale-Variable-entity-wake-up-duration.patch b/luminol-server/minecraft-patches/features/0031-Gale-Variable-entity-wake-up-duration.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0029-Gale-Variable-entity-wake-up-duration.patch rename to luminol-server/minecraft-patches/features/0031-Gale-Variable-entity-wake-up-duration.patch diff --git a/luminol-server/minecraft-patches/features/0030-Gale-Skip-entity-move-if-movement-is-zero.patch b/luminol-server/minecraft-patches/features/0032-Gale-Skip-entity-move-if-movement-is-zero.patch similarity index 94% rename from luminol-server/minecraft-patches/features/0030-Gale-Skip-entity-move-if-movement-is-zero.patch rename to luminol-server/minecraft-patches/features/0032-Gale-Skip-entity-move-if-movement-is-zero.patch index c49db01..d69a1dc 100644 --- a/luminol-server/minecraft-patches/features/0030-Gale-Skip-entity-move-if-movement-is-zero.patch +++ b/luminol-server/minecraft-patches/features/0032-Gale-Skip-entity-move-if-movement-is-zero.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Gale Skip entity move if movement is zero diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 35e413b7b2f8465946b2cc8651560c6899898458..59dd6ecc3b79b1d6c13eda7b71d6dbbf4ffc1dfe 100644 +index 46460af3ebd76d7475aa7a7cbe55203a40f1c323..72934a95991d25152e93c9b70e9992254d0daf23 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -1104,7 +1104,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/luminol-server/minecraft-patches/features/0031-Gale-Replace-AI-attributes-with-optimized-collection.patch b/luminol-server/minecraft-patches/features/0033-Gale-Replace-AI-attributes-with-optimized-collection.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0031-Gale-Replace-AI-attributes-with-optimized-collection.patch rename to luminol-server/minecraft-patches/features/0033-Gale-Replace-AI-attributes-with-optimized-collection.patch diff --git a/luminol-server/minecraft-patches/features/0032-Gale-Optimize-noise-generation.patch b/luminol-server/minecraft-patches/features/0034-Gale-Optimize-noise-generation.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0032-Gale-Optimize-noise-generation.patch rename to luminol-server/minecraft-patches/features/0034-Gale-Optimize-noise-generation.patch diff --git a/luminol-server/minecraft-patches/features/0033-SparklyPaper-Optimize-canSee-checks.patch b/luminol-server/minecraft-patches/features/0035-SparklyPaper-Optimize-canSee-checks.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0033-SparklyPaper-Optimize-canSee-checks.patch rename to luminol-server/minecraft-patches/features/0035-SparklyPaper-Optimize-canSee-checks.patch diff --git a/luminol-server/minecraft-patches/features/0034-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch b/luminol-server/minecraft-patches/features/0036-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0034-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch rename to luminol-server/minecraft-patches/features/0036-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch diff --git a/luminol-server/minecraft-patches/features/0035-Leaf-Secure-seed-and-matter-seed-command.patch b/luminol-server/minecraft-patches/features/0037-Leaf-Secure-seed-and-matter-seed-command.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0035-Leaf-Secure-seed-and-matter-seed-command.patch rename to luminol-server/minecraft-patches/features/0037-Leaf-Secure-seed-and-matter-seed-command.patch diff --git a/luminol-server/minecraft-patches/features/0036-Tick-regions-api.patch b/luminol-server/minecraft-patches/features/0038-Tick-regions-api.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0036-Tick-regions-api.patch rename to luminol-server/minecraft-patches/features/0038-Tick-regions-api.patch diff --git a/luminol-server/minecraft-patches/features/0037-Add-missing-teleportation-apis-for-folia.patch b/luminol-server/minecraft-patches/features/0039-Add-missing-teleportation-apis-for-folia.patch similarity index 99% rename from luminol-server/minecraft-patches/features/0037-Add-missing-teleportation-apis-for-folia.patch rename to luminol-server/minecraft-patches/features/0039-Add-missing-teleportation-apis-for-folia.patch index 4655857..ff4bea8 100644 --- a/luminol-server/minecraft-patches/features/0037-Add-missing-teleportation-apis-for-folia.patch +++ b/luminol-server/minecraft-patches/features/0039-Add-missing-teleportation-apis-for-folia.patch @@ -19,7 +19,7 @@ index 9fd3fe181df2ce6dbe695f6463d3940ac4c01167..822d401150d3764004b2570da828b4f6 ); }); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 59dd6ecc3b79b1d6c13eda7b71d6dbbf4ffc1dfe..f26cdc00180f72bea271877b9ef814daf9850916 100644 +index 72934a95991d25152e93c9b70e9992254d0daf23..b99b5830a3e5bdbb781c7bcb8544b2e57415b5f5 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -4166,6 +4166,31 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/luminol-server/minecraft-patches/features/0038-Leaves-Disable-moved-wrongly-threshold.patch b/luminol-server/minecraft-patches/features/0040-Leaves-Disable-moved-wrongly-threshold.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0038-Leaves-Disable-moved-wrongly-threshold.patch rename to luminol-server/minecraft-patches/features/0040-Leaves-Disable-moved-wrongly-threshold.patch diff --git a/luminol-server/minecraft-patches/features/0039-Leaves-Fix-Incorrect-Collision-Behavior-for-Block-Sh.patch b/luminol-server/minecraft-patches/features/0041-Leaves-Fix-Incorrect-Collision-Behavior-for-Block-Sh.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0039-Leaves-Fix-Incorrect-Collision-Behavior-for-Block-Sh.patch rename to luminol-server/minecraft-patches/features/0041-Leaves-Fix-Incorrect-Collision-Behavior-for-Block-Sh.patch diff --git a/luminol-server/minecraft-patches/features/0040-Raytracing-tracker-experiment.patch b/luminol-server/minecraft-patches/features/0042-Raytracing-tracker-experiment.patch similarity index 98% rename from luminol-server/minecraft-patches/features/0040-Raytracing-tracker-experiment.patch rename to luminol-server/minecraft-patches/features/0042-Raytracing-tracker-experiment.patch index fdbbf6b..0b8d480 100644 --- a/luminol-server/minecraft-patches/features/0040-Raytracing-tracker-experiment.patch +++ b/luminol-server/minecraft-patches/features/0042-Raytracing-tracker-experiment.patch @@ -19,7 +19,7 @@ index 7eff847790394aecd058e7a61905da86163b4c6e..9099457f55a2829297ac1db8a69a98ff double rangeY = level.paperConfig().entities.trackingRangeY.get(this.entity, -1); if (rangeY != -1) { diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index f26cdc00180f72bea271877b9ef814daf9850916..647510b9fae49b5a4113a35be9909babf54acfcf 100644 +index b99b5830a3e5bdbb781c7bcb8544b2e57415b5f5..a570499366ff238c869de60be3aeed0459b73db8 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -135,7 +135,7 @@ import net.minecraft.world.scores.ScoreHolder; diff --git a/luminol-server/minecraft-patches/features/0041-Purpur-Barrels-and-enderchests-6-rows.patch b/luminol-server/minecraft-patches/features/0043-Purpur-Barrels-and-enderchests-6-rows.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0041-Purpur-Barrels-and-enderchests-6-rows.patch rename to luminol-server/minecraft-patches/features/0043-Purpur-Barrels-and-enderchests-6-rows.patch diff --git a/luminol-server/minecraft-patches/features/0042-Configurable-tripwire-dupe.patch b/luminol-server/minecraft-patches/features/0044-Configurable-tripwire-dupe.patch similarity index 100% rename from luminol-server/minecraft-patches/features/0042-Configurable-tripwire-dupe.patch rename to luminol-server/minecraft-patches/features/0044-Configurable-tripwire-dupe.patch diff --git a/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/ForceCleanupEntityBrainMemoryConfig.java.patch b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/ForceCleanupEntityBrainMemoryConfig.java.patch new file mode 100644 index 0000000..7d8c3a4 --- /dev/null +++ b/luminol-server/paper-patches/files/src/main/java/me/earthme/luminol/config/modules/experiment/ForceCleanupEntityBrainMemoryConfig.java.patch @@ -0,0 +1,25 @@ +--- /dev/null ++++ b/src/main/java/me/earthme/luminol/config/modules/experiment/ForceCleanupEntityBrainMemoryConfig.java +@@ -1,0 +_,22 @@ ++package me.earthme.luminol.config.modules.experiment; ++ ++import me.earthme.luminol.config.ConfigInfo; ++import me.earthme.luminol.config.EnumConfigCategory; ++import me.earthme.luminol.config.IConfigModule; ++ ++public class ForceCleanupEntityBrainMemoryConfig implements IConfigModule { ++ @ConfigInfo(baseName = "enabled_for_entity", comments = "When enabled, the entity's brain will clean the memory which is typed of entity and not belong to current tickregion") ++ public static boolean enabledForEntity = false; ++ @ConfigInfo(baseName = "enabled_for_block_pos", comments = "When enabled, the entity's brain will clean the memory which is typed of block_pos and not belong to current tickregion") ++ public static boolean enabledForBlockPos = false; ++ ++ @Override ++ public EnumConfigCategory getCategory() { ++ return EnumConfigCategory.EXPERIMENT; ++ } ++ ++ @Override ++ public String getBaseName() { ++ return "force_cleanup_drop_non_owned_entity_memory_module"; ++ } ++}