Search in sources :

Example 1 with BlockGlass

use of net.minecraft.block.BlockGlass in project SpringFestival by TeamCovertDragon.

the class BlockHangingFirecracker method canBlockStay.

public boolean canBlockStay(World worldIn, BlockPos pos) {
    pos = pos.up();
    IBlockState state = worldIn.getBlockState(pos);
    Block block = state.getBlock();
    if (state.isSideSolid(worldIn, pos, EnumFacing.DOWN) || state.getBlockFaceShape(worldIn, pos, EnumFacing.DOWN) == BlockFaceShape.SOLID) {
        return block != Blocks.END_GATEWAY && !(block instanceof BlockPistonBase);
    } else if (block instanceof BlockHangingFirecracker) {
        return state.getValue(COUNT) == 0;
    } else {
        return block.isLeaves(state, worldIn, pos) || block instanceof BlockFence || block instanceof BlockGlass || block instanceof BlockWall || block instanceof BlockStainedGlass;
    }
}
Also used : BlockStainedGlass(net.minecraft.block.BlockStainedGlass) IBlockState(net.minecraft.block.state.IBlockState) BlockWall(net.minecraft.block.BlockWall) BlockPistonBase(net.minecraft.block.BlockPistonBase) BlockGlass(net.minecraft.block.BlockGlass) Block(net.minecraft.block.Block) BlockFence(net.minecraft.block.BlockFence)

Aggregations

Block (net.minecraft.block.Block)1 BlockFence (net.minecraft.block.BlockFence)1 BlockGlass (net.minecraft.block.BlockGlass)1 BlockPistonBase (net.minecraft.block.BlockPistonBase)1 BlockStainedGlass (net.minecraft.block.BlockStainedGlass)1 BlockWall (net.minecraft.block.BlockWall)1 IBlockState (net.minecraft.block.state.IBlockState)1