public static InventoryAdaptor getAdaptor(Object te, ForgeDirection d)
{
if ( te == null )
return null;
IBetterStorage bs = (IBetterStorage) (AppEng.instance.isIntegrationEnabled( IntegrationType.BetterStorage ) ? AppEng.instance.getIntegration( IntegrationType.BetterStorage ) : null);
if ( te instanceof EntityPlayer )
{
return new AdaptorIInventory( new AdaptorPlayerInventory( ((EntityPlayer) te).inventory, false ) );
}
else if ( te instanceof ArrayList )
{
return new AdaptorList( (ArrayList<ItemStack>) te );
}
else if ( bs != null && bs.isStorageCrate( te ) )
{
return bs.getAdaptor( te, d );
}
else if ( te instanceof TileEntityChest )
{
return new AdaptorIInventory( Platform.GetChestInv( te ) );
}