Allow option in server.properties to disable world change messages

This commit is contained in:
UnknownShadow200 2018-04-04 12:36:22 +10:00
parent b1a506257d
commit c33862b400
3 changed files with 11 additions and 7 deletions

View File

@ -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) {

View File

@ -120,8 +120,10 @@ namespace MCGalaxy {
CheckGamesJoin(p, oldLevel);
if (p.level.ShouldShowJoinMessage(oldLevel)) {
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;

View File

@ -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;