Skip to content

Enchantment API setOffers Precondition Incorrect Expression #11815

@JavaDreamerX

Description

@JavaDreamerX

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.version: 1.21.3Game version 1.21.3

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions