本文整理汇总了Java中net.minecraft.init.Blocks.piston_extension方法的典型用法代码示例。如果您正苦于以下问题:Java Blocks.piston_extension方法的具体用法?Java Blocks.piston_extension怎么用?Java Blocks.piston_extension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.piston_extension方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clearPistonTileEntity
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
/**
* 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());
}
}
}
示例2: update
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
/**
* 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);
}
}
}