Bug fix: /move command went to the wrong location

This commit is contained in:
BruceChen 2022-08-25 14:36:15 +08:00
parent 5f520e2cf4
commit ed8e97fd2d
4 changed files with 35 additions and 9 deletions

View file

@ -121,14 +121,14 @@ namespace MinecraftClient.Protocol.Keys
{
foreach (string line in FileMonitor.ReadAllLinesWithRetries(KeysCacheFilePlaintext))
{
if (!line.Trim().StartsWith("#"))
if (!line.TrimStart().StartsWith("#"))
{
int separatorIdx = line.IndexOf('=');
if (separatorIdx >= 1 && line.Length > separatorIdx + 1)
{
string login = line.Substring(0, separatorIdx);
string value = line.Substring(separatorIdx + 1);
string login = line[..separatorIdx];
string value = line[(separatorIdx + 1)..];
try
{
PlayerKeyPair playerKeyPair = PlayerKeyPair.FromString(value);