9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-30 04:19:27 +00:00

禁止不可附魔的物品被附魔书附魔

This commit is contained in:
XiaoMoMi
2025-08-26 21:56:30 +08:00
parent cf750316b5
commit 613939f610
2 changed files with 5 additions and 1 deletions

View File

@@ -284,6 +284,10 @@ public class RecipeEventListener implements Listener {
}
// 如果第二个物品是附魔书,那么忽略
if (wrappedSecond.vanillaId().equals(ItemKeys.ENCHANTED_BOOK)) {
// 禁止不可附魔的物品被附魔书附魔
if (firstCustom.isPresent() && !firstCustom.get().settings().canEnchant()) {
event.setResult(null);
}
return;
}