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

42 lines
1.3 KiB
Java
Raw Normal View History

2018-08-08 03:16:53 +00:00
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
2018-08-08 03:16:53 +00:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
2018-08-22 20:15:56 +00:00
package baritone.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.
*
2018-08-02 03:13:48 +00:00
* @author avecowa
*/
public class GoalGetToBlock extends GoalComposite {
public GoalGetToBlock(BlockPos pos) {
2018-08-02 04:27:11 +00:00
super(adjacentBlocks(pos));
2018-08-02 03:13:48 +00:00
}
2018-08-02 04:27:11 +00:00
private static BlockPos[] adjacentBlocks(BlockPos pos) {
2018-08-02 03:13:48 +00:00
BlockPos[] sides = new BlockPos[6];
for (int i = 0; i < 6; i++) {
sides[i] = pos.offset(EnumFacing.values()[i]);
}
return sides;
}
}