mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-01-14 03:21:27 +01:00
only change Holograms lines if text changed
This commit is contained in:
parent
3b230a5d76
commit
478be3f7d4
@ -70,6 +70,14 @@ public class HologramsHolograms extends Holograms {
|
||||
location = fixLocation(location);
|
||||
Hologram hologram = hologramPlugin.getHologramManager().getHologram(locStr(location));
|
||||
if (hologram != null) {
|
||||
// only update if there is a change to the text
|
||||
boolean isChanged = lines.size() != hologram.getLines().size();
|
||||
if(!isChanged) {
|
||||
// double-check the lines
|
||||
for(int i = 0; !isChanged && i < lines.size(); ++i) {
|
||||
isChanged = !hologram.getLine(i).getRaw().equals(lines.get(i));
|
||||
}
|
||||
}
|
||||
for(HologramLine line : hologram.getLines().toArray(new HologramLine[0])) {
|
||||
hologram.removeLine(line);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user