package eu.midnightdust.motschen.rocks.block; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.*; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.BlockView; import net.minecraft.world.WorldView; public class Pinecone extends Block { private static final VoxelShape SHAPE; public Pinecone() { super(FabricBlockSettings.copy(Blocks.POPPY).nonOpaque().sounds(BlockSoundGroup.WOOD)); this.setDefaultState(this.stateManager.getDefaultState()); } @Override public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) { return SHAPE; } static { VoxelShape shape = createCuboidShape(0, 0, 0, 16, 3, 16); SHAPE = shape; } public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { return world.getBlockState(pos.down()).isSideSolidFullSquare(world,pos,Direction.UP); } }