Limit enchantments to 0-255

This commit is contained in:
Nassim Jahnke 2024-04-23 19:32:32 +02:00
parent f2b9c42590
commit e2f3dc7572
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
1 changed files with 1 additions and 1 deletions

View File

@ -1168,7 +1168,7 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
continue; continue;
} }
enchantments.enchantments().put(intId, lvl.asInt()); enchantments.enchantments().put(intId, clamp(lvl.asInt(), 0, 255));
} }
data.set(newKey, enchantments); data.set(newKey, enchantments);