- Баллы
- 66
Нужно чтобы в stream.msg можно было добавить hex цвета, но вместо этого в чате появляется каша из обычных майнкрафт цветов.
Код:
for (String stream : config.getStringList("stream.msg")) {
for (Player all : Bukkit.getOnlinePlayers()) {
TextComponent button = new TextComponent(ColorUtil.color(stream.replace("*player*", me.getName()).replace("*channel_name*", strings[0])));
button.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new ComponentBuilder("&7Нажмите чтобы перейти".replace("&", "§"))).create()));
button.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, strings[1]));
Location loc = all.getLocation();
all.spigot().sendMessage(button);
all.sendTitle(ColorUtil.color(config.getString("stream.up-title")).replace("*player*", me.getName()), ColorUtil.color(config.getString("stream.down-title")));
if (config.getBoolean("stream.sound"))
all.playSound(loc, Sound.BLOCK_BEACON_ACTIVATE, 1.0F, 1.0F);
}
}