Search in sources :

Example 11 with MutableMoveResult

use of baritone.utils.pathing.MutableMoveResult in project baritone by cabaletta.

the class MovementDiagonal method calculateCost.

@Override
public double calculateCost(CalculationContext context) {
    MutableMoveResult result = new MutableMoveResult();
    cost(context, src.x, src.y, src.z, dest.x, dest.z, result);
    if (result.y != dest.y) {
        // doesn't apply to us, this position is incorrect
        return COST_INF;
    }
    return result.cost;
}
Also used : MutableMoveResult(baritone.utils.pathing.MutableMoveResult)

Example 12 with MutableMoveResult

use of baritone.utils.pathing.MutableMoveResult in project baritone by cabaletta.

the class MovementFall method willPlaceBucket.

private boolean willPlaceBucket() {
    CalculationContext context = new CalculationContext(baritone);
    MutableMoveResult result = new MutableMoveResult();
    return MovementDescend.dynamicFallCost(context, src.x, src.y, src.z, dest.x, dest.z, 0, context.get(dest.x, src.y - 2, dest.z), result);
}
Also used : CalculationContext(baritone.pathing.movement.CalculationContext) MutableMoveResult(baritone.utils.pathing.MutableMoveResult)

Example 13 with MutableMoveResult

use of baritone.utils.pathing.MutableMoveResult in project baritone by cabaletta.

the class MovementFall method calculateCost.

@Override
public double calculateCost(CalculationContext context) {
    MutableMoveResult result = new MutableMoveResult();
    MovementDescend.cost(context, src.x, src.y, src.z, dest.x, dest.z, result);
    if (result.y != dest.y) {
        // doesn't apply to us, this position is a descend not a fall
        return COST_INF;
    }
    return result.cost;
}
Also used : MutableMoveResult(baritone.utils.pathing.MutableMoveResult)

Example 14 with MutableMoveResult

use of baritone.utils.pathing.MutableMoveResult in project baritone by cabaletta.

the class MovementParkour method cost.

public static MovementParkour cost(CalculationContext context, BetterBlockPos src, EnumFacing direction) {
    MutableMoveResult res = new MutableMoveResult();
    cost(context, src.x, src.y, src.z, direction, res);
    int dist = Math.abs(res.x - src.x) + Math.abs(res.z - src.z);
    return new MovementParkour(context.getBaritone(), src, dist, direction, res.y > src.y);
}
Also used : MutableMoveResult(baritone.utils.pathing.MutableMoveResult)

Aggregations

MutableMoveResult (baritone.utils.pathing.MutableMoveResult)14 IPath (baritone.api.pathing.calc.IPath)2 BinaryHeapOpenSet (baritone.pathing.calc.openset.BinaryHeapOpenSet)2 CalculationContext (baritone.pathing.movement.CalculationContext)2 Moves (baritone.pathing.movement.Moves)2 BetterWorldBorder (baritone.utils.pathing.BetterWorldBorder)2