diff --git a/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java b/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java index 8cc64ac95..4517bce32 100644 --- a/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java +++ b/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java @@ -716,7 +716,7 @@ public ItemStack getIslandCrystal(int amount) { )); NBT.modify(itemStack, readWriteItemNBT -> { - readWriteItemNBT.getOrCreateCompound("iridiumskyblock").setInteger("islandCrystals", amount); + readWriteItemNBT.resolveOrCreateCompound("iridiumskyblock").setInteger("islandCrystals", amount); }); return itemStack; @@ -726,10 +726,7 @@ public int getIslandCrystals(ItemStack itemStack) { if (itemStack == null || itemStack.getType() == Material.AIR) return 0; return NBT.get(itemStack, readableItemNBT -> { - if(readableItemNBT.getCompound("iridiumskyblock").hasTag("islandCrystals")) { - return readableItemNBT.getCompound("iridiumskyblock").getInteger("islandCrystals"); - } - return 0; + return readableItemNBT.resolveOrDefault("iridiumskyblock.islandCrystals", 0); }); }