mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-28 07:35:47 +00:00
Use BlockPos and Vec3i, remove our Vect implementations
This commit is contained in:
1 parent
62ddd7bafc
commit
c30c3d7575
82 files changed
+597
-967
No files matched your search
@@ -11,6 +11,7 @@
|
||||
package forestry.farming.logic;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -19,9 +20,7 @@ import net.minecraft.world.World;
|
||||
import forestry.api.farming.ICrop;
|
||||
import forestry.api.farming.IFarmable;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.utils.BlockUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.core.utils.vect.Vect;
|
||||
|
||||
public class FarmableBasicAgricraft implements IFarmable {
|
||||
|
||||
@@ -35,18 +34,22 @@ public class FarmableBasicAgricraft implements IFarmable {
|
||||
|
||||
@Override
|
||||
public boolean isSaplingAt(World world, BlockPos pos) {
|
||||
return BlockUtil.getBlock(world, pos) == block;
|
||||
return world.getBlockState(pos).getBlock() == this.block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICrop getCropAt(World world, BlockPos pos) {
|
||||
if (BlockUtil.getBlock(world, pos) != block) {
|
||||
IBlockState blockState = world.getBlockState(pos);
|
||||
Block block = blockState.getBlock();
|
||||
if (block != this.block) {
|
||||
return null;
|
||||
}
|
||||
if (BlockUtil.getBlockMetadata(world, pos) != matureMeta) {
|
||||
|
||||
int blockMetadata = block.getMetaFromState(blockState);
|
||||
if (blockMetadata != matureMeta) {
|
||||
return null;
|
||||
}
|
||||
return new CropBasicAgriCraft(world, block, matureMeta, new Vect(pos));
|
||||
return new CropBasicAgriCraft(world, this.block, matureMeta, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user