diff --git a/Levels/Level.Blocks.cs b/Levels/Level.Blocks.cs index 47c048df2..055ac89cb 100644 --- a/Levels/Level.Blocks.cs +++ b/Levels/Level.Blocks.cs @@ -1,7 +1,7 @@ /* Copyright 2010 MCSharp team (Modified for use with MCZall/MCLawl/MCGalaxy) - Dual-licensed under the Educational Community License, Version 2.0 and + Dual-licensed under the Educational Community License, Version 2.0 and the GNU General Public License, Version 3 (the "Licenses"); you may not use this file except in compliance with the Licenses. You may obtain a copy of the Licenses at diff --git a/Levels/Level.cs b/Levels/Level.cs index 33d15d441..fed3b5313 100644 --- a/Levels/Level.cs +++ b/Levels/Level.cs @@ -110,6 +110,10 @@ namespace MCGalaxy [Obsolete] public ushort depth; [Obsolete] public ushort length; + public bool IsMuseum { + get { return name.StartsWith("&cMuseum " + Server.DefaultColor, StringComparison.Ordinal); } + } + public int drown = 70; public bool edgeWater; public int fall = 9; @@ -275,7 +279,7 @@ namespace MCGalaxy public bool Unload(bool silent = false, bool save = true) { if (Server.mainLevel == this) return false; - if (name.Contains("&cMuseum ")) return false; + if (IsMuseum) return false; if (Server.lava.active && Server.lava.map == this) return false; if (LevelUnload != null) LevelUnload(this); diff --git a/Player/Player.Handlers.cs b/Player/Player.Handlers.cs index 9d2cbc5f4..bdede8bdd 100644 --- a/Player/Player.Handlers.cs +++ b/Player/Player.Handlers.cs @@ -30,7 +30,7 @@ namespace MCGalaxy { byte b = level.GetTile(x, y, z); if ( b == Block.Zero ) { return; } if ( jailed || !agreed ) { RevertBlock(x, y, z); return; } - if ( level.name.Contains("Museum " + Server.DefaultColor) && Blockchange == null ) { + if ( level.IsMuseum && Blockchange == null ) { return; } @@ -65,7 +65,7 @@ namespace MCGalaxy { lastClick[0] = x; lastClick[1] = y; lastClick[2] = z; if ( Blockchange != null ) { - if ( Blockchange.Method.ToString().IndexOf("AboutBlockchange") == -1 && !level.name.Contains("Museum " + Server.DefaultColor) ) { + if ( Blockchange.Method.ToString().IndexOf("AboutBlockchange") == -1 && !level.IsMuseum ) { bP.deleted = true; level.blockCache.Add(bP); } @@ -1150,7 +1150,8 @@ try { SendBlockchange(pos1.x, pos1.y, pos1.z, Block.waterstill); } catch { } } if( HasCpeExt(CpeExt.LongerMessages) && continued != 0 ) { - storedMessage += text; + if (text.Length < 64) storedMessage = storedMessage + text + " "; + else storedMessage = storedMessage + text; return; } @@ -1501,7 +1502,7 @@ return; } if (cmd != "repeat") lastCMD = cmd + " " + message; - if (level.name.Contains("Museum " + Server.DefaultColor) && !command.museumUsable ) { + if (level.IsMuseum && !command.museumUsable ) { SendMessage("Cannot use this command while in a museum!"); return; } if ((joker || muted) && cmd == "me") {