mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 18:45:29 +01:00
Add new pathfinder maximum iterations setting
This commit is contained in:
parent
5f062dbb3a
commit
fd7b6c6fbf
@ -101,6 +101,7 @@ public class Settings {
|
||||
MAX_PACKET_ENTRIES("npc.limits.max-packet-entries", 15),
|
||||
MAX_SPEED("npc.limits.max-speed", 100),
|
||||
MAX_TEXT_RANGE("npc.chat.options.max-text-range", 500),
|
||||
MAXIMUM_ASTAR_ITERATIONS("npc.pathfinding.maximum-new-pathfinder-iterations", 50000),
|
||||
MESSAGE_COLOUR("general.color-scheme.message", "<a>"),
|
||||
NEW_PATHFINDER_OPENS_DOORS("npc.pathfinding.new-finder-open-doors", false),
|
||||
NPC_ATTACK_DISTANCE("npc.pathfinding.attack-range", 1.75 * 1.75),
|
||||
|
@ -11,6 +11,7 @@ import org.bukkit.util.Vector;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.citizensnpcs.Settings.Setting;
|
||||
import net.citizensnpcs.api.ai.AbstractPathStrategy;
|
||||
import net.citizensnpcs.api.ai.NavigatorParameters;
|
||||
import net.citizensnpcs.api.ai.TargetType;
|
||||
@ -86,7 +87,7 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
|
||||
VectorGoal goal = new VectorGoal(destination, (float) params.pathDistanceMargin());
|
||||
setPlan(ASTAR.runFully(goal,
|
||||
new VectorNode(goal, location, new ChunkBlockSource(location, params.range()), params.examiners()),
|
||||
50000));
|
||||
Setting.MAXIMUM_ASTAR_ITERATIONS.asInt()));
|
||||
}
|
||||
if (getCancelReason() != null || plan == null || plan.isComplete()) {
|
||||
return true;
|
||||
|
@ -10,6 +10,7 @@ import org.bukkit.util.Vector;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.citizensnpcs.Settings.Setting;
|
||||
import net.citizensnpcs.api.ai.AbstractPathStrategy;
|
||||
import net.citizensnpcs.api.ai.NavigatorParameters;
|
||||
import net.citizensnpcs.api.ai.TargetType;
|
||||
@ -95,7 +96,8 @@ public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
|
||||
parameters.examiner(new FlyingBlockExaminer());
|
||||
}
|
||||
setPlan(ASTAR.runFully(goal, new VectorNode(goal, location,
|
||||
new ChunkBlockSource(location, parameters.range()), parameters.examiners()), 50000));
|
||||
new ChunkBlockSource(location, parameters.range()), parameters.examiners()),
|
||||
Setting.MAXIMUM_ASTAR_ITERATIONS.asInt()));
|
||||
}
|
||||
if (getCancelReason() != null || plan == null || plan.isComplete()) {
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user