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-10 15:20:16 +08:00
parent 01bffc1f8c
commit 1aed961edf
2 changed files with 6 additions and 2 deletions

View File

@@ -345,7 +345,11 @@ public class ComponentItemFactory1_20_5 extends BukkitItemFactory<ComponentItemW
@Override
protected void unbreakable(ComponentItemWrapper item, boolean unbreakable) {
item.setJavaComponent(ComponentTypes.UNBREAKABLE, unbreakable);
if (unbreakable) {
item.setJavaComponent(ComponentTypes.UNBREAKABLE, Map.of());
} else {
item.resetComponent(ComponentTypes.UNBREAKABLE);
}
}
@Override