feat: add stuckEntityPoiRetryDelay config (#12949)
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
mutableLong.setValue(time + 20L + level.getRandom().nextInt(20));
|
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();
|
PoiManager poiManager = level.getPoiManager();
|
||||||
map.long2ObjectEntrySet().removeIf(entry -> !entry.getValue().isStillValid(time));
|
map.long2ObjectEntrySet().removeIf(entry -> !entry.getValue().isStillValid(time));
|
||||||
Predicate<BlockPos> predicate1 = pos -> {
|
Predicate<BlockPos> predicate1 = pos -> {
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import java.util.IdentityHashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.OptionalDouble;
|
import java.util.OptionalDouble;
|
||||||
|
import java.util.OptionalInt;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import net.minecraft.Util;
|
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.")
|
@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;
|
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;
|
public TrackingRangeY trackingRangeY;
|
||||||
|
|||||||
Reference in New Issue
Block a user