9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-06 15:52:03 +00:00

Update UniversalItemFactory.java

This commit is contained in:
XiaoMoMi
2025-02-12 01:37:09 +08:00
parent 88e809395d
commit 89f791067a

View File

@@ -37,17 +37,12 @@ public class UniversalItemFactory extends BukkitItemFactory {
@Override
protected void itemName(ItemWrapper<ItemStack> item, String json) {
if (json != null) {
item.set(json, "item", "Name");
} else {
item.remove("item", "Name");
}
throw new UnsupportedOperationException("This feature is only available on 1.20.5+");
}
@Override
protected Optional<String> itemName(ItemWrapper<ItemStack> item) {
if (!item.hasTag("item", "Name")) return Optional.empty();
return Optional.of(item.get("item", "Name"));
throw new UnsupportedOperationException("This feature is only available on 1.20.5+");
}
@Override