Java Code Examples for net.minecraft.init.Blocks.piston_extension()

The following are Jave code examples for showing how to use piston_extension() of the net.minecraft.init.Blocks 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: TileEntityPiston.java   View Source Code Vote up 6 votes
/**
 * removes a piston's tile entity (and if the piston is moving, stops it)
 */
public void clearPistonTileEntity()
{
    if (this.lastProgress < 1.0F && this.worldObj != null)
    {
        this.lastProgress = this.progress = 1.0F;
        this.worldObj.removeTileEntity(this.pos);
        this.invalidate();

        if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension)
        {
            this.worldObj.setBlockState(this.pos, this.pistonState, 3);
            this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock());
        }
    }
}
 
Example 2
Project: DecompiledMinecraft   File: TileEntityPiston.java   View Source Code Vote up 6 votes
/**
 * removes a piston's tile entity (and if the piston is moving, stops it)
 */
public void clearPistonTileEntity()
{
    if (this.lastProgress < 1.0F && this.worldObj != null)
    {
        this.lastProgress = this.progress = 1.0F;
        this.worldObj.removeTileEntity(this.pos);
        this.invalidate();

        if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension)
        {
            this.worldObj.setBlockState(this.pos, this.pistonState, 3);
            this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock());
        }
    }
}
 
Example 3
Project: BaseClient   File: TileEntityPiston.java   View Source Code Vote up 6 votes
/**
 * removes a piston's tile entity (and if the piston is moving, stops it)
 */
public void clearPistonTileEntity()
{
    if (this.lastProgress < 1.0F && this.worldObj != null)
    {
        this.lastProgress = this.progress = 1.0F;
        this.worldObj.removeTileEntity(this.pos);
        this.invalidate();

        if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension)
        {
            this.worldObj.setBlockState(this.pos, this.pistonState, 3);
            this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock());
        }
    }
}
 
Example 4
Project: BaseClient   File: TileEntityPiston.java   View Source Code Vote up 6 votes
/**
 * removes a piston's tile entity (and if the piston is moving, stops it)
 */
public void clearPistonTileEntity()
{
    if (this.lastProgress < 1.0F && this.worldObj != null)
    {
        this.lastProgress = this.progress = 1.0F;
        this.worldObj.removeTileEntity(this.pos);
        this.invalidate();

        if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension)
        {
            this.worldObj.setBlockState(this.pos, this.pistonState, 3);
            this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock());
        }
    }
}
 
Example 5
Project: DecompiledMinecraft   File: TileEntityPiston.java   View Source Code Vote up 5 votes
/**
 * Like the old updateEntity(), except more generic.
 */
public void update()
{
    this.lastProgress = this.progress;

    if (this.lastProgress >= 1.0F)
    {
        this.launchWithSlimeBlock(1.0F, 0.25F);
        this.worldObj.removeTileEntity(this.pos);
        this.invalidate();

        if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension)
        {
            this.worldObj.setBlockState(this.pos, this.pistonState, 3);
            this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock());
        }
    }
    else
    {
        this.progress += 0.5F;

        if (this.progress >= 1.0F)
        {
            this.progress = 1.0F;
        }

        if (this.extending)
        {
            this.launchWithSlimeBlock(this.progress, this.progress - this.lastProgress + 0.0625F);
        }
    }
}
 
Example 6
Project: DecompiledMinecraft   File: TileEntityPiston.java   View Source Code Vote up 5 votes
/**
 * Like the old updateEntity(), except more generic.
 */
public void update()
{
    this.lastProgress = this.progress;

    if (this.lastProgress >= 1.0F)
    {
        this.launchWithSlimeBlock(1.0F, 0.25F);
        this.worldObj.removeTileEntity(this.pos);
        this.invalidate();

        if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension)
        {
            this.worldObj.setBlockState(this.pos, this.pistonState, 3);
            this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock());
        }
    }
    else
    {
        this.progress += 0.5F;

        if (this.progress >= 1.0F)
        {
            this.progress = 1.0F;
        }

        if (this.extending)
        {
            this.launchWithSlimeBlock(this.progress, this.progress - this.lastProgress + 0.0625F);
        }
    }
}
 
Example 7
Project: BaseClient   File: TileEntityPiston.java   View Source Code Vote up 5 votes
/**
 * Like the old updateEntity(), except more generic.
 */
public void update()
{
    this.lastProgress = this.progress;

    if (this.lastProgress >= 1.0F)
    {
        this.launchWithSlimeBlock(1.0F, 0.25F);
        this.worldObj.removeTileEntity(this.pos);
        this.invalidate();

        if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension)
        {
            this.worldObj.setBlockState(this.pos, this.pistonState, 3);
            this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock());
        }
    }
    else
    {
        this.progress += 0.5F;

        if (this.progress >= 1.0F)
        {
            this.progress = 1.0F;
        }

        if (this.extending)
        {
            this.launchWithSlimeBlock(this.progress, this.progress - this.lastProgress + 0.0625F);
        }
    }
}
 
Example 8
Project: BaseClient   File: TileEntityPiston.java   View Source Code Vote up 5 votes
/**
 * Like the old updateEntity(), except more generic.
 */
public void update()
{
    this.lastProgress = this.progress;

    if (this.lastProgress >= 1.0F)
    {
        this.launchWithSlimeBlock(1.0F, 0.25F);
        this.worldObj.removeTileEntity(this.pos);
        this.invalidate();

        if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension)
        {
            this.worldObj.setBlockState(this.pos, this.pistonState, 3);
            this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock());
        }
    }
    else
    {
        this.progress += 0.5F;

        if (this.progress >= 1.0F)
        {
            this.progress = 1.0F;
        }

        if (this.extending)
        {
            this.launchWithSlimeBlock(this.progress, this.progress - this.lastProgress + 0.0625F);
        }
    }
}