
Still need to do some more work, such as adding the seeds and the material you get from the plant.
46 lines
1.5 KiB
Java
46 lines
1.5 KiB
Java
package wayoftime.bloodmagic.common.block;
|
|
|
|
import net.minecraft.block.AbstractBlock;
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.block.BlockState;
|
|
import net.minecraft.block.CropsBlock;
|
|
import net.minecraft.item.Items;
|
|
import net.minecraft.util.IItemProvider;
|
|
import net.minecraft.util.math.BlockPos;
|
|
import net.minecraft.util.math.shapes.ISelectionContext;
|
|
import net.minecraft.util.math.shapes.VoxelShape;
|
|
import net.minecraft.world.IBlockReader;
|
|
|
|
public class BlockGrowingDoubt extends CropsBlock
|
|
{
|
|
private static final VoxelShape[] SHAPES = new VoxelShape[] {
|
|
Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 4.0D, 16.0D),
|
|
Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D),
|
|
Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D),
|
|
Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 9.0D, 16.0D),
|
|
Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 10.0D, 16.0D),
|
|
Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 11.0D, 16.0D),
|
|
Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 14.0D, 16.0D),
|
|
Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D) };
|
|
|
|
public BlockGrowingDoubt(AbstractBlock.Properties properties)
|
|
{
|
|
super(properties);
|
|
}
|
|
|
|
protected boolean isValidGround(BlockState state, IBlockReader worldIn, BlockPos pos)
|
|
{
|
|
return state.isIn(BloodMagicBlocks.NETHER_SOIL.get());
|
|
}
|
|
|
|
protected IItemProvider getSeedsItem()
|
|
{
|
|
return Items.POTATO;
|
|
}
|
|
|
|
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context)
|
|
{
|
|
return SHAPES[state.get(this.getAgeProperty())];
|
|
}
|
|
}
|