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


Java EnumFacing.getAxisDirection方法代码示例

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


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

示例1: func_150809_p

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public void func_150809_p()
{
    this.isTerrainPopulated = true;
    this.isLightPopulated = true;
    BlockPos blockpos = new BlockPos(this.xPosition << 4, 0, this.zPosition << 4);

    if (!this.worldObj.provider.getHasNoSky())
    {
        if (this.worldObj.isAreaLoaded(blockpos.add(-1, 0, -1), blockpos.add(16, this.worldObj.func_181545_F(), 16)))
        {
            label92:

            for (int i = 0; i < 16; ++i)
            {
                for (int j = 0; j < 16; ++j)
                {
                    if (!this.func_150811_f(i, j))
                    {
                        this.isLightPopulated = false;
                        break label92;
                    }
                }
            }

            if (this.isLightPopulated)
            {
                for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
                {
                    int k = enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE ? 16 : 1;
                    this.worldObj.getChunkFromBlockCoords(blockpos.offset(enumfacing, k)).func_180700_a(enumfacing.getOpposite());
                }

                this.func_177441_y();
            }
        }
        else
        {
            this.isLightPopulated = false;
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:42,代码来源:Chunk.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: func_150809_p

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public void func_150809_p()
{
    this.isTerrainPopulated = true;
    this.isLightPopulated = true;
    BlockPos blockpos = new BlockPos(this.xPosition << 4, 0, this.zPosition << 4);

    if (!this.worldObj.provider.getHasNoSky())
    {
        if (this.worldObj.isAreaLoaded(blockpos.add(-1, 0, -1), blockpos.add(16, this.worldObj.func_181545_F(), 16)))
        {
            label92:

            for (int i = 0; i < 16; ++i)
            {
                for (int j = 0; j < 16; ++j)
                {
                    if (!this.func_150811_f(i, j))
                    {
                        this.isLightPopulated = false;
                        break label92;
                    }
                }
            }

            if (this.isLightPopulated)
            {
                for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL)
                {
                	EnumFacing enumfacing = (EnumFacing)enumfacing0;
                    int k = enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE ? 16 : 1;
                    this.worldObj.getChunkFromBlockCoords(blockpos.offset(enumfacing, k)).func_180700_a(enumfacing.getOpposite());
                }

                this.func_177441_y();
            }
        }
        else
        {
            this.isLightPopulated = false;
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:43,代码来源:Chunk.java

示例4: func_150809_p

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public void func_150809_p()
{
    this.isTerrainPopulated = true;
    this.isLightPopulated = true;
    BlockPos blockpos = new BlockPos(this.xPosition << 4, 0, this.zPosition << 4);

    if (!this.worldObj.provider.getHasNoSky())
    {
        if (this.worldObj.isAreaLoaded(blockpos.add(-1, 0, -1), blockpos.add(16, this.worldObj.func_181545_F(), 16)))
        {
            label92:

            for (int i = 0; i < 16; ++i)
            {
                for (int j = 0; j < 16; ++j)
                {
                    if (!this.func_150811_f(i, j))
                    {
                        this.isLightPopulated = false;
                        break label92;
                    }
                }
            }

            if (this.isLightPopulated)
            {
                for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL)
                {
                    EnumFacing enumfacing = (EnumFacing) enumfacing0;
                    int k = enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE ? 16 : 1;
                    this.worldObj.getChunkFromBlockCoords(blockpos.offset(enumfacing, k)).func_180700_a(enumfacing.getOpposite());
                }

                this.func_177441_y();
            }
        }
        else
        {
            this.isLightPopulated = false;
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:43,代码来源:Chunk.java

示例5: checkLight

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public void checkLight()
{
    this.isTerrainPopulated = true;
    this.isLightPopulated = true;
    BlockPos blockpos = new BlockPos(this.xPosition << 4, 0, this.zPosition << 4);

    if (this.worldObj.provider.func_191066_m())
    {
        if (this.worldObj.isAreaLoaded(blockpos.add(-1, 0, -1), blockpos.add(16, this.worldObj.getSeaLevel(), 16)))
        {
            label92:

            for (int i = 0; i < 16; ++i)
            {
                for (int j = 0; j < 16; ++j)
                {
                    if (!this.checkLight(i, j))
                    {
                        this.isLightPopulated = false;
                        break label92;
                    }
                }
            }

            if (this.isLightPopulated)
            {
                for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
                {
                    int k = enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE ? 16 : 1;
                    this.worldObj.getChunkFromBlockCoords(blockpos.offset(enumfacing, k)).checkLightSide(enumfacing.getOpposite());
                }

                this.setSkylightUpdated();
            }
        }
        else
        {
            this.isLightPopulated = false;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:42,代码来源:Chunk.java

示例6: 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

示例7: func_190589_G

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private void func_190589_G()
{
    IBlockState iblockstate = this.world.getBlockState(this.getPos());

    if (iblockstate.getBlock() instanceof BlockShulkerBox)
    {
        EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(BlockShulkerBox.field_190957_a);
        AxisAlignedBB axisalignedbb = this.func_190588_c(enumfacing).offset(this.pos);
        List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity((Entity)null, axisalignedbb);

        if (!list.isEmpty())
        {
            for (int i = 0; i < list.size(); ++i)
            {
                Entity entity = (Entity)list.get(i);

                if (entity.getPushReaction() != EnumPushReaction.IGNORE)
                {
                    double d0 = 0.0D;
                    double d1 = 0.0D;
                    double d2 = 0.0D;
                    AxisAlignedBB axisalignedbb1 = entity.getEntityBoundingBox();

                    switch (enumfacing.getAxis())
                    {
                        case X:
                            if (enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE)
                            {
                                d0 = axisalignedbb.maxX - axisalignedbb1.minX;
                            }
                            else
                            {
                                d0 = axisalignedbb1.maxX - axisalignedbb.minX;
                            }

                            d0 = d0 + 0.01D;
                            break;

                        case Y:
                            if (enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE)
                            {
                                d1 = axisalignedbb.maxY - axisalignedbb1.minY;
                            }
                            else
                            {
                                d1 = axisalignedbb1.maxY - axisalignedbb.minY;
                            }

                            d1 = d1 + 0.01D;
                            break;

                        case Z:
                            if (enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE)
                            {
                                d2 = axisalignedbb.maxZ - axisalignedbb1.minZ;
                            }
                            else
                            {
                                d2 = axisalignedbb1.maxZ - axisalignedbb.minZ;
                            }

                            d2 = d2 + 0.01D;
                    }

                    entity.moveEntity(MoverType.SHULKER_BOX, d0 * (double)enumfacing.getFrontOffsetX(), d1 * (double)enumfacing.getFrontOffsetY(), d2 * (double)enumfacing.getFrontOffsetZ());
                }
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:71,代码来源:TileEntityShulkerBox.java

示例8: func_190611_b

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private static double func_190611_b(AxisAlignedBB p_190611_0_, EnumFacing p_190611_1_, AxisAlignedBB p_190611_2_)
{
    return p_190611_1_.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE ? p_190611_0_.maxX - p_190611_2_.minX : p_190611_2_.maxX - p_190611_0_.minX;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:TileEntityPiston.java

示例9: func_190608_c

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private static double func_190608_c(AxisAlignedBB p_190608_0_, EnumFacing p_190608_1_, AxisAlignedBB p_190608_2_)
{
    return p_190608_1_.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE ? p_190608_0_.maxY - p_190608_2_.minY : p_190608_2_.maxY - p_190608_0_.minY;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:TileEntityPiston.java

示例10: func_190604_d

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private static double func_190604_d(AxisAlignedBB p_190604_0_, EnumFacing p_190604_1_, AxisAlignedBB p_190604_2_)
{
    return p_190604_1_.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE ? p_190604_0_.maxZ - p_190604_2_.minZ : p_190604_2_.maxZ - p_190604_0_.minZ;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:TileEntityPiston.java

示例11: checkLight

import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public void checkLight()
{
    this.isTerrainPopulated = true;
    this.isLightPopulated = true;
    BlockPos blockpos = new BlockPos(this.xPosition << 4, 0, this.zPosition << 4);

    if (!this.worldObj.provider.getHasNoSky())
    {
        if (this.worldObj.isAreaLoaded(blockpos.add(-1, 0, -1), blockpos.add(16, this.worldObj.getSeaLevel(), 16)))
        {
            label92:

            for (int i = 0; i < 16; ++i)
            {
                for (int j = 0; j < 16; ++j)
                {
                    if (!this.checkLight(i, j))
                    {
                        this.isLightPopulated = false;
                        break label92;
                    }
                }
            }

            if (this.isLightPopulated)
            {
                for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
                {
                    int k = enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE ? 16 : 1;
                    this.worldObj.getChunkFromBlockCoords(blockpos.offset(enumfacing, k)).checkLightSide(enumfacing.getOpposite());
                }

                this.setSkylightUpdated();
            }
        }
        else
        {
            this.isLightPopulated = false;
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:42,代码来源:Chunk.java


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