mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 01:27:37 +00:00
Actually fix it
This commit is contained in:
parent
730f7c5ea0
commit
bae1e49c5e
@ -25,8 +25,8 @@ public class ServerListener extends PlexListener
|
||||
AtomicReference<Component> motd = new AtomicReference<>(Component.empty());
|
||||
for (final String word : baseMotd.split(" "))
|
||||
{
|
||||
motd.get().append(Component.text(word).color(RandomUtil.getRandomColor()));
|
||||
motd.get().append(Component.space());
|
||||
motd.set(motd.get().append(Component.text(word).color(RandomUtil.getRandomColor())));
|
||||
motd.set(motd.get().append(Component.space()));
|
||||
}
|
||||
event.motd(motd.get());
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package dev.plex.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
|
||||
@ -8,7 +9,7 @@ public class RandomUtil
|
||||
|
||||
public static NamedTextColor getRandomColor()
|
||||
{
|
||||
NamedTextColor[] colors = NamedTextColor.NAMES.values().toArray(NamedTextColor[]::new);
|
||||
NamedTextColor[] colors = NamedTextColor.NAMES.values().stream().filter(namedTextColor -> namedTextColor != NamedTextColor.BLACK && namedTextColor != NamedTextColor.DARK_BLUE).toArray(NamedTextColor[]::new);
|
||||
return colors[randomNum(colors.length)];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user