25 lines
1.3 KiB
Diff
25 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: M2ke4U <79621885+MrHua269@users.noreply.github.com>
|
|
Date: Sun, 26 Nov 2023 17:30:32 +0800
|
|
Subject: [PATCH] Gale Skip secondary POI sensor if absent
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
|
|
index cb1d91f9fe98f21c2afbe3894dfd9bca3bdd3ba6..75dc06a3041bfdfb08c914eb50cfa282ae9eb2fe 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
|
|
@@ -22,6 +22,13 @@ public class SecondaryPoiSensor extends Sensor<Villager> {
|
|
|
|
@Override
|
|
protected void doTick(ServerLevel world, Villager entity) {
|
|
+ // Gale start - Lithium - skip secondary POI sensor if absent
|
|
+ var secondaryPoi = entity.getVillagerData().getProfession().secondaryPoi();
|
|
+ if (secondaryPoi.isEmpty()) {
|
|
+ entity.getBrain().eraseMemory(MemoryModuleType.SECONDARY_JOB_SITE);
|
|
+ return;
|
|
+ }
|
|
+ // Gale end - Lithium - skip secondary POI sensor if absent
|
|
ResourceKey<Level> resourceKey = world.dimension();
|
|
BlockPos blockPos = entity.blockPosition();
|
|
List<GlobalPos> list = Lists.newArrayList();
|