Only scan world if Villager profession has secondary POI (#14144)

This commit is contained in:
Max Lee 2026-08-06 11:00:20 +01:00 committed by GitHub
parent 714512e3bc
commit 2035ad384c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,10 @@
--- a/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
+++ b/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
@@ -27,6 +_,7 @@
List<GlobalPos> jobSites = Lists.newArrayList();
int horizontalSearch = 4;
+ if (!body.getVillagerData().profession().value().secondaryPoi().isEmpty()) // Paper - Perf: Only scan world if Villager profession has secondary POI
for (int x = -4; x <= 4; x++) {
for (int y = -2; y <= 2; y++) {
for (int z = -4; z <= 4; z++) {