Search in sources :

Example 1 with TileEntityAdvancedBoundingBlock

use of mekanism.common.tile.TileEntityAdvancedBoundingBlock in project Mekanism by mekanism.

the class WorldUtils method makeAdvancedBoundingBlock.

/**
 * Places a fake advanced bounding block at the defined location.
 *
 * @param world            world to place block in
 * @param boundingLocation coordinates of bounding block
 * @param orig             original block position
 */
public static void makeAdvancedBoundingBlock(IWorld world, BlockPos boundingLocation, BlockPos orig) {
    BlockBounding boundingBlock = MekanismBlocks.ADVANCED_BOUNDING_BLOCK.getBlock();
    BlockState newState = BlockStateHelper.getStateForPlacement(boundingBlock, boundingBlock.defaultBlockState(), world, boundingLocation, null, Direction.NORTH);
    world.setBlock(boundingLocation, newState, BlockFlags.DEFAULT);
    if (!world.isClientSide()) {
        TileEntityAdvancedBoundingBlock tile = getTileEntity(TileEntityAdvancedBoundingBlock.class, world, boundingLocation);
        if (tile != null) {
            tile.setMainLocation(orig);
        } else {
            Mekanism.logger.warn("Unable to find Advanced Bounding Block Tile at: {}", boundingLocation);
        }
    }
}
Also used : TileEntityAdvancedBoundingBlock(mekanism.common.tile.TileEntityAdvancedBoundingBlock) BlockState(net.minecraft.block.BlockState) BlockBounding(mekanism.common.block.BlockBounding)

Aggregations

BlockBounding (mekanism.common.block.BlockBounding)1 TileEntityAdvancedBoundingBlock (mekanism.common.tile.TileEntityAdvancedBoundingBlock)1 BlockState (net.minecraft.block.BlockState)1