From 8efb8d80a4d211eff3f1df886ebfa2e51e620a67 Mon Sep 17 00:00:00 2001 From: ReinforceZwei <39955851+ReinforceZwei@users.noreply.github.com> Date: Mon, 17 May 2021 16:53:38 +0800 Subject: [PATCH] Reamls worlds: Use expired property to determine available world --- MinecraftClient/Protocol/ProtocolHandler.cs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/MinecraftClient/Protocol/ProtocolHandler.cs b/MinecraftClient/Protocol/ProtocolHandler.cs index e7c59a71..424b5a49 100644 --- a/MinecraftClient/Protocol/ProtocolHandler.cs +++ b/MinecraftClient/Protocol/ProtocolHandler.cs @@ -700,20 +700,16 @@ namespace MinecraftClient.Protocol if (realmsServer.Properties.ContainsKey("name") && realmsServer.Properties.ContainsKey("owner") && realmsServer.Properties.ContainsKey("id") - && realmsServer.Properties.ContainsKey("daysLeft")) + && realmsServer.Properties.ContainsKey("expired")) { - int daysLeft; - if (int.TryParse(realmsServer.Properties["daysLeft"].StringValue, out daysLeft)) + if (realmsServer.Properties["expired"].StringValue == "false") { - if (daysLeft > 0) - { - availableWorlds.Add(String.Format("[{0}] {2} ({3}) - {1}", - index++, - realmsServer.Properties["id"].StringValue, - realmsServer.Properties["name"].StringValue, - realmsServer.Properties["owner"].StringValue)); - realmsWorldsResult.Add(realmsServer.Properties["id"].StringValue); - } + availableWorlds.Add(String.Format("[{0}] {2} ({3}) - {1}", + index++, + realmsServer.Properties["id"].StringValue, + realmsServer.Properties["name"].StringValue, + realmsServer.Properties["owner"].StringValue)); + realmsWorldsResult.Add(realmsServer.Properties["id"].StringValue); } } }