Package micdoodle8.mods.galacticraft.api.vector

Examples of micdoodle8.mods.galacticraft.api.vector.BlockVec3


     * Used in BlockUnlitTorch.
     */
    public static boolean checkTorchHasOxygen(World world, Block block, int x, int y, int z)
    {
        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))
            {
                return true;
            }
        }
View Full Code Here


     * air-reachable blocks (up to 5 blocks away) and return true if breathable air is found
     * in one of them, or false if not.
     */
    public static boolean 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 true;
        }

        if (block.getMaterial() == Material.air)
        {
            return false;
        }

        //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 false;
                }
            }
            else if (block instanceof BlockGlass || block instanceof BlockStainedGlass)
            {
                return false;
            }
            else if (block instanceof BlockLiquid)
            {
                return false;
            }
            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 false;
                }
            }
        }
        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);
                        if (OxygenUtil.testContactWithBreathableAir(world, newblock, sidevec.x, sidevec.y, sidevec.z, limitCount + 1))
                        {
                            return true;
                        }
                    }
View Full Code Here

    {
        TileEntity[] adjacentConnections = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length];

        boolean isMekLoaded = EnergyConfigHandler.isMekanismLoaded();

        BlockVec3 thisVec = new BlockVec3(tile);
        for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
        {
            TileEntity tileEntity = thisVec.getTileEntityOnSide(tile.getWorldObj(), direction);

            if (tileEntity instanceof IConnector)
            {
                if (((IConnector) tileEntity).canConnect(direction.getOpposite(), NetworkType.OXYGEN))
                {
View Full Code Here

    {
        float provide = this.getOxygenProvide(outputDirection);

        if (provide > 0)
        {
            TileEntity outputTile = new BlockVec3(this).modifyPositionFromSide(outputDirection).getTileEntity(this.worldObj);
            IOxygenNetwork outputNetwork = NetworkHelper.getOxygenNetworkFromTileEntity(outputTile, outputDirection);

            if (outputNetwork != null)
            {
                float powerRequest = outputNetwork.getRequest(this);
View Full Code Here

    }

    @Override
    public boolean canPlaceBlockAt(World par1World, int x, int y, int z)
    {
        BlockVec3 thisvec = new BlockVec3(x, y, z);
        for (int i = 0; i < 6; i++)
        {
            if (thisvec.blockOnSideHasSolidFace(par1World, i))
            {
                return true;
            }
        }
        return false;
View Full Code Here

    }

    @Override
    public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metaOld)
    {
        BlockVec3 thisvec = new BlockVec3(x, y, z);

        if (thisvec.blockOnSideHasSolidFace(world, side ^ 1))
        {
            return side ^ 1;
        }

        return metaOld;
View Full Code Here

    @Override
    public void onNeighborBlockChange(World par1World, int x, int y, int z, Block par5)
    {
        final int side = par1World.getBlockMetadata(x, y, z);

        BlockVec3 thisvec = new BlockVec3(x, y, z);

        if (thisvec.blockOnSideHasSolidFace(par1World, side))
        {
            return;
        }

        this.dropBlockAsItem(par1World, x, y, z, 0, 0);
View Full Code Here

            int address = nbt2.getInteger("Address");
            int dimID = nbt2.getInteger("DimID");
            int posX = nbt2.getInteger("PosX");
            int posY = nbt2.getInteger("PosY");
            int posZ = nbt2.getInteger("PosZ");
            tileMap.put(address, new TelepadEntry(dimID, new BlockVec3(posX, posY, posZ)));
        }
    }
View Full Code Here

    @Override
    @SideOnly(Side.CLIENT)
    public IIcon getIcon(IBlockAccess par1IBlockAccess, int x, int y, int z, int par5)
    {
        BlockVec3 thisVec = new BlockVec3(x, y, z).modifyPositionFromSide(ForgeDirection.getOrientation(par5));
        final Block blockAt = thisVec.getBlock(par1IBlockAccess);

        final TileEntityOxygenPipe tileEntity = (TileEntityOxygenPipe) par1IBlockAccess.getTileEntity(x, y, z);

        if (blockAt == GCBlocks.oxygenPipe && ((TileEntityOxygenPipe) thisVec.getTileEntity(par1IBlockAccess)).getColor() == tileEntity.getColor())
        {
            return this.pipeIcons[15];
        }

        return this.pipeIcons[tileEntity.getColor()];
View Full Code Here

    {
        if (!telepad.getWorld().isRemote)
        {
            if (telepad.addressValid)
            {
                TelepadEntry newEntry = new TelepadEntry(telepad.getWorldObj().provider.dimensionId, new BlockVec3(telepad));
                TelepadEntry previous = tileMap.put(telepad.address, newEntry);

                if (previous == null || !previous.equals(newEntry))
                {
                    AsteroidsTickHandlerServer.spaceRaceData.setDirty(true);
View Full Code Here

TOP

Related Classes of micdoodle8.mods.galacticraft.api.vector.BlockVec3

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.