on Close
Called when player closes this menu, before the framework decides what to do with the free-slot items. Read the final inventory state here if you need it (e.g. persist the contents), then return a CloseAction telling the framework how to dispose of the free slots.
The default returns CloseAction.RETURN_TO_PLAYER — the "input tray" behaviour that hands the free-slot items back to the player. Override and return CloseAction.NO_RETURN for a persistent container: save the contents yourself here, and the framework will leave the slots alone (the inventory is a throwaway snapshot, so unread items are discarded — see CloseAction.NO_RETURN).