Merge branch 'master' of github.com:cabaletta/baritone

This commit is contained in:
Leijurv 2018-08-02 00:19:18 -04:00
commit 46f76df2af
No known key found for this signature in database
GPG Key ID: 0936202430AE187C
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,5 @@
package baritone.bot.pathing.actions;
public interface Action {
double cost();
}

View File

@ -12,19 +12,24 @@ import net.minecraft.util.math.BlockPos;
* @author leijurv
*/
public class GoalYLevel implements Goal {
final int level;
public GoalYLevel(int level) {
this.level = level;
}
@Override
public boolean isInGoal(BlockPos pos) {
return pos.getY() == level;
}
@Override
public double heuristic(BlockPos pos) {
return 20 * Math.abs(pos.getY() - level);//the number 20 was chosen somewhat randomly.
//TODO fix that
}
@Override
public String toString() {
return "Goal{y=" + level + "}";

View File

@ -0,0 +1,25 @@
package baritone.bot.pathing.movements;
import baritone.bot.pathing.actions.Action;
import net.minecraft.util.math.BlockPos;
import java.util.List;
public abstract class Movement {
protected List<Action> actions;
/**
* Gets source block position for Movement.
*
* @return Movement's starting block position
*/
public abstract BlockPos getSrc();
/**
* Gets the block position the movement should finish at
*
* @return Movement's final block position
*/
public abstract BlockPos getDest();
}