本文整理汇总了Java中net.minecraft.tileentity.TileEntityPiston.getPistonOrientation方法的典型用法代码示例。如果您正苦于以下问题:Java TileEntityPiston.getPistonOrientation方法的具体用法?Java TileEntityPiston.getPistonOrientation怎么用?Java TileEntityPiston.getPistonOrientation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.tileentity.TileEntityPiston
的用法示例。
在下文中一共展示了TileEntityPiston.getPistonOrientation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setBlockBoundsBasedOnState
import net.minecraft.tileentity.TileEntityPiston; //导入方法依赖的package包/类
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{
TileEntityPiston tileentitypiston = this.func_149963_e(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_);
if (tileentitypiston != null)
{
Block block = tileentitypiston.getStoredBlockID();
if (block == this || block.getMaterial() == Material.air)
{
return;
}
block.setBlockBoundsBasedOnState(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_);
float f = tileentitypiston.func_145860_a(0.0F);
if (tileentitypiston.isExtending())
{
f = 1.0F - f;
}
int l = tileentitypiston.getPistonOrientation();
this.minX = block.getBlockBoundsMinX() - (double)((float)Facing.offsetsXForSide[l] * f);
this.minY = block.getBlockBoundsMinY() - (double)((float)Facing.offsetsYForSide[l] * f);
this.minZ = block.getBlockBoundsMinZ() - (double)((float)Facing.offsetsZForSide[l] * f);
this.maxX = block.getBlockBoundsMaxX() - (double)((float)Facing.offsetsXForSide[l] * f);
this.maxY = block.getBlockBoundsMaxY() - (double)((float)Facing.offsetsYForSide[l] * f);
this.maxZ = block.getBlockBoundsMaxZ() - (double)((float)Facing.offsetsZForSide[l] * f);
}
}
示例2: setBlockBoundsBasedOnState
import net.minecraft.tileentity.TileEntityPiston; //导入方法依赖的package包/类
/**
* Updates the blocks bounds based on its current state. Args: world, x, y, z
*/
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
TileEntityPiston tileentitypiston = this.getTileEntityAtLocation(par1IBlockAccess, par2, par3, par4);
if (tileentitypiston != null)
{
Block block = Block.blocksList[tileentitypiston.getStoredBlockID()];
if (block == null || block == this)
{
return;
}
block.setBlockBoundsBasedOnState(par1IBlockAccess, par2, par3, par4);
float f = tileentitypiston.getProgress(0.0F);
if (tileentitypiston.isExtending())
{
f = 1.0F - f;
}
int l = tileentitypiston.getPistonOrientation();
this.minX = block.getBlockBoundsMinX() - (double)((float)Facing.offsetsXForSide[l] * f);
this.minY = block.getBlockBoundsMinY() - (double)((float)Facing.offsetsYForSide[l] * f);
this.minZ = block.getBlockBoundsMinZ() - (double)((float)Facing.offsetsZForSide[l] * f);
this.maxX = block.getBlockBoundsMaxX() - (double)((float)Facing.offsetsXForSide[l] * f);
this.maxY = block.getBlockBoundsMaxY() - (double)((float)Facing.offsetsYForSide[l] * f);
this.maxZ = block.getBlockBoundsMaxZ() - (double)((float)Facing.offsetsZForSide[l] * f);
}
}