當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。