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:
parent
8f94aa8bdd
commit
0e06049d6e
8
Gamemode.cs
Normal file
8
Gamemode.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
public enum Gamemode
|
||||
{
|
||||
survival,
|
||||
creative,
|
||||
adventure
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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; } = [];
|
||||
|
Loading…
Reference in New Issue
Block a user