Enchantment API setOffers Precondition Incorrect Expression #11815
Labels
status: accepted
Disputed bug is accepted as valid or Feature accepted as desired to be added.
version: 1.21.3
Game version 1.21.3
Expected behavior
An error is not thrown when an array of EnchantmentOffers of size 3 is passed into setOffers.
https://jd.papermc.io/paper/1.21.4/org/bukkit/inventory/view/EnchantmentView.html#setOffers(org.bukkit.enchantments.EnchantmentOffer%5B%5D)
Observed/Actual behavior
If a array of EnchantmentOffer of size 3 is passed into the setOffer function, the Precondition as written throws the exception. This needs to be the opposite way around as == 3 as the Precondition is thrown when the value is false.
Steps/models to reproduce
Pass in an EnchantmentOffer array of size 3 into the function.
Plugin and Datapack List
Paper version
This server is running Paper version 1.21.3-82-ver/1.21.3@5a60ffb (2024-12-23T19:10:30Z) (Implementing API version 1.21.3-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.3-16529-fb817aa (MC: 1.21.3)
Other
No response
The text was updated successfully, but these errors were encountered: