diff --git a/patches/server/Implement-enchantWithLevels-API.patch b/patches/server/Implement-enchantWithLevels-API.patch index 6407b8e170..e3540018a4 100644 --- a/patches/server/Implement-enchantWithLevels-API.patch +++ b/patches/server/Implement-enchantWithLevels-API.patch @@ -30,9 +30,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + new org.bukkit.craftbukkit.util.RandomSourceWrapper(random), + internalStack, + levels, -+ enchantments.holders() -+ .>map(r -> r) -+ .filter(r -> allowTreasure || !r.is(EnchantmentTags.TREASURE)) ++ registryAccess, ++ allowTreasure ++ ? Optional.empty() ++ // While IN_ENCHANTING_TABLE is not logically the same as all but TREASURE, the tag is defined as ++ // NON_TREASURE, which does contain all enchantments not in the treasure tag. ++ // Additionally, the allowTreasure boolean is more intended to configure this method to behave like ++ // an enchanting table. ++ : registryAccess.registryOrThrow(Registries.ENCHANTMENT).getTag(EnchantmentTags.IN_ENCHANTING_TABLE) + ); + return CraftItemStack.asCraftMirror(enchanted); + }