mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-05 15:01:26 +01:00
Fix guided waypoint provider (?)
This commit is contained in:
parent
ccdb7b8d92
commit
b14663c588
@ -130,8 +130,9 @@ public class GuidedWaypointProvider implements EnumerableWaypointProvider {
|
|||||||
public void run() {
|
public void run() {
|
||||||
available.clear();
|
available.clear();
|
||||||
helpers.clear();
|
helpers.clear();
|
||||||
if (showPath)
|
if (showPath) {
|
||||||
markers.destroyMarkers();
|
markers.destroyMarkers();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -155,7 +156,9 @@ public class GuidedWaypointProvider implements EnumerableWaypointProvider {
|
|||||||
helpers.add(element);
|
helpers.add(element);
|
||||||
Messaging.send(player, Messages.GUIDED_WAYPOINT_EDITOR_ADDED_GUIDE);
|
Messaging.send(player, Messages.GUIDED_WAYPOINT_EDITOR_ADDED_GUIDE);
|
||||||
}
|
}
|
||||||
createWaypointMarkerWithData(element);
|
if (showPath) {
|
||||||
|
createWaypointMarkerWithData(element);
|
||||||
|
}
|
||||||
rebuildTree();
|
rebuildTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,9 +374,10 @@ public class GuidedWaypointProvider implements EnumerableWaypointProvider {
|
|||||||
public Iterable<AStarNode> getNeighbours() {
|
public Iterable<AStarNode> getNeighbours() {
|
||||||
PhFilterDistance filter = new PhFilterDistance();
|
PhFilterDistance filter = new PhFilterDistance();
|
||||||
filter.set(new long[] { waypoint.getLocation().getBlockX(), waypoint.getLocation().getBlockY(),
|
filter.set(new long[] { waypoint.getLocation().getBlockX(), waypoint.getLocation().getBlockY(),
|
||||||
waypoint.getLocation().getBlockZ() }, new PhDistanceL(), 15);
|
waypoint.getLocation().getBlockZ() }, PhDistanceL.THIS, 10);
|
||||||
PhKnnQuery<Waypoint> res = tree.nearestNeighbour(0, null, filter, waypoint.getLocation().getBlockX(),
|
PhKnnQuery<Waypoint> res = tree.nearestNeighbour(100, PhDistanceL.THIS, filter,
|
||||||
waypoint.getLocation().getBlockY(), waypoint.getLocation().getBlockZ());
|
waypoint.getLocation().getBlockX(), waypoint.getLocation().getBlockY(),
|
||||||
|
waypoint.getLocation().getBlockZ());
|
||||||
List<AStarNode> resList = Lists.newArrayList();
|
List<AStarNode> resList = Lists.newArrayList();
|
||||||
res.forEachRemaining(new Consumer<Waypoint>() {
|
res.forEachRemaining(new Consumer<Waypoint>() {
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user