Fix EnchantmentView#setOffers length precondition being flipped (#11818)

This commit is contained in:
Warrior 2024-12-25 11:08:07 +01:00 committed by GitHub
parent d568e175ee
commit 25cc3d8578
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -47,7 +47,7 @@ public class CraftEnchantmentView extends CraftInventoryView<EnchantmentMenu, En
@Override @Override
public void setOffers(@NotNull final EnchantmentOffer[] offers) { public void setOffers(@NotNull final EnchantmentOffer[] offers) {
Preconditions.checkArgument(offers.length != 3, "There must be 3 offers given"); Preconditions.checkArgument(offers.length == 3, "There must be 3 offers given");
IdMap<Holder<Enchantment>> registry = CraftRegistry.getMinecraftRegistry().lookupOrThrow(Registries.ENCHANTMENT).asHolderIdMap(); IdMap<Holder<Enchantment>> registry = CraftRegistry.getMinecraftRegistry().lookupOrThrow(Registries.ENCHANTMENT).asHolderIdMap();
for (int i = 0; i < offers.length; i++) { for (int i = 0; i < offers.length; i++) {
final EnchantmentOffer offer = offers[i]; final EnchantmentOffer offer = offers[i];