diff --git a/Config/PropertiesFile.cs b/Config/PropertiesFile.cs index 050280741..15342fc16 100644 --- a/Config/PropertiesFile.cs +++ b/Config/PropertiesFile.cs @@ -28,26 +28,9 @@ namespace MCGalaxy { public static bool Read(string path, Action processor, char separator = '=', bool trimValue = true) { - if (!File.Exists(path)) return false; - - using (CP437Reader reader = new CP437Reader(path)) { - string line; - while ((line = reader.ReadLine()) != null) { - int index = ParseLine(line, path, separator); - if (index == -1) continue; - - string key = line.Substring(0, index), value = line.Substring(index + 1); - if (trimValue) value = value.Trim(); - - try { - processor(key.Trim(), value); - } catch (Exception ex) { - Server.ErrorLog(ex); - Server.s.Log("Line \"" + line + "\" in " + path + " caused an error"); - } - } - } - return true; + object obj = null; + LineProcessor del = (string key, string value, ref object state) => { processor(key, value); }; + return Read(path, ref obj, del, separator, trimValue); } public static bool Read(string path, ref T state, LineProcessor processor, diff --git a/Player/PlayerActions.cs b/Player/PlayerActions.cs index 54cd0c15d..e9262c014 100644 --- a/Player/PlayerActions.cs +++ b/Player/PlayerActions.cs @@ -125,7 +125,7 @@ namespace MCGalaxy { p.prevMsg = ""; if (!p.hidden && p.level.ShouldShowJoinMessage(oldLevel)) { - Player.SendChatFrom(p, p.DisplayName + " %Swent to &b" + lvl.name, false); + Player.SendChatFrom(p, p.ColoredName + " %Swent to &b" + lvl.name, false); Player.RaisePlayerAction(p, PlayerAction.JoinWorld, lvl.name); } return true;