Search in sources :

Example 1 with FakeBlockAccessSingleBlock

use of buildcraft.core.lib.world.FakeBlockAccessSingleBlock in project BuildCraft by BuildCraft.

the class ItemFacade method isValidFacade.

public static boolean isValidFacade(IBlockState state) {
    if (blacklistedFacades.contains(state)) {
        return false;
    }
    if (whitelistedFacades.contains(state)) {
        return true;
    }
    Block block = state.getBlock();
    if (block instanceof IFluidBlock || block.hasTileEntity(state)) {
        return false;
    }
    block.setBlockBoundsBasedOnState(new FakeBlockAccessSingleBlock(state), BlockPos.ORIGIN);
    if (block.getBlockBoundsMinX() != 0.0D || block.getBlockBoundsMinY() != 0.0D || block.getBlockBoundsMinZ() != 0.0D) {
        return false;
    }
    if (block.getBlockBoundsMaxX() != 1.0D || block.getBlockBoundsMaxY() != 1.0D || block.getBlockBoundsMaxZ() != 1.0D) {
        return false;
    }
    return true;
}
Also used : IFluidBlock(net.minecraftforge.fluids.IFluidBlock) Block(net.minecraft.block.Block) FakeBlockAccessSingleBlock(buildcraft.core.lib.world.FakeBlockAccessSingleBlock) IFluidBlock(net.minecraftforge.fluids.IFluidBlock) FakeBlockAccessSingleBlock(buildcraft.core.lib.world.FakeBlockAccessSingleBlock)

Aggregations

FakeBlockAccessSingleBlock (buildcraft.core.lib.world.FakeBlockAccessSingleBlock)1 Block (net.minecraft.block.Block)1 IFluidBlock (net.minecraftforge.fluids.IFluidBlock)1