newPos.moveForwards(1.0);
TileEntity entity = worldObj.getBlockTileEntity((int) newPos.x, (int) newPos.y, (int) newPos.z);
if (entity instanceof IInventory) {
if (new StackUtil(item.item).checkAvailableSlot((IInventory) entity, false, newPos.orientation.reverse())) {
newOris.add(newPos.orientation);
}
}
}
}
//System.out.println("NewOris Size: " + newOris.size() + " - PO Size: " + possibleOrientations.size() + " - Level: " + Level);
if (newOris.size() > 0) {
Position destPos = new Position(pos.x, pos.y, pos.z, newOris.get( (new Random()) .nextInt(newOris.size()) ) );
destPos.moveForwards(1.0);
StackUtil utils = new StackUtil(item.item);
TileEntity tile = worldObj.getBlockTileEntity((int) destPos.x, (int) destPos.y, (int) destPos.z);
if (!APIProxy.isClient(worldObj)) {
if (utils.checkAvailableSlot((IInventory) tile, true, destPos.orientation.reverse()) && utils.items.stackSize == 0) {
item.remove();
((PipeTransportItems) this.transport).scheduleRemoval(item);
}
else {
item.item = utils.items;