Java Code Examples for net.minecraft.world.World.forceBlockUpdateTick()

The following are Jave code examples for showing how to use forceBlockUpdateTick() of the net.minecraft.world.World class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: DecompiledMinecraft   File: StructureNetherBridgePieces.java   Source Code and License Vote up 4 votes
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 12, 4, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 12, 13, 12, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 1, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 5, 0, 12, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 11, 4, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 11, 10, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 11, 7, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 0, 4, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 0, 10, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 0, 7, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 11, 2, 10, 12, 10, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 8, 0, 7, 8, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);

    for (int i = 1; i <= 11; i += 2)
    {
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 0, i, 11, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 12, i, 11, 12, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 10, i, 0, 11, i, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 10, i, 12, 11, i, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), i, 13, 0, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), i, 13, 12, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 0, 13, i, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 12, 13, i, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 0, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 12, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, i + 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 12, 13, i + 1, structureBoundingBoxIn);
    }

    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 12, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 12, 13, 0, structureBoundingBoxIn);

    for (int k = 3; k <= 9; k += 2)
    {
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 7, k, 1, 8, k, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 7, k, 11, 8, k, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
    }

    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 8, 2, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 4, 12, 2, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 0, 8, 1, 3, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 9, 8, 1, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 4, 3, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 0, 4, 12, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);

    for (int l = 4; l <= 8; ++l)
    {
        for (int j = 0; j <= 2; ++j)
        {
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), l, -1, j, structureBoundingBoxIn);
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), l, -1, 12 - j, structureBoundingBoxIn);
        }
    }

    for (int i1 = 0; i1 <= 2; ++i1)
    {
        for (int j1 = 4; j1 <= 8; ++j1)
        {
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i1, -1, j1, structureBoundingBoxIn);
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), 12 - i1, -1, j1, structureBoundingBoxIn);
        }
    }

    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 5, 7, 5, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 6, 6, 4, 6, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
    this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 6, 0, 6, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.flowing_lava.getDefaultState(), 6, 5, 6, structureBoundingBoxIn);
    BlockPos blockpos = new BlockPos(this.getXWithOffset(6, 6), this.getYWithOffset(5), this.getZWithOffset(6, 6));

    if (structureBoundingBoxIn.isVecInside(blockpos))
    {
        worldIn.forceBlockUpdateTick(Blocks.flowing_lava, blockpos, randomIn);
    }

    return true;
}
 
Example 2
Project: DecompiledMinecraft   File: WorldGenHellLava.java   Source Code and License Vote up 4 votes
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (worldIn.getBlockState(position.up()).getBlock() != Blocks.netherrack)
    {
        return false;
    }
    else if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.air && worldIn.getBlockState(position).getBlock() != Blocks.netherrack)
    {
        return false;
    }
    else
    {
        int i = 0;

        if (worldIn.getBlockState(position.west()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.east()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.north()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.south()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.down()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        int j = 0;

        if (worldIn.isAirBlock(position.west()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.east()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.north()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.south()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.down()))
        {
            ++j;
        }

        if (!this.field_94524_b && i == 4 && j == 1 || i == 5)
        {
            worldIn.setBlockState(position, this.field_150553_a.getDefaultState(), 2);
            worldIn.forceBlockUpdateTick(this.field_150553_a, position, rand);
        }

        return true;
    }
}
 
Example 3
Project: DecompiledMinecraft   File: WorldGenLiquids.java   Source Code and License Vote up 4 votes
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (worldIn.getBlockState(position.up()).getBlock() != Blocks.stone)
    {
        return false;
    }
    else if (worldIn.getBlockState(position.down()).getBlock() != Blocks.stone)
    {
        return false;
    }
    else if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.air && worldIn.getBlockState(position).getBlock() != Blocks.stone)
    {
        return false;
    }
    else
    {
        int i = 0;

        if (worldIn.getBlockState(position.west()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.east()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.north()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.south()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        int j = 0;

        if (worldIn.isAirBlock(position.west()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.east()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.north()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.south()))
        {
            ++j;
        }

        if (i == 3 && j == 1)
        {
            worldIn.setBlockState(position, this.block.getDefaultState(), 2);
            worldIn.forceBlockUpdateTick(this.block, position, rand);
        }

        return true;
    }
}
 
Example 4
Project: DecompiledMinecraft   File: StructureNetherBridgePieces.java   Source Code and License Vote up 4 votes
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 12, 4, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 12, 13, 12, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 1, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 5, 0, 12, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 11, 4, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 11, 10, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 11, 7, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 0, 4, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 0, 10, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 0, 7, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 11, 2, 10, 12, 10, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 8, 0, 7, 8, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);

    for (int i = 1; i <= 11; i += 2)
    {
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 0, i, 11, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 12, i, 11, 12, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 10, i, 0, 11, i, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 10, i, 12, 11, i, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), i, 13, 0, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), i, 13, 12, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 0, 13, i, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 12, 13, i, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 0, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 12, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, i + 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 12, 13, i + 1, structureBoundingBoxIn);
    }

    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 12, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 12, 13, 0, structureBoundingBoxIn);

    for (int k = 3; k <= 9; k += 2)
    {
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 7, k, 1, 8, k, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 7, k, 11, 8, k, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
    }

    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 8, 2, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 4, 12, 2, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 0, 8, 1, 3, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 9, 8, 1, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 4, 3, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 0, 4, 12, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);

    for (int l = 4; l <= 8; ++l)
    {
        for (int j = 0; j <= 2; ++j)
        {
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), l, -1, j, structureBoundingBoxIn);
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), l, -1, 12 - j, structureBoundingBoxIn);
        }
    }

    for (int i1 = 0; i1 <= 2; ++i1)
    {
        for (int j1 = 4; j1 <= 8; ++j1)
        {
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i1, -1, j1, structureBoundingBoxIn);
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), 12 - i1, -1, j1, structureBoundingBoxIn);
        }
    }

    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 5, 7, 5, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 6, 6, 4, 6, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
    this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 6, 0, 6, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.flowing_lava.getDefaultState(), 6, 5, 6, structureBoundingBoxIn);
    BlockPos blockpos = new BlockPos(this.getXWithOffset(6, 6), this.getYWithOffset(5), this.getZWithOffset(6, 6));

    if (structureBoundingBoxIn.isVecInside(blockpos))
    {
        worldIn.forceBlockUpdateTick(Blocks.flowing_lava, blockpos, randomIn);
    }

    return true;
}
 
Example 5
Project: DecompiledMinecraft   File: WorldGenHellLava.java   Source Code and License Vote up 4 votes
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (worldIn.getBlockState(position.up()).getBlock() != Blocks.netherrack)
    {
        return false;
    }
    else if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.air && worldIn.getBlockState(position).getBlock() != Blocks.netherrack)
    {
        return false;
    }
    else
    {
        int i = 0;

        if (worldIn.getBlockState(position.west()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.east()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.north()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.south()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.down()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        int j = 0;

        if (worldIn.isAirBlock(position.west()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.east()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.north()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.south()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.down()))
        {
            ++j;
        }

        if (!this.field_94524_b && i == 4 && j == 1 || i == 5)
        {
            worldIn.setBlockState(position, this.field_150553_a.getDefaultState(), 2);
            worldIn.forceBlockUpdateTick(this.field_150553_a, position, rand);
        }

        return true;
    }
}
 
Example 6
Project: DecompiledMinecraft   File: WorldGenLiquids.java   Source Code and License Vote up 4 votes
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (worldIn.getBlockState(position.up()).getBlock() != Blocks.stone)
    {
        return false;
    }
    else if (worldIn.getBlockState(position.down()).getBlock() != Blocks.stone)
    {
        return false;
    }
    else if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.air && worldIn.getBlockState(position).getBlock() != Blocks.stone)
    {
        return false;
    }
    else
    {
        int i = 0;

        if (worldIn.getBlockState(position.west()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.east()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.north()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.south()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        int j = 0;

        if (worldIn.isAirBlock(position.west()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.east()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.north()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.south()))
        {
            ++j;
        }

        if (i == 3 && j == 1)
        {
            worldIn.setBlockState(position, this.block.getDefaultState(), 2);
            worldIn.forceBlockUpdateTick(this.block, position, rand);
        }

        return true;
    }
}
 
Example 7
Project: BaseClient   File: StructureNetherBridgePieces.java   Source Code and License Vote up 4 votes
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 12, 4, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 12, 13, 12, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 1, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 5, 0, 12, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 11, 4, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 11, 10, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 11, 7, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 0, 4, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 0, 10, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 0, 7, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 11, 2, 10, 12, 10, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 8, 0, 7, 8, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);

    for (int i = 1; i <= 11; i += 2)
    {
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 0, i, 11, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 12, i, 11, 12, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 10, i, 0, 11, i, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 10, i, 12, 11, i, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), i, 13, 0, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), i, 13, 12, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 0, 13, i, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 12, 13, i, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 0, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 12, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, i + 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 12, 13, i + 1, structureBoundingBoxIn);
    }

    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 12, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 12, 13, 0, structureBoundingBoxIn);

    for (int k = 3; k <= 9; k += 2)
    {
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 7, k, 1, 8, k, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 7, k, 11, 8, k, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
    }

    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 8, 2, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 4, 12, 2, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 0, 8, 1, 3, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 9, 8, 1, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 4, 3, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 0, 4, 12, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);

    for (int l = 4; l <= 8; ++l)
    {
        for (int j = 0; j <= 2; ++j)
        {
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), l, -1, j, structureBoundingBoxIn);
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), l, -1, 12 - j, structureBoundingBoxIn);
        }
    }

    for (int i1 = 0; i1 <= 2; ++i1)
    {
        for (int j1 = 4; j1 <= 8; ++j1)
        {
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i1, -1, j1, structureBoundingBoxIn);
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), 12 - i1, -1, j1, structureBoundingBoxIn);
        }
    }

    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 5, 7, 5, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 6, 6, 4, 6, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
    this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 6, 0, 6, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.flowing_lava.getDefaultState(), 6, 5, 6, structureBoundingBoxIn);
    BlockPos blockpos = new BlockPos(this.getXWithOffset(6, 6), this.getYWithOffset(5), this.getZWithOffset(6, 6));

    if (structureBoundingBoxIn.isVecInside(blockpos))
    {
        worldIn.forceBlockUpdateTick(Blocks.flowing_lava, blockpos, randomIn);
    }

    return true;
}
 
Example 8
Project: BaseClient   File: WorldGenHellLava.java   Source Code and License Vote up 4 votes
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (worldIn.getBlockState(position.up()).getBlock() != Blocks.netherrack)
    {
        return false;
    }
    else if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.air && worldIn.getBlockState(position).getBlock() != Blocks.netherrack)
    {
        return false;
    }
    else
    {
        int i = 0;

        if (worldIn.getBlockState(position.west()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.east()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.north()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.south()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.down()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        int j = 0;

        if (worldIn.isAirBlock(position.west()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.east()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.north()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.south()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.down()))
        {
            ++j;
        }

        if (!this.field_94524_b && i == 4 && j == 1 || i == 5)
        {
            worldIn.setBlockState(position, this.field_150553_a.getDefaultState(), 2);
            worldIn.forceBlockUpdateTick(this.field_150553_a, position, rand);
        }

        return true;
    }
}
 
Example 9
Project: BaseClient   File: WorldGenLiquids.java   Source Code and License Vote up 4 votes
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (worldIn.getBlockState(position.up()).getBlock() != Blocks.stone)
    {
        return false;
    }
    else if (worldIn.getBlockState(position.down()).getBlock() != Blocks.stone)
    {
        return false;
    }
    else if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.air && worldIn.getBlockState(position).getBlock() != Blocks.stone)
    {
        return false;
    }
    else
    {
        int i = 0;

        if (worldIn.getBlockState(position.west()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.east()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.north()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.south()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        int j = 0;

        if (worldIn.isAirBlock(position.west()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.east()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.north()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.south()))
        {
            ++j;
        }

        if (i == 3 && j == 1)
        {
            worldIn.setBlockState(position, this.block.getDefaultState(), 2);
            worldIn.forceBlockUpdateTick(this.block, position, rand);
        }

        return true;
    }
}
 
Example 10
Project: BaseClient   File: StructureNetherBridgePieces.java   Source Code and License Vote up 4 votes
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 12, 4, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 12, 13, 12, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 1, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 5, 0, 12, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 11, 4, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 11, 10, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 11, 7, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 0, 4, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 0, 10, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 0, 7, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 11, 2, 10, 12, 10, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 8, 0, 7, 8, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);

    for (int i = 1; i <= 11; i += 2)
    {
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 0, i, 11, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 12, i, 11, 12, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 10, i, 0, 11, i, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 10, i, 12, 11, i, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), i, 13, 0, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), i, 13, 12, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 0, 13, i, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 12, 13, i, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 0, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 12, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, i + 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 12, 13, i + 1, structureBoundingBoxIn);
    }

    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 12, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 12, 13, 0, structureBoundingBoxIn);

    for (int k = 3; k <= 9; k += 2)
    {
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 7, k, 1, 8, k, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 7, k, 11, 8, k, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false);
    }

    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 8, 2, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 4, 12, 2, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 0, 8, 1, 3, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 9, 8, 1, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 4, 3, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 0, 4, 12, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);

    for (int l = 4; l <= 8; ++l)
    {
        for (int j = 0; j <= 2; ++j)
        {
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), l, -1, j, structureBoundingBoxIn);
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), l, -1, 12 - j, structureBoundingBoxIn);
        }
    }

    for (int i1 = 0; i1 <= 2; ++i1)
    {
        for (int j1 = 4; j1 <= 8; ++j1)
        {
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i1, -1, j1, structureBoundingBoxIn);
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), 12 - i1, -1, j1, structureBoundingBoxIn);
        }
    }

    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 5, 7, 5, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 6, 6, 4, 6, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
    this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 6, 0, 6, structureBoundingBoxIn);
    this.setBlockState(worldIn, Blocks.flowing_lava.getDefaultState(), 6, 5, 6, structureBoundingBoxIn);
    BlockPos blockpos = new BlockPos(this.getXWithOffset(6, 6), this.getYWithOffset(5), this.getZWithOffset(6, 6));

    if (structureBoundingBoxIn.isVecInside(blockpos))
    {
        worldIn.forceBlockUpdateTick(Blocks.flowing_lava, blockpos, randomIn);
    }

    return true;
}
 
Example 11
Project: BaseClient   File: WorldGenHellLava.java   Source Code and License Vote up 4 votes
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (worldIn.getBlockState(position.up()).getBlock() != Blocks.netherrack)
    {
        return false;
    }
    else if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.air && worldIn.getBlockState(position).getBlock() != Blocks.netherrack)
    {
        return false;
    }
    else
    {
        int i = 0;

        if (worldIn.getBlockState(position.west()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.east()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.north()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.south()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.down()).getBlock() == Blocks.netherrack)
        {
            ++i;
        }

        int j = 0;

        if (worldIn.isAirBlock(position.west()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.east()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.north()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.south()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.down()))
        {
            ++j;
        }

        if (!this.field_94524_b && i == 4 && j == 1 || i == 5)
        {
            worldIn.setBlockState(position, this.field_150553_a.getDefaultState(), 2);
            worldIn.forceBlockUpdateTick(this.field_150553_a, position, rand);
        }

        return true;
    }
}
 
Example 12
Project: BaseClient   File: WorldGenLiquids.java   Source Code and License Vote up 4 votes
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (worldIn.getBlockState(position.up()).getBlock() != Blocks.stone)
    {
        return false;
    }
    else if (worldIn.getBlockState(position.down()).getBlock() != Blocks.stone)
    {
        return false;
    }
    else if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.air && worldIn.getBlockState(position).getBlock() != Blocks.stone)
    {
        return false;
    }
    else
    {
        int i = 0;

        if (worldIn.getBlockState(position.west()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.east()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.north()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        if (worldIn.getBlockState(position.south()).getBlock() == Blocks.stone)
        {
            ++i;
        }

        int j = 0;

        if (worldIn.isAirBlock(position.west()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.east()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.north()))
        {
            ++j;
        }

        if (worldIn.isAirBlock(position.south()))
        {
            ++j;
        }

        if (i == 3 && j == 1)
        {
            worldIn.setBlockState(position, this.block.getDefaultState(), 2);
            worldIn.forceBlockUpdateTick(this.block, position, rand);
        }

        return true;
    }
}