From 1f25ad07e325234fb2347150122a61c9a51fa351 Mon Sep 17 00:00:00 2001 From: NanaChiyo0721 Date: Sun, 26 Jul 2026 21:45:56 +0800 Subject: [PATCH] Fix wrong ticket update determination in RegionizedTaskQueue --- ...-update-determination-in-RegionizedT.patch | 29 ++++++ ...21-Force-clamp-grid-exponent-to-1-6.patch} | 0 ...-Force-disable-builtin-spark-plugin.patch} | 0 ...nimals-check-can-teleport-in-an-unl.patch} | 0 ...cket-processing-queue-with-mt-queue.patch} | 0 ...ync-protocol-switching-optimization.patch} | 0 ...0026-Improved-server-health-command.patch} | 0 ...iju-Entity-tick-and-removal-limiter.patch} | 0 ...ju-Vanilla-end-portal-teleportation.patch} | 0 ...-to-support-for-long-command-inputs.patch} | 0 ...0030-Add-config-for-server-mod-name.patch} | 0 ...=> 0031-Add-config-for-cpu-affinity.patch} | 0 ...Add-config-for-unsafe-teleportation.patch} | 0 ...033-Add-config-for-watchdog-timeout.patch} | 0 ...fig-to-disable-entity-tick-catchers.patch} | 0 ...35-Add-config-for-heightmap-warning.patch} | 0 ...atch => 0036-Add-config-gui-support.patch} | 0 ...e-data-command-to-be-enabled-config.patch} | 0 ...config-for-command-block-command-ex.patch} | 0 ...-config-to-modify-tripwire-behavior.patch} | 0 ... 0040-Add-config-for-item-multitask.patch} | 0 ...1-Add-config-to-enable-tick-command.patch} | 0 ...-for-whether-to-save-portal-tickets.patch} | 0 ...tch => 0043-Add-portal-rate-limiter.patch} | 0 ...us-bar.patch => 0044-Add-status-bar.patch} | 0 ...patch => 0045-Leaves-Vanilla-Hopper.patch} | 0 ...eaves-Lithium-Sleeping-Block-Entity.patch} | 0 ...ch => 0047-Petal-Reduce-sensor-work.patch} | 0 ...8-Purpur-Lobotomize-stuck-villagers.patch} | 0 ...ish-Reduce-projectile-chunk-loading.patch} | 0 ...le-goal-selector-during-inactive-ti.patch} | 0 ...Secure-seed-and-matter-seed-command.patch} | 0 ... => 0052-Secure-seed-V2-with-Blake3.patch} | 0 ...rain-maps-with-optimized-collection.patch} | 0 ...ss-creating-stats-json-bases-on-pla.patch} | 0 ...mize-PatchedDataComponentMap-equals.patch} | 0 ...r-checking-for-useless-move-packets.patch} | 0 ...ch => 0057-Leaf-fast-bit-radix-sort.patch} | 0 ...Configurable-vanilla-username-check.patch} | 0 ...59-Leaf-Lithium-faster-hash-palette.patch} | 0 ...cket-limit-Shiroha-Option-to-full-d.patch} | 0 ...ves-Configurable-collision-behavior.patch} | 0 ...062-Leaves-Optimized-dragon-respawn.patch} | 0 ...le-Variable-entity-wake-up-duration.patch} | 0 ...ttributes-with-optimized-collection.patch} | 0 ...kip-entity-move-if-movement-is-zero.patch} | 0 ...6-Gale-Store-mob-counts-in-an-array.patch} | 0 ...imize-random-calls-in-chunk-ticking.patch} | 0 ...uce-enderman-teleport-chunk-lookups.patch} | 0 ...> 0069-Gale-Cache-ShapePairKey-hash.patch} | 0 ...n-check-has-physics-before-same-veh.patch} | 0 ...ible-planar-movement-multiplication.patch} | 0 ...-Gale-Optimize-matching-item-checks.patch} | 0 ...a-and-Optional-allocation-in-Entity.patch} | 0 ... 0074-Gale-Reduce-array-allocations.patch} | 0 ...075-Some-optimizations-from-krypton.patch} | 0 ...h => 0076-Frustum-filtering-tracker.patch} | 0 ...um-Optimizes-Hoglin-repellent-search.patch | 36 ------- ...imized-collections-for-WeightedList.patch} | 0 ...m-optimized-non-poi-block-searching.patch} | 96 ++++++++++++++++++- ...um-Optimizes-Piglin-repellent-search.patch | 35 ------- ...0-Lithium-Optimize-remove-block-goal.patch | 39 -------- 62 files changed, 123 insertions(+), 112 deletions(-) create mode 100644 shiroha-server/minecraft-patches/features/0020-Fix-wrong-ticket-update-determination-in-RegionizedT.patch rename shiroha-server/minecraft-patches/features/{0020-Force-clamp-grid-exponent-to-1-6.patch => 0021-Force-clamp-grid-exponent-to-1-6.patch} (100%) rename shiroha-server/minecraft-patches/features/{0021-Force-disable-builtin-spark-plugin.patch => 0022-Force-disable-builtin-spark-plugin.patch} (100%) rename shiroha-server/minecraft-patches/features/{0022-Prevent-tamable-animals-check-can-teleport-in-an-unl.patch => 0023-Prevent-tamable-animals-check-can-teleport-in-an-unl.patch} (100%) rename shiroha-server/minecraft-patches/features/{0023-Replace-packet-processing-queue-with-mt-queue.patch => 0024-Replace-packet-processing-queue-with-mt-queue.patch} (100%) rename shiroha-server/minecraft-patches/features/{0024-Async-protocol-switching-optimization.patch => 0025-Async-protocol-switching-optimization.patch} (100%) rename shiroha-server/minecraft-patches/features/{0025-Improved-server-health-command.patch => 0026-Improved-server-health-command.patch} (100%) rename shiroha-server/minecraft-patches/features/{0026-Kaiiju-Entity-tick-and-removal-limiter.patch => 0027-Kaiiju-Entity-tick-and-removal-limiter.patch} (100%) rename shiroha-server/minecraft-patches/features/{0027-Kaiiju-Vanilla-end-portal-teleportation.patch => 0028-Kaiiju-Vanilla-end-portal-teleportation.patch} (100%) rename shiroha-server/minecraft-patches/features/{0028-Add-config-to-support-for-long-command-inputs.patch => 0029-Add-config-to-support-for-long-command-inputs.patch} (100%) rename shiroha-server/minecraft-patches/features/{0029-Add-config-for-server-mod-name.patch => 0030-Add-config-for-server-mod-name.patch} (100%) rename shiroha-server/minecraft-patches/features/{0030-Add-config-for-cpu-affinity.patch => 0031-Add-config-for-cpu-affinity.patch} (100%) rename shiroha-server/minecraft-patches/features/{0031-Add-config-for-unsafe-teleportation.patch => 0032-Add-config-for-unsafe-teleportation.patch} (100%) rename shiroha-server/minecraft-patches/features/{0032-Add-config-for-watchdog-timeout.patch => 0033-Add-config-for-watchdog-timeout.patch} (100%) rename shiroha-server/minecraft-patches/features/{0033-Add-config-to-disable-entity-tick-catchers.patch => 0034-Add-config-to-disable-entity-tick-catchers.patch} (100%) rename shiroha-server/minecraft-patches/features/{0034-Add-config-for-heightmap-warning.patch => 0035-Add-config-for-heightmap-warning.patch} (100%) rename shiroha-server/minecraft-patches/features/{0035-Add-config-gui-support.patch => 0036-Add-config-gui-support.patch} (100%) rename shiroha-server/minecraft-patches/features/{0036-Add-force-the-data-command-to-be-enabled-config.patch => 0037-Add-force-the-data-command-to-be-enabled-config.patch} (100%) rename shiroha-server/minecraft-patches/features/{0037-Add-experimental-config-for-command-block-command-ex.patch => 0038-Add-experimental-config-for-command-block-command-ex.patch} (100%) rename shiroha-server/minecraft-patches/features/{0038-Add-config-to-modify-tripwire-behavior.patch => 0039-Add-config-to-modify-tripwire-behavior.patch} (100%) rename shiroha-server/minecraft-patches/features/{0039-Add-config-for-item-multitask.patch => 0040-Add-config-for-item-multitask.patch} (100%) rename shiroha-server/minecraft-patches/features/{0040-Add-config-to-enable-tick-command.patch => 0041-Add-config-to-enable-tick-command.patch} (100%) rename shiroha-server/minecraft-patches/features/{0041-Add-config-for-whether-to-save-portal-tickets.patch => 0042-Add-config-for-whether-to-save-portal-tickets.patch} (100%) rename shiroha-server/minecraft-patches/features/{0042-Add-portal-rate-limiter.patch => 0043-Add-portal-rate-limiter.patch} (100%) rename shiroha-server/minecraft-patches/features/{0043-Add-status-bar.patch => 0044-Add-status-bar.patch} (100%) rename shiroha-server/minecraft-patches/features/{0044-Leaves-Vanilla-Hopper.patch => 0045-Leaves-Vanilla-Hopper.patch} (100%) rename shiroha-server/minecraft-patches/features/{0045-Leaves-Lithium-Sleeping-Block-Entity.patch => 0046-Leaves-Lithium-Sleeping-Block-Entity.patch} (100%) rename shiroha-server/minecraft-patches/features/{0046-Petal-Reduce-sensor-work.patch => 0047-Petal-Reduce-sensor-work.patch} (100%) rename shiroha-server/minecraft-patches/features/{0047-Purpur-Lobotomize-stuck-villagers.patch => 0048-Purpur-Lobotomize-stuck-villagers.patch} (100%) rename shiroha-server/minecraft-patches/features/{0048-Pufferfish-Reduce-projectile-chunk-loading.patch => 0049-Pufferfish-Reduce-projectile-chunk-loading.patch} (100%) rename shiroha-server/minecraft-patches/features/{0049-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch => 0050-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch} (100%) rename shiroha-server/minecraft-patches/features/{0050-Leaf-Secure-seed-and-matter-seed-command.patch => 0051-Leaf-Secure-seed-and-matter-seed-command.patch} (100%) rename shiroha-server/minecraft-patches/features/{0051-Secure-seed-V2-with-Blake3.patch => 0052-Secure-seed-V2-with-Blake3.patch} (100%) rename shiroha-server/minecraft-patches/features/{0052-Leaf-Replace-brain-maps-with-optimized-collection.patch => 0053-Leaf-Replace-brain-maps-with-optimized-collection.patch} (100%) rename shiroha-server/minecraft-patches/features/{0053-Leaf-Remove-useless-creating-stats-json-bases-on-pla.patch => 0054-Leaf-Remove-useless-creating-stats-json-bases-on-pla.patch} (100%) rename shiroha-server/minecraft-patches/features/{0054-Leaf-Optimize-PatchedDataComponentMap-equals.patch => 0055-Leaf-Optimize-PatchedDataComponentMap-equals.patch} (100%) rename shiroha-server/minecraft-patches/features/{0055-Leaf-Better-checking-for-useless-move-packets.patch => 0056-Leaf-Better-checking-for-useless-move-packets.patch} (100%) rename shiroha-server/minecraft-patches/features/{0056-Leaf-fast-bit-radix-sort.patch => 0057-Leaf-fast-bit-radix-sort.patch} (100%) rename shiroha-server/minecraft-patches/features/{0057-Leaf-Configurable-vanilla-username-check.patch => 0058-Leaf-Configurable-vanilla-username-check.patch} (100%) rename shiroha-server/minecraft-patches/features/{0058-Leaf-Lithium-faster-hash-palette.patch => 0059-Leaf-Lithium-faster-hash-palette.patch} (100%) rename shiroha-server/minecraft-patches/features/{0059-Leaves-Disable-packet-limit-Shiroha-Option-to-full-d.patch => 0060-Leaves-Disable-packet-limit-Shiroha-Option-to-full-d.patch} (100%) rename shiroha-server/minecraft-patches/features/{0060-Leaves-Configurable-collision-behavior.patch => 0061-Leaves-Configurable-collision-behavior.patch} (100%) rename shiroha-server/minecraft-patches/features/{0061-Leaves-Optimized-dragon-respawn.patch => 0062-Leaves-Optimized-dragon-respawn.patch} (100%) rename shiroha-server/minecraft-patches/features/{0062-Gale-Variable-entity-wake-up-duration.patch => 0063-Gale-Variable-entity-wake-up-duration.patch} (100%) rename shiroha-server/minecraft-patches/features/{0063-Gale-Replace-AI-attributes-with-optimized-collection.patch => 0064-Gale-Replace-AI-attributes-with-optimized-collection.patch} (100%) rename shiroha-server/minecraft-patches/features/{0064-Gale-Skip-entity-move-if-movement-is-zero.patch => 0065-Gale-Skip-entity-move-if-movement-is-zero.patch} (100%) rename shiroha-server/minecraft-patches/features/{0065-Gale-Store-mob-counts-in-an-array.patch => 0066-Gale-Store-mob-counts-in-an-array.patch} (100%) rename shiroha-server/minecraft-patches/features/{0066-Gale-Optimize-random-calls-in-chunk-ticking.patch => 0067-Gale-Optimize-random-calls-in-chunk-ticking.patch} (100%) rename shiroha-server/minecraft-patches/features/{0067-Gale-Reduce-enderman-teleport-chunk-lookups.patch => 0068-Gale-Reduce-enderman-teleport-chunk-lookups.patch} (100%) rename shiroha-server/minecraft-patches/features/{0068-Gale-Cache-ShapePairKey-hash.patch => 0069-Gale-Cache-ShapePairKey-hash.patch} (100%) rename shiroha-server/minecraft-patches/features/{0069-Gale-For-collision-check-has-physics-before-same-veh.patch => 0070-Gale-For-collision-check-has-physics-before-same-veh.patch} (100%) rename shiroha-server/minecraft-patches/features/{0070-Gale-Skip-negligible-planar-movement-multiplication.patch => 0071-Gale-Skip-negligible-planar-movement-multiplication.patch} (100%) rename shiroha-server/minecraft-patches/features/{0071-Gale-Optimize-matching-item-checks.patch => 0072-Gale-Optimize-matching-item-checks.patch} (100%) rename shiroha-server/minecraft-patches/features/{0072-Gale-Reduce-lambda-and-Optional-allocation-in-Entity.patch => 0073-Gale-Reduce-lambda-and-Optional-allocation-in-Entity.patch} (100%) rename shiroha-server/minecraft-patches/features/{0073-Gale-Reduce-array-allocations.patch => 0074-Gale-Reduce-array-allocations.patch} (100%) rename shiroha-server/minecraft-patches/features/{0074-Some-optimizations-from-krypton.patch => 0075-Some-optimizations-from-krypton.patch} (100%) rename shiroha-server/minecraft-patches/features/{0075-Frustum-filtering-tracker.patch => 0076-Frustum-filtering-tracker.patch} (100%) delete mode 100644 shiroha-server/minecraft-patches/features/0077-Lithium-Optimizes-Hoglin-repellent-search.patch rename shiroha-server/minecraft-patches/features/{0076-Lithium-optimized-collections-for-WeightedList.patch => 0077-Lithium-optimized-collections-for-WeightedList.patch} (100%) rename shiroha-server/minecraft-patches/features/{0078-Lithium-Optimizes-move-to-block-goal.patch => 0078-Lithium-optimized-non-poi-block-searching.patch} (64%) delete mode 100644 shiroha-server/minecraft-patches/features/0079-Lithium-Optimizes-Piglin-repellent-search.patch delete mode 100644 shiroha-server/minecraft-patches/features/0080-Lithium-Optimize-remove-block-goal.patch diff --git a/shiroha-server/minecraft-patches/features/0020-Fix-wrong-ticket-update-determination-in-RegionizedT.patch b/shiroha-server/minecraft-patches/features/0020-Fix-wrong-ticket-update-determination-in-RegionizedT.patch new file mode 100644 index 0000000..c5ba14f --- /dev/null +++ b/shiroha-server/minecraft-patches/features/0020-Fix-wrong-ticket-update-determination-in-RegionizedT.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: NanaChiyo0721 +Date: Sun, 26 Jul 2026 20:42:44 +0800 +Subject: [PATCH] Fix wrong ticket update determination in RegionizedTaskQueue + + +diff --git a/io/papermc/paper/threadedregions/RegionizedTaskQueue.java b/io/papermc/paper/threadedregions/RegionizedTaskQueue.java +index fefec2930716b02b8e14f4b4f0fe3226fe53a617..037697e6364c73057b1fbac354bd78d8bf35bc7b 100644 +--- a/io/papermc/paper/threadedregions/RegionizedTaskQueue.java ++++ b/io/papermc/paper/threadedregions/RegionizedTaskQueue.java +@@ -289,14 +289,17 @@ public final class RegionizedTaskQueue { + boolean executeTickTasks = allowedTickTasks > 0; + boolean executeChunkTasks = allowedChunkTasks > 0; + boolean executeGlobalTasks = true; ++ boolean processedChunkTask = false; // Shiroha - Fix wrong ticket update determination in RegionizedTaskQueue + + do { + executeTickTasks = executeTickTasks && allowedTickTasks-- > 0 && tickTaskQueue.executeTask(); + executeChunkTasks = executeChunkTasks && allowedChunkTasks-- > 0 && chunkTaskQueue.executeTask(); + executeGlobalTasks = executeGlobalTasks && this.worldRegionTaskData.executeGlobalChunkTask(); ++ ++ processedChunkTask |= (executeChunkTasks | executeGlobalTasks); // Shiroha - Fix wrong ticket update determination in RegionizedTaskQueue + } while (executeTickTasks | executeChunkTasks | executeGlobalTasks); + +- if (allowedChunkTasks > 0) { ++ if (processedChunkTask) { // Shiroha - Fix wrong ticket update determination in RegionizedTaskQueue + // if we executed chunk tasks, we should try to process ticket updates for full status changes + this.worldRegionTaskData.world.moonrise$getChunkTaskScheduler().chunkHolderManager.processTicketUpdates(); + } diff --git a/shiroha-server/minecraft-patches/features/0020-Force-clamp-grid-exponent-to-1-6.patch b/shiroha-server/minecraft-patches/features/0021-Force-clamp-grid-exponent-to-1-6.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0020-Force-clamp-grid-exponent-to-1-6.patch rename to shiroha-server/minecraft-patches/features/0021-Force-clamp-grid-exponent-to-1-6.patch diff --git a/shiroha-server/minecraft-patches/features/0021-Force-disable-builtin-spark-plugin.patch b/shiroha-server/minecraft-patches/features/0022-Force-disable-builtin-spark-plugin.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0021-Force-disable-builtin-spark-plugin.patch rename to shiroha-server/minecraft-patches/features/0022-Force-disable-builtin-spark-plugin.patch diff --git a/shiroha-server/minecraft-patches/features/0022-Prevent-tamable-animals-check-can-teleport-in-an-unl.patch b/shiroha-server/minecraft-patches/features/0023-Prevent-tamable-animals-check-can-teleport-in-an-unl.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0022-Prevent-tamable-animals-check-can-teleport-in-an-unl.patch rename to shiroha-server/minecraft-patches/features/0023-Prevent-tamable-animals-check-can-teleport-in-an-unl.patch diff --git a/shiroha-server/minecraft-patches/features/0023-Replace-packet-processing-queue-with-mt-queue.patch b/shiroha-server/minecraft-patches/features/0024-Replace-packet-processing-queue-with-mt-queue.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0023-Replace-packet-processing-queue-with-mt-queue.patch rename to shiroha-server/minecraft-patches/features/0024-Replace-packet-processing-queue-with-mt-queue.patch diff --git a/shiroha-server/minecraft-patches/features/0024-Async-protocol-switching-optimization.patch b/shiroha-server/minecraft-patches/features/0025-Async-protocol-switching-optimization.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0024-Async-protocol-switching-optimization.patch rename to shiroha-server/minecraft-patches/features/0025-Async-protocol-switching-optimization.patch diff --git a/shiroha-server/minecraft-patches/features/0025-Improved-server-health-command.patch b/shiroha-server/minecraft-patches/features/0026-Improved-server-health-command.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0025-Improved-server-health-command.patch rename to shiroha-server/minecraft-patches/features/0026-Improved-server-health-command.patch diff --git a/shiroha-server/minecraft-patches/features/0026-Kaiiju-Entity-tick-and-removal-limiter.patch b/shiroha-server/minecraft-patches/features/0027-Kaiiju-Entity-tick-and-removal-limiter.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0026-Kaiiju-Entity-tick-and-removal-limiter.patch rename to shiroha-server/minecraft-patches/features/0027-Kaiiju-Entity-tick-and-removal-limiter.patch diff --git a/shiroha-server/minecraft-patches/features/0027-Kaiiju-Vanilla-end-portal-teleportation.patch b/shiroha-server/minecraft-patches/features/0028-Kaiiju-Vanilla-end-portal-teleportation.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0027-Kaiiju-Vanilla-end-portal-teleportation.patch rename to shiroha-server/minecraft-patches/features/0028-Kaiiju-Vanilla-end-portal-teleportation.patch diff --git a/shiroha-server/minecraft-patches/features/0028-Add-config-to-support-for-long-command-inputs.patch b/shiroha-server/minecraft-patches/features/0029-Add-config-to-support-for-long-command-inputs.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0028-Add-config-to-support-for-long-command-inputs.patch rename to shiroha-server/minecraft-patches/features/0029-Add-config-to-support-for-long-command-inputs.patch diff --git a/shiroha-server/minecraft-patches/features/0029-Add-config-for-server-mod-name.patch b/shiroha-server/minecraft-patches/features/0030-Add-config-for-server-mod-name.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0029-Add-config-for-server-mod-name.patch rename to shiroha-server/minecraft-patches/features/0030-Add-config-for-server-mod-name.patch diff --git a/shiroha-server/minecraft-patches/features/0030-Add-config-for-cpu-affinity.patch b/shiroha-server/minecraft-patches/features/0031-Add-config-for-cpu-affinity.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0030-Add-config-for-cpu-affinity.patch rename to shiroha-server/minecraft-patches/features/0031-Add-config-for-cpu-affinity.patch diff --git a/shiroha-server/minecraft-patches/features/0031-Add-config-for-unsafe-teleportation.patch b/shiroha-server/minecraft-patches/features/0032-Add-config-for-unsafe-teleportation.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0031-Add-config-for-unsafe-teleportation.patch rename to shiroha-server/minecraft-patches/features/0032-Add-config-for-unsafe-teleportation.patch diff --git a/shiroha-server/minecraft-patches/features/0032-Add-config-for-watchdog-timeout.patch b/shiroha-server/minecraft-patches/features/0033-Add-config-for-watchdog-timeout.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0032-Add-config-for-watchdog-timeout.patch rename to shiroha-server/minecraft-patches/features/0033-Add-config-for-watchdog-timeout.patch diff --git a/shiroha-server/minecraft-patches/features/0033-Add-config-to-disable-entity-tick-catchers.patch b/shiroha-server/minecraft-patches/features/0034-Add-config-to-disable-entity-tick-catchers.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0033-Add-config-to-disable-entity-tick-catchers.patch rename to shiroha-server/minecraft-patches/features/0034-Add-config-to-disable-entity-tick-catchers.patch diff --git a/shiroha-server/minecraft-patches/features/0034-Add-config-for-heightmap-warning.patch b/shiroha-server/minecraft-patches/features/0035-Add-config-for-heightmap-warning.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0034-Add-config-for-heightmap-warning.patch rename to shiroha-server/minecraft-patches/features/0035-Add-config-for-heightmap-warning.patch diff --git a/shiroha-server/minecraft-patches/features/0035-Add-config-gui-support.patch b/shiroha-server/minecraft-patches/features/0036-Add-config-gui-support.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0035-Add-config-gui-support.patch rename to shiroha-server/minecraft-patches/features/0036-Add-config-gui-support.patch diff --git a/shiroha-server/minecraft-patches/features/0036-Add-force-the-data-command-to-be-enabled-config.patch b/shiroha-server/minecraft-patches/features/0037-Add-force-the-data-command-to-be-enabled-config.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0036-Add-force-the-data-command-to-be-enabled-config.patch rename to shiroha-server/minecraft-patches/features/0037-Add-force-the-data-command-to-be-enabled-config.patch diff --git a/shiroha-server/minecraft-patches/features/0037-Add-experimental-config-for-command-block-command-ex.patch b/shiroha-server/minecraft-patches/features/0038-Add-experimental-config-for-command-block-command-ex.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0037-Add-experimental-config-for-command-block-command-ex.patch rename to shiroha-server/minecraft-patches/features/0038-Add-experimental-config-for-command-block-command-ex.patch diff --git a/shiroha-server/minecraft-patches/features/0038-Add-config-to-modify-tripwire-behavior.patch b/shiroha-server/minecraft-patches/features/0039-Add-config-to-modify-tripwire-behavior.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0038-Add-config-to-modify-tripwire-behavior.patch rename to shiroha-server/minecraft-patches/features/0039-Add-config-to-modify-tripwire-behavior.patch diff --git a/shiroha-server/minecraft-patches/features/0039-Add-config-for-item-multitask.patch b/shiroha-server/minecraft-patches/features/0040-Add-config-for-item-multitask.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0039-Add-config-for-item-multitask.patch rename to shiroha-server/minecraft-patches/features/0040-Add-config-for-item-multitask.patch diff --git a/shiroha-server/minecraft-patches/features/0040-Add-config-to-enable-tick-command.patch b/shiroha-server/minecraft-patches/features/0041-Add-config-to-enable-tick-command.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0040-Add-config-to-enable-tick-command.patch rename to shiroha-server/minecraft-patches/features/0041-Add-config-to-enable-tick-command.patch diff --git a/shiroha-server/minecraft-patches/features/0041-Add-config-for-whether-to-save-portal-tickets.patch b/shiroha-server/minecraft-patches/features/0042-Add-config-for-whether-to-save-portal-tickets.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0041-Add-config-for-whether-to-save-portal-tickets.patch rename to shiroha-server/minecraft-patches/features/0042-Add-config-for-whether-to-save-portal-tickets.patch diff --git a/shiroha-server/minecraft-patches/features/0042-Add-portal-rate-limiter.patch b/shiroha-server/minecraft-patches/features/0043-Add-portal-rate-limiter.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0042-Add-portal-rate-limiter.patch rename to shiroha-server/minecraft-patches/features/0043-Add-portal-rate-limiter.patch diff --git a/shiroha-server/minecraft-patches/features/0043-Add-status-bar.patch b/shiroha-server/minecraft-patches/features/0044-Add-status-bar.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0043-Add-status-bar.patch rename to shiroha-server/minecraft-patches/features/0044-Add-status-bar.patch diff --git a/shiroha-server/minecraft-patches/features/0044-Leaves-Vanilla-Hopper.patch b/shiroha-server/minecraft-patches/features/0045-Leaves-Vanilla-Hopper.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0044-Leaves-Vanilla-Hopper.patch rename to shiroha-server/minecraft-patches/features/0045-Leaves-Vanilla-Hopper.patch diff --git a/shiroha-server/minecraft-patches/features/0045-Leaves-Lithium-Sleeping-Block-Entity.patch b/shiroha-server/minecraft-patches/features/0046-Leaves-Lithium-Sleeping-Block-Entity.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0045-Leaves-Lithium-Sleeping-Block-Entity.patch rename to shiroha-server/minecraft-patches/features/0046-Leaves-Lithium-Sleeping-Block-Entity.patch diff --git a/shiroha-server/minecraft-patches/features/0046-Petal-Reduce-sensor-work.patch b/shiroha-server/minecraft-patches/features/0047-Petal-Reduce-sensor-work.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0046-Petal-Reduce-sensor-work.patch rename to shiroha-server/minecraft-patches/features/0047-Petal-Reduce-sensor-work.patch diff --git a/shiroha-server/minecraft-patches/features/0047-Purpur-Lobotomize-stuck-villagers.patch b/shiroha-server/minecraft-patches/features/0048-Purpur-Lobotomize-stuck-villagers.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0047-Purpur-Lobotomize-stuck-villagers.patch rename to shiroha-server/minecraft-patches/features/0048-Purpur-Lobotomize-stuck-villagers.patch diff --git a/shiroha-server/minecraft-patches/features/0048-Pufferfish-Reduce-projectile-chunk-loading.patch b/shiroha-server/minecraft-patches/features/0049-Pufferfish-Reduce-projectile-chunk-loading.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0048-Pufferfish-Reduce-projectile-chunk-loading.patch rename to shiroha-server/minecraft-patches/features/0049-Pufferfish-Reduce-projectile-chunk-loading.patch diff --git a/shiroha-server/minecraft-patches/features/0049-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch b/shiroha-server/minecraft-patches/features/0050-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0049-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch rename to shiroha-server/minecraft-patches/features/0050-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch diff --git a/shiroha-server/minecraft-patches/features/0050-Leaf-Secure-seed-and-matter-seed-command.patch b/shiroha-server/minecraft-patches/features/0051-Leaf-Secure-seed-and-matter-seed-command.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0050-Leaf-Secure-seed-and-matter-seed-command.patch rename to shiroha-server/minecraft-patches/features/0051-Leaf-Secure-seed-and-matter-seed-command.patch diff --git a/shiroha-server/minecraft-patches/features/0051-Secure-seed-V2-with-Blake3.patch b/shiroha-server/minecraft-patches/features/0052-Secure-seed-V2-with-Blake3.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0051-Secure-seed-V2-with-Blake3.patch rename to shiroha-server/minecraft-patches/features/0052-Secure-seed-V2-with-Blake3.patch diff --git a/shiroha-server/minecraft-patches/features/0052-Leaf-Replace-brain-maps-with-optimized-collection.patch b/shiroha-server/minecraft-patches/features/0053-Leaf-Replace-brain-maps-with-optimized-collection.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0052-Leaf-Replace-brain-maps-with-optimized-collection.patch rename to shiroha-server/minecraft-patches/features/0053-Leaf-Replace-brain-maps-with-optimized-collection.patch diff --git a/shiroha-server/minecraft-patches/features/0053-Leaf-Remove-useless-creating-stats-json-bases-on-pla.patch b/shiroha-server/minecraft-patches/features/0054-Leaf-Remove-useless-creating-stats-json-bases-on-pla.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0053-Leaf-Remove-useless-creating-stats-json-bases-on-pla.patch rename to shiroha-server/minecraft-patches/features/0054-Leaf-Remove-useless-creating-stats-json-bases-on-pla.patch diff --git a/shiroha-server/minecraft-patches/features/0054-Leaf-Optimize-PatchedDataComponentMap-equals.patch b/shiroha-server/minecraft-patches/features/0055-Leaf-Optimize-PatchedDataComponentMap-equals.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0054-Leaf-Optimize-PatchedDataComponentMap-equals.patch rename to shiroha-server/minecraft-patches/features/0055-Leaf-Optimize-PatchedDataComponentMap-equals.patch diff --git a/shiroha-server/minecraft-patches/features/0055-Leaf-Better-checking-for-useless-move-packets.patch b/shiroha-server/minecraft-patches/features/0056-Leaf-Better-checking-for-useless-move-packets.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0055-Leaf-Better-checking-for-useless-move-packets.patch rename to shiroha-server/minecraft-patches/features/0056-Leaf-Better-checking-for-useless-move-packets.patch diff --git a/shiroha-server/minecraft-patches/features/0056-Leaf-fast-bit-radix-sort.patch b/shiroha-server/minecraft-patches/features/0057-Leaf-fast-bit-radix-sort.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0056-Leaf-fast-bit-radix-sort.patch rename to shiroha-server/minecraft-patches/features/0057-Leaf-fast-bit-radix-sort.patch diff --git a/shiroha-server/minecraft-patches/features/0057-Leaf-Configurable-vanilla-username-check.patch b/shiroha-server/minecraft-patches/features/0058-Leaf-Configurable-vanilla-username-check.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0057-Leaf-Configurable-vanilla-username-check.patch rename to shiroha-server/minecraft-patches/features/0058-Leaf-Configurable-vanilla-username-check.patch diff --git a/shiroha-server/minecraft-patches/features/0058-Leaf-Lithium-faster-hash-palette.patch b/shiroha-server/minecraft-patches/features/0059-Leaf-Lithium-faster-hash-palette.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0058-Leaf-Lithium-faster-hash-palette.patch rename to shiroha-server/minecraft-patches/features/0059-Leaf-Lithium-faster-hash-palette.patch diff --git a/shiroha-server/minecraft-patches/features/0059-Leaves-Disable-packet-limit-Shiroha-Option-to-full-d.patch b/shiroha-server/minecraft-patches/features/0060-Leaves-Disable-packet-limit-Shiroha-Option-to-full-d.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0059-Leaves-Disable-packet-limit-Shiroha-Option-to-full-d.patch rename to shiroha-server/minecraft-patches/features/0060-Leaves-Disable-packet-limit-Shiroha-Option-to-full-d.patch diff --git a/shiroha-server/minecraft-patches/features/0060-Leaves-Configurable-collision-behavior.patch b/shiroha-server/minecraft-patches/features/0061-Leaves-Configurable-collision-behavior.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0060-Leaves-Configurable-collision-behavior.patch rename to shiroha-server/minecraft-patches/features/0061-Leaves-Configurable-collision-behavior.patch diff --git a/shiroha-server/minecraft-patches/features/0061-Leaves-Optimized-dragon-respawn.patch b/shiroha-server/minecraft-patches/features/0062-Leaves-Optimized-dragon-respawn.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0061-Leaves-Optimized-dragon-respawn.patch rename to shiroha-server/minecraft-patches/features/0062-Leaves-Optimized-dragon-respawn.patch diff --git a/shiroha-server/minecraft-patches/features/0062-Gale-Variable-entity-wake-up-duration.patch b/shiroha-server/minecraft-patches/features/0063-Gale-Variable-entity-wake-up-duration.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0062-Gale-Variable-entity-wake-up-duration.patch rename to shiroha-server/minecraft-patches/features/0063-Gale-Variable-entity-wake-up-duration.patch diff --git a/shiroha-server/minecraft-patches/features/0063-Gale-Replace-AI-attributes-with-optimized-collection.patch b/shiroha-server/minecraft-patches/features/0064-Gale-Replace-AI-attributes-with-optimized-collection.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0063-Gale-Replace-AI-attributes-with-optimized-collection.patch rename to shiroha-server/minecraft-patches/features/0064-Gale-Replace-AI-attributes-with-optimized-collection.patch diff --git a/shiroha-server/minecraft-patches/features/0064-Gale-Skip-entity-move-if-movement-is-zero.patch b/shiroha-server/minecraft-patches/features/0065-Gale-Skip-entity-move-if-movement-is-zero.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0064-Gale-Skip-entity-move-if-movement-is-zero.patch rename to shiroha-server/minecraft-patches/features/0065-Gale-Skip-entity-move-if-movement-is-zero.patch diff --git a/shiroha-server/minecraft-patches/features/0065-Gale-Store-mob-counts-in-an-array.patch b/shiroha-server/minecraft-patches/features/0066-Gale-Store-mob-counts-in-an-array.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0065-Gale-Store-mob-counts-in-an-array.patch rename to shiroha-server/minecraft-patches/features/0066-Gale-Store-mob-counts-in-an-array.patch diff --git a/shiroha-server/minecraft-patches/features/0066-Gale-Optimize-random-calls-in-chunk-ticking.patch b/shiroha-server/minecraft-patches/features/0067-Gale-Optimize-random-calls-in-chunk-ticking.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0066-Gale-Optimize-random-calls-in-chunk-ticking.patch rename to shiroha-server/minecraft-patches/features/0067-Gale-Optimize-random-calls-in-chunk-ticking.patch diff --git a/shiroha-server/minecraft-patches/features/0067-Gale-Reduce-enderman-teleport-chunk-lookups.patch b/shiroha-server/minecraft-patches/features/0068-Gale-Reduce-enderman-teleport-chunk-lookups.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0067-Gale-Reduce-enderman-teleport-chunk-lookups.patch rename to shiroha-server/minecraft-patches/features/0068-Gale-Reduce-enderman-teleport-chunk-lookups.patch diff --git a/shiroha-server/minecraft-patches/features/0068-Gale-Cache-ShapePairKey-hash.patch b/shiroha-server/minecraft-patches/features/0069-Gale-Cache-ShapePairKey-hash.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0068-Gale-Cache-ShapePairKey-hash.patch rename to shiroha-server/minecraft-patches/features/0069-Gale-Cache-ShapePairKey-hash.patch diff --git a/shiroha-server/minecraft-patches/features/0069-Gale-For-collision-check-has-physics-before-same-veh.patch b/shiroha-server/minecraft-patches/features/0070-Gale-For-collision-check-has-physics-before-same-veh.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0069-Gale-For-collision-check-has-physics-before-same-veh.patch rename to shiroha-server/minecraft-patches/features/0070-Gale-For-collision-check-has-physics-before-same-veh.patch diff --git a/shiroha-server/minecraft-patches/features/0070-Gale-Skip-negligible-planar-movement-multiplication.patch b/shiroha-server/minecraft-patches/features/0071-Gale-Skip-negligible-planar-movement-multiplication.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0070-Gale-Skip-negligible-planar-movement-multiplication.patch rename to shiroha-server/minecraft-patches/features/0071-Gale-Skip-negligible-planar-movement-multiplication.patch diff --git a/shiroha-server/minecraft-patches/features/0071-Gale-Optimize-matching-item-checks.patch b/shiroha-server/minecraft-patches/features/0072-Gale-Optimize-matching-item-checks.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0071-Gale-Optimize-matching-item-checks.patch rename to shiroha-server/minecraft-patches/features/0072-Gale-Optimize-matching-item-checks.patch diff --git a/shiroha-server/minecraft-patches/features/0072-Gale-Reduce-lambda-and-Optional-allocation-in-Entity.patch b/shiroha-server/minecraft-patches/features/0073-Gale-Reduce-lambda-and-Optional-allocation-in-Entity.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0072-Gale-Reduce-lambda-and-Optional-allocation-in-Entity.patch rename to shiroha-server/minecraft-patches/features/0073-Gale-Reduce-lambda-and-Optional-allocation-in-Entity.patch diff --git a/shiroha-server/minecraft-patches/features/0073-Gale-Reduce-array-allocations.patch b/shiroha-server/minecraft-patches/features/0074-Gale-Reduce-array-allocations.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0073-Gale-Reduce-array-allocations.patch rename to shiroha-server/minecraft-patches/features/0074-Gale-Reduce-array-allocations.patch diff --git a/shiroha-server/minecraft-patches/features/0074-Some-optimizations-from-krypton.patch b/shiroha-server/minecraft-patches/features/0075-Some-optimizations-from-krypton.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0074-Some-optimizations-from-krypton.patch rename to shiroha-server/minecraft-patches/features/0075-Some-optimizations-from-krypton.patch diff --git a/shiroha-server/minecraft-patches/features/0075-Frustum-filtering-tracker.patch b/shiroha-server/minecraft-patches/features/0076-Frustum-filtering-tracker.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0075-Frustum-filtering-tracker.patch rename to shiroha-server/minecraft-patches/features/0076-Frustum-filtering-tracker.patch diff --git a/shiroha-server/minecraft-patches/features/0077-Lithium-Optimizes-Hoglin-repellent-search.patch b/shiroha-server/minecraft-patches/features/0077-Lithium-Optimizes-Hoglin-repellent-search.patch deleted file mode 100644 index 4ed9b0e..0000000 --- a/shiroha-server/minecraft-patches/features/0077-Lithium-Optimizes-Hoglin-repellent-search.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: NanaChiyo0721 -Date: Sat, 25 Jul 2026 21:16:19 +0800 -Subject: [PATCH] Lithium Optimizes Hoglin repellent search. - - -diff --git a/net/minecraft/world/entity/ai/sensing/HoglinSpecificSensor.java b/net/minecraft/world/entity/ai/sensing/HoglinSpecificSensor.java -index 7022679c84e184999b416e06d1af2cc2500cb12b..ac8f4acc2aaee8ca9f7598d842ecf29f2ad73be3 100644 ---- a/net/minecraft/world/entity/ai/sensing/HoglinSpecificSensor.java -+++ b/net/minecraft/world/entity/ai/sensing/HoglinSpecificSensor.java -@@ -16,6 +16,14 @@ import net.minecraft.world.entity.monster.hoglin.Hoglin; - import net.minecraft.world.entity.monster.piglin.Piglin; - - public class HoglinSpecificSensor extends Sensor { -+ // Shiroha start - Lithium Optimizes Hoglin repellent search. -+ private static final java.util.function.Predicate IS_VALID_REPELLENT_PREDICATE = -+ HoglinSpecificSensor::lithium$isValidRepellent; -+ -+ private static boolean lithium$isValidRepellent(net.minecraft.world.level.block.state.BlockState blockState) { -+ return blockState.is(BlockTags.HOGLIN_REPELLENTS); -+ } -+ // Shiroha end - Lithium Optimizes Hoglin repellent search. - @Override - public Set> requires() { - return ImmutableSet.of( -@@ -30,8 +38,8 @@ public class HoglinSpecificSensor extends Sensor { - - @Override - protected void doTick(final ServerLevel level, final Hoglin body) { -- Brain brain = body.getBrain(); -- brain.setMemory(MemoryModuleType.NEAREST_REPELLENT, this.findNearestRepellent(level, body)); -+ Brain brain = body.getBrain();; -+ brain.setMemory(MemoryModuleType.NEAREST_REPELLENT, net.caffeinemc.mods.lithium.common.ai.non_poi_block_search.CommonBlockSearchesCheckAndCache.blockPosFindClosestMatch(level, body, 8, 4, IS_VALID_REPELLENT_PREDICATE, true)); // Shiroha - Lithium Optimizes Hoglin repellent search. - Optional adultPiglin = Optional.empty(); - int adultPiglinCount = 0; - List adultHoglins = Lists.newArrayList(); diff --git a/shiroha-server/minecraft-patches/features/0076-Lithium-optimized-collections-for-WeightedList.patch b/shiroha-server/minecraft-patches/features/0077-Lithium-optimized-collections-for-WeightedList.patch similarity index 100% rename from shiroha-server/minecraft-patches/features/0076-Lithium-optimized-collections-for-WeightedList.patch rename to shiroha-server/minecraft-patches/features/0077-Lithium-optimized-collections-for-WeightedList.patch diff --git a/shiroha-server/minecraft-patches/features/0078-Lithium-Optimizes-move-to-block-goal.patch b/shiroha-server/minecraft-patches/features/0078-Lithium-optimized-non-poi-block-searching.patch similarity index 64% rename from shiroha-server/minecraft-patches/features/0078-Lithium-Optimizes-move-to-block-goal.patch rename to shiroha-server/minecraft-patches/features/0078-Lithium-optimized-non-poi-block-searching.patch index b4c28e4..8d0aa3f 100644 --- a/shiroha-server/minecraft-patches/features/0078-Lithium-Optimizes-move-to-block-goal.patch +++ b/shiroha-server/minecraft-patches/features/0078-Lithium-optimized-non-poi-block-searching.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: NanaChiyo0721 -Date: Sat, 25 Jul 2026 21:30:17 +0800 -Subject: [PATCH] Lithium Optimizes move to block goal +Date: Sat, 25 Jul 2026 21:16:19 +0800 +Subject: [PATCH] Lithium optimized non poi block searching diff --git a/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java @@ -185,3 +185,95 @@ index c6e9b155c2341c13d569f28f54f0c1d2d7313676..7bd3c8a1c627cfd3e377a269c649c0c1 + } + // Shiorha end - Lithium Optimizes move to block goal } +diff --git a/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java b/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java +index ff0f99d4b560a1c0721885b0eba5bd5ab2087bd7..90beeee7b74324f81690776546713b4f04887f75 100644 +--- a/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java ++++ b/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java +@@ -25,6 +25,19 @@ public class RemoveBlockGoal extends MoveToBlockGoal { + private final Mob removerMob; + private int ticksSinceReachedGoal; + private static final int WAIT_AFTER_BLOCK_FOUND = 20; ++ // Shiroha start - Lithium Optimize remove block goal ++ private static final java.util.function.BiPredicate IS_VALID_TARGET_ABOVE_BIPREDICATE = ++ RemoveBlockGoal::lithium$isValidTargetAbove; ++ //Split check condition in order to use maybeHas ++ private boolean lithium$isValidTargetBlock(net.minecraft.world.level.block.state.BlockState blockState){ ++ return blockState.is(this.blockToRemove); ++ } ++ ++ private static boolean lithium$isValidTargetAbove(ChunkAccess chunkAccess, BlockPos.MutableBlockPos mutable) { ++ return chunkAccess.getBlockState(mutable.move(0, 1, 0)).isAir() ++ && chunkAccess.getBlockState(mutable.move(0, 1, 0)).isAir(); ++ } ++ // Shiroha end - Lithium Optimize remove block goal + + public RemoveBlockGoal(final Block blockToRemove, final PathfinderMob mob, final double speedModifier, final int verticalSearchRange) { + super(mob, speedModifier, 24, verticalSearchRange); +@@ -39,7 +52,7 @@ public class RemoveBlockGoal extends MoveToBlockGoal { + } else if (this.nextStartTick > 0) { + this.nextStartTick--; + return false; +- } else if (this.findNearestBlock()) { ++ } else if (((net.caffeinemc.mods.lithium.common.ai.non_poi_block_search.LithiumMoveToBlockGoal) this).lithium$findNearestBlock(this::lithium$isValidTargetBlock, IS_VALID_TARGET_ABOVE_BIPREDICATE, false)) { // Shiroha - Lithium Optimize remove block goal + this.nextStartTick = reducedTickDelay(20); + return true; + } else { +diff --git a/net/minecraft/world/entity/ai/sensing/HoglinSpecificSensor.java b/net/minecraft/world/entity/ai/sensing/HoglinSpecificSensor.java +index 7022679c84e184999b416e06d1af2cc2500cb12b..ac8f4acc2aaee8ca9f7598d842ecf29f2ad73be3 100644 +--- a/net/minecraft/world/entity/ai/sensing/HoglinSpecificSensor.java ++++ b/net/minecraft/world/entity/ai/sensing/HoglinSpecificSensor.java +@@ -16,6 +16,14 @@ import net.minecraft.world.entity.monster.hoglin.Hoglin; + import net.minecraft.world.entity.monster.piglin.Piglin; + + public class HoglinSpecificSensor extends Sensor { ++ // Shiroha start - Lithium Optimizes Hoglin repellent search. ++ private static final java.util.function.Predicate IS_VALID_REPELLENT_PREDICATE = ++ HoglinSpecificSensor::lithium$isValidRepellent; ++ ++ private static boolean lithium$isValidRepellent(net.minecraft.world.level.block.state.BlockState blockState) { ++ return blockState.is(BlockTags.HOGLIN_REPELLENTS); ++ } ++ // Shiroha end - Lithium Optimizes Hoglin repellent search. + @Override + public Set> requires() { + return ImmutableSet.of( +@@ -30,8 +38,8 @@ public class HoglinSpecificSensor extends Sensor { + + @Override + protected void doTick(final ServerLevel level, final Hoglin body) { +- Brain brain = body.getBrain(); +- brain.setMemory(MemoryModuleType.NEAREST_REPELLENT, this.findNearestRepellent(level, body)); ++ Brain brain = body.getBrain();; ++ brain.setMemory(MemoryModuleType.NEAREST_REPELLENT, net.caffeinemc.mods.lithium.common.ai.non_poi_block_search.CommonBlockSearchesCheckAndCache.blockPosFindClosestMatch(level, body, 8, 4, IS_VALID_REPELLENT_PREDICATE, true)); // Shiroha - Lithium Optimizes Hoglin repellent search. + Optional adultPiglin = Optional.empty(); + int adultPiglinCount = 0; + List adultHoglins = Lists.newArrayList(); +diff --git a/net/minecraft/world/entity/ai/sensing/PiglinSpecificSensor.java b/net/minecraft/world/entity/ai/sensing/PiglinSpecificSensor.java +index 060a53da799a3036a343cc6f1d73e3e5ca4b7af9..7e5accce5a9183165e7604ca5e144e600b6f503d 100644 +--- a/net/minecraft/world/entity/ai/sensing/PiglinSpecificSensor.java ++++ b/net/minecraft/world/entity/ai/sensing/PiglinSpecificSensor.java +@@ -26,6 +26,15 @@ import net.minecraft.world.level.block.CampfireBlock; + import net.minecraft.world.level.block.state.BlockState; + + public class PiglinSpecificSensor extends Sensor { ++ // Shiroha start - Lithium Optimizes Piglin repellent search. ++ private static final java.util.function.Predicate IS_VALID_REPELLENT_PREDICATE = ++ PiglinSpecificSensor::lithium$isValidRepellent; ++ private static boolean lithium$isValidRepellent(BlockState blockState){ ++ final boolean isPiglinRepellent = blockState.is(BlockTags.PIGLIN_REPELLENTS); ++ return isPiglinRepellent && blockState.is(Blocks.SOUL_CAMPFIRE) ? ++ CampfireBlock.isLitCampfire(blockState) : isPiglinRepellent; ++ } ++ // Shiroha end - Lithium Optimizes Piglin repellent search. + @Override + public Set> requires() { + return ImmutableSet.of( +@@ -47,7 +56,7 @@ public class PiglinSpecificSensor extends Sensor { + @Override + protected void doTick(final ServerLevel level, final LivingEntity body) { + Brain brain = body.getBrain(); +- brain.setMemory(MemoryModuleType.NEAREST_REPELLENT, findNearestRepellent(level, body)); ++ brain.setMemory(MemoryModuleType.NEAREST_REPELLENT, net.caffeinemc.mods.lithium.common.ai.non_poi_block_search.CommonBlockSearchesCheckAndCache.blockPosFindClosestMatch(level, body, 8, 4, IS_VALID_REPELLENT_PREDICATE, true)); // Shiroha - Lithium Optimizes Piglin repellent search. + Optional nemesis = Optional.empty(); + Optional huntableHoglin = Optional.empty(); + Optional babyHoglin = Optional.empty(); diff --git a/shiroha-server/minecraft-patches/features/0079-Lithium-Optimizes-Piglin-repellent-search.patch b/shiroha-server/minecraft-patches/features/0079-Lithium-Optimizes-Piglin-repellent-search.patch deleted file mode 100644 index d782202..0000000 --- a/shiroha-server/minecraft-patches/features/0079-Lithium-Optimizes-Piglin-repellent-search.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: NanaChiyo0721 -Date: Sat, 25 Jul 2026 21:30:26 +0800 -Subject: [PATCH] Lithium Optimizes Piglin repellent search. - - -diff --git a/net/minecraft/world/entity/ai/sensing/PiglinSpecificSensor.java b/net/minecraft/world/entity/ai/sensing/PiglinSpecificSensor.java -index 060a53da799a3036a343cc6f1d73e3e5ca4b7af9..7e5accce5a9183165e7604ca5e144e600b6f503d 100644 ---- a/net/minecraft/world/entity/ai/sensing/PiglinSpecificSensor.java -+++ b/net/minecraft/world/entity/ai/sensing/PiglinSpecificSensor.java -@@ -26,6 +26,15 @@ import net.minecraft.world.level.block.CampfireBlock; - import net.minecraft.world.level.block.state.BlockState; - - public class PiglinSpecificSensor extends Sensor { -+ // Shiroha start - Lithium Optimizes Piglin repellent search. -+ private static final java.util.function.Predicate IS_VALID_REPELLENT_PREDICATE = -+ PiglinSpecificSensor::lithium$isValidRepellent; -+ private static boolean lithium$isValidRepellent(BlockState blockState){ -+ final boolean isPiglinRepellent = blockState.is(BlockTags.PIGLIN_REPELLENTS); -+ return isPiglinRepellent && blockState.is(Blocks.SOUL_CAMPFIRE) ? -+ CampfireBlock.isLitCampfire(blockState) : isPiglinRepellent; -+ } -+ // Shiroha end - Lithium Optimizes Piglin repellent search. - @Override - public Set> requires() { - return ImmutableSet.of( -@@ -47,7 +56,7 @@ public class PiglinSpecificSensor extends Sensor { - @Override - protected void doTick(final ServerLevel level, final LivingEntity body) { - Brain brain = body.getBrain(); -- brain.setMemory(MemoryModuleType.NEAREST_REPELLENT, findNearestRepellent(level, body)); -+ brain.setMemory(MemoryModuleType.NEAREST_REPELLENT, net.caffeinemc.mods.lithium.common.ai.non_poi_block_search.CommonBlockSearchesCheckAndCache.blockPosFindClosestMatch(level, body, 8, 4, IS_VALID_REPELLENT_PREDICATE, true)); // Shiroha - Lithium Optimizes Piglin repellent search. - Optional nemesis = Optional.empty(); - Optional huntableHoglin = Optional.empty(); - Optional babyHoglin = Optional.empty(); diff --git a/shiroha-server/minecraft-patches/features/0080-Lithium-Optimize-remove-block-goal.patch b/shiroha-server/minecraft-patches/features/0080-Lithium-Optimize-remove-block-goal.patch deleted file mode 100644 index 3dcd27c..0000000 --- a/shiroha-server/minecraft-patches/features/0080-Lithium-Optimize-remove-block-goal.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: NanaChiyo0721 -Date: Sat, 25 Jul 2026 21:33:58 +0800 -Subject: [PATCH] Lithium Optimize remove block goal - - -diff --git a/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java b/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java -index ff0f99d4b560a1c0721885b0eba5bd5ab2087bd7..90beeee7b74324f81690776546713b4f04887f75 100644 ---- a/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java -+++ b/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java -@@ -25,6 +25,19 @@ public class RemoveBlockGoal extends MoveToBlockGoal { - private final Mob removerMob; - private int ticksSinceReachedGoal; - private static final int WAIT_AFTER_BLOCK_FOUND = 20; -+ // Shiroha start - Lithium Optimize remove block goal -+ private static final java.util.function.BiPredicate IS_VALID_TARGET_ABOVE_BIPREDICATE = -+ RemoveBlockGoal::lithium$isValidTargetAbove; -+ //Split check condition in order to use maybeHas -+ private boolean lithium$isValidTargetBlock(net.minecraft.world.level.block.state.BlockState blockState){ -+ return blockState.is(this.blockToRemove); -+ } -+ -+ private static boolean lithium$isValidTargetAbove(ChunkAccess chunkAccess, BlockPos.MutableBlockPos mutable) { -+ return chunkAccess.getBlockState(mutable.move(0, 1, 0)).isAir() -+ && chunkAccess.getBlockState(mutable.move(0, 1, 0)).isAir(); -+ } -+ // Shiroha end - Lithium Optimize remove block goal - - public RemoveBlockGoal(final Block blockToRemove, final PathfinderMob mob, final double speedModifier, final int verticalSearchRange) { - super(mob, speedModifier, 24, verticalSearchRange); -@@ -39,7 +52,7 @@ public class RemoveBlockGoal extends MoveToBlockGoal { - } else if (this.nextStartTick > 0) { - this.nextStartTick--; - return false; -- } else if (this.findNearestBlock()) { -+ } else if (((net.caffeinemc.mods.lithium.common.ai.non_poi_block_search.LithiumMoveToBlockGoal) this).lithium$findNearestBlock(this::lithium$isValidTargetBlock, IS_VALID_TARGET_ABOVE_BIPREDICATE, false)) { // Shiroha - Lithium Optimize remove block goal - this.nextStartTick = reducedTickDelay(20); - return true; - } else {