mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Bug fix
This commit is contained in:
parent
d3cf0f4adf
commit
e9f227ca5b
4 changed files with 45 additions and 11 deletions
|
|
@ -969,7 +969,40 @@ namespace MinecraftClient
|
|||
|
||||
public string TeleportRequest = @"^([a-zA-Z0-9_]+) has requested (?:to|that you) teleport to (?:you|them)\.$";
|
||||
|
||||
public void OnSettingUpdate() { }
|
||||
public void OnSettingUpdate()
|
||||
{
|
||||
if (UserDefined)
|
||||
{
|
||||
bool checkResult = true;
|
||||
|
||||
try { _ = new Regex(Public); }
|
||||
catch (ArgumentException)
|
||||
{
|
||||
checkResult = false;
|
||||
ConsoleIO.WriteLineFormatted("§cIllegal regular expression: ChatFormat.Public = " + Public);
|
||||
}
|
||||
|
||||
try { _ = new Regex(Private); }
|
||||
catch (ArgumentException)
|
||||
{
|
||||
checkResult = false;
|
||||
ConsoleIO.WriteLineFormatted("§cIllegal regular expression: ChatFormat.Private = " + Private);
|
||||
}
|
||||
|
||||
try { _ = new Regex(TeleportRequest); }
|
||||
catch (ArgumentException)
|
||||
{
|
||||
checkResult = false;
|
||||
ConsoleIO.WriteLineFormatted("§cIllegal regular expression: ChatFormat.TeleportRequest = " + TeleportRequest);
|
||||
}
|
||||
|
||||
if (!checkResult)
|
||||
{
|
||||
UserDefined = false;
|
||||
ConsoleIO.WriteLineFormatted("§cChatFormat: User-defined regular expressions are disabled.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue