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