Package net.minecraft.src.buildcraft.api

Examples of net.minecraft.src.buildcraft.api.Position


            LinkedList<Orientations> theList = getRealPossibleMovements(pipeList.get(a).getPosition());

            if (theList.size() > 0) {
                for (int b = 0; b < theList.size(); b++) {
                    Orientations newPos = theList.get(b);
                    Position destPos = new Position(pipeList.get(a).xCoord, pipeList.get(a).yCoord, pipeList.get(a).zCoord, newPos);
                    destPos.moveForwards(1.0);

                    //System.out.println(getPosition().toString() + " RequestEnergy: " + from.toString() + " - Val: " + is + " - Dest: " + destPos.toString());

                    TileEntity tile = worldObj.getBlockTileEntity((int)destPos.x, (int)destPos.y, (int)destPos.z);
View Full Code Here


        LinkedList<Orientations> result = new LinkedList<Orientations>();

        for (int o = 0; o < 6; ++o) {
            if (container.pipe.outputOpen(Orientations.values()[o])) {
                Position newPos = new Position(pos);
                newPos.orientation = Orientations.values()[o];
                newPos.moveForwards(1.0);

                if (canReceivePipeObjects(newPos, item)) {
                    result.add(newPos.orientation);
                }
            }
View Full Code Here

        if (meta > 5) {
            return;
        }

        Position pos = new Position(xCoord, yCoord, zCoord,
                                    Orientations.values()[meta]);
        pos.moveForwards(1);
        int blockId = w.getBlockId((int) pos.x, (int) pos.y, (int) pos.z);
        TileEntity tile = w.getBlockTileEntity((int) pos.x, (int) pos.y,
                                               (int) pos.z);

        if (tile == null
                || !(tile instanceof IInventory || tile instanceof ILiquidContainer)
                || PipeLogicWood
                .isExcludedFromExtraction(Block.blocksList[blockId])) {
            return;
        }

        if (tile instanceof IInventory) {
            IInventory inventory = (IInventory) tile;

            ItemStack stack = checkExtract(inventory, true,
                                           pos.orientation.reverse());

            if (stack == null || stack.stackSize == 0) {
                powerProvider.useEnergy(1, 1, false);
                return;
            }

            Position entityPos = new Position(pos.x + 0.5, pos.y
                                              + Utils.getPipeFloorOf(stack), pos.z + 0.5,
                                              pos.orientation.reverse());

            entityPos.moveForwards(0.5);

            EntityPassiveItem entity = new EntityPassiveItem(w, entityPos.x,
                    entityPos.y, entityPos.z, stack);

            ((PipeTransportItems) transport).entityEntering(entity,
View Full Code Here

        LinkedList<Orientations> nullReturn = new LinkedList<Orientations>();
        nullReturn.add(Orientations.values()[0]);

        for (int o = 0; o < 6; ++o) {
            if (Orientations.values()[o] != pos.orientation.reverse()) {
                Position newPos = new Position(pos);
                newPos.orientation = Orientations.values()[o];
                newPos.moveForwards(1.0);

                TileEntity entity = worldObj.getBlockTileEntity((int) newPos.x, (int) newPos.y, (int) newPos.z);

                if (entity instanceof IInventory) {
                    if (new StackUtil(item.item).checkAvailableSlot((IInventory) entity, false, newPos.orientation.reverse())) {
                        newOris.add(newPos.orientation);
                    }
                }
            }
        }


        //System.out.println("NewOris Size: " + newOris.size() + " - PO Size: " + possibleOrientations.size() + " - Level: " + Level);
        if (newOris.size() > 0) {
            Position destPos =  new Position(pos.x, pos.y, pos.z, newOris.get( (new Random()) .nextInt(newOris.size()) ) );
            destPos.moveForwards(1.0);
            StackUtil utils = new StackUtil(item.item);
            TileEntity tile = worldObj.getBlockTileEntity((int) destPos.x, (int) destPos.y, (int) destPos.z);

            if (!APIProxy.isClient(worldObj)) {
                if (utils.checkAvailableSlot((IInventory) tile, true, destPos.orientation.reverse()) && utils.items.stackSize == 0) {
View Full Code Here

        int outputNumber = 0;
        int total = 0;
        int ret[] = new int[2];

        for (int i = 0; i < 6; ++i) {
            Position p = new Position(xCoord, yCoord, zCoord, Orientations.values()[i]);
            p.moveForwards(1);

            if (canRec(p)) {
                ret[0]++;
                ret[1] += ((PipeTransportLiquids)this.transport).side[i].average;
            }
View Full Code Here

TOP

Related Classes of net.minecraft.src.buildcraft.api.Position

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.