Use BlockPos and Vec3i, remove our Vect implementations

This commit is contained in:
mezz committed 2016-05-06 02:18:03 -07:00
1 parent 62ddd7bafc
commit c30c3d7575
82 files changed
+597 -967

No files matched your search

@@ -13,6 +13,7 @@ package forestry.farming.logic;
import java.util.Collection;
import java.util.Stack;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -30,8 +31,6 @@ import forestry.api.farming.ICrop;
import forestry.api.farming.IFarmHousing;
import forestry.api.farming.IFarmable;
import forestry.core.utils.BlockUtil;
import forestry.core.utils.vect.Vect;
import forestry.core.utils.vect.VectUtil;
public class FarmLogicInfernal extends FarmLogicHomogeneous {
@@ -71,7 +70,7 @@ public class FarmLogicInfernal extends FarmLogicHomogeneous {
Stack<ICrop> crops = new Stack<>();
for (int i = 0; i < extent; i++) {
Vect position = translateWithOffset(pos.add(0, 1, 0), direction, i);
BlockPos position = translateWithOffset(pos.add(0, 1, 0), direction, i);
for (IFarmable farmable : germlings) {
ICrop crop = farmable.getCropAt(world, position);
if (crop != null) {
@@ -89,14 +88,17 @@ public class FarmLogicInfernal extends FarmLogicHomogeneous {
World world = getWorld();
for (int i = 0; i < extent; i++) {
Vect position = translateWithOffset(pos, direction, i);
BlockPos position = translateWithOffset(pos, direction, i);
IBlockState blockState = world.getBlockState(position);
if (!VectUtil.isAirBlock(world, position) && !BlockUtil.isReplaceableBlock(blockState, world, position)) {
if (!world.isAirBlock(position) && !BlockUtil.isReplaceableBlock(blockState, world, position)) {
continue;
}
ItemStack below = VectUtil.getAsItemStack(world, position.down());
if (!isAcceptedSoil(below)) {
BlockPos soilPosition = position.down();
IBlockState soilState = world.getBlockState(soilPosition);
Block soilBlock = soilState.getBlock();
ItemStack soilStack = soilBlock.getPickBlock(soilState, null, world, soilPosition, null);
if (!isAcceptedSoil(soilStack)) {
continue;
}
@@ -106,7 +108,7 @@ public class FarmLogicInfernal extends FarmLogicHomogeneous {
return false;
}
private boolean trySetCrop(Vect position) {
private boolean trySetCrop(BlockPos position) {
World world = getWorld();
for (IFarmable candidate : germlings) {