baritone/src/main/java/baritone/bot/pathing/goals/GoalGetToBlock.java

32 lines
837 B
Java
Raw Normal View History

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:30:12 +00:00
package baritone.bot.pathing.goals;
2018-08-02 03:13:48 +00:00
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 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;
}
}