Closed StarTux closed 4 months ago
Well I'd much rather it return an empty stack instead of null, but moving past that, I wonder if it isn't better API to throw for invalid equipment slots. Certainly I think the setter for a certain slot should throw instead of just doing nothing and not informing the user at all that they are taking an invalid action. And then it seems weird that one interaction returns empty and the other throws.
if you're doing something invalid you should generally be told that you're doing something invalid; There are 0 promises that you can iterate over random enums inside of the API safely, and so I don't think that this is a concern vs us returning borked data
Expected behavior
Usually I can call
and get all player equipment this way.
Observed/Actual behavior
However, the getter for new EquipmentSlot
BODY
is not implemented for CraftInventoryPlayer.Steps/models to reproduce
Call
This should simply return
null
because iterating over EquipmentSlot was a common shortcut to iterate over a player's inventory in Paper 1.20.4 and prior. Instead, an exception is thrown, breaking existing plugins.Plugin and Datapack List
Paper version
This server is running Paper version 1.20.6-115-master@9d6f2cc (2024-05-28T14:55:16Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT)
Other
No response