当前位置: 首页>>代码示例>>Java>>正文


Java EnumShape.INNER_LEFT属性代码示例

本文整理汇总了Java中net.minecraft.block.BlockStairs.EnumShape.INNER_LEFT属性的典型用法代码示例。如果您正苦于以下问题:Java EnumShape.INNER_LEFT属性的具体用法?Java EnumShape.INNER_LEFT怎么用?Java EnumShape.INNER_LEFT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraft.block.BlockStairs.EnumShape的用法示例。


在下文中一共展示了EnumShape.INNER_LEFT属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isSideSolid

@Override
public boolean isSideSolid(IBlockState state,IBlockAccess world, BlockPos pos, EnumFacing side)
{
	boolean flipped = state.getValue(BlockStairs.HALF) == EnumHalf.TOP;
	EnumShape shape = (EnumShape)state.getValue(BlockStairs.SHAPE);
	EnumFacing facing = (EnumFacing)state.getValue(BlockStairs.FACING);
	if (side == EnumFacing.UP) return flipped;
	if (side == EnumFacing.DOWN) return !flipped;
	if (facing == side) return true;
	if (flipped)
	{
		if (shape == EnumShape.INNER_LEFT) return side == facing.rotateYCCW();
		if (shape == EnumShape.INNER_RIGHT) return side == facing.rotateY();
	}
	else
	{
		if (shape == EnumShape.INNER_LEFT) return side == facing.rotateY();
		if (shape == EnumShape.INNER_RIGHT) return side == facing.rotateYCCW();
	}
	return false;
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:21,代码来源:BlockStairsTFC.java

示例2: doesSideBlockRendering

@Override
public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
{
	if (net.minecraftforge.common.ForgeModContainer.disableStairSlabCulling)
		return super.doesSideBlockRendering(state, world, pos, face);

	if ( state.isOpaqueCube() )
		return true;

	state = this.getActualState(state, world, pos);

	EnumHalf half = state.getValue(BlockStairs.HALF);
	EnumFacing side = state.getValue(BlockStairs.FACING);
	EnumShape shape = state.getValue(BlockStairs.SHAPE);
	if (face == EnumFacing.UP) return half == EnumHalf.TOP;
	if (face == EnumFacing.DOWN) return half == EnumHalf.BOTTOM;
	if (shape == EnumShape.OUTER_LEFT || shape == EnumShape.OUTER_RIGHT) return false;
	if (face == side) return true;
	if (shape == EnumShape.INNER_LEFT && face.rotateY() == side) return true;
	if (shape == EnumShape.INNER_RIGHT && face.rotateYCCW() == side) return true;
	return false;
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:22,代码来源:BlockStairsTFC.java

示例3: matchBlockState

@Override
public boolean matchBlockState(IBlockState b1, IBlockState b2)
{
    final EnumFacing b1Facing = b1.getValue(BlockHorizontal.FACING);
    final EnumFacing b2Facing = b2.getValue(BlockHorizontal.FACING);

    final EnumHalf b1Half = b1.getValue(HALF);
    final EnumHalf b2Half = b2.getValue(HALF);

    final EnumShape b1Shape = b1.getValue(SHAPE);
    final EnumShape b2Shape = b2.getValue(SHAPE);

    if (b1Half != b2Half)
    {
        return false;
    }

    if (b1Facing == b2Facing)
    {
        return b1Shape == b2Shape;
    }

    if (b1Facing.getOpposite() == b2Facing)
    {
        return false;
    }

    if ((b1Shape == EnumShape.OUTER_RIGHT && b2Shape == EnumShape.OUTER_LEFT) ||
            (b1Shape == EnumShape.INNER_RIGHT && b2Shape == EnumShape.INNER_LEFT) ||
            (b1Shape == EnumShape.OUTER_LEFT && b2Shape == EnumShape.OUTER_RIGHT) ||
            (b1Shape == EnumShape.INNER_LEFT && b2Shape == EnumShape.INNER_RIGHT))
    {
        return true;
    }

    return false;
}
 
开发者ID:FoudroyantFactotum,项目名称:Structure,代码行数:37,代码来源:StairMatcher.java


注:本文中的net.minecraft.block.BlockStairs.EnumShape.INNER_LEFT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。