mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -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,
|
public static bool Read(string path, Action<string, string> processor,
|
||||||
char separator = '=', bool trimValue = true) {
|
char separator = '=', bool trimValue = true) {
|
||||||
if (!File.Exists(path)) return false;
|
object obj = null;
|
||||||
|
LineProcessor<object> del = (string key, string value, ref object state) => { processor(key, value); };
|
||||||
using (CP437Reader reader = new CP437Reader(path)) {
|
return Read(path, ref obj, del, separator, trimValue);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool Read<T>(string path, ref T state, LineProcessor<T> processor,
|
public static bool Read<T>(string path, ref T state, LineProcessor<T> processor,
|
||||||
|
@ -125,7 +125,7 @@ namespace MCGalaxy {
|
|||||||
p.prevMsg = "";
|
p.prevMsg = "";
|
||||||
|
|
||||||
if (!p.hidden && p.level.ShouldShowJoinMessage(oldLevel)) {
|
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);
|
Player.RaisePlayerAction(p, PlayerAction.JoinWorld, lvl.name);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user