Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enchantment API setOffers Precondition Incorrect Expression #11815

Closed
JavaDreamerX opened this issue Dec 25, 2024 · 0 comments · Fixed by #11818
Closed

Enchantment API setOffers Precondition Incorrect Expression #11815

JavaDreamerX opened this issue Dec 25, 2024 · 0 comments · Fixed by #11818
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

Comments

@JavaDreamerX
Copy link

Expected behavior

Image

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

Image

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

@papermc-sniffer papermc-sniffer bot added the version: 1.21.3 Game version 1.21.3 label Dec 25, 2024
@Warriorrrr Warriorrrr added status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. and removed status: needs triage labels Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants