forked from EnigmaticaModpacks/Enigmatica2Expert
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: ⚡increase HEI recipe iteration by 1-3 seconds
Since there istens of thouthands HEI recipes, rapid calling of progress bar steps caused excess second of waiting. https://spark.lucko.me/MRBZYLxzrN?hl=340125
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+35.8 KB
bansoukou/HadEnoughItems_1.12.2-4.25.4/mezz/jei/recipes/RecipeRegistry.class
Binary file not shown.
23 changes: 23 additions & 0 deletions
23
...a/bansoukou_diffs/HadEnoughItems_1.12.2-4.25.4/mezz/jei/recipes/RecipeRegistry.class.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@@ -204,11 +204,11 @@ implements IRecipeRegistry { | ||
private void addRecipes(List<Object> unsortedRecipes, ListMultiMap<String, Object> recipes) { | ||
Set entries = recipes.entrySet(); | ||
int step = 0; | ||
- ProgressManager.ProgressBar progressBar = ProgressManager.push((String)"Loading recipes", (int)(recipes.getTotalSize() + unsortedRecipes.size())); | ||
+ ProgressManager.ProgressBar progressBar = ProgressManager.push((String)"Loading recipes", (int)((recipes.getTotalSize() + unsortedRecipes.size()) / 100)); | ||
for (Map.Entry entry : entries) { | ||
String recipeCategoryUid = (String)entry.getKey(); | ||
for (Object recipe : (List)entry.getValue()) { | ||
- if (step % 100 == 0) { | ||
+ if (step % 100 == 99) { | ||
progressBar.step(""); | ||
} | ||
this.addRecipe(recipe, recipe.getClass(), recipeCategoryUid); | ||
@@ -216,7 +216,7 @@ implements IRecipeRegistry { | ||
} | ||
} | ||
for (Object recipe : unsortedRecipes) { | ||
- if (step % 100 == 0) { | ||
+ if (step % 100 == 99) { | ||
progressBar.step(""); | ||
} | ||
this.addRecipe(recipe, recipe.getClass(), null); |