1
0
mirror of https://github.com/CyberL1/MyMcRealms.git synced 2024-11-21 13:38:21 -05:00

fix: check if world's motd is longer than the limit first (idk some C# shenanigans)

This commit is contained in:
CyberL1 2024-09-22 08:31:02 +02:00
parent 9976c0bbb5
commit 79c97c7415

View File

@ -54,10 +54,16 @@ namespace MyMcRealms.Controllers
}
if (SemVersion.Parse(gameVerision, SemVersionStyles.OptionalPatch).ComparePrecedenceTo(SemVersion.Parse("1.19.4", SemVersionStyles.OptionalPatch)) < 0) {
world.Motd = world.Motd.Remove(32); // Pre 1.19.4 MOTD limit
if (world.Motd.Length > 32)
{
world.Motd = world.Motd.Remove(32); // Pre 1.19.4 MOTD limit
}
} else
{
world.Motd = world.Motd.Remove(52); // Post 1.19.4 MOTD limit
if (world.Motd.Length > 52)
{
world.Motd = world.Motd.Remove(52); // Post 1.19.4 MOTD limit
}
}
WorldResponse response = new()