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


Java EnumFacing.AxisDirection方法代码示例

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


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

示例1: rotateXY

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static EnumFacing rotateXY(EnumFacing actual, EnumFacing.AxisDirection direction, EnumFacing facing) {
	boolean inverse = direction == EnumFacing.AxisDirection.POSITIVE;
	switch(facing) {
		case NORTH:
		case SOUTH:
			inverse = inverse ? facing == SOUTH : facing == NORTH;
			actual = rotateX(actual, inverse);
			break;
		case WEST:
		case EAST:
			inverse = inverse ? facing == EAST : facing == WEST;
			actual = rotateZ(actual, inverse);
			break;
	}
	return actual;
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:17,代码来源:FacingHelper.java

示例2: func_181089_f

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public BlockPattern.PatternHelper func_181089_f(World p_181089_1_, BlockPos p_181089_2_)
{
    EnumFacing.Axis enumfacing$axis = EnumFacing.Axis.Z;
    BlockPortal.Size blockportal$size = new BlockPortal.Size(p_181089_1_, p_181089_2_, EnumFacing.Axis.X);
    LoadingCache<BlockPos, BlockWorldState> loadingcache = BlockPattern.func_181627_a(p_181089_1_, true);

    if (!blockportal$size.func_150860_b())
    {
        enumfacing$axis = EnumFacing.Axis.X;
        blockportal$size = new BlockPortal.Size(p_181089_1_, p_181089_2_, EnumFacing.Axis.Z);
    }

    if (!blockportal$size.func_150860_b())
    {
        return new BlockPattern.PatternHelper(p_181089_2_, EnumFacing.NORTH, EnumFacing.UP, loadingcache, 1, 1, 1);
    }
    else
    {
        int[] aint = new int[EnumFacing.AxisDirection.values().length];
        EnumFacing enumfacing = blockportal$size.field_150866_c.rotateYCCW();
        BlockPos blockpos = blockportal$size.field_150861_f.up(blockportal$size.func_181100_a() - 1);

        for (EnumFacing.AxisDirection enumfacing$axisdirection : EnumFacing.AxisDirection.values())
        {
            BlockPattern.PatternHelper blockpattern$patternhelper = new BlockPattern.PatternHelper(enumfacing.getAxisDirection() == enumfacing$axisdirection ? blockpos : blockpos.offset(blockportal$size.field_150866_c, blockportal$size.func_181101_b() - 1), EnumFacing.func_181076_a(enumfacing$axisdirection, enumfacing$axis), EnumFacing.UP, loadingcache, blockportal$size.func_181101_b(), blockportal$size.func_181100_a(), 1);

            for (int i = 0; i < blockportal$size.func_181101_b(); ++i)
            {
                for (int j = 0; j < blockportal$size.func_181100_a(); ++j)
                {
                    BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, j, 1);

                    if (blockworldstate.getBlockState() != null && blockworldstate.getBlockState().getBlock().getMaterial() != Material.air)
                    {
                        ++aint[enumfacing$axisdirection.ordinal()];
                    }
                }
            }
        }

        EnumFacing.AxisDirection enumfacing$axisdirection1 = EnumFacing.AxisDirection.POSITIVE;

        for (EnumFacing.AxisDirection enumfacing$axisdirection2 : EnumFacing.AxisDirection.values())
        {
            if (aint[enumfacing$axisdirection2.ordinal()] < aint[enumfacing$axisdirection1.ordinal()])
            {
                enumfacing$axisdirection1 = enumfacing$axisdirection2;
            }
        }

        return new BlockPattern.PatternHelper(enumfacing.getAxisDirection() == enumfacing$axisdirection1 ? blockpos : blockpos.offset(blockportal$size.field_150866_c, blockportal$size.func_181101_b() - 1), EnumFacing.func_181076_a(enumfacing$axisdirection1, enumfacing$axis), EnumFacing.UP, loadingcache, blockportal$size.func_181101_b(), blockportal$size.func_181100_a(), 1);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:54,代码来源:BlockPortal.java

示例3: createPatternHelper

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public BlockPattern.PatternHelper createPatternHelper(World worldIn, BlockPos p_181089_2_)
{
    EnumFacing.Axis enumfacing$axis = EnumFacing.Axis.Z;
    BlockPortal.Size blockportal$size = new BlockPortal.Size(worldIn, p_181089_2_, EnumFacing.Axis.X);
    LoadingCache<BlockPos, BlockWorldState> loadingcache = BlockPattern.createLoadingCache(worldIn, true);

    if (!blockportal$size.isValid())
    {
        enumfacing$axis = EnumFacing.Axis.X;
        blockportal$size = new BlockPortal.Size(worldIn, p_181089_2_, EnumFacing.Axis.Z);
    }

    if (!blockportal$size.isValid())
    {
        return new BlockPattern.PatternHelper(p_181089_2_, EnumFacing.NORTH, EnumFacing.UP, loadingcache, 1, 1, 1);
    }
    else
    {
        int[] aint = new int[EnumFacing.AxisDirection.values().length];
        EnumFacing enumfacing = blockportal$size.rightDir.rotateYCCW();
        BlockPos blockpos = blockportal$size.bottomLeft.up(blockportal$size.getHeight() - 1);

        for (EnumFacing.AxisDirection enumfacing$axisdirection : EnumFacing.AxisDirection.values())
        {
            BlockPattern.PatternHelper blockpattern$patternhelper = new BlockPattern.PatternHelper(enumfacing.getAxisDirection() == enumfacing$axisdirection ? blockpos : blockpos.offset(blockportal$size.rightDir, blockportal$size.getWidth() - 1), EnumFacing.getFacingFromAxis(enumfacing$axisdirection, enumfacing$axis), EnumFacing.UP, loadingcache, blockportal$size.getWidth(), blockportal$size.getHeight(), 1);

            for (int i = 0; i < blockportal$size.getWidth(); ++i)
            {
                for (int j = 0; j < blockportal$size.getHeight(); ++j)
                {
                    BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, j, 1);

                    if (blockworldstate.getBlockState() != null && blockworldstate.getBlockState().getMaterial() != Material.AIR)
                    {
                        ++aint[enumfacing$axisdirection.ordinal()];
                    }
                }
            }
        }

        EnumFacing.AxisDirection enumfacing$axisdirection1 = EnumFacing.AxisDirection.POSITIVE;

        for (EnumFacing.AxisDirection enumfacing$axisdirection2 : EnumFacing.AxisDirection.values())
        {
            if (aint[enumfacing$axisdirection2.ordinal()] < aint[enumfacing$axisdirection1.ordinal()])
            {
                enumfacing$axisdirection1 = enumfacing$axisdirection2;
            }
        }

        return new BlockPattern.PatternHelper(enumfacing.getAxisDirection() == enumfacing$axisdirection1 ? blockpos : blockpos.offset(blockportal$size.rightDir, blockportal$size.getWidth() - 1), EnumFacing.getFacingFromAxis(enumfacing$axisdirection1, enumfacing$axis), EnumFacing.UP, loadingcache, blockportal$size.getWidth(), blockportal$size.getHeight(), 1);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:54,代码来源:BlockPortal.java


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