mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-23 16:59:24 +00:00
33 lines
1.9 KiB
Diff
33 lines
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Sun, 6 Jul 2025 02:26:11 +0300
|
|
Subject: [PATCH] lithium: skip useless secondary poi sensor
|
|
|
|
This patch is based on the following mixin:
|
|
"net/caffeinemc/mods/lithium/mixin/ai/sensor/secondary_poi/SecondaryPoiSensorMixin.java"
|
|
By: 2No2Name <2No2Name@web.de>
|
|
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
|
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
|
|
|
Lithium description:
|
|
|
|
villagers that have no secondary POI (farmland) do not search for it
|
|
|
|
diff --git a/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java b/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
|
|
index dc4a9ddb8479e9d0c4895b19d7d677cdd8ad3faa..c3911232667ae9e1f70397f6ff5e7608694248fa 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(ServerLevel level, Villager entity) {
|
|
+ // DivineMC start - lithium: skip useless secondary poi sensor
|
|
+ if (org.bxteam.divinemc.config.DivineConfig.PerformanceCategory.skipUselessSecondaryPoiSensor && entity.getVillagerData().profession().value().secondaryPoi().isEmpty()) {
|
|
+ entity.getBrain().eraseMemory(MemoryModuleType.SECONDARY_JOB_SITE);
|
|
+ return;
|
|
+ }
|
|
+ // DivineMC end - lithium: skip useless secondary poi sensor
|
|
// Purpur start - Option for Villager Clerics to farm Nether Wart - make sure clerics don't wander to soul sand when the option is off
|
|
Brain<?> brain = entity.getBrain();
|
|
if (!level.purpurConfig.villagerClericsFarmWarts && entity.getVillagerData().profession().is(net.minecraft.world.entity.npc.VillagerProfession.CLERIC)) {
|