Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix/easymoderecipes2' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Feb 14, 2024
2 parents 2b5efaf + 84b60b8 commit 6f6894c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main/java/appeng/core/RecipeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ public RecipeLoader(@Nonnull final File recipeDirectory, @Nonnull final CustomRe

@Override
public final void run() {
final String recipesFolder = Loader.isModLoaded("dreamcraft") ? ASSETS_RECIPE_PATH : ASSETS_EASY_RECIPE_PATH;
boolean useResourceFallBack = true;

if (this.config.isEnabled()) {
// setup copying
final RecipeResourceCopier copier = new RecipeResourceCopier("assets/appliedenergistics2/recipes/");
final RecipeResourceCopier copier = new RecipeResourceCopier(recipesFolder.substring(1));

final File generatedRecipesDir = new File(this.recipeDirectory, "generated");
final File userRecipesDir = new File(this.recipeDirectory, "user");
Expand All @@ -87,20 +90,17 @@ public final void run() {

// parse recipes prioritising the user scripts by using the generated as template
this.handler.parseRecipes(new ConfigLoader(generatedRecipesDir, userRecipesDir), "index.recipe");

useResourceFallBack = false;
}
// on failure use jar parsing
catch (final IOException | URISyntaxException e) {
AELog.debug(e);
this.handler.parseRecipes(new JarLoader(ASSETS_RECIPE_PATH), "index.recipe");
if (!Loader.isModLoaded("dreamcraft")) {
this.handler.parseRecipes(new JarLoader(ASSETS_EASY_RECIPE_PATH), "index.recipe");
}
}
} else {
this.handler.parseRecipes(new JarLoader(ASSETS_RECIPE_PATH), "index.recipe");
if (!Loader.isModLoaded("dreamcraft")) {
this.handler.parseRecipes(new JarLoader(ASSETS_EASY_RECIPE_PATH), "index.recipe");
}
}

if (useResourceFallBack) {
this.handler.parseRecipes(new JarLoader(recipesFolder), "index.recipe");
}
}
}

0 comments on commit 6f6894c

Please sign in to comment.