Package mods.railcraft.api.carts

Examples of mods.railcraft.api.carts.IItemTransfer


    }

    protected void stockBallast() {
        EntityMinecart link = LinkageManager.instance().getLinkedCartA(this);
        if (link instanceof IItemTransfer) {
            IItemTransfer tranfer = (IItemTransfer) link;

            for (int slot = 0; slot < invBallast.getSizeInventory(); slot++) {
                ItemStack stack = invBallast.getStackInSlot(slot);
                if (stack != null && !BallastRegistry.isItemBallast(stack)) {
                    stack = tranfer.offerItem(this, stack);
                    invBallast.setInventorySlotContents(slot, stack);
                    return;
                }
                if (stack == null) {
                    stack = tranfer.requestItem(this, StackFilter.BALLAST);
                    InvTools.moveItemStack(stack, invBallast);
                    return;
                }
            }
        }
View Full Code Here


    }

    protected void stockTracks() {
        EntityMinecart link = LinkageManager.instance().getLinkedCartA(this);
        if (link instanceof IItemTransfer) {
            IItemTransfer tranfer = (IItemTransfer) link;

            for (int slot = 0; slot < invRails.getSizeInventory(); slot++) {
                ItemStack stack = invRails.getStackInSlot(slot);
                if (stack != null && !StackFilter.TRACK.matches(stack)) {
                    stack = tranfer.offerItem(this, stack);
                    invRails.setInventorySlotContents(slot, stack);
                    return;
                }
                if (stack == null) {
                    stack = tranfer.requestItem(this, StackFilter.TRACK);
                    InvTools.moveItemStack(stack, invRails);
                    return;
                }
            }
        }
View Full Code Here

    }

    protected void stockFuel() {
        EntityMinecart link = LinkageManager.instance().getLinkedCartA(this);
        if (link instanceof IItemTransfer) {
            IItemTransfer tranfer = (IItemTransfer) link;

            for (int slot = 0; slot < invFuel.getSizeInventory(); slot++) {
                ItemStack stack = invFuel.getStackInSlot(slot);
                if (stack != null && !StackFilter.FUEL.matches(stack)) {
                    stack = tranfer.offerItem(this, stack);
                    invFuel.setInventorySlotContents(slot, stack);
                    return;
                }
                if (stack == null) {
                    stack = tranfer.requestItem(this, StackFilter.FUEL);
                    if (stack != null) {
                        InvTools.moveItemStack(stack, invFuel);
                        return;
                    }
                }
View Full Code Here

TOP

Related Classes of mods.railcraft.api.carts.IItemTransfer

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.