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


Java IBlockState.withRotation方法代码示例

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


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

示例1: withMirror

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
 * blockstate.
 */
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
    return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(FACING)));
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:9,代码来源:HeroHead.java

示例2: withMirror

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")

    /**
     * Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
     * blockstate.
     */
    public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
    {
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
        BlockStairs.EnumShape blockstairs$enumshape = (BlockStairs.EnumShape)state.getValue(SHAPE);

        switch (mirrorIn)
        {
            case LEFT_RIGHT:
                if (enumfacing.getAxis() == EnumFacing.Axis.Z)
                {
                    switch (blockstairs$enumshape)
                    {
                        case OUTER_LEFT:
                            return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.OUTER_RIGHT);

                        case OUTER_RIGHT:
                            return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.OUTER_LEFT);

                        case INNER_RIGHT:
                            return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.INNER_LEFT);

                        case INNER_LEFT:
                            return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.INNER_RIGHT);

                        default:
                            return state.withRotation(Rotation.CLOCKWISE_180);
                    }
                }

                break;

            case FRONT_BACK:
                if (enumfacing.getAxis() == EnumFacing.Axis.X)
                {
                    switch (blockstairs$enumshape)
                    {
                        case OUTER_LEFT:
                            return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.OUTER_RIGHT);

                        case OUTER_RIGHT:
                            return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.OUTER_LEFT);

                        case INNER_RIGHT:
                            return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.INNER_RIGHT);

                        case INNER_LEFT:
                            return state.withRotation(Rotation.CLOCKWISE_180).withProperty(SHAPE, BlockStairs.EnumShape.INNER_LEFT);

                        case STRAIGHT:
                            return state.withRotation(Rotation.CLOCKWISE_180);
                    }
                }
        }

        return super.withMirror(state, mirrorIn);
    }
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:63,代码来源:BlockStairs.java

示例3: withMirror

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
 * blockstate.
 */
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
    return state.withRotation(mirrorIn.toRotation((EnumFacing)state.getValue(field_190957_a)));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:BlockShulkerBox.java

示例4: withMirror

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Override
public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
    return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:5,代码来源:CraftiniumForge.java

示例5: withMirror

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed
 * blockstate.
 */
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
{
    return state.withRotation(mirrorIn.toRotation(((BlockLever.EnumOrientation)state.getValue(FACING)).getFacing()));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:BlockLever.java


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