mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-02-14 02:31:21 +01:00
Delete old holograms when moved.
This commit is contained in:
parent
7250d74677
commit
1df8a0a3d4
@ -77,7 +77,7 @@ public class RemoveHologramCommand extends SubCommand {
|
|||||||
Hologram hologram = hologramManager.getHologram(hologramType1);
|
Hologram hologram = hologramManager.getHologram(hologramType1);
|
||||||
|
|
||||||
if (hologram != null)
|
if (hologram != null)
|
||||||
hologram.remove();
|
hologramManager.removeHologram(hologram);
|
||||||
});
|
});
|
||||||
|
|
||||||
messageManager.sendMessage(sender, configLoad.getString("Command.Island.Admin.RemoveHologram.Removed.Message").replace("%type", hologramType.name()));
|
messageManager.sendMessage(sender, configLoad.getString("Command.Island.Admin.RemoveHologram.Removed.Message").replace("%type", hologramType.name()));
|
||||||
|
@ -49,15 +49,16 @@ public class SetHologramCommand extends SubCommand {
|
|||||||
fileManager.getConfig(new File(skyblock.getDataFolder(), "locations.yml")),
|
fileManager.getConfig(new File(skyblock.getDataFolder(), "locations.yml")),
|
||||||
"Location.Hologram.Leaderboard." + hologramType.name(), player.getLocation(), true);
|
"Location.Hologram.Leaderboard." + hologramType.name(), player.getLocation(), true);
|
||||||
|
|
||||||
HologramType hologramType1 = HologramType
|
|
||||||
.valueOf(WordUtils.capitalize(args[0].toLowerCase()));
|
Bukkit.getServer().getScheduler().runTask(skyblock, () -> {
|
||||||
|
HologramType hologramType1 = HologramType.valueOf(WordUtils.capitalize(args[0].toLowerCase()));
|
||||||
Hologram hologram = hologramManager.getHologram(hologramType1);
|
Hologram hologram = hologramManager.getHologram(hologramType1);
|
||||||
|
|
||||||
if (hologram != null)
|
if (hologram != null)
|
||||||
hologram.remove();
|
hologramManager.removeHologram(hologram);
|
||||||
|
|
||||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(skyblock, () ->
|
hologramManager.spawnHologram(hologramType1);
|
||||||
hologramManager.spawnHologram(hologramType1));
|
});
|
||||||
|
|
||||||
messageManager.sendMessage(player,
|
messageManager.sendMessage(player,
|
||||||
configLoad.getString("Command.Island.Admin.SetHologram.Set.Message").replace("%type",
|
configLoad.getString("Command.Island.Admin.SetHologram.Set.Message").replace("%type",
|
||||||
|
@ -172,4 +172,9 @@ public class HologramTask extends BukkitRunnable {
|
|||||||
hologramList.update(getHologramLines(hologramList.getType()));
|
hologramList.update(getHologramLines(hologramList.getType()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeHologram(Hologram hologram) {
|
||||||
|
hologramStorage.remove(hologram);
|
||||||
|
hologram.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user