diff --git a/src/xyz/soper/arty/item/MortarTuner.java b/src/xyz/soper/arty/item/MortarTuner.java index cede647..637b71b 100644 --- a/src/xyz/soper/arty/item/MortarTuner.java +++ b/src/xyz/soper/arty/item/MortarTuner.java @@ -41,9 +41,14 @@ public class MortarTuner { if(!isTuner(tuner)){ throw new IllegalArgumentException("Tried to update an non-tuner item with tuner data"); } - List lore = tuner.getItemMeta().getLore(); - lore.set(0, ChatColor.GOLD + "Linked to Mortar at " + location.getBlockX() + ", " + location.getBlockY() + ", " + location.getBlockZ()); - tuner.getItemMeta().setLore(lore); + ItemMeta meta = tuner.getItemMeta(); + List lore = meta.getLore(); + if(location == null){ + lore.set(0, ChatColor.GOLD + "Currently unlinked"); + } + else lore.set(0, ChatColor.GOLD + "Linked to Mortar at " + location.getBlockX() + ", " + location.getBlockY() + ", " + location.getBlockZ()); + meta.setLore(lore); + tuner.setItemMeta(meta); } // public static void updateTunerStatus(ItemStack tuner, boolean reset){ diff --git a/src/xyz/soper/arty/util/MortarHandler.java b/src/xyz/soper/arty/util/MortarHandler.java index 144dd33..c09656b 100644 --- a/src/xyz/soper/arty/util/MortarHandler.java +++ b/src/xyz/soper/arty/util/MortarHandler.java @@ -54,6 +54,9 @@ public class MortarHandler { if(Mortar.isMortar(mortar) && MortarTuner.isTuner(tuner)){ MortarTuner.updateTunerLocation(tuner, mortar.getLocation()); } + else if(MortarTuner.isTuner(tuner) && mortar == null){ + MortarTuner.updateTunerLocation(tuner, null); + } } // /**