Update ItemUtils
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-06-08 13:13:45 +02:00
Ursprung 4507516f45
Commit d7dc2515c0

Datei anzeigen

@ -53,7 +53,7 @@ public class ItemUtils {
if (!container.has(key, PersistentDataType.STRING)) {
return null;
}
return container.get(ITEM_KEY, PersistentDataType.STRING)
return container.get(ITEM_KEY, PersistentDataType.STRING);
}
public void setTag(ItemStack itemStack, NamespacedKey key, String value) {
@ -64,7 +64,11 @@ public class ItemUtils {
if (meta == null) {
return;
}
meta.getPersistentDataContainer().set(key, PersistentDataType.STRING, value);
if (value == null) {
meta.getPersistentDataContainer().remove(key);
} else {
meta.getPersistentDataContainer().set(key, PersistentDataType.STRING, value);
}
itemStack.setItemMeta(meta);
}
}