Package net.minecraft.src

Examples of net.minecraft.src.TileEntity


                    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);

                    if (tile instanceof TileGenericPipe) {
                        TileGenericPipe nearbyTile = (TileGenericPipe) tile;
                        PipeTransportPower nearbyTransport = (PipeTransportPower) nearbyTile.pipe.transport;
                        nearbyTransport.requestEnergy(newPos.reverse(), is);
View Full Code Here


        return result;
    }

    public boolean canReceivePipeObjects(Position p,
                                         EntityPassiveItem item) {
        TileEntity entity = worldObj.getBlockTileEntity((int) p.x, (int) p.y,
                            (int) p.z);

        if (!Utils.checkPipesConnections(worldObj, (int) p.x, (int) p.y,
                                         (int) p.z, xCoord, yCoord, zCoord)) {
            return false;
View Full Code Here

        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
View Full Code Here

            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) {
                    item.remove();
                    ((PipeTransportItems) this.transport).scheduleRemoval(item);
View Full Code Here

    public int computeMaxLiquid() {
        return ((computeEnds()[0] + 1) * PipeTransportLiquids.LIQUID_IN_PIPE);
    }

    public boolean canRec(Position p) {
        TileEntity entity = worldObj.getBlockTileEntity((int) p.x, (int) p.y,
                            (int) p.z);

        if (!Utils.checkPipesConnections(worldObj, (int) p.x, (int) p.y,
                                         (int) p.z, xCoord, yCoord, zCoord)) {
            return false;
View Full Code Here

TOP

Related Classes of net.minecraft.src.TileEntity

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.