public void injectItem(TravelingItem item, ForgeDirection inputOrientation) {
if(MainProxy.isServer(this.getWorld())) {
if(item instanceof LPRoutedBCTravelingItem) {
ItemRoutingInformation info = ((LPRoutedBCTravelingItem)item).getRoutingInformation();
info.setItem(ItemIdentifierStack.getFromStack(item.getItemStack()));
LPTravelingItemServer lpItem = new LPTravelingItemServer(info);
this.injectItem(lpItem, inputOrientation);
} else {
ItemRoutingInformation info = LPRoutedBCTravelingItem.restoreFromExtraNBTData(item);
if(info != null) {
info.setItem(ItemIdentifierStack.getFromStack(item.getItemStack()));
LPTravelingItemServer lpItem = new LPTravelingItemServer(info);
this.injectItem(lpItem, inputOrientation);
} else {
LPTravelingItemServer lpItem = SimpleServiceLocator.routedItemHelper.createNewTravelItem(item.getItemStack());
lpItem.setSpeed(item.getSpeed());
this.injectItem(lpItem, inputOrientation);
}
}
}
}