diff --git a/Natsurainko.FluentCore/GameManagement/Installer/Data/OptiFineInstallData.cs b/Natsurainko.FluentCore/GameManagement/Installer/Data/OptiFineInstallData.cs index 3b112d1..9654207 100644 --- a/Natsurainko.FluentCore/GameManagement/Installer/Data/OptiFineInstallData.cs +++ b/Natsurainko.FluentCore/GameManagement/Installer/Data/OptiFineInstallData.cs @@ -14,5 +14,5 @@ public class OptiFineInstallData public required string FileName { get; set; } [JsonPropertyName("forge")] - public required string ForgeVersion { get; set; } + public string? ForgeVersion { get; set; } } diff --git a/Natsurainko.FluentCore/GameManagement/Instances/MinecraftInstanceParser.cs b/Natsurainko.FluentCore/GameManagement/Instances/MinecraftInstanceParser.cs index 6cf669e..b06ce49 100644 --- a/Natsurainko.FluentCore/GameManagement/Instances/MinecraftInstanceParser.cs +++ b/Natsurainko.FluentCore/GameManagement/Instances/MinecraftInstanceParser.cs @@ -21,13 +21,13 @@ public class MinecraftInstanceParser /// Successfully parsed instances /// public IReadOnlyCollection ParsedInstances => _parsedInstances; - private readonly List _parsedInstances = new(); + private readonly List _parsedInstances = []; /// /// Erroneous directories that failed to parse /// public IReadOnlyCollection ErroneousDirectories => _erroneousDirectories; - private readonly List _erroneousDirectories = new(); + private readonly List _erroneousDirectories = []; // .minecraft folder path private readonly string _minecraftFolderPath; @@ -48,6 +48,9 @@ public MinecraftInstanceParser(string minecraftFolderPath) /// All Minecraft instances parsed in this .minecraft profile public IReadOnlyCollection ParseAllInstances() { + _parsedInstances.Clear(); + _erroneousDirectories.Clear(); + var versionsDirectory = new DirectoryInfo(Path.Combine(_minecraftFolderPath, "versions")); if (!versionsDirectory.Exists)