Package mods.railcraft.api.carts

Examples of mods.railcraft.api.carts.ILinkageManager


        if (!passAlong)
            return extra;

        try {
            ILinkageManager lm = CartTools.getLinkageManager(worldObj);

            EntityMinecart linkedCart = lm.getLinkedCartA(this);
            if (extra > 0 && linkedCart != source && linkedCart instanceof IEnergyTransfer)
                extra = ((IEnergyTransfer) linkedCart).injectEnergy(this, extra, tier, ignoreTransferLimit, simulate, true);

            linkedCart = lm.getLinkedCartB(this);
            if (extra > 0 && linkedCart != source && linkedCart instanceof IEnergyTransfer)
                extra = ((IEnergyTransfer) linkedCart).injectEnergy(this, extra, tier, ignoreTransferLimit, simulate, true);
        } catch (Throwable t) {
            APIErrorHandler.versionMismatch(IEnergyTransfer.class);
        }
View Full Code Here


            setEnergy(e);

        if (!passAlong)
            return provide;

        ILinkageManager lm = CartTools.getLinkageManager(worldObj);

        EntityMinecart linkedCart = lm.getLinkedCartA(this);
        if (provide < amount && linkedCart != source && linkedCart instanceof IEnergyTransfer)
            provide += ((IEnergyTransfer) linkedCart).extractEnergy(this, amount - provide, tier, ignoreTransferLimit, simulate, true);

        linkedCart = lm.getLinkedCartB(this);
        if (provide < amount && linkedCart != source && linkedCart instanceof IEnergyTransfer)
            provide += ((IEnergyTransfer) linkedCart).extractEnergy(this, amount - provide, tier, ignoreTransferLimit, simulate, true);

        return provide;
    }
View Full Code Here

            offer = moveItemStack(offer, this);
            if (offer == null)
                return null;
        }

        ILinkageManager lm = CartTools.getLinkageManager(worldObj);

        EntityMinecart linkedCart = lm.getLinkedCartA(this);
        if (linkedCart != source && linkedCart instanceof IItemTransfer)
            offer = ((IItemTransfer) linkedCart).offerItem(this, offer);

        if (offer == null)
            return null;

        linkedCart = lm.getLinkedCartB(this);
        if (linkedCart != source && linkedCart instanceof IItemTransfer)
            offer = ((IItemTransfer) linkedCart).offerItem(this, offer);

        return offer;
    }
View Full Code Here

            result = removeOneItem(this, request);
            if (result != null)
                return result;
        }

        ILinkageManager lm = CartTools.getLinkageManager(worldObj);

        EntityMinecart linkedCart = lm.getLinkedCartA(this);
        if (linkedCart != source && linkedCart instanceof IItemTransfer)
            result = ((IItemTransfer) linkedCart).requestItem(this, request);

        if (result != null)
            return result;

        linkedCart = lm.getLinkedCartB(this);
        if (linkedCart != source && linkedCart instanceof IItemTransfer)
            result = ((IItemTransfer) linkedCart).requestItem(this, request);

        return result;
    }
View Full Code Here

    }

    @Override
    public void onMinecartPass(EntityMinecart cart) {
        if (isPowered()) {
            ILinkageManager lm = CartTools.getLinkageManager(cart.worldObj);
            if (decouple) {
                lm.breakLinks(cart);
                LinkageManager.printDebug("Reason For Broken Link: Passed Decoupler Track.");
            } else {
                lm.createLink(taggedCart, cart);
                taggedCart = cart;
            }
        }
    }
View Full Code Here

TOP

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

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.