-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
None
-
This server is running Spigot version 4622-Spigot-566f972-ce1ed6c (MC: 26.1.2) (Implementing API version 26.1.2-R0.1-SNAPSHOT)
-
Yes
The precondition checking the length of enchantment offers is inverted, causing only arrays of lengths other than 3 to be accepted. This has been a problem since the introduction of the EnchantingView.
Preconditions.checkArgument(offers.length != 3, "There must be 3 offers given");
should be
Preconditions.checkArgument(offers.length == 3, "There must be 3 offers given");
Minimal reproduction:
@EventHandler public void onPrepareItemEnchant(PrepareItemEnchantEvent event) { System.out.printf("Got %s offers%n", event.getOffers().length); event.getView().setOffers(event.getOffers()); }
Place any item into an enchanting table, stack trace ensues.