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


Java BlockVec3.newVecSide方法代码示例

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


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

示例1: checkTorchHasOxygen

import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入方法依赖的package包/类
public static boolean checkTorchHasOxygen(World world, Block block, int x, int y, int z)
{
	if (OxygenUtil.inOxygenBubble(world, x + 0.5D, y + 0.6D, z + 0.5D)) return true;
	OxygenUtil.checked = new HashSet();
    BlockVec3 vec = new BlockVec3(x, y, z);
    for (int side = 0; side < 6; side++)
    {
        BlockVec3 sidevec = vec.newVecSide(side);
        Block newblock = sidevec.getBlockID_noChunkLoad(world);
        if (OxygenUtil.testContactWithBreathableAir(world, newblock, sidevec.x, sidevec.y, sidevec.z, 1) >= 0)
        {
            return true;
        }
    }
    return false;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:17,代码来源:OxygenUtil.java

示例2: testContactWithBreathableAir

import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入方法依赖的package包/类
private static int testContactWithBreathableAir(World world, Block block, int x, int y, int z, int limitCount)
{
    BlockVec3 vec = new BlockVec3(x, y, z);
    checked.add(vec);
    if (block == GCBlocks.breatheableAir || block == GCBlocks.brightBreatheableAir)
    {
        return world.getBlockMetadata(x, y, z);
    }

    if (block == null || block.getMaterial() == Material.air)
    {
        return -1;
    }

    //Test for non-sided permeable or solid blocks first
    boolean permeableFlag = false;
    if (!(block instanceof BlockLeavesBase))
    {
        if (block.isOpaqueCube())
        {
            if (block instanceof BlockGravel || block.getMaterial() == Material.cloth || block instanceof BlockSponge)
            {
                permeableFlag = true;
            }
            else
            {
                return -1;
            }
        }
        else if (block instanceof BlockGlass || block instanceof BlockStainedGlass)
        {
            return -1;
        }
        else if (block instanceof BlockLiquid)
        {
            return -1;
        }
        else if (OxygenPressureProtocol.nonPermeableBlocks.containsKey(block))
        {
            ArrayList<Integer> metaList = OxygenPressureProtocol.nonPermeableBlocks.get(block);
            if (metaList.contains(Integer.valueOf(-1)) || metaList.contains(world.getBlockMetadata(x, y, z)))
            {
                return -1;
            }
        }
    }
    else
    {
        permeableFlag = true;
    }

    //Testing a non-air, permeable block (for example a torch or a ladder)
    if (limitCount < 5)
    {
        for (int side = 0; side < 6; side++)
        {
            if (permeableFlag || OxygenUtil.canBlockPassAirOnSide(world, block, vec, side))
            {
                BlockVec3 sidevec = vec.newVecSide(side);
                if (!checked.contains(sidevec))
                {
                    Block newblock = sidevec.getBlockID_noChunkLoad(world);
                    int adjResult = OxygenUtil.testContactWithBreathableAir(world, newblock, sidevec.x, sidevec.y, sidevec.z, limitCount + 1);
                    if (adjResult >= 0)
                    {
                        return adjResult;
                    }
                }
            }
        }
    }

    return -1;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:75,代码来源:OxygenUtil.java


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