Closed Ne0N-droid closed 1 year ago
please post your code here
I got the same problem. it's not a problem with the cmllib btw
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();
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 "";
}
}
What is FabricMCVersions? Visual Studion cant to find this namespace
lol it's just btw you don't need to do like that
https://www.fembed.com/v/177n0ybj7qrjp865 I showed the error in the link