Reamls worlds: Use expired property to determine available world

This commit is contained in:
ReinforceZwei 2021-05-17 16:53:38 +08:00
parent 83521d7cca
commit 8efb8d80a4

View file

@ -700,12 +700,9 @@ 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 (daysLeft > 0)
if (realmsServer.Properties["expired"].StringValue == "false")
{
availableWorlds.Add(String.Format("[{0}] {2} ({3}) - {1}",
index++,
@ -716,7 +713,6 @@ namespace MinecraftClient.Protocol
}
}
}
}
if (availableWorlds.Count > 0)
{
Translations.WriteLine("mcc.realms_available");