Skip to content

Commit

Permalink
Fixed invalid erroring case during loading Advancements form mods tha…
Browse files Browse the repository at this point in the history
…t don't have advancements.
  • Loading branch information
LexManos committed Jul 14, 2017
1 parent 6167bbf commit 6d35b1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/net/minecraftforge/common/ForgeHooks.java
Expand Up @@ -1305,7 +1305,8 @@ private static boolean loadAdvancements(Map<ResourceLocation, Advancement.Builde
}

return true;
}
},
true
);
}
}
Expand Up @@ -726,14 +726,21 @@ private static boolean loadRecipes(ModContainer mod)


public static boolean findFiles(ModContainer mod, String base, Function<Path, Boolean> preprocessor, BiFunction<Path, Path, Boolean> processor)
{
return findFiles(mod, base, preprocessor, processor, false);
}
public static boolean findFiles(ModContainer mod, String base, Function<Path, Boolean> preprocessor, BiFunction<Path, Path, Boolean> processor, boolean defaultUnfoundRoot)
{
FileSystem fs = null;
try
{
File source = mod.getSource();

if ("minecraft".equals(mod.getModId()) && DEBUG_LOAD_MINECRAFT)
if ("minecraft".equals(mod.getModId()))
{
if (!DEBUG_LOAD_MINECRAFT)
return true;

try
{
URI tmp = CraftingManager.class.getResource("/assets/.mcassetsroot").toURI();
Expand Down Expand Up @@ -766,7 +773,7 @@ else if (source.isDirectory())
}

if (root == null || !Files.exists(root))
return false;
return defaultUnfoundRoot;

if (preprocessor != null)
{
Expand Down

0 comments on commit 6d35b1b

Please sign in to comment.