Fix ModList cache never being updated (#5081)
This commit is contained in:
parent
21097a4122
commit
dd0c251b3d
|
@ -99,8 +99,11 @@ public class LibraryManager
|
|||
for (ModList list : ModList.getKnownLists(minecraftHome))
|
||||
{
|
||||
Repository repo = list.getRepository() == null ? libraries_dir : list.getRepository();
|
||||
for (Artifact artifact : list.getArtifacts())
|
||||
List<Artifact> artifacts = list.getArtifacts();
|
||||
// extractPacked adds artifacts to the list. As such, we can't use an Iterator to traverse it.
|
||||
for (int i = 0; i < artifacts.size(); i++)
|
||||
{
|
||||
Artifact artifact = artifacts.get(i);
|
||||
Artifact resolved = repo.resolve(artifact);
|
||||
if (resolved != null)
|
||||
{
|
||||
|
|
|
@ -50,8 +50,7 @@ public class ModList
|
|||
try
|
||||
{
|
||||
String key = json.getCanonicalFile().getAbsolutePath();
|
||||
if (cache.containsKey(key))
|
||||
return cache.get(key);
|
||||
return cache.computeIfAbsent(key, k -> new ModList(json, mcdir));
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue