Inventory#all doesn't scan the entire inventory
Expected behavior
Suggested by the docs of the method, it should look up all slots in the entire inventory
Observed/Actual behavior
It only looks up the storage content
Steps/models to reproduce
Well... it's just an inconsistency... soo...
Plugin and Datapack List
unimportent
Paper version
1.20.6-R0.1-SNAPSHOT
Other
docs:
implementation:
I think this is "works as intended" due to the documentation on Inventory#getStorageContents. The javadocs for that method say
In most cases this will represent the entire inventory, but in some cases it may exclude armor or result slots.
and continues
It is these contents which will be used for add / contains / remove methods which look for a specific stack
I think that second part includes the #all method you mention here, as its looking for a specific stack. And it's right, all the other methods only operate on the "storage contents".
It looks like previously, Paper has added specific API to cover "all slots". There is a Inventory#removeItemAnySlot method to account for the other Inventory#removeItem only removing from the "storage" contents. I think that is the better solution here, adding an "any slot" variant of all the methods that have "storage-specific" versions.