ItemStack targetStack = player.inventory.getStackInSlot( x );
if ( input.equals( targetStack ) )
{
IAEItemStack insertItem = input.copy();
insertItem.setStackSize( targetStack.stackSize );
IAEItemStack failedToInsert = Platform.poweredInsert( energy, cell, insertItem, new PlayerSource( player, this ) );
player.inventory.setInventorySlotContents( x, failedToInsert == null ? null : failedToInsert.getItemStack() );
}
}
}
else
{
IAEItemStack failedToInsert = Platform.poweredInsert( energy, cell, input, new PlayerSource( player, this ) );
player.inventory.setInventorySlotContents( player.inventory.currentItem, failedToInsert == null ? null : failedToInsert.getItemStack() );
}
}
catch (GridAccessException e)
{