CmlLib / CmlLib.Core

.NET Minecraft Launcher Library. All Version, Auth, Forge, Java, Crossplatform
MIT License
216 stars 42 forks source link

[BUG] starts the game with 1.19.1 instead of 1.19 #60

Closed Ne0N-droid closed 1 year ago

Ne0N-droid commented 2 years ago

https://www.fembed.com/v/177n0ybj7qrjp865 I showed the error in the link

AlphaBs commented 2 years ago

please post your code here

NoobNotFound commented 2 years ago

I got the same problem. it's not a problem with the cmllib btw

NoobNotFound commented 2 years ago

image

Ne0N-droid commented 2 years ago

please post your code here

        // Install fabric
        if (!fabricVersions.Any(x => x.Name.Contains("1.19")))
        {
            MessageBox.Show("Could not find minecraft version.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            Environment.Exit(1);
        }
        var targetVersions = fabricVersions.Where(x => x.Name.Contains("1.19"));
        var fabric = fabricVersions.GetVersionMetadata(targetVersions.First().Name);
        await fabric.SaveAsync(path);
        await launcher.GetAllVersionsAsync();
Ne0N-droid commented 2 years ago

resim

NoobNotFound commented 2 years ago

image

NoobNotFound commented 2 years ago

I got the fix. Use EndsWith instead of Contains

this is how I do it

public string SearchFabric(string ver)
        {
            var item = from t in FabricMCVersions where t.Name.EndsWith(ver) select t;
            if (item != null)
            {
                return item.FirstOrDefault().Name;
            }
            else
            {
                return "";
            }
        }
DmitryYalchik commented 2 years ago

What is FabricMCVersions? Visual Studion cant to find this namespace

NoobNotFound commented 2 years ago

lol it's just image image btw you don't need to do like that