spawn goal setting, addresses #54
This commit is contained in:
parent
e5128635fc
commit
92ec2a35c6
@ -23,10 +23,7 @@ import baritone.bot.behavior.Behavior;
|
|||||||
import baritone.bot.behavior.impl.PathingBehavior;
|
import baritone.bot.behavior.impl.PathingBehavior;
|
||||||
import baritone.bot.event.events.ChatEvent;
|
import baritone.bot.event.events.ChatEvent;
|
||||||
import baritone.bot.pathing.calc.AStarPathFinder;
|
import baritone.bot.pathing.calc.AStarPathFinder;
|
||||||
import baritone.bot.pathing.goals.Goal;
|
import baritone.bot.pathing.goals.*;
|
||||||
import baritone.bot.pathing.goals.GoalBlock;
|
|
||||||
import baritone.bot.pathing.goals.GoalXZ;
|
|
||||||
import baritone.bot.pathing.goals.GoalYLevel;
|
|
||||||
import baritone.bot.pathing.movement.ActionCosts;
|
import baritone.bot.pathing.movement.ActionCosts;
|
||||||
import baritone.bot.pathing.movement.CalculationContext;
|
import baritone.bot.pathing.movement.CalculationContext;
|
||||||
import baritone.bot.pathing.movement.Movement;
|
import baritone.bot.pathing.movement.Movement;
|
||||||
@ -113,6 +110,15 @@ public class ExampleBaritoneControl extends Behavior {
|
|||||||
event.cancel();
|
event.cancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (msg.toLowerCase().equals("spawn")) {
|
||||||
|
BlockPos spawnPoint = player().getBedLocation();
|
||||||
|
// for some reason the default spawnpoint is underground sometimes
|
||||||
|
Goal goal = new GoalXZ(spawnPoint.getX(), spawnPoint.getY());
|
||||||
|
PathingBehavior.INSTANCE.setGoal(goal);
|
||||||
|
displayChatMessageRaw("Goal: " + goal);
|
||||||
|
event.cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (msg.toLowerCase().equals("costs")) {
|
if (msg.toLowerCase().equals("costs")) {
|
||||||
Movement[] movements = AStarPathFinder.getConnectedPositions(new BetterBlockPos(playerFeet()), new CalculationContext());
|
Movement[] movements = AStarPathFinder.getConnectedPositions(new BetterBlockPos(playerFeet()), new CalculationContext());
|
||||||
ArrayList<Movement> moves = new ArrayList<>(Arrays.asList(movements));
|
ArrayList<Movement> moves = new ArrayList<>(Arrays.asList(movements));
|
||||||
|
Loading…
Reference in New Issue
Block a user