mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-11-03 09:29:34 +01:00
Don't display {"text":"..."} for MOTD in Minecraft 1.9+
This commit is contained in:
parent
f291bf31e4
commit
0dc0b7303c
@ -43,9 +43,18 @@ public class PingResponse
|
|||||||
Object descriptionObject = json.get("description");
|
Object descriptionObject = json.get("description");
|
||||||
|
|
||||||
if (descriptionObject != null) {
|
if (descriptionObject != null) {
|
||||||
motd = descriptionObject.toString();
|
if (descriptionObject instanceof JSONObject) {
|
||||||
|
Object text = ((JSONObject) descriptionObject).get("text");
|
||||||
|
if (text != null) {
|
||||||
|
motd = text.toString();
|
||||||
} else {
|
} else {
|
||||||
motd = "Invalid ping response";
|
motd = "Invalid ping response (text not found)";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
motd = descriptionObject.toString();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
motd = "Invalid ping response (description not found)";
|
||||||
DebugHandler.logToConsole("Received invalid Json response from IP \"" + address.toString() + "\": " + jsonString);
|
DebugHandler.logToConsole("Received invalid Json response from IP \"" + address.toString() + "\": " + jsonString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user