feat: add stuckEntityPoiRetryDelay config (#12949)

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
MC_XiaoHei
2025-08-24 00:39:19 +08:00
committed by GitHub
parent 79cf1353b9
commit ea014f7a77
2 changed files with 4 additions and 1 deletions
@@ -4,7 +4,7 @@
return false;
} else {
mutableLong.setValue(time + 20L + level.getRandom().nextInt(20));
+ if (mob.getNavigation().isStuck()) mutableLong.add(200); // Paper - Perf: Wait an additional 10s to check again if they're stuck // TODO Modifies Vanilla behavior, add config option
+ if (level.paperConfig().entities.behavior.stuckEntityPoiRetryDelay.enabled() && mob.getNavigation().isStuck()) mutableLong.add(level.paperConfig().entities.behavior.stuckEntityPoiRetryDelay.intValue()); // Paper - Next stuck check delay config
PoiManager poiManager = level.getPoiManager();
map.long2ObjectEntrySet().removeIf(entry -> !entry.getValue().isStillValid(time));
Predicate<BlockPos> predicate1 = pos -> {
@@ -31,6 +31,7 @@ import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import java.util.OptionalDouble;
import java.util.OptionalInt;
import java.util.function.Function;
import java.util.stream.Collectors;
import net.minecraft.Util;
@@ -331,6 +332,8 @@ public class WorldConfiguration extends ConfigurationPart {
@Comment("Adds a cooldown to bees being released after a failed release, which can occur if the hive is blocked or it being night.")
public boolean cooldownFailedBeehiveReleases = true;
@Comment("The delay before retrying POI acquisition when entity navigation is stuck. This will reduce pathfinding performance impact. Measured in ticks.")
public IntOr.Disabled stuckEntityPoiRetryDelay = new IntOr.Disabled(OptionalInt.of(200));
}
public TrackingRangeY trackingRangeY;