mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-30 11:21:24 +01:00
Properly update hologram lines.
This commit is contained in:
parent
cd5a2f38f7
commit
7250d74677
@ -9,9 +9,9 @@ import com.songoda.skyblock.hologram.HologramType;
|
||||
import com.songoda.skyblock.island.IslandLevel;
|
||||
import com.songoda.skyblock.leaderboard.Leaderboard;
|
||||
import com.songoda.skyblock.leaderboard.LeaderboardManager;
|
||||
import com.songoda.skyblock.message.MessageManager;
|
||||
import com.songoda.skyblock.utils.NumberUtil;
|
||||
import com.songoda.skyblock.utils.player.OfflinePlayer;
|
||||
import com.songoda.skyblock.utils.world.LocationUtil;
|
||||
import com.songoda.skyblock.visit.Visit;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@ -63,7 +63,12 @@ public class HologramTask extends BukkitRunnable {
|
||||
}
|
||||
|
||||
public void spawnHologram(HologramType type, Location location, List<String> lines) {
|
||||
hologramStorage.add(new Hologram(type, location, lines));
|
||||
Hologram hologram = hologramStorage.stream()
|
||||
.filter(h -> LocationUtil.isLocationLocation(h.getLocation(), location)).findFirst().orElse(null);
|
||||
if (hologram == null)
|
||||
hologramStorage.add(new Hologram(type, location, lines));
|
||||
else
|
||||
hologram.update(lines);
|
||||
}
|
||||
|
||||
public void spawnHologram(HologramType type) {
|
||||
|
Loading…
Reference in New Issue
Block a user