bring back text displays bossbar thing
This commit is contained in:
parent
702cf6f0e9
commit
e49a05fd8c
2 changed files with 9 additions and 1 deletions
|
@ -18,6 +18,7 @@ public class BotBossBar extends BossBar {
|
|||
|
||||
private final Bot bot;
|
||||
|
||||
public String onlyName;
|
||||
public String id;
|
||||
|
||||
private String players;
|
||||
|
@ -63,7 +64,11 @@ public class BotBossBar extends BossBar {
|
|||
|
||||
this.title = title;
|
||||
|
||||
bot.core.run("minecraft:bossbar set " + id + " name " + GsonComponentSerializer.gson().serialize(title));
|
||||
final String serialized = GsonComponentSerializer.gson().serialize(title);
|
||||
|
||||
bot.core.run("minecraft:bossbar set " + id + " name " + serialized);
|
||||
|
||||
if (!bot.core.hasRateLimit()) bot.core.run("minecraft:execute as @e[type=minecraft:text_display,tag=" + bot.config.bossBarNamespace + "_" + onlyName + "] run data modify entity @s text set value '" + serialized.replace("\\", "\\\\" + "'").replace("'", "\\'") + "'");
|
||||
}
|
||||
|
||||
public BossBarColor color(BossBarColor color) {
|
||||
|
|
|
@ -84,6 +84,7 @@ public class BossbarManagerPlugin extends Bot.Listener {
|
|||
);
|
||||
|
||||
bossBars.get(packet.getUuid()).id = bossBar.id;
|
||||
bossBars.get(packet.getUuid()).onlyName = bossBar.onlyName;
|
||||
bossBars.get(packet.getUuid()).uuid = packet.getUuid();
|
||||
|
||||
newBossBar.setTitle(bossBar.title);
|
||||
|
@ -183,6 +184,8 @@ public class BossbarManagerPlugin extends Bot.Listener {
|
|||
public void add (String name, BotBossBar bossBar) {
|
||||
if (!enabled || !bot.options.useCore) return;
|
||||
|
||||
bossBar.onlyName = name;
|
||||
|
||||
bossBar.id = bossBarPrefix + name;
|
||||
|
||||
bossBars.put(bossBar.uuid, bossBar);
|
||||
|
|
Loading…
Reference in a new issue