Package micdoodle8.mods.galacticraft.api.vector

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


    private List<TileEntityOxygenSealer> otherSealers;
    private List<BlockVec3> torchesToUpdate;

    public ThreadFindSeal(TileEntityOxygenSealer sealer)
    {
        this(sealer.getWorldObj(), new BlockVec3(sealer).translate(0, 1, 0), sealer.getFindSealChecks(), new ArrayList<TileEntityOxygenSealer>(Arrays.asList(sealer)));
    }
View Full Code Here


        this.sealersAround = new HashMap<BlockVec3, TileEntityOxygenSealer>();
        for (TileEntity tile : new ArrayList<TileEntity>(world.loadedTileEntityList))
        {
            if (tile instanceof TileEntityOxygenSealer && tile.getDistanceFrom(head.x, head.y, head.z) < 1024 * 1024)
            {
                this.sealersAround.put(new BlockVec3(tile.xCoord, tile.yCoord, tile.zCoord), (TileEntityOxygenSealer) tile);
            }
        }

        //If called by a sealer test the head block and if partiallySealable mark its sides done as required
        if (!sealers.isEmpty())
View Full Code Here

                    // If it hasn't already been counted, need to check the
                    // other sealer immediately in case it can keep the space
                    // sealed
                    if (!sealersDone.contains(otherSealer) && otherSealer.getFindSealChecks() > 0)
                    {
                        BlockVec3 newhead = new BlockVec3(otherSealer).translate(0, 1, 0);
                        this.sealed = true;
                        this.checkCount = otherSealer.getFindSealChecks();
                        this.sealers = new LinkedList<TileEntityOxygenSealer>();
                        this.sealers.add(otherSealer);
                        this.checked = new HashSet<BlockVec3>();
                        this.checked.add(newhead);
                        this.currentLayer.clear();
                        this.airToReplace.clear();
                        this.airToReplaceBright.clear();
                        this.torchesToUpdate = new LinkedList<BlockVec3>();
                        this.currentLayer.add(newhead.clone());
                        if (newhead.x < -29990000 || newhead.z < -29990000 || newhead.x >= 29990000 || newhead.z >= 29990000)
                        {
                            this.doLayerNearMapEdge();
                        }
                        else
                        {
                            this.doLayer();
                        }

                        // If found a sealer which can still seal the space, it
                        // should take over as head
                        if (this.sealed)
                        {
                            if (ConfigManagerCore.enableDebug)
                            {
                                FMLLog.info("Oxygen Sealer replacing head at x" + this.head.x + " y" + (this.head.y - 1) + " z" + this.head.z);
                            }
                            if (!sealersSave.isEmpty())
                            {
                                TileEntityOxygenSealer oldHead = sealersSave.get(0);
                                if (!this.sealers.contains(oldHead))
                                {
                                    this.sealers.add(oldHead);
                                }
                            }
                            this.head = newhead.clone();
                            otherSealer.threadSeal = this;
                            otherSealer.stopSealThreadCooldown = 75 + TileEntityOxygenSealer.countEntities;
                            checkedSave.addAll(this.checked);
                            break;
                        }
View Full Code Here

                int side = 0;
                do
                {
                    if (!vec.sideDone[side])
                    {
                        BlockVec3 sideVec = vec.newVecSide(side);

                        if (!checkedLocal.contains(sideVec))
                        {
                            Block id = sideVec.getBlockIDsafe_noChunkLoad(this.world);

                            if (id == breatheableAirID)
                            {
                                this.breatheableToReplace.add(sideVec);
                                // Only follow paths with adjacent breatheableAir
View Full Code Here

    {
        this.mainBlockPosition = placedPosition;

        for (int y = 1; y < 3; y++)
        {
            final BlockVec3 vecToAdd = new BlockVec3(placedPosition.x, placedPosition.y + y, placedPosition.z);

            if (!vecToAdd.equals(placedPosition))
            {
                ((BlockMulti) GCBlocks.fakeBlock).makeFakeBlock(this.worldObj, vecToAdd, placedPosition, 1);
            }
        }
    }
View Full Code Here

                {
                    if (vec.sideDone[side])
                    {
                        continue;
                    }
                    BlockVec3 sideVec = vec.newVecSide(side);

                    if (!checkedLocal.contains(sideVec))
                    {
                        Block id = sideVec.getBlockID_noChunkLoad(this.world);

                        if (id == breatheableAirID)
                        {
                            this.breatheableToReplace.add(sideVec);
                            // Only follow paths with adjacent breatheableAir
View Full Code Here

        if (!this.worldObj.isRemote)
        {
            EnumSet<ForgeDirection> outputDirections = this.getElectricalOutputDirections();
            outputDirections.remove(ForgeDirection.UNKNOWN);

            BlockVec3 thisVec = new BlockVec3(this);
            for (ForgeDirection direction : outputDirections)
            {
                TileEntity tileAdj = thisVec.getTileEntityOnSide(this.worldObj, direction);

                if (tileAdj != null)
                {
                    float toSend = this.extractEnergyGC(null, Math.min(this.getEnergyStoredGC() - amountProduced, this.getEnergyStoredGC() / outputDirections.size()), true);
                    if (toSend <= 0)
View Full Code Here

                    //This is also used to skip looking on the solid sides of partially sealable blocks
                    if (!vec.sideDone[side])
                    {
                        // The sides 0 to 5 correspond with the ForgeDirections
                        // but saves a bit of time not to call ForgeDirection
                        BlockVec3 sideVec = vec.newVecSide(side);

                        if (!checkedLocal.contains(sideVec))
                        {
                            if (this.checkCount > 0)
                            {
                                this.checkCount--;
                                checkedLocal.add(sideVec);

                                Block id = sideVec.getBlockIDsafe_noChunkLoad(this.world);
                                // The most likely case
                                if (id == breatheableAirID)
                                {
                                    nextLayer.add(sideVec);
                                }
                                else if (id == airID)
                                {
                                    nextLayer.add(sideVec);
                                    this.airToReplace.add(sideVec);
                                }
                                else if (id == breatheableAirIDBright)
                                {
                                    nextLayer.add(sideVec);
                                }
                                else if (id == airIDBright)
                                {
                                    nextLayer.add(sideVec);
                                    this.airToReplaceBright.add(sideVec);
                                }
                                else if (id == null)
                                {
                                    // Broken through to the void or the
                                    // stratosphere (above y==255) - set
                                    // unsealed and abort
                                    this.checkCount = 0;
                                    this.sealed = false;
                                    return;
                                }
                                else if (this.canBlockPassAirCheck(id, sideVec, side))
                                {
                                    nextLayer.add(sideVec);
                                }
                                else if (id == oxygenSealerID)
                                {
                                    TileEntityOxygenSealer sealer = this.sealersAround.get(sideVec);

                                    if (sealer != null && !this.sealers.contains(sealer))
                                    {
                                        if (side == 0)
                                        {
                                            this.sealers.add(sealer);
                                            this.checkCount += sealer.getFindSealChecks();
                                        }
                                        else
                                        {
                                            //Allow this sealer to be checked from other sides
                                            checkedLocal.remove(sideVec);
                                        }
                                    }
                                }
                                //If the chunk was unloaded, BlockVec3.getBlockID returns Blocks.bedrock
                                //which is a solid block, so the loop will treat that as a sealed edge
                                //and not iterate any further in that direction
                            }
                            // the if (this.isSealed) check here is unnecessary because of the returns
                            else
                            {
                                Block id = sideVec.getBlockIDsafe_noChunkLoad(this.world);
                                // id == null means the void or height y>255, both
                                // of which are unsealed obviously
                                if (id == null || id == airID || id == breatheableAirID || id == airIDBright || id == breatheableAirIDBright || this.canBlockPassAirCheck(id, sideVec, side))
                                {
                                    this.sealed = false;
View Full Code Here

    @Override
    public float getProvide(ForgeDirection direction)
    {
        if (direction == ForgeDirection.UNKNOWN && EnergyConfigHandler.isIndustrialCraft2Loaded())
        {
            TileEntity tile = new BlockVec3(this).getTileEntityOnSide(this.worldObj, this.getElectricalOutputDirectionMain());
            if (tile instanceof IConductor)
            {
                //No power provide to IC2 mod if it's a Galacticraft wire on the output.  Galacticraft network will provide the power.
                return 0.0F;
            }
View Full Code Here

                    //This is also used to skip looking on the solid sides of partially sealable blocks
                    if (!vec.sideDone[side])
                    {
                        // The sides 0 to 5 correspond with the ForgeDirections
                        // but saves a bit of time not to call ForgeDirection
                        BlockVec3 sideVec = vec.newVecSide(side);

                        if (!checkedLocal.contains(sideVec))
                        {
                            if (this.checkCount > 0)
                            {
                                this.checkCount--;
                                checkedLocal.add(sideVec);

                                Block id = sideVec.getBlockID_noChunkLoad(this.world);
                                // The most likely case
                                if (id == breatheableAirID)
                                {
                                    nextLayer.add(sideVec);
                                }
                                else if (id == airID)
                                {
                                    nextLayer.add(sideVec);
                                    this.airToReplace.add(sideVec);
                                }
                                else if (id == breatheableAirIDBright)
                                {
                                    nextLayer.add(sideVec);
                                }
                                else if (id == airIDBright)
                                {
                                    nextLayer.add(sideVec);
                                    this.airToReplaceBright.add(sideVec);
                                }
                                else if (id == null)
                                {
                                    // Broken through to the void or the
                                    // stratosphere (above y==255) - set
                                    // unsealed and abort
                                    this.checkCount = 0;
                                    this.sealed = false;
                                    return;
                                }
                                else if (this.canBlockPassAirCheck(id, sideVec, side))
                                {
                                    nextLayer.add(sideVec);
                                }
                                else if (id == oxygenSealerID)
                                {
                                    TileEntityOxygenSealer sealer = this.sealersAround.get(sideVec);

                                    if (sealer != null && !this.sealers.contains(sealer))
                                    {
                                        if (side == 0)
                                        {
                                            this.sealers.add(sealer);
                                            this.checkCount += sealer.getFindSealChecks();
                                        }
                                        else
                                        {
                                            //Allow this sealer to be checked from other sides
                                            checkedLocal.remove(sideVec);
                                        }
                                    }
                                }
                                //If the chunk was unloaded, BlockVec3.getBlockID returns Blocks.bedrock
                                //which is a solid block, so the loop will treat that as a sealed edge
                                //and not iterate any further in that direction
                            }
                            // the if (this.isSealed) check here is unnecessary because of the returns
                            else
                            {
                                Block id = sideVec.getBlockID_noChunkLoad(this.world);
                                // id == null means the void or height y>255, both
                                // of which are unsealed obviously
                                if (id == null || id == airID || id == breatheableAirID || id == airIDBright || id == breatheableAirIDBright || this.canBlockPassAirCheck(id, sideVec, side))
                                {
                                    this.sealed = false;
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.