27 lines
1.6 KiB
Diff
27 lines
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|||
|
|
From: NanaChiyo0721 <nanachiyo0721@163.com>
|
||
|
|
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<Villager> {
|
||
|
|
|
||
|
|
@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<Level> dimensionType = level.dimension();
|
||
|
|
BlockPos center = body.blockPosition();
|
||
|
|
List<GlobalPos> jobSites = Lists.newArrayList();
|