You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Things to note:
- JukeboxPlayableComponent#isShowInTooltip/setShowInTooltip are deprecated since
no longer available on the component. The alternative is either keep supporting item flag (by adding a new one)
or migrate to use the new data component API
- ItemFlag#HIDE_ADDITIONAL_TOOLTIP is deprecated, the new component tooltip_display allow to hide
component individually, using the flag on an item now will do exactly like mojang data fixer
providing backward compatibility by adding the components that would be hidden in a previous version
in the tooltip_display component
Preconditions.checkArgument(ench != null, "Enchantment cannot be null");
434
-
if ((level < ench.getStartLevel()) || (level > ench.getMaxLevel())) {
435
-
thrownewIllegalArgumentException("Enchantment level is either too low or too high (given " + level + ", bounds are " + ench.getStartLevel() + " to " + ench.getMaxLevel() + ")");
Preconditions.checkArgument(enchant != null, "Enchantment cannot be null");
434
+
if ((level < enchant.getStartLevel()) || (level > enchant.getMaxLevel())) {
435
+
thrownewIllegalArgumentException("Enchantment level is either too low or too high (given " + level + ", bounds are " + enchant.getStartLevel() + " to " + enchant.getMaxLevel() + ")");
436
+
} elseif (!enchant.canEnchantItem(this)) {
437
437
thrownewIllegalArgumentException("Specified enchantment cannot be applied to this itemstack");
438
438
}
439
439
440
-
addUnsafeEnchantment(ench, level);
440
+
addUnsafeEnchantment(enchant, level);
441
441
}
442
442
443
443
/**
@@ -465,22 +465,22 @@ public void addUnsafeEnchantments(@NotNull Map<Enchantment, Integer> enchantment
465
465
* This method is unsafe and will ignore level restrictions or item type.
0 commit comments