baritone/pathfinding/goals/GoalGetToBlock.java
2018-08-01 11:34:35 -04:00

32 lines
885 B
Java

/*
* 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.
*/
package baritone.pathfinding.goals;
import net.minecraft.client.Minecraft;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
/**
*
* @author avecowa
*/
public class GoalGetToBlock extends GoalComposite{
public static BlockPos goalPos;
public GoalGetToBlock(BlockPos pos) {
super(ajacentBlocks(goalPos = pos));
}
public GoalGetToBlock(){
this(Minecraft.getMinecraft().player.getPosition0());
}
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;
}
}