mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-11-03 09:29:34 +01:00
Add option to trim (remove trailing spaces) from the motd.
This commit is contained in:
parent
010b72fe7d
commit
be1866fc2d
@ -1,5 +1,7 @@
|
||||
package com.gmail.filoghost.holographicdisplays.bridge.bungeecord;
|
||||
|
||||
import com.gmail.filoghost.holographicdisplays.disk.Configuration;
|
||||
|
||||
public class BungeeServerInfo {
|
||||
|
||||
private boolean isOnline;
|
||||
@ -60,10 +62,10 @@ public class BungeeServerInfo {
|
||||
|
||||
if (motd.contains("\n")) {
|
||||
String[] split = motd.split("\n");
|
||||
this.motd1 = split[0];
|
||||
this.motd2 = split[1];
|
||||
this.motd1 = Configuration.pingerTrimMotd ? split[0].trim() : split[0];
|
||||
this.motd2 = Configuration.pingerTrimMotd ? split[1].trim() : split[1];
|
||||
} else {
|
||||
this.motd1 = motd;
|
||||
this.motd1 = Configuration.pingerTrimMotd ? motd.trim() : motd;
|
||||
this.motd2 = "";
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ public enum ConfigNode {
|
||||
BUNGEE_PINGER_OFFLINE_MOTD("bungee.pinger.offline-motd", "&cOffline, couldn't get the MOTD."),
|
||||
BUNGEE_PINGER_ONLINE_FORMAT("bungee.pinger.status.online", "&aOnline"),
|
||||
BUNGEE_PINGER_OFFLINE_FORMAT("bungee.pinger.status.offline", "&cOffline"),
|
||||
BUNGEE_PINGER_TRIM_MOTD("bungee.pinger.trim-motd", true),
|
||||
BUNGEE_PINGER_SERVERS("bungee.pinger.servers", Arrays.asList("hub: 127.0.0.1:25565", "survival: 127.0.0.1:25566", "minigames: 127.0.0.1:25567")),
|
||||
TIME_FORMAT("time.format", "H:mm"),
|
||||
TIME_ZONE("time.zone", "GMT+1"),
|
||||
|
@ -39,6 +39,7 @@ public class Configuration {
|
||||
public static String pingerOfflineMotd;
|
||||
public static String pingerStatusOnline;
|
||||
public static String pingerStatusOffline;
|
||||
public static boolean pingerTrimMotd;
|
||||
|
||||
public static boolean debug;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user