for( Class adapterClass : PluginManager.getInventoryAdapters().keySet() ) {
if( adapterClass != null && adapterClass.isAssignableFrom( inventory.getClass() ) )
return PluginManager.getInventoryAdapters().get( adapterClass ).createInventoryAdapter( inventory );
}
if( inventory instanceof IInventory ) {
return new LinearInventory( (IInventory) inventory );
}
Utils.logException( "Invalid inventory adapter", new InvalidInventoryAdapterException( inventory.getClass() ), false );
}
return null;