Java Code Examples for net.minecraft.block.Block#renderAsNormalBlock()

The following examples show how to use net.minecraft.block.Block#renderAsNormalBlock() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlockLightChain.java    From GardenCollection with MIT License 6 votes vote down vote up
public Vec3[] getAttachPoints (IBlockAccess world, int x, int y, int z) {
    int yMin = findMinY(world, x, y, z);
    Block bottomBlock = world.getBlock(x, yMin - 1, z);

    IAttachable attachable = GardenAPI.instance().registries().attachable().getAttachable(bottomBlock, world.getBlockMetadata(x, y - 1, z));

    Vec3[] attachPoints = singleAttachPoint;
    if (bottomBlock instanceof IChainAttachable)
        attachPoints = ((IChainAttachable) bottomBlock).getChainAttachPoints(1);
    else if (attachable != null && attachable.isAttachable(world, x, y - 1, z, 1))
        attachPoints = new Vec3[] { Vec3.createVectorHelper(.5, attachable.getAttachDepth(world, x, y - 1, z, 1), .5) };
    else if (bottomBlock instanceof IChainSingleAttachable) {
        Vec3 attachPoint = ((IChainSingleAttachable) bottomBlock).getChainAttachPoint(world, x, y, z, 1);
        if (attachPoint != null)
            attachPoints = new Vec3[] { attachPoint };
    }
    else if (bottomBlock.renderAsNormalBlock() && bottomBlock.getMaterial() != Material.air)
        attachPoints = defaultAttachPoints;

    return attachPoints;
}
 
Example 2
Source File: BlockLattice.java    From GardenCollection with MIT License 6 votes vote down vote up
private boolean isNeighborHardConnection (IBlockAccess world, int x, int y, int z, Block block, ForgeDirection side) {
    if (block.getMaterial().isOpaque() && block.renderAsNormalBlock())
        return true;

    if (block.isSideSolid(world, x, y, z, side.getOpposite()))
        return true;

    if (block == this)
        return true;

    if (side == ForgeDirection.DOWN || side == ForgeDirection.UP) {
        if (block instanceof BlockFence || block instanceof net.minecraft.block.BlockFence)
            return true;
    }

    return false;
}
 
Example 3
Source File: BlockThinLog.java    From GardenCollection with MIT License 5 votes vote down vote up
private boolean isNeighborHardConnection (IBlockAccess world, int x, int y, int z, Block block, ForgeDirection side) {
    if (block.getMaterial().isOpaque() && block.renderAsNormalBlock())
        return true;

    if (block.isSideSolid(world, x, y, z, side.getOpposite()))
        return true;

    //if (block == ModBlocks.largePot)
    //    return true;
    return false;
}
 
Example 4
Source File: BlockThinLogFence.java    From GardenCollection with MIT License 5 votes vote down vote up
public boolean canConnectFenceTo (IBlockAccess world, int x, int y, int z) {
    Block block = world.getBlock(x, y, z);
    if (block != this)
        return (block.getMaterial().isOpaque() && block.renderAsNormalBlock()) ? block.getMaterial() != Material.gourd : false;

    return true;
}
 
Example 5
Source File: BlockConnected.java    From GardenCollection with MIT License 5 votes vote down vote up
private boolean isNeighborHardConnection (IBlockAccess world, int x, int y, int z, Block block, ForgeDirection side) {
    if (block.getMaterial().isOpaque() && block.renderAsNormalBlock())
        return true;

    if (block.isSideSolid(world, x, y, z, side.getOpposite()))
        return true;

    if (block == this)
        return true;

    return false;
}
 
Example 6
Source File: BlockConnected.java    From GardenCollection with MIT License 4 votes vote down vote up
public boolean canConnectTo (Block block) {
    return (block.getMaterial().isOpaque() && block.renderAsNormalBlock())
        || (block == this);
}
 
Example 7
Source File: CarvableHelper.java    From Chisel-2 with GNU General Public License v2.0 3 votes vote down vote up
public void registerVariation(String name, IVariationInfo info) {

		Block block = info.getVariation().getBlock();

		if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) {
			FMPIMC.registerFMP(block, info.getVariation().getBlockMeta());
		}

		if (forbidChiseling)
			return;

		CarvingUtils.getChiselRegistry().addVariation(name, info.getVariation());
	}