Search in sources :

Example 1 with LPRoutedBCTravelingItem

use of logisticspipes.proxy.buildcraft.LPRoutedBCTravelingItem in project LogisticsPipes by RS485.

the class PipeTransportLogistics method injectItem.

/**
	 * Accept items from BC
	 */
@ModDependentMethod(modId = "BuildCraft|Transport")
public void injectItem(TravelingItem item, ForgeDirection inputOrientation) {
    if (MainProxy.isServer(getWorld())) {
        if (item instanceof LPRoutedBCTravelingItem) {
            ItemRoutingInformation info = ((LPRoutedBCTravelingItem) item).getRoutingInformation();
            info.setItem(ItemIdentifierStack.getFromStack(item.getItemStack()));
            LPTravelingItemServer lpItem = new LPTravelingItemServer(info);
            lpItem.setSpeed(item.getSpeed());
            this.injectItem(lpItem, inputOrientation);
        } else {
            ItemRoutingInformation info = LPRoutedBCTravelingItem.restoreFromExtraNBTData(item);
            if (info != null) {
                info.setItem(ItemIdentifierStack.getFromStack(item.getItemStack()));
                LPTravelingItemServer lpItem = new LPTravelingItemServer(info);
                lpItem.setSpeed(item.getSpeed());
                this.injectItem(lpItem, inputOrientation);
            } else {
                LPTravelingItemServer lpItem = SimpleServiceLocator.routedItemHelper.createNewTravelItem(item.getItemStack());
                lpItem.setSpeed(item.getSpeed());
                this.injectItem(lpItem, inputOrientation);
            }
        }
    }
}
Also used : ItemRoutingInformation(logisticspipes.routing.ItemRoutingInformation) LPRoutedBCTravelingItem(logisticspipes.proxy.buildcraft.LPRoutedBCTravelingItem) LPTravelingItemServer(logisticspipes.transport.LPTravelingItem.LPTravelingItemServer) ModDependentMethod(logisticspipes.asm.ModDependentMethod)

Aggregations

ModDependentMethod (logisticspipes.asm.ModDependentMethod)1 LPRoutedBCTravelingItem (logisticspipes.proxy.buildcraft.LPRoutedBCTravelingItem)1 ItemRoutingInformation (logisticspipes.routing.ItemRoutingInformation)1 LPTravelingItemServer (logisticspipes.transport.LPTravelingItem.LPTravelingItemServer)1