From 1da1382b16c8711ee636e7764beadc8834b1fba5 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sat, 29 Sep 2018 16:22:50 -0400 Subject: [PATCH] some toString() changes --- .../messages/LegacyChannelIdentifier.java | 4 +--- .../messages/MinecraftChannelIdentifier.java | 5 +---- .../api/proxy/server/ServerPing.java | 20 +++++++++++++++++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/api/src/main/java/com/velocitypowered/api/proxy/messages/LegacyChannelIdentifier.java b/api/src/main/java/com/velocitypowered/api/proxy/messages/LegacyChannelIdentifier.java index a5a345cfd..bc91b1e24 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/messages/LegacyChannelIdentifier.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/messages/LegacyChannelIdentifier.java @@ -23,9 +23,7 @@ public final class LegacyChannelIdentifier implements ChannelIdentifier { @Override public String toString() { - return "LegacyChannelIdentifier{" + - "name='" + name + '\'' + - '}'; + return name + " (legacy)"; } @Override diff --git a/api/src/main/java/com/velocitypowered/api/proxy/messages/MinecraftChannelIdentifier.java b/api/src/main/java/com/velocitypowered/api/proxy/messages/MinecraftChannelIdentifier.java index 1355ed239..10d1deef6 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/messages/MinecraftChannelIdentifier.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/messages/MinecraftChannelIdentifier.java @@ -54,10 +54,7 @@ public final class MinecraftChannelIdentifier implements ChannelIdentifier { @Override public String toString() { - return "MinecraftChannelIdentifier{" + - "namespace='" + namespace + '\'' + - ", name='" + name + '\'' + - '}'; + return getId() + " (modern)"; } @Override diff --git a/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java b/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java index 4ffaa83a1..4dc47c33d 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java @@ -164,8 +164,8 @@ public final class ServerPing { } public ServerPing build() { - return new ServerPing(version, nullOutPlayers ? null : new Players(onlinePlayers, maximumPlayers, samplePlayers), description, favicon, - nullOutModinfo ? null : new ModInfo(modType, mods)); + return new ServerPing(version, nullOutPlayers ? null : new Players(onlinePlayers, maximumPlayers, samplePlayers), + description, favicon, nullOutModinfo ? null : new ModInfo(modType, mods)); } public Version getVersion() { @@ -320,6 +320,14 @@ public final class ServerPing { public List getMods() { return modList; } + + @Override + public String toString() { + return "ModInfo{" + + "type='" + type + '\'' + + ", modList=" + modList + + '}'; + } } public static final class Mod { @@ -338,5 +346,13 @@ public final class ServerPing { public String getVersion() { return version; } + + @Override + public String toString() { + return "Mod{" + + "id='" + id + '\'' + + ", version='" + version + '\'' + + '}'; + } } }