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

The following are Jave code examples for showing how to use isBlockTickPending() 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.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: BlockRedstoneDiode.java   View Source Code Vote up 6 votes
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!this.isLocked(worldIn, pos, state))
    {
        boolean flag = this.shouldBePowered(worldIn, pos, state);

        if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && !worldIn.isBlockTickPending(pos, this))
        {
            int i = -1;

            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                i = -3;
            }
            else if (this.isRepeaterPowered)
            {
                i = -2;
            }

            worldIn.updateBlockTick(pos, this, this.getDelay(state), i);
        }
    }
}
 
Example 2
Project: DecompiledMinecraft   File: BlockRedstoneComparator.java   View Source Code Vote up 6 votes
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}
 
Example 3
Project: DecompiledMinecraft   File: BlockRedstoneDiode.java   View Source Code Vote up 6 votes
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!this.isLocked(worldIn, pos, state))
    {
        boolean flag = this.shouldBePowered(worldIn, pos, state);

        if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && !worldIn.isBlockTickPending(pos, this))
        {
            int i = -1;

            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                i = -3;
            }
            else if (this.isRepeaterPowered)
            {
                i = -2;
            }

            worldIn.updateBlockTick(pos, this, this.getDelay(state), i);
        }
    }
}
 
Example 4
Project: DecompiledMinecraft   File: BlockRedstoneComparator.java   View Source Code Vote up 6 votes
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}
 
Example 5
Project: BaseClient   File: BlockRedstoneDiode.java   View Source Code Vote up 6 votes
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!this.isLocked(worldIn, pos, state))
    {
        boolean flag = this.shouldBePowered(worldIn, pos, state);

        if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && !worldIn.isBlockTickPending(pos, this))
        {
            int i = -1;

            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                i = -3;
            }
            else if (this.isRepeaterPowered)
            {
                i = -2;
            }

            worldIn.updateBlockTick(pos, this, this.getDelay(state), i);
        }
    }
}
 
Example 6
Project: BaseClient   File: BlockRedstoneComparator.java   View Source Code Vote up 6 votes
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}
 
Example 7
Project: BaseClient   File: BlockRedstoneDiode.java   View Source Code Vote up 6 votes
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!this.isLocked(worldIn, pos, state))
    {
        boolean flag = this.shouldBePowered(worldIn, pos, state);

        if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && !worldIn.isBlockTickPending(pos, this))
        {
            int i = -1;

            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                i = -3;
            }
            else if (this.isRepeaterPowered)
            {
                i = -2;
            }

            worldIn.updateBlockTick(pos, this, this.getDelay(state), i);
        }
    }
}
 
Example 8
Project: BaseClient   File: BlockRedstoneComparator.java   View Source Code Vote up 6 votes
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}
 
Example 9
Project: Backmemed   File: BlockRedstoneDiode.java   View Source Code Vote up 6 votes
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!this.isLocked(worldIn, pos, state))
    {
        boolean flag = this.shouldBePowered(worldIn, pos, state);

        if (this.isRepeaterPowered != flag && !worldIn.isBlockTickPending(pos, this))
        {
            int i = -1;

            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                i = -3;
            }
            else if (this.isRepeaterPowered)
            {
                i = -2;
            }

            worldIn.updateBlockTick(pos, this, this.getDelay(state), i);
        }
    }
}
 
Example 10
Project: Backmemed   File: BlockRedstoneComparator.java   View Source Code Vote up 6 votes
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}
 
Example 11
Project: CustomWorldGen   File: BlockRedstoneDiode.java   View Source Code Vote up 6 votes
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!this.isLocked(worldIn, pos, state))
    {
        boolean flag = this.shouldBePowered(worldIn, pos, state);

        if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && !worldIn.isBlockTickPending(pos, this))
        {
            int i = -1;

            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                i = -3;
            }
            else if (this.isRepeaterPowered)
            {
                i = -2;
            }

            worldIn.updateBlockTick(pos, this, this.getDelay(state), i);
        }
    }
}
 
Example 12
Project: CustomWorldGen   File: BlockRedstoneComparator.java   View Source Code Vote up 6 votes
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}