2018-08-02 03:13:48 +00:00
|
|
|
/*
|
|
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
|
|
* To change this template file, choose Tools | Templates
|
|
|
|
* and open the template in the editor.
|
|
|
|
*/
|
2018-08-02 03:17:10 +00:00
|
|
|
package baritone.bot.goals;
|
2018-08-02 03:13:48 +00:00
|
|
|
|
|
|
|
import baritone.Baritone;
|
|
|
|
import net.minecraft.util.EnumFacing;
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Don't get into the block, but get directly adjacent to it.
|
|
|
|
* Useful for chests.
|
|
|
|
* @author avecowa
|
|
|
|
*/
|
|
|
|
public class GoalGetToBlock extends GoalComposite {
|
|
|
|
|
|
|
|
public static BlockPos goalPos;
|
|
|
|
|
|
|
|
public GoalGetToBlock(BlockPos pos) {
|
|
|
|
super(ajacentBlocks(goalPos = pos));
|
|
|
|
}
|
|
|
|
|
|
|
|
public GoalGetToBlock() {
|
|
|
|
this(Baritone.playerFeet);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static BlockPos[] ajacentBlocks(BlockPos pos) {
|
|
|
|
BlockPos[] sides = new BlockPos[6];
|
|
|
|
for (int i = 0; i < 6; i++) {
|
|
|
|
sides[i] = pos.offset(EnumFacing.values()[i]);
|
|
|
|
}
|
|
|
|
return sides;
|
|
|
|
}
|
|
|
|
}
|