use of baritone.api.pathing.goals.GoalXZ in project meteor-client by MeteorDevelopment.
the class SwarmCommand method scatter.
private void scatter(int radius) {
Random random = new Random();
double a = random.nextDouble() * 2 * Math.PI;
double r = radius * Math.sqrt(random.nextDouble());
double x = mc.player.getX() + r * Math.cos(a);
double z = mc.player.getZ() + r * Math.sin(a);
BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().cancelEverything();
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ((int) x, (int) z));
}
use of baritone.api.pathing.goals.GoalXZ in project baritone by cabaletta.
the class FollowProcess method towards.
private Goal towards(Entity following) {
BlockPos pos;
if (Baritone.settings().followOffsetDistance.value == 0) {
pos = new BlockPos(following);
} else {
GoalXZ g = GoalXZ.fromDirection(following.getPositionVector(), Baritone.settings().followOffsetDirection.value, Baritone.settings().followOffsetDistance.value);
pos = new BlockPos(g.getX(), following.posY, g.getZ());
}
return new GoalNear(pos, Baritone.settings().followRadius.value);
}
use of baritone.api.pathing.goals.GoalXZ in project baritone by cabaletta.
the class PathingBehavior method createPathfinder.
private static AbstractNodeCostSearch createPathfinder(BlockPos start, Goal goal, IPath previous, CalculationContext context) {
Goal transformed = goal;
if (Baritone.settings().simplifyUnloadedYCoord.value && goal instanceof IGoalRenderPos) {
BlockPos pos = ((IGoalRenderPos) goal).getGoalPos();
if (!context.bsi.worldContainsLoadedChunk(pos.getX(), pos.getZ())) {
transformed = new GoalXZ(pos.getX(), pos.getZ());
}
}
Favoring favoring = new Favoring(context.getBaritone().getPlayerContext(), previous, context);
return new AStarPathFinder(start.getX(), start.getY(), start.getZ(), transformed, favoring, context);
}
use of baritone.api.pathing.goals.GoalXZ in project Client by MatHax.
the class SwarmCommand method scatter.
private void scatter(int radius) {
Random random = new Random();
double a = random.nextDouble() * 2 * Math.PI;
double r = radius * Math.sqrt(random.nextDouble());
double x = mc.player.getX() + r * Math.cos(a);
double z = mc.player.getZ() + r * Math.sin(a);
BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().cancelEverything();
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ((int) x, (int) z));
}
Aggregations