Remove ItemFactory#enchantWithLevels range check for vanilla parity (#12209)

This commit is contained in:
Esophose
2025-03-08 13:38:14 -07:00
committed by GitHub
parent 20df25d3a5
commit 43f37b1b5e
3 changed files with 8 additions and 9 deletions

View File

@ -349,7 +349,6 @@ public final class CraftItemFactory implements ItemFactory {
) {
Preconditions.checkArgument(itemStack != null, "Argument 'itemStack' must not be null");
Preconditions.checkArgument(!itemStack.isEmpty(), "Argument 'itemStack' cannot be empty");
Preconditions.checkArgument(levels > 0 && levels <= 30, "Argument 'levels' must be in range [1, 30] (attempted " + levels + ")");
Preconditions.checkArgument(random != null, "Argument 'random' must not be null");
final net.minecraft.world.item.ItemStack internalStack = CraftItemStack.asNMSCopy(itemStack);
if (internalStack.isEnchanted()) {