3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Fix recent PR not loading default messages from config correctly.

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-08-21 00:10:34 -04:00
Ursprung c15a49ce7d
Commit ade9deec47

Datei anzeigen

@ -837,38 +837,42 @@ public class VelocityConfiguration implements ProxyConfig {
} }
private String getString(String path) { private String getString(String path) {
return toml.getOrElse(path, defaultToml.getOrElse(path, "")); String def = defaultToml.getOrElse(path, "");
if (toml == null) {
return def;
}
return toml.getOrElse(path, def);
} }
public Component getKickPrefix(String server) { public Component getKickPrefix(String server) {
return serialize(String.format(kickPrefix, server)); return deserialize(String.format(kickPrefix, server));
} }
public Component getDisconnectPrefix(String server) { public Component getDisconnectPrefix(String server) {
return serialize(String.format(disconnectPrefix, server)); return deserialize(String.format(disconnectPrefix, server));
} }
public Component getOnlineModeOnly() { public Component getOnlineModeOnly() {
return serialize(onlineModeOnly); return deserialize(onlineModeOnly);
} }
public Component getNoAvailableServers() { public Component getNoAvailableServers() {
return serialize(noAvailableServers); return deserialize(noAvailableServers);
} }
public Component getAlreadyConnected() { public Component getAlreadyConnected() {
return serialize(alreadyConnected); return deserialize(alreadyConnected);
} }
public Component getMovedToNewServerPrefix() { public Component getMovedToNewServerPrefix() {
return serialize(movedToNewServerPrefix); return deserialize(movedToNewServerPrefix);
} }
public Component getGenericConnectionError() { public Component getGenericConnectionError() {
return serialize(genericConnectionError); return deserialize(genericConnectionError);
} }
private Component serialize(String str) { private Component deserialize(String str) {
if (str.startsWith("{")) { if (str.startsWith("{")) {
return GsonComponentSerializer.gson().deserialize(str); return GsonComponentSerializer.gson().deserialize(str);
} }