Package micdoodle8.mods.galacticraft.api.recipe

Examples of micdoodle8.mods.galacticraft.api.recipe.ISchematicPage


        if (this.worldObj != null)
        {
            if (this.worldObj.isRemote)
            {
                final BlockVec3 thisVec = new BlockVec3(this);
                this.worldObj.func_147479_m(thisVec.x, thisVec.y, thisVec.z);
            }
            else
            {
                this.getNetwork().split(this);
View Full Code Here


            {
                this.attachedFuelable = null;

                for (final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
                {
                    final TileEntity pad = new BlockVec3(this).getTileEntityOnSide(this.worldObj, dir);

                    if (pad instanceof TileEntityMulti)
                    {
                        final TileEntity mainTile = ((TileEntityMulti) pad).mainBlockPosition.getTileEntity(this.worldObj);
View Full Code Here

     */
    public static Set<IElectricityNetwork> getNetworksFromMultipleSides(TileEntity tileEntity, EnumSet<ForgeDirection> approachingDirection)
    {
        final Set<IElectricityNetwork> connectedNetworks = new HashSet<IElectricityNetwork>();

        BlockVec3 tileVec = new BlockVec3(tileEntity);
        for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
        {
            if (approachingDirection.contains(side))
            {
                TileEntity outputConductor = tileVec.getTileEntityOnSide(tileEntity.getWorldObj(), side);
                IElectricityNetwork electricityNetwork = NetworkHelper.getElectricalNetworkFromTileEntity(outputConductor, side);

                if (electricityNetwork != null)
                {
                    connectedNetworks.add(electricityNetwork);
View Full Code Here

   
    public static TileEntity[] getAdjacentPowerConnections(TileEntity tile)
    {
        TileEntity[] adjacentConnections = new TileEntity[6];

        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.POWER))
                {
View Full Code Here

                    e.printStackTrace();
                }
            }
            else if (clazz.equals(BlockVec3.class))
            {
                objList.add(new BlockVec3(buffer.readInt(), buffer.readInt(), buffer.readInt()));
            }
            else if (clazz.equals(UUID.class))
            {
                objList.add(new UUID(buffer.readLong(), buffer.readLong()));
            }
View Full Code Here

        {
            return new Vector3(buffer.readDouble(), buffer.readDouble(), buffer.readDouble());
        }
        else if (dataValue.equals(BlockVec3.class))
        {
            return new BlockVec3(buffer.readInt(), buffer.readInt(), buffer.readInt());
        }
        else if (dataValue.equals(UUID.class))
        {
            return new UUID(buffer.readLong(), buffer.readLong());
        }
View Full Code Here

         */
        if (this.adjacentConnections == null)
        {
            this.adjacentConnections = new TileEntity[6];

            BlockVec3 thisVec = new BlockVec3(this);
            for (int i = 0; i < 6; i++)
            {
                ForgeDirection side = ForgeDirection.getOrientation(i);
                TileEntity tileEntity = thisVec.getTileEntityOnSide(this.worldObj, side);

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

        {
            this.adjacentConnections = null;

            for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
            {
                TileEntity tileEntity = new BlockVec3(this).getTileEntityOnSide(this.worldObj, side);

                if (tileEntity != null)
                {
                    if (tileEntity.getClass() == this.getClass() && tileEntity instanceof INetworkProvider && !this.getNetwork().equals(((INetworkProvider) tileEntity).getNetwork()))
                    {
View Full Code Here

            {
                this.oneSSBlock = baseBlock.clone();
            }
            else
            {
                this.oneSSBlock = new BlockVec3(0, 64, 0);
            }
        }

        // Find contiguous blocks using an algorithm like the oxygen sealer one
        List<BlockVec3> currentLayer = new LinkedList<BlockVec3>();
        List<BlockVec3> nextLayer = new LinkedList<BlockVec3>();
        final List<BlockVec3> foundThrusters = new LinkedList<BlockVec3>();

        this.checked.clear();
        currentLayer.add(this.oneSSBlock.clone());
        this.checked.add(this.oneSSBlock.clone());
        Block bStart = this.oneSSBlock.getBlockID(this.worldObj);
        if (bStart instanceof BlockSpinThruster)
        {
            foundThrusters.add(this.oneSSBlock);
        }

        float thismass = 0.1F; //Mass of a thruster
        float thismassCentreX = 0.1F * this.oneSSBlock.x;
        float thismassCentreY = 0.1F * this.oneSSBlock.y;
        float thismassCentreZ = 0.1F * this.oneSSBlock.z;
        float thismoment = 0F;
        int thisssBoundsMaxX = this.oneSSBlock.x;
        int thisssBoundsMinX = this.oneSSBlock.x;
        int thisssBoundsMaxY = this.oneSSBlock.y;
        int thisssBoundsMinY = this.oneSSBlock.y;
        int thisssBoundsMaxZ = this.oneSSBlock.z;
        int thisssBoundsMinZ = this.oneSSBlock.z;

        while (currentLayer.size() > 0)
        {
            for (BlockVec3 vec : currentLayer)
            {
                if (vec.x < thisssBoundsMinX)
                {
                    thisssBoundsMinX = vec.x;
                }
                if (vec.y < thisssBoundsMinY)
                {
                    thisssBoundsMinY = vec.y;
                }
                if (vec.z < thisssBoundsMinZ)
                {
                    thisssBoundsMinZ = vec.z;
                }
                if (vec.x > thisssBoundsMaxX)
                {
                    thisssBoundsMaxX = vec.x;
                }
                if (vec.y > thisssBoundsMaxY)
                {
                    thisssBoundsMaxY = vec.y;
                }
                if (vec.z > thisssBoundsMaxZ)
                {
                    thisssBoundsMaxZ = vec.z;
                }

                for (int side = 0; side < 6; side++)
                {
                    if (vec.sideDone[side])
                    {
                        continue;
                    }
                    BlockVec3 sideVec = vec.newVecSide(side);

                    if (!this.checked.contains(sideVec))
                    {
                        this.checked.add(sideVec);
                        Block b = sideVec.getBlockID(this.worldObj);
                        if (!(b instanceof BlockAir) && b != null)
                        {
                            nextLayer.add(sideVec);
                            if (bStart instanceof BlockAir)
                            {
                                this.oneSSBlock = sideVec.clone();
                                bStart = b;
                            }
                            float m = 1.0F;
                            //Liquids have a mass of 1, stone, metal blocks etc will be heavier
                            if (!(b instanceof BlockLiquid))
View Full Code Here

        TileEntity tile = world.getTileEntity(x, y, z);

        if (tile instanceof IMultiBlock)
        {
            ((IMultiBlock) tile).onCreate(new BlockVec3(x, y, z));
        }
    }
View Full Code Here

TOP

Related Classes of micdoodle8.mods.galacticraft.api.recipe.ISchematicPage

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.