Mortar Tuner can now be cleared from linked location
parent
4c1725a7d2
commit
65590642ba
|
@ -41,9 +41,14 @@ public class MortarTuner {
|
|||
if(!isTuner(tuner)){
|
||||
throw new IllegalArgumentException("Tried to update an non-tuner item with tuner data");
|
||||
}
|
||||
List<String> 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<String> 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){
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
|
|
Loading…
Reference in New Issue