no more references to player() from pathing thread

This commit is contained in:
Leijurv
2018-11-09 17:21:02 -08:00
parent a2a60e9847
commit dd08b2c825
9 changed files with 87 additions and 56 deletions
@@ -31,6 +31,7 @@ import baritone.cache.ChunkPacker;
import baritone.cache.Waypoint;
import baritone.cache.WorldProvider;
import baritone.pathing.calc.AbstractNodeCostSearch;
import baritone.pathing.movement.CalculationContext;
import baritone.pathing.movement.Movement;
import baritone.pathing.movement.Moves;
import baritone.process.CustomGoalProcess;
@@ -450,7 +451,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper {
return true;
}
if (msg.equals("costs")) {
List<Movement> moves = Stream.of(Moves.values()).map(x -> x.apply0(playerFeet())).collect(Collectors.toCollection(ArrayList::new));
List<Movement> moves = Stream.of(Moves.values()).map(x -> x.apply0(new CalculationContext(), playerFeet())).collect(Collectors.toCollection(ArrayList::new));
while (moves.contains(null)) {
moves.remove(null);
}