本文整理汇总了Java中net.minecraft.block.BlockStairs.EnumShape方法的典型用法代码示例。如果您正苦于以下问题:Java BlockStairs.EnumShape方法的具体用法?Java BlockStairs.EnumShape怎么用?Java BlockStairs.EnumShape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.BlockStairs
的用法示例。
在下文中一共展示了BlockStairs.EnumShape方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCollisionBoxList
import net.minecraft.block.BlockStairs; //导入方法依赖的package包/类
private static List<AxisAlignedBB> getCollisionBoxList(IBlockState bstate)
{
List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
boolean flag = bstate.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP;
list.add(flag ? AABB_SLAB_TOP : AABB_SLAB_BOTTOM);
BlockStairs.EnumShape blockstairs$enumshape = (BlockStairs.EnumShape)bstate.getValue(BlockStairs.SHAPE);
if (blockstairs$enumshape == BlockStairs.EnumShape.STRAIGHT || blockstairs$enumshape == BlockStairs.EnumShape.INNER_LEFT || blockstairs$enumshape == BlockStairs.EnumShape.INNER_RIGHT)
{
list.add(getCollQuarterBlock(bstate));
}
if (blockstairs$enumshape != BlockStairs.EnumShape.STRAIGHT)
{
list.add(getCollEighthBlock(bstate));
}
return list;
}
示例2: getCollEighthBlock
import net.minecraft.block.BlockStairs; //导入方法依赖的package包/类
/**
* Returns a bounding box representing an eighth of a block (a block whose three dimensions are halved).
* Used in all stair shapes except STRAIGHT (gets added alone in the case of OUTER; alone with a quarter block in
* case of INSIDE).
*/
private static AxisAlignedBB getCollEighthBlock(IBlockState bstate)
{
EnumFacing enumfacing = (EnumFacing)bstate.getValue(BlockStairs.FACING);
EnumFacing enumfacing1;
switch ((BlockStairs.EnumShape)bstate.getValue(BlockStairs.SHAPE))
{
case OUTER_LEFT:
default:
enumfacing1 = enumfacing;
break;
case OUTER_RIGHT:
enumfacing1 = enumfacing.rotateY();
break;
case INNER_RIGHT:
enumfacing1 = enumfacing.getOpposite();
break;
case INNER_LEFT:
enumfacing1 = enumfacing.rotateYCCW();
}
boolean flag = bstate.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP;
switch (enumfacing1)
{
case NORTH:
default:
return flag ? AABB_OCT_BOT_NW : AABB_OCT_TOP_NW;
case SOUTH:
return flag ? AABB_OCT_BOT_SE : AABB_OCT_TOP_SE;
case WEST:
return flag ? AABB_OCT_BOT_SW : AABB_OCT_TOP_SW;
case EAST:
return flag ? AABB_OCT_BOT_NE : AABB_OCT_TOP_NE;
}
}
示例3: func_185706_d
import net.minecraft.block.BlockStairs; //导入方法依赖的package包/类
private static BlockStairs.EnumShape func_185706_d(IBlockState p_185706_0_, IBlockAccess p_185706_1_, BlockPos p_185706_2_)
{
EnumFacing enumfacing = (EnumFacing)p_185706_0_.getValue(BlockStairs.FACING);
IBlockState iblockstate = p_185706_1_.getBlockState(p_185706_2_.offset(enumfacing));
if (isBlockStairs(iblockstate) && p_185706_0_.getValue(BlockStairs.HALF) == iblockstate.getValue(BlockStairs.HALF))
{
EnumFacing enumfacing1 = (EnumFacing)iblockstate.getValue(BlockStairs.FACING);
if (enumfacing1.getAxis() != ((EnumFacing)p_185706_0_.getValue(BlockStairs.FACING)).getAxis() && isDifferentStairs(p_185706_0_, p_185706_1_, p_185706_2_, enumfacing1.getOpposite()))
{
if (enumfacing1 == enumfacing.rotateYCCW())
{
return BlockStairs.EnumShape.OUTER_LEFT;
}
return BlockStairs.EnumShape.OUTER_RIGHT;
}
}
IBlockState iblockstate1 = p_185706_1_.getBlockState(p_185706_2_.offset(enumfacing.getOpposite()));
if (isBlockStairs(iblockstate1) && p_185706_0_.getValue(BlockStairs.HALF) == iblockstate1.getValue(BlockStairs.HALF))
{
EnumFacing enumfacing2 = (EnumFacing)iblockstate1.getValue(BlockStairs.FACING);
if (enumfacing2.getAxis() != ((EnumFacing)p_185706_0_.getValue(BlockStairs.FACING)).getAxis() && isDifferentStairs(p_185706_0_, p_185706_1_, p_185706_2_, enumfacing2))
{
if (enumfacing2 == enumfacing.rotateYCCW())
{
return BlockStairs.EnumShape.INNER_LEFT;
}
return BlockStairs.EnumShape.INNER_RIGHT;
}
}
return BlockStairs.EnumShape.STRAIGHT;
}