CmlLib.Core icon indicating copy to clipboard operation
CmlLib.Core copied to clipboard

[BUG] starts the game with 1.19.1 instead of 1.19

Open Ne0N-droid opened this issue 3 years ago • 9 comments

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

Ne0N-droid avatar Jun 22 '22 08:06 Ne0N-droid

please post your code here

AlphaBs avatar Jun 24 '22 05:06 AlphaBs

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

NoobNotFound avatar Jun 25 '22 08:06 NoobNotFound

image

NoobNotFound avatar Jun 25 '22 08:06 NoobNotFound

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 avatar Jun 25 '22 09:06 Ne0N-droid

resim

Ne0N-droid avatar Jun 25 '22 09:06 Ne0N-droid

image

NoobNotFound avatar Jun 25 '22 09:06 NoobNotFound

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 "";
            }
        }

NoobNotFound avatar Jun 25 '22 13:06 NoobNotFound

What is FabricMCVersions? Visual Studion cant to find this namespace

DmitryYalchik avatar Aug 08 '22 20:08 DmitryYalchik

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

NoobNotFound avatar Aug 09 '22 07:08 NoobNotFound