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


Java BlockPattern.func_181627_a方法代码示例

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


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

示例1: func_181089_f

import net.minecraft.block.state.pattern.BlockPattern; //导入方法依赖的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


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