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


Java EnumShape类代码示例

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


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

示例1: isSideSolid

import net.minecraft.block.BlockStairs.EnumShape; //导入依赖的package包/类
@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,代码行数:22,代码来源:BlockStairsTFC.java

示例2: doesSideBlockRendering

import net.minecraft.block.BlockStairs.EnumShape; //导入依赖的package包/类
@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,代码行数:23,代码来源:BlockStairsTFC.java

示例3: getCollisionBoxList

import net.minecraft.block.BlockStairs.EnumShape; //导入依赖的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;
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:20,代码来源:BlockStairsTFC.java

示例4: alterBlockState

import net.minecraft.block.BlockStairs.EnumShape; //导入依赖的package包/类
@Override
public IBlockState alterBlockState(IBlockState state, EnumFacing orientation, boolean mirror)
{
    final EnumFacing facing = state.getValue(BlockHorizontal.FACING);
    final EnumShape shape = state.getValue(SHAPE);
    final EnumHalf half = state.getValue(HALF);

    return state
            .withProperty(BlockHorizontal.FACING, localToGlobal(facing, orientation, mirror))
            .withProperty(SHAPE, mirror & half == EnumHalf.BOTTOM ? opp[shape.ordinal()] : shape);
}
 
开发者ID:FoudroyantFactotum,项目名称:Structure,代码行数:12,代码来源:StairsMinecraftRotation.java

示例5: matchBlockState

import net.minecraft.block.BlockStairs.EnumShape; //导入依赖的package包/类
@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,代码行数:38,代码来源:StairMatcher.java

示例6: BlockStairsTFC

import net.minecraft.block.BlockStairs.EnumShape; //导入依赖的package包/类
public BlockStairsTFC(IBlockState modelState)
{
	super(modelState.getBlock().getMaterial(modelState), null);
	setDefaultState(this.blockState.getBaseState().withProperty(BlockStairs.FACING, EnumFacing.NORTH).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM).withProperty(BlockStairs.SHAPE, EnumShape.STRAIGHT));
	this.modelBlock = modelState.getBlock();
	this.modelState = modelState;
	//setHardness(this.modelBlock.blockHardness);
	//setResistance(this.modelBlock.blockResistance / 3.0F);
	this.setSoundType(SoundType.WOOD);
	setLightOpacity(255);
	this.setCreativeTab(TFCTabs.TFCBuilding);
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:13,代码来源:BlockStairsTFC.java

示例7: getCollEighthBlock

import net.minecraft.block.BlockStairs.EnumShape; //导入依赖的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;
	}
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:42,代码来源:BlockStairsTFC.java

示例8: getStateForPlacement

import net.minecraft.block.BlockStairs.EnumShape; //导入依赖的package包/类
@Override
public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand)
{
	IBlockState iblockstate = super.getStateForPlacement(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer, hand);
	iblockstate = iblockstate.withProperty(BlockStairs.FACING, placer.getHorizontalFacing()).withProperty(BlockStairs.SHAPE, EnumShape.STRAIGHT);
	return (facing != EnumFacing.DOWN) && ((facing == EnumFacing.UP) || (hitY <= 0.5D)) ? iblockstate.withProperty(BlockStairs.HALF, EnumHalf.BOTTOM) : iblockstate.withProperty(BlockStairs.HALF, EnumHalf.TOP);
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:8,代码来源:BlockStairsTFC.java

示例9: func_185706_d

import net.minecraft.block.BlockStairs.EnumShape; //导入依赖的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;
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:40,代码来源:BlockStairsTFC.java


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