ProxioDev / ValioBungee

Synchronize players data between BungeeCord / Velocity proxies
Eclipse Public License 1.0
200 stars 51 forks source link

textOfChildren threw an error #40

Closed ghost closed 2 years ago

ghost commented 2 years ago

textOfChildren method threw an error for our proxy, using append() made it go away

4drian3d commented 2 years ago

I used textOfChildren which simplifies using a Component.text().append(... which is available since Velocity 3.1.2-SNAPSHOT along with Adventure 4.10.0 as I thought most servers would currently be using Velocity 3.1.2 because of the improvements it has. If you wanted to get exactly the same result you could use

Component serverInfo = Component.text()
    .append(Component.text("[" + server + "] ", NamedTextColor.GREEN)
    .append(Component.text("(" + serverToPlayers.get(server).size() + "): ", NamedTextColor.YELLOW))
    .append(Component.text(Joiner.on(", ").join(human.get(server)), NamedTextColor.WHITE))
    .build();

Although in the specific use given here, the visible result would be the same

ham1255 commented 2 years ago

just referenced this pull request in readme incase somebody had same issue.