diff --git a/BauSystem_Main/src/de/steamwar/bausystem/utils/ItemUtils.java b/BauSystem_Main/src/de/steamwar/bausystem/utils/ItemUtils.java index ee4b93aa..a815be80 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/utils/ItemUtils.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/utils/ItemUtils.java @@ -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); } }