From f1ad249c1133c330c1509c222f21dfb111267770 Mon Sep 17 00:00:00 2001 From: NanaChiyo0721 Date: Fri, 7 Aug 2026 15:07:23 +0800 Subject: [PATCH] Lithium skip unnecessary secondary poi sensing This is a part of lithium(https://github.com/CaffeineMC/lithium/blob/c42972b6e9d21c8ff45559df6b271802050a22e2/common/src/main/java/net/caffeinemc/mods/lithium/mixin/ai/sensor/secondary_poi/SecondaryPoiSensorMixin.java#L13) Original license: https://github.com/CaffeineMC/lithium/blob/c42972b6e9d21c8ff45559df6b271802050a22e2/LICENSE.md --- ...ip-unnecessary-secondary-poi-sensing.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 shiroha-server/minecraft-patches/features/0086-Lithium-skip-unnecessary-secondary-poi-sensing.patch diff --git a/shiroha-server/minecraft-patches/features/0086-Lithium-skip-unnecessary-secondary-poi-sensing.patch b/shiroha-server/minecraft-patches/features/0086-Lithium-skip-unnecessary-secondary-poi-sensing.patch new file mode 100644 index 0000000..fb71e05 --- /dev/null +++ b/shiroha-server/minecraft-patches/features/0086-Lithium-skip-unnecessary-secondary-poi-sensing.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: NanaChiyo0721 +Date: Fri, 7 Aug 2026 15:05:38 +0800 +Subject: [PATCH] Lithium skip unnecessary secondary poi sensing + +This is a part of lithium(https://github.com/CaffeineMC/lithium/blob/c42972b6e9d21c8ff45559df6b271802050a22e2/common/src/main/java/net/caffeinemc/mods/lithium/mixin/ai/sensor/secondary_poi/SecondaryPoiSensorMixin.java#L13) + +Original license: https://github.com/CaffeineMC/lithium/blob/c42972b6e9d21c8ff45559df6b271802050a22e2/LICENSE.md + +diff --git a/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java b/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java +index ec12508c112b1e7748a5d197b73a0d540bed10fc..a9e1c80d20f3ff9b7e68d617e3360fc786a6015d 100644 +--- a/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java ++++ b/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java +@@ -22,6 +22,12 @@ public class SecondaryPoiSensor extends Sensor { + + @Override + protected void doTick(final ServerLevel level, final Villager body) { ++ // Shiroha start - lithium skip unnecessary secondary poi sensing ++ if (body.getVillagerData().profession().value().secondaryPoi().isEmpty()) { ++ body.getBrain().eraseMemory(MemoryModuleType.SECONDARY_JOB_SITE); ++ return; ++ } ++ // Shiroha end - lithium skip unnecessary secondary poi sensing + ResourceKey dimensionType = level.dimension(); + BlockPos center = body.blockPosition(); + List jobSites = Lists.newArrayList();