make it compile \o/

This commit is contained in:
granny
2026-03-24 01:25:42 -07:00
parent 465f4d86be
commit 57a0650b8f
40 changed files with 78 additions and 147 deletions

View File

@@ -14,7 +14,7 @@
if (!item.isEmpty()) {
if (enchantment.canEnchant(item)
- && EnchantmentHelper.isEnchantmentCompatible(EnchantmentHelper.getEnchantmentsForCrafting(item).keySet(), enchantmentHolder)) {
+ && EnchantmentHelper.isEnchantmentCompatible(EnchantmentHelper.getEnchantmentsForCrafting(item).keySet(), enchantmentHolder) || (org.purpurmc.purpur.PurpurConfig.allowUnsafeEnchantCommand && !mainHandItem.hasEnchantment(enchantment))) { // Purpur - Config to allow unsafe enchants
+ && EnchantmentHelper.isEnchantmentCompatible(EnchantmentHelper.getEnchantmentsForCrafting(item).keySet(), enchantmentHolder) || (org.purpurmc.purpur.PurpurConfig.allowUnsafeEnchantCommand && !item.hasEnchantment(enchantmentHolder))) { // Purpur - Config to allow unsafe enchants
item.enchant(enchantmentHolder, level);
success++;
} else if (targets.size() == 1) {