mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 03:55:18 -04:00
Core: Fix color not being in /goto.
This commit is contained in:
parent
3714775621
commit
a6de8d7986
@ -28,26 +28,9 @@ namespace MCGalaxy {
|
||||
|
||||
public static bool Read(string path, Action<string, string> 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<object> del = (string key, string value, ref object state) => { processor(key, value); };
|
||||
return Read(path, ref obj, del, separator, trimValue);
|
||||
}
|
||||
|
||||
public static bool Read<T>(string path, ref T state, LineProcessor<T> processor,
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user