Fix colour bleeding in /who when on a museum map (Thanks fam0r)

This commit is contained in:
UnknownShadow200 2017-05-14 00:27:54 +10:00
parent 551459a451
commit 8aa3a1e7da
3 changed files with 9 additions and 6 deletions

View File

@ -110,7 +110,8 @@ namespace MCGalaxy.Commands.Info {
}
builder.Append(name);
builder.Append(" (").Append(pl.level.name).Append("),");
string lvlName = Colors.StripColors(pl.level.name); // for museums
builder.Append(" (").Append(lvlName).Append("),");
}
}

View File

@ -16,7 +16,6 @@
permissions and limitations under the Licenses.
*/
using System;
using System.IO;
using System.Threading;
using MCGalaxy.Generator;
@ -44,6 +43,7 @@ namespace MCGalaxy.Commands.World {
if (!CheckMapAxis(p, args[1], "Width", ref x)) return false;
if (!CheckMapAxis(p, args[2], "Height", ref y)) return false;
if (!CheckMapAxis(p, args[3], "Length", ref z)) return false;
if (!CheckMapVolume(p, x, y, z)) return true;
string seed = args.Length == 6 ? args[5] : "";
if (!Formatter.ValidName(p, name, "level")) return false;

View File

@ -33,14 +33,16 @@ namespace MCGalaxy {
[ConfigString("MOTD", "General", null, "ignore", true, null, 128)]
public string motd = "ignore";
public string ColoredName {
public string Color {
get {
LevelPermission maxPerm = permissionvisit;
if (maxPerm < permissionbuild) maxPerm = permissionbuild;
return Group.GetColor(maxPerm) + name;
return Group.GetColor(maxPerm);
}
}
public string ColoredName { get { return Color + name; } }
public byte rotx, roty;
public ushort spawnx, spawny, spawnz;
public Position SpawnPos { get { return new Position(16 + spawnx * 32, 32 + spawny * 32, 16 + spawnz * 32); } }