mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-22 10:22:29 +00:00
Fixed holograms when dynamic line, that is not the last one, disappears
This commit is contained in:
parent
d4da428bc1
commit
0f1d68e0c1
@ -55,6 +55,10 @@ public class Hologram {
|
||||
public void addLine(int line, String text) {
|
||||
if (text == null || text.isEmpty()) return;
|
||||
|
||||
if (line >= armorStands.size()) {
|
||||
line = armorStands.size();
|
||||
}
|
||||
|
||||
text = ChatColor.translateAlternateColorCodes('&', text);
|
||||
|
||||
if (config.hologram_fixed_bottom) {
|
||||
@ -69,10 +73,6 @@ public class Hologram {
|
||||
}
|
||||
}
|
||||
|
||||
if (line >= armorStands.size()) {
|
||||
line = armorStands.size();
|
||||
}
|
||||
|
||||
Location location = this.location.clone();
|
||||
|
||||
if (!config.hologram_fixed_bottom) {
|
||||
@ -152,7 +152,7 @@ public class Hologram {
|
||||
Location loc = location.clone().add(0, 0.4, 0);
|
||||
|
||||
try {
|
||||
ArmorStand armorStand = (ArmorStand) location.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
|
||||
ArmorStand armorStand = (ArmorStand) loc.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
|
||||
armorStand.setGravity(false);
|
||||
armorStand.setVisible(false);
|
||||
|
||||
|
@ -231,7 +231,9 @@ public class Shop {
|
||||
format = format.replace(regex.toString(), replace);
|
||||
}
|
||||
|
||||
lines.add(format);
|
||||
if (!format.isEmpty()) {
|
||||
lines.add(format);
|
||||
}
|
||||
}
|
||||
|
||||
return lines.toArray(new String[lines.size()]);
|
||||
|
Loading…
Reference in New Issue
Block a user