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

The following are Jave code examples for showing how to use updateBlockTick() 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: BlockRedstoneDiode.java   Source Code and License Vote up 6 votes
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    if (!this.isLocked(worldIn, pos, state))
    {
        boolean flag = this.shouldBePowered(worldIn, pos, state);

        if (this.isRepeaterPowered && !flag)
        {
            worldIn.setBlockState(pos, this.getUnpoweredState(state), 2);
        }
        else if (!this.isRepeaterPowered)
        {
            worldIn.setBlockState(pos, this.getPoweredState(state), 2);

            if (!flag)
            {
                worldIn.updateBlockTick(pos, this.getPoweredState(state).getBlock(), this.getTickDelay(state), -1);
            }
        }
    }
}
 
Example 2
Project: DecompiledMinecraft   File: BlockRedstoneDiode.java   Source Code and License 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 3
Project: DecompiledMinecraft   File: BlockRedstoneComparator.java   Source Code and License 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 4
Project: DecompiledMinecraft   File: BlockRedstoneDiode.java   Source Code and License Vote up 6 votes
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    if (!this.isLocked(worldIn, pos, state))
    {
        boolean flag = this.shouldBePowered(worldIn, pos, state);

        if (this.isRepeaterPowered && !flag)
        {
            worldIn.setBlockState(pos, this.getUnpoweredState(state), 2);
        }
        else if (!this.isRepeaterPowered)
        {
            worldIn.setBlockState(pos, this.getPoweredState(state), 2);

            if (!flag)
            {
                worldIn.updateBlockTick(pos, this.getPoweredState(state).getBlock(), this.getTickDelay(state), -1);
            }
        }
    }
}
 
Example 5
Project: DecompiledMinecraft   File: BlockRedstoneDiode.java   Source Code and License 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: DecompiledMinecraft   File: BlockRedstoneComparator.java   Source Code and License 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   Source Code and License Vote up 6 votes
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    if (!this.isLocked(worldIn, pos, state))
    {
        boolean flag = this.shouldBePowered(worldIn, pos, state);

        if (this.isRepeaterPowered && !flag)
        {
            worldIn.setBlockState(pos, this.getUnpoweredState(state), 2);
        }
        else if (!this.isRepeaterPowered)
        {
            worldIn.setBlockState(pos, this.getPoweredState(state), 2);

            if (!flag)
            {
                worldIn.updateBlockTick(pos, this.getPoweredState(state).getBlock(), this.getTickDelay(state), -1);
            }
        }
    }
}
 
Example 8
Project: BaseClient   File: BlockRedstoneDiode.java   Source Code and License 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 9
Project: BaseClient   File: BlockRedstoneComparator.java   Source Code and License 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 10
Project: BaseClient   File: BlockRedstoneDiode.java   Source Code and License Vote up 6 votes
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    if (!this.isLocked(worldIn, pos, state))
    {
        boolean flag = this.shouldBePowered(worldIn, pos, state);

        if (this.isRepeaterPowered && !flag)
        {
            worldIn.setBlockState(pos, this.getUnpoweredState(state), 2);
        }
        else if (!this.isRepeaterPowered)
        {
            worldIn.setBlockState(pos, this.getPoweredState(state), 2);

            if (!flag)
            {
                worldIn.updateBlockTick(pos, this.getPoweredState(state).getBlock(), this.getTickDelay(state), -1);
            }
        }
    }
}
 
Example 11
Project: BaseClient   File: BlockRedstoneDiode.java   Source Code and License 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: BaseClient   File: BlockRedstoneComparator.java   Source Code and License 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 13
Project: Backmemed   File: BlockRedstoneDiode.java   Source Code and License Vote up 6 votes
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    if (!this.isLocked(worldIn, pos, state))
    {
        boolean flag = this.shouldBePowered(worldIn, pos, state);

        if (this.isRepeaterPowered && !flag)
        {
            worldIn.setBlockState(pos, this.getUnpoweredState(state), 2);
        }
        else if (!this.isRepeaterPowered)
        {
            worldIn.setBlockState(pos, this.getPoweredState(state), 2);

            if (!flag)
            {
                worldIn.updateBlockTick(pos, this.getPoweredState(state).getBlock(), this.getTickDelay(state), -1);
            }
        }
    }
}
 
Example 14
Project: Backmemed   File: BlockRedstoneDiode.java   Source Code and License 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 15
Project: Backmemed   File: BlockRedstoneComparator.java   Source Code and License 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 16
Project: CustomWorldGen   File: BlockRedstoneDiode.java   Source Code and License Vote up 6 votes
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    if (!this.isLocked(worldIn, pos, state))
    {
        boolean flag = this.shouldBePowered(worldIn, pos, state);

        if (this.isRepeaterPowered && !flag)
        {
            worldIn.setBlockState(pos, this.getUnpoweredState(state), 2);
        }
        else if (!this.isRepeaterPowered)
        {
            worldIn.setBlockState(pos, this.getPoweredState(state), 2);

            if (!flag)
            {
                worldIn.updateBlockTick(pos, this.getPoweredState(state).getBlock(), this.getTickDelay(state), -1);
            }
        }
    }
}
 
Example 17
Project: CustomWorldGen   File: BlockRedstoneDiode.java   Source Code and License 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 18
Project: CustomWorldGen   File: BlockRedstoneComparator.java   Source Code and License 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 19
Project: Minecoprocessors   File: BlockMinecoprocessor.java   Source Code and License Vote up 4 votes
@Override
protected void updateState(World worldIn, BlockPos pos, IBlockState state) {
  worldIn.updateBlockTick(pos, this, 0, -1);
}