本文整理匯總了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);
}
}
}