diff --git a/MinecraftClient/ChatBots/AntiAFK.cs b/MinecraftClient/ChatBots/AntiAFK.cs index f4604484..c216d807 100644 --- a/MinecraftClient/ChatBots/AntiAFK.cs +++ b/MinecraftClient/ChatBots/AntiAFK.cs @@ -1,4 +1,5 @@ using System; +using System.Globalization; using MinecraftClient.Mapping; namespace MinecraftClient.ChatBots @@ -63,11 +64,11 @@ namespace MinecraftClient.ChatBots if (parts.Length == 2) { - if (int.TryParse(parts[0].Trim(), out int firstTime)) + if (int.TryParse(parts[0].Trim(), NumberStyles.Any, CultureInfo.CurrentCulture, out int firstTime)) { timeping = firstTime; - if (int.TryParse(parts[1].Trim(), out int secondTime)) + if (int.TryParse(parts[1].Trim(), NumberStyles.Any, CultureInfo.CurrentCulture, out int secondTime)) timepingMax = secondTime; else LogToConsole(Translations.TryGet("bot.antiafk.invalid_range_partial", timeping)); } @@ -77,7 +78,7 @@ namespace MinecraftClient.ChatBots } else { - if (int.TryParse(pingparam.Trim(), out int value)) + if (int.TryParse(pingparam.Trim(), NumberStyles.Any, CultureInfo.CurrentCulture, out int value)) timeping = value; else LogToConsole(Translations.TryGet("bot.antiafk.invalid_value")); } diff --git a/MinecraftClient/ChatBots/Map.cs b/MinecraftClient/ChatBots/Map.cs index d84a1117..631cee4e 100644 --- a/MinecraftClient/ChatBots/Map.cs +++ b/MinecraftClient/ChatBots/Map.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.Globalization; using System.IO; using MinecraftClient.Mapping; using MinecraftClient.Protocol.Handlers; @@ -70,7 +71,7 @@ namespace MinecraftClient.ChatBots if (args.Length < 2) return "maps > | maps >"; - if (int.TryParse(args[1], out int mapId)) + if (int.TryParse(args[1], NumberStyles.Any, CultureInfo.CurrentCulture, out int mapId)) { if (!cachedMaps.ContainsKey(mapId)) return Translations.TryGet("bot.map.cmd.not_found", mapId); diff --git a/MinecraftClient/ChatBots/ScriptScheduler.cs b/MinecraftClient/ChatBots/ScriptScheduler.cs index b30bb468..8fe8af82 100644 --- a/MinecraftClient/ChatBots/ScriptScheduler.cs +++ b/MinecraftClient/ChatBots/ScriptScheduler.cs @@ -84,8 +84,8 @@ namespace MinecraftClient.ChatBots string[] parts = argValue.Split("-"); if (parts.Length == 2) { - interval = int.Parse(parts[0].Trim()); - intervalMax = int.Parse(parts[1].Trim()); + interval = int.Parse(parts[0].Trim(), NumberStyles.Any, CultureInfo.CurrentCulture); + intervalMax = int.Parse(parts[1].Trim(), NumberStyles.Any, CultureInfo.CurrentCulture); } else { @@ -94,7 +94,7 @@ namespace MinecraftClient.ChatBots } else { - interval = int.Parse(argValue); + interval = int.Parse(argValue, NumberStyles.Any, CultureInfo.CurrentCulture); } current_task.triggerOnInterval_Interval = interval; diff --git a/MinecraftClient/Commands/Bed.cs b/MinecraftClient/Commands/Bed.cs index 3bffd887..4cedce82 100644 --- a/MinecraftClient/Commands/Bed.cs +++ b/MinecraftClient/Commands/Bed.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Threading.Tasks; using MinecraftClient.Mapping; @@ -30,7 +31,7 @@ namespace MinecraftClient.Commands { if (args.Length == 2) { - if (!int.TryParse(args[1], out int radius)) + if (!int.TryParse(args[1], NumberStyles.Any, CultureInfo.CurrentCulture, out int radius)) return CmdUsage; handler.GetLogger().Info(Translations.TryGet("cmd.bed.searching", radius)); diff --git a/MinecraftClient/Commands/Chunk.cs b/MinecraftClient/Commands/Chunk.cs index 8939efc6..ee1b8c7b 100644 --- a/MinecraftClient/Commands/Chunk.cs +++ b/MinecraftClient/Commands/Chunk.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Text; using MinecraftClient.Mapping; @@ -36,7 +37,10 @@ namespace MinecraftClient.Commands { sb.Append("Marked location: "); if (args.Length == 1 + 3) - sb.Append(String.Format("X:{0:0.00} Y:{1:0.00} Z:{2:0.00}, ", double.Parse(args[1]), double.Parse(args[2]), double.Parse(args[3]))); + sb.Append(String.Format("X:{0:0.00} Y:{1:0.00} Z:{2:0.00}, ", + double.Parse(args[1], NumberStyles.Any, CultureInfo.CurrentCulture), + double.Parse(args[2], NumberStyles.Any, CultureInfo.CurrentCulture), + double.Parse(args[3], NumberStyles.Any, CultureInfo.CurrentCulture))); sb.Append(String.Format("chunk: ({0}, {1}).\n", markChunkX, markChunkZ)); } @@ -230,14 +234,18 @@ namespace MinecraftClient.Commands int chunkX, chunkZ; if (args.Length == 1 + 3) { - Location pos = new(double.Parse(args[1]), double.Parse(args[2]), double.Parse(args[3])); + Location pos = new( + double.Parse(args[1], NumberStyles.Any, CultureInfo.CurrentCulture), + double.Parse(args[2], NumberStyles.Any, CultureInfo.CurrentCulture), + double.Parse(args[3], NumberStyles.Any, CultureInfo.CurrentCulture) + ); chunkX = pos.ChunkX; chunkZ = pos.ChunkZ; } else if (args.Length == 1 + 2) { - chunkX = int.Parse(args[1]); - chunkZ = int.Parse(args[2]); + chunkX = int.Parse(args[1], NumberStyles.Any, CultureInfo.CurrentCulture); + chunkZ = int.Parse(args[2], NumberStyles.Any, CultureInfo.CurrentCulture); } else return null; diff --git a/MinecraftClient/Commands/Entitycmd.cs b/MinecraftClient/Commands/Entitycmd.cs index 767f7134..bb5783b6 100644 --- a/MinecraftClient/Commands/Entitycmd.cs +++ b/MinecraftClient/Commands/Entitycmd.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using MinecraftClient.Inventory; using MinecraftClient.Mapping; @@ -20,7 +21,7 @@ namespace MinecraftClient.Commands { try { - int entityID = int.Parse(args[0]); + int entityID = int.Parse(args[0], NumberStyles.Any, CultureInfo.CurrentCulture); if (entityID != 0) { if (handler.GetEntities().ContainsKey(entityID)) diff --git a/MinecraftClient/Commands/Inventory.cs b/MinecraftClient/Commands/Inventory.cs index 58d7997e..c01e9964 100644 --- a/MinecraftClient/Commands/Inventory.cs +++ b/MinecraftClient/Commands/Inventory.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; using MinecraftClient.Inventory; @@ -24,14 +25,14 @@ namespace MinecraftClient.Commands { if (args.Length >= 4) { - if (!int.TryParse(args[1], out int slot)) + if (!int.TryParse(args[1], NumberStyles.Any, CultureInfo.CurrentCulture, out int slot)) return GetCmdDescTranslated(); if (Enum.TryParse(args[2], true, out ItemType itemType)) { if (handler.GetGamemode() == 1) { - if (!int.TryParse(args[3], out int count)) + if (!int.TryParse(args[3], NumberStyles.Any, CultureInfo.CurrentCulture, out int count)) return GetCmdDescTranslated(); if (handler.DoCreativeGive(slot, itemType, count, null)) @@ -52,7 +53,7 @@ namespace MinecraftClient.Commands { if (args.Length >= 2) { - if (!int.TryParse(args[1], out int slot)) + if (!int.TryParse(args[1], NumberStyles.Any, CultureInfo.CurrentCulture, out int slot)) return GetCmdDescTranslated(); if (handler.GetGamemode() == 1) @@ -105,7 +106,7 @@ namespace MinecraftClient.Commands bool shouldUseItemCount = args.Length >= 3; int itemCount = 0; - if (shouldUseItemCount && !int.TryParse(args[2], out itemCount)) + if (shouldUseItemCount && !int.TryParse(args[2], NumberStyles.Any, CultureInfo.CurrentCulture, out itemCount)) return GetCmdDescTranslated(); Dictionary inventories = handler.GetInventories(); @@ -162,7 +163,7 @@ namespace MinecraftClient.Commands else return GetHelp(); } - else if (!int.TryParse(args[0], out inventoryId)) + else if (!int.TryParse(args[0], NumberStyles.Any, CultureInfo.CurrentCulture, out inventoryId)) return GetCmdDescTranslated(); Container? inventory = handler.GetInventory(inventoryId); @@ -205,7 +206,7 @@ namespace MinecraftClient.Commands } else if (action == "click" && args.Length >= 3) { - if (!int.TryParse(args[2], out int slot)) + if (!int.TryParse(args[2], NumberStyles.Any, CultureInfo.CurrentCulture, out int slot)) return GetCmdDescTranslated(); WindowActionType actionType = WindowActionType.LeftClick; @@ -224,7 +225,7 @@ namespace MinecraftClient.Commands } else if (action == "shiftclick" && args.Length >= 3) { - if (!int.TryParse(args[2], out int slot)) + if (!int.TryParse(args[2], NumberStyles.Any, CultureInfo.CurrentCulture, out int slot)) return GetCmdDescTranslated(); if (!handler.DoWindowAction(inventoryId, slot, WindowActionType.ShiftClick)) @@ -234,7 +235,7 @@ namespace MinecraftClient.Commands } else if (action == "drop" && args.Length >= 3) { - if (!int.TryParse(args[2], out int slot)) + if (!int.TryParse(args[2], NumberStyles.Any, CultureInfo.CurrentCulture, out int slot)) return GetCmdDescTranslated(); // check item exist diff --git a/MinecraftClient/Commands/Look.cs b/MinecraftClient/Commands/Look.cs index 2f6488b2..11065f62 100644 --- a/MinecraftClient/Commands/Look.cs +++ b/MinecraftClient/Commands/Look.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using MinecraftClient.Mapping; namespace MinecraftClient.Commands @@ -50,8 +51,8 @@ namespace MinecraftClient.Commands { try { - float yaw = float.Parse(args[0]); - float pitch = float.Parse(args[1]); + float yaw = float.Parse(args[0], NumberStyles.Any, CultureInfo.CurrentCulture); + float pitch = float.Parse(args[1], NumberStyles.Any, CultureInfo.CurrentCulture); handler.UpdateLocation(handler.GetCurrentLocation(), yaw, pitch); return Translations.Get("cmd.look.at", yaw.ToString("0.00"), pitch.ToString("0.00")); diff --git a/MinecraftClient/Inventory/Item.cs b/MinecraftClient/Inventory/Item.cs index cfe4201e..6d21a5fb 100644 --- a/MinecraftClient/Inventory/Item.cs +++ b/MinecraftClient/Inventory/Item.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Text; using System.Linq; +using System.Globalization; namespace MinecraftClient.Inventory { @@ -105,7 +106,7 @@ namespace MinecraftClient.Inventory object damage = NBT["Damage"]; if (damage != null) { - return int.Parse(damage.ToString() ?? string.Empty); + return int.Parse(damage.ToString() ?? string.Empty, NumberStyles.Any, CultureInfo.CurrentCulture); } } return 0; diff --git a/MinecraftClient/Json.cs b/MinecraftClient/Json.cs index 06722166..e77e32bf 100644 --- a/MinecraftClient/Json.cs +++ b/MinecraftClient/Json.cs @@ -103,7 +103,8 @@ namespace MinecraftClient && IsHex(toparse[cursorpos + 5])) { //"abc\u0123abc" => "0123" => 0123 => Unicode char n°0123 => Add char to string - data.StringValue += char.ConvertFromUtf32(int.Parse(toparse.Substring(cursorpos + 2, 4), System.Globalization.NumberStyles.HexNumber)); + data.StringValue += char.ConvertFromUtf32(int.Parse(toparse.Substring(cursorpos + 2, 4), + System.Globalization.NumberStyles.HexNumber)); cursorpos += 6; continue; } else if (toparse[cursorpos + 1] == 'n') diff --git a/MinecraftClient/Mapping/BlockPalettes/BlockPaletteGenerator.cs b/MinecraftClient/Mapping/BlockPalettes/BlockPaletteGenerator.cs index 57675b5f..a1f7b307 100644 --- a/MinecraftClient/Mapping/BlockPalettes/BlockPaletteGenerator.cs +++ b/MinecraftClient/Mapping/BlockPalettes/BlockPaletteGenerator.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Text; @@ -66,7 +67,7 @@ namespace MinecraftClient.Mapping.BlockPalettes foreach (Json.JSONData state in item.Value.Properties["states"].DataArray) { - int id = int.Parse(state.Properties["id"].StringValue); + int id = int.Parse(state.Properties["id"].StringValue, NumberStyles.Any, CultureInfo.CurrentCulture); if (knownStates.Contains(id)) throw new InvalidDataException("Duplicate state id " + id + "!?"); diff --git a/MinecraftClient/Mapping/Location.cs b/MinecraftClient/Mapping/Location.cs index 069fdf32..b64ace5e 100644 --- a/MinecraftClient/Mapping/Location.cs +++ b/MinecraftClient/Mapping/Location.cs @@ -1,4 +1,5 @@ using System; +using System.Globalization; using System.Runtime.CompilerServices; namespace MinecraftClient.Mapping @@ -85,7 +86,7 @@ namespace MinecraftClient.Mapping for (int i = 0; i < 3; ++i) { - if (!double.TryParse(coord_str[i], out coord_res[i])) + if (!double.TryParse(coord_str[i], NumberStyles.Any, CultureInfo.CurrentCulture, out coord_res[i])) { location = null; return false; @@ -126,7 +127,7 @@ namespace MinecraftClient.Mapping { if (coord_str[i].Length > 1) { - if (!double.TryParse(coord_str[i][1..], out coord_res[i])) + if (!double.TryParse(coord_str[i][1..], NumberStyles.Any, CultureInfo.CurrentCulture, out coord_res[i])) { location = null; return false; @@ -138,7 +139,7 @@ namespace MinecraftClient.Mapping } else { - if (!double.TryParse(coord_str[i], out coord_res[i])) + if (!double.TryParse(coord_str[i], NumberStyles.Any, CultureInfo.CurrentCulture, out coord_res[i])) { location = null; return false; diff --git a/MinecraftClient/Program.cs b/MinecraftClient/Program.cs index 2eedb89a..70bbad1a 100644 --- a/MinecraftClient/Program.cs +++ b/MinecraftClient/Program.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Reflection; @@ -411,7 +412,7 @@ namespace MinecraftClient return; } string worldId = addressInput.Split(':')[1]; - if (!availableWorlds.Contains(worldId) && int.TryParse(worldId, out int worldIndex) && worldIndex < availableWorlds.Count) + if (!availableWorlds.Contains(worldId) && int.TryParse(worldId, NumberStyles.Any, CultureInfo.CurrentCulture, out int worldIndex) && worldIndex < availableWorlds.Count) worldId = availableWorlds[worldIndex]; if (availableWorlds.Contains(worldId)) { diff --git a/MinecraftClient/Protocol/DataTypeGenerator.cs b/MinecraftClient/Protocol/DataTypeGenerator.cs index 039ae477..af5adce8 100644 --- a/MinecraftClient/Protocol/DataTypeGenerator.cs +++ b/MinecraftClient/Protocol/DataTypeGenerator.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; @@ -26,7 +27,7 @@ namespace MinecraftClient.Protocol foreach (KeyValuePair entry in rawRegistry.Properties) { - int entryId = int.Parse(entry.Value.Properties["protocol_id"].StringValue); + int entryId = int.Parse(entry.Value.Properties["protocol_id"].StringValue, NumberStyles.Any, CultureInfo.CurrentCulture); //minecraft:item_name => ItemName string entryName = String.Concat( diff --git a/MinecraftClient/Protocol/Handlers/Protocol16.cs b/MinecraftClient/Protocol/Handlers/Protocol16.cs index 60a2df72..73b7aebc 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol16.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol16.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Net.Sockets; using System.Security.Cryptography; @@ -872,7 +873,7 @@ namespace MinecraftClient.Protocol.Handlers if (result.Length > 2 && result[0] == '§' && result[1] == '1') { string[] tmp = result.Split((char)0x00); - protocolversion = (byte)Int16.Parse(tmp[1]); + protocolversion = (byte)Int16.Parse(tmp[1], NumberStyles.Any, CultureInfo.CurrentCulture); version = tmp[2]; if (protocolversion == 127) //MC 1.7.2+ diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index c267b429..76fd55ab 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; +using System.Globalization; using System.Linq; using System.Net.Sockets; using System.Security.Cryptography; @@ -2139,7 +2140,7 @@ namespace MinecraftClient.Protocol.Handlers //Retrieve protocol version number for handling this server if (versionData.Properties.ContainsKey("protocol")) - protocolVersion = int.Parse(versionData.Properties["protocol"].StringValue); + protocolVersion = int.Parse(versionData.Properties["protocol"].StringValue, NumberStyles.Any, CultureInfo.CurrentCulture); // Check for forge on the server. Protocol18Forge.ServerInfoCheckForge(jsonData, ref forgeInfo); diff --git a/MinecraftClient/Protocol/MicrosoftAuthentication.cs b/MinecraftClient/Protocol/MicrosoftAuthentication.cs index 15cd710e..cbb84a61 100644 --- a/MinecraftClient/Protocol/MicrosoftAuthentication.cs +++ b/MinecraftClient/Protocol/MicrosoftAuthentication.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Collections.Specialized; using System.Diagnostics; +using System.Globalization; using System.Linq; using System.Runtime.InteropServices; using System.Text.RegularExpressions; @@ -73,7 +74,7 @@ namespace MinecraftClient.Protocol { string accessToken = jsonData.Properties["access_token"].StringValue; string refreshToken = jsonData.Properties["refresh_token"].StringValue; - int expiresIn = int.Parse(jsonData.Properties["expires_in"].StringValue); + int expiresIn = int.Parse(jsonData.Properties["expires_in"].StringValue, NumberStyles.Any, CultureInfo.CurrentCulture); // Extract email from JWT string payload = JwtPayloadDecode.GetPayload(jsonData.Properties["id_token"].StringValue); @@ -237,7 +238,7 @@ namespace MinecraftClient.Protocol Email = email, AccessToken = dict["access_token"], RefreshToken = dict["refresh_token"], - ExpiresIn = int.Parse(dict["expires_in"]) + ExpiresIn = int.Parse(dict["expires_in"], NumberStyles.Any, CultureInfo.CurrentCulture) }; } else diff --git a/MinecraftClient/Protocol/ProtocolHandler.cs b/MinecraftClient/Protocol/ProtocolHandler.cs index 4fb1b190..7b12de0f 100644 --- a/MinecraftClient/Protocol/ProtocolHandler.cs +++ b/MinecraftClient/Protocol/ProtocolHandler.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Net.Security; using System.Net.Sockets; @@ -317,7 +318,7 @@ namespace MinecraftClient.Protocol { try { - return Int32.Parse(MCVersion); + return Int32.Parse(MCVersion, NumberStyles.Any, CultureInfo.CurrentCulture); } catch { @@ -628,7 +629,7 @@ namespace MinecraftClient.Protocol { var payload = JwtPayloadDecode.GetPayload(session.ID); var json = Json.ParseJson(payload); - var expTimestamp = long.Parse(json.Properties["exp"].StringValue); + var expTimestamp = long.Parse(json.Properties["exp"].StringValue, NumberStyles.Any, CultureInfo.CurrentCulture); var now = DateTime.Now; var tokenExp = UnixTimeStampToDateTime(expTimestamp); if (Settings.DebugMessages) diff --git a/MinecraftClient/Protocol/ProxiedWebRequest.cs b/MinecraftClient/Protocol/ProxiedWebRequest.cs index e402234d..3fcde5fc 100644 --- a/MinecraftClient/Protocol/ProxiedWebRequest.cs +++ b/MinecraftClient/Protocol/ProxiedWebRequest.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; +using System.Globalization; using System.IO; using System.Net.Security; using System.Net.Sockets; @@ -162,7 +163,7 @@ namespace MinecraftClient.Protocol if (raw.StartsWith("HTTP/1.1") || raw.StartsWith("HTTP/1.0")) { Queue msg = new(raw.Split(new string[] { "\r\n" }, StringSplitOptions.None)); - statusCode = int.Parse(msg.Dequeue().Split(' ')[1]); + statusCode = int.Parse(msg.Dequeue().Split(' ')[1], NumberStyles.Any, CultureInfo.CurrentCulture); while (msg.Peek() != "") { diff --git a/MinecraftClient/Settings.cs b/MinecraftClient/Settings.cs index 8fe4211e..f66c5f6b 100644 --- a/MinecraftClient/Settings.cs +++ b/MinecraftClient/Settings.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Runtime.CompilerServices; @@ -954,7 +955,7 @@ namespace MinecraftClient /// Float number public static float str2float(string str) { - if (float.TryParse(str.Trim(), out float num)) + if (float.TryParse(str.Trim(), NumberStyles.Any, CultureInfo.CurrentCulture, out float num)) return num; else { @@ -970,7 +971,7 @@ namespace MinecraftClient /// Double number public static double str2double(string str) { - if (double.TryParse(str.Trim(), out double num)) + if (double.TryParse(str.Trim(), NumberStyles.Any, CultureInfo.CurrentCulture, out double num)) return num; else { @@ -1016,7 +1017,7 @@ namespace MinecraftClient for (int j = 0; j < curCodLen; ++j) { - if (!double.TryParse(coordinates_str_list[j], out res![i, j])) + if (!double.TryParse(coordinates_str_list[j], NumberStyles.Any, CultureInfo.CurrentCulture, out res![i, j])) { ConsoleIO.WriteLogLine(Translations.Get("error.setting.str2locationList.convert_fail", coordinates_str_list[j])); return null; diff --git a/MinecraftClient/WinAPI/WindowsVersion.cs b/MinecraftClient/WinAPI/WindowsVersion.cs index 3b4e94c6..414c7d49 100644 --- a/MinecraftClient/WinAPI/WindowsVersion.cs +++ b/MinecraftClient/WinAPI/WindowsVersion.cs @@ -1,4 +1,5 @@ -using System.Runtime.InteropServices; +using System.Globalization; +using System.Runtime.InteropServices; using Microsoft.Win32; namespace MinecraftClient.WinAPI @@ -35,7 +36,7 @@ namespace MinecraftClient.WinAPI var versionParts = ((string)version!).Split('.'); if (versionParts.Length != 2) return 0; - return uint.TryParse(versionParts[0], out uint majorAsUInt) ? majorAsUInt : 0; + return uint.TryParse(versionParts[0], NumberStyles.Any, CultureInfo.CurrentCulture, out uint majorAsUInt) ? majorAsUInt : 0; } return 0; @@ -62,7 +63,7 @@ namespace MinecraftClient.WinAPI var versionParts = ((string)version!).Split('.'); if (versionParts.Length != 2) return 0; - return uint.TryParse(versionParts[1], out uint minorAsUInt) ? minorAsUInt : 0; + return uint.TryParse(versionParts[1], NumberStyles.Any, CultureInfo.CurrentCulture, out uint minorAsUInt) ? minorAsUInt : 0; } return 0;