mirror of
https://github.com/plexusorg/Plex.git
synced 2025-06-25 13:24:28 +00:00
add the ability to overide the chat
This commit is contained in:
@ -13,6 +13,7 @@ import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@ -23,7 +24,7 @@ public class ServerListener extends PlexListener
|
||||
@Subscribe(order = PostOrder.FIRST)
|
||||
public void onPing(ProxyPingEvent event)
|
||||
{
|
||||
String baseMotd = plugin.getConfig().as(ServerSettings.class).getServer().getMotd();
|
||||
String baseMotd = plugin.getConfig().as(ServerSettings.class).getServer().getMotd().get(ThreadLocalRandom.current().nextInt(plugin.getConfig().as(ServerSettings.class).getServer().getMotd().size()));
|
||||
baseMotd = baseMotd.replace("\\n", "\n");
|
||||
baseMotd = baseMotd.replace("%servername%", plugin.getConfig().as(ServerSettings.class).getServer().getName());
|
||||
baseMotd = baseMotd.replace("%mcversion%", plugin.getServer().getVersion().getVersion().split(" ")[0]);
|
||||
|
@ -15,7 +15,7 @@ public class ServerSettings
|
||||
@Data
|
||||
public static class Server {
|
||||
private String name = "Server";
|
||||
private String motd = "%randomgradient%%servername% - %mcversion%";
|
||||
private List<String> motd = Lists.newArrayList("%randomgradient%%servername% - %mcversion%", "Another motd");
|
||||
private boolean colorizeMotd = false;
|
||||
private boolean debug = false;
|
||||
private final List<String> sample = Lists.newArrayList("example", "example");
|
||||
|
@ -13,7 +13,7 @@
|
||||
# %servername% - The name provided above
|
||||
# %randomgradient% - Creates a random gradient every ping of two random colors for the whole string
|
||||
# Supports MiniMessage strings, no legacy & and §
|
||||
motd = "%randomgradient%%servername% - %mcversion%"
|
||||
motd = ["%randomgradient%%servername% - %mcversion%", "Another motd"]
|
||||
colorizeMotd = false
|
||||
|
||||
# Enables debug messages
|
||||
|
Reference in New Issue
Block a user