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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user