diff --git a/MCGalaxy/Blocks/BlockDefinitions.cs b/MCGalaxy/Blocks/BlockDefinitions.cs index 7c92d44e0..67e242853 100644 --- a/MCGalaxy/Blocks/BlockDefinitions.cs +++ b/MCGalaxy/Blocks/BlockDefinitions.cs @@ -75,7 +75,7 @@ namespace MCGalaxy { } - internal static BlockDefinition[] Load(bool global, string mapName) { + public static BlockDefinition[] Load(bool global, string mapName) { BlockDefinition[] defs = null; string path = global ? GlobalPath : "blockdefs/lvl_" + mapName + ".json"; try { @@ -115,7 +115,7 @@ namespace MCGalaxy { return adjDefs; } - internal static void Save(bool global, Level lvl) { + public static void Save(bool global, Level lvl) { BlockDefinition[] defs = global ? GlobalDefs : lvl.CustomBlockDefs; // We don't want to save global blocks in the level's custom blocks list if (!global) { diff --git a/MCGalaxy/Player/PlayerActions.cs b/MCGalaxy/Player/PlayerActions.cs index f70f87237..6e90ecabe 100644 --- a/MCGalaxy/Player/PlayerActions.cs +++ b/MCGalaxy/Player/PlayerActions.cs @@ -38,7 +38,7 @@ namespace MCGalaxy { static bool ChangeMap(Player p, Level lvl, string name) { if (Interlocked.CompareExchange(ref p.UsingGoto, 1, 0) == 1) { - Player.Message(p, "Cannot use /goto, already joining a map."); return false; + Player.Message(p, "Cannot use /goto, already joining a map."); return false; } Level oldLevel = p.level; bool didJoin = false; @@ -107,7 +107,7 @@ namespace MCGalaxy { p.Loading = true; Entities.DespawnEntities(p); Level oldLevel = p.level; - p.level = lvl; + p.level = lvl; p.SendMap(oldLevel); Position pos = lvl.SpawnPos; @@ -115,13 +115,15 @@ namespace MCGalaxy { byte yaw = lvl.rotx, pitch = lvl.roty; OnPlayerSpawningEvent.Call(p, ref pos, ref yaw, ref pitch, false); - rot.RotY = yaw; rot.HeadX = pitch; + rot.RotY = yaw; rot.HeadX = pitch; Entities.SpawnEntities(p, pos, rot); CheckGamesJoin(p, oldLevel); if (p.level.ShouldShowJoinMessage(oldLevel)) { - string msg = p.level.IsMuseum ? " %Swent to the " : " %Swent to "; - Chat.MessageGlobal(p, p.ColoredName + msg + lvl.ColoredName, false, true); + if (ServerConfig.ShowWorldChanges) { + string msg = p.level.IsMuseum ? " %Swent to the " : " %Swent to "; + Chat.MessageGlobal(p, p.ColoredName + msg + lvl.ColoredName, false, true); + } OnPlayerActionEvent.Call(p, PlayerAction.JoinWorld, lvl.name); } return true; diff --git a/MCGalaxy/Server/ServerConfig.cs b/MCGalaxy/Server/ServerConfig.cs index 70f44f1e9..5a4f7b1e1 100644 --- a/MCGalaxy/Server/ServerConfig.cs +++ b/MCGalaxy/Server/ServerConfig.cs @@ -119,6 +119,8 @@ namespace MCGalaxy { public static bool GuestJoinsNotify = true; [ConfigBool("guest-leave-notify", "Other", true)] public static bool GuestLeavesNotify = true; + [ConfigBool("show-world-changes", "Other", true)] + public static bool ShowWorldChanges = true; [ConfigBool("kick-on-hackrank", "Other", true)] public static bool HackrankKicks = true;