/
SugarCaneCropBlock.java
37 lines (32 loc) · 1.16 KB
/
SugarCaneCropBlock.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package knightminer.inspirations.tweaks.block;
import knightminer.inspirations.tweaks.InspirationsTweaks;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
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;
import net.minecraftforge.common.PlantType;
public class SugarCaneCropBlock extends BlockCropBlock {
private static final VoxelShape[] BOUNDS = {
makeCuboidShape(2, 0, 2, 14, 2, 14),
makeCuboidShape(2, 0, 2, 14, 4, 14),
makeCuboidShape(2, 0, 2, 14, 6, 14),
makeCuboidShape(2, 0, 2, 14, 8, 14),
makeCuboidShape(2, 0, 2, 14, 10, 14),
makeCuboidShape(2, 0, 2, 14, 12, 14),
makeCuboidShape(2, 0, 2, 14, 14, 14)
};
public SugarCaneCropBlock() {
super(Blocks.SUGAR_CANE, PlantType.BEACH);
}
@Override
protected IItemProvider getSeedsItem() {
return InspirationsTweaks.cactusSeeds;
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
return BOUNDS[this.getAge(state)];
}
}