1
1
mirror of https://github.com/CyberL1/MyMcRealms.git synced 2024-12-25 05:48:23 -05:00

fix: display motd on >1.21.1

This commit is contained in:
CyberL1 2024-12-10 00:31:05 +01:00
parent 8f94aa8bdd
commit 0e06049d6e
4 changed files with 19 additions and 0 deletions

8
Gamemode.cs Normal file
View File

@ -0,0 +1,8 @@
using System;
public enum Gamemode
{
survival,
creative,
adventure
}

View File

@ -90,6 +90,10 @@ namespace MyMcRealms.Controllers
ActiveVersion = world.GameVersion
};
if (world.Gamemode == "survival") response.GameMode = 0;
if (world.Gamemode == "creative") response.GameMode = 1;
if (world.Gamemode == "adventure") response.GameMode = 2;
allWorlds.Add(response);
}
}
@ -185,6 +189,10 @@ namespace MyMcRealms.Controllers
]
};
if (world.Gamemode == "survival") response.GameMode = 0;
if (world.Gamemode == "creative") response.GameMode = 1;
if (world.Gamemode == "adventure") response.GameMode = 2;
return Ok(response);
}

View File

@ -18,6 +18,7 @@
public List<Whitelist> Whitelist { get; set; } = null!;
public bool WhitelistEnable { get; set; }
public string OwnersToken { get; set; } = string.Empty;
public string Gamemode { get; set; } = null!;
}
public class Op

View File

@ -7,6 +7,8 @@
public string? OwnerUUID { get; set; }
public string? Name { get; set; }
public string? Motd { get; set; }
public int GameMode { get; set; }
public bool Hardcore { get; set; }
public string State { get; set; } = "OPEN";
public string WorldType { get; set; } = "NORMAL";
public List<PlayerResponse> Players { get; set; } = [];