mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-20 12:20:00 +00:00
Concurrent recipe profiler (#478)
* concurrent recipe profiler * eliminate NPE by giving nulls a name
This commit is contained in:
1 parent
9fd9aad357
commit
5056fe5437
7 files changed
+77
-18
No files matched your search
@@ -18,8 +18,9 @@ public class GuiUsageRecipe extends GuiRecipe<IUsageHandler> {
|
||||
public static boolean openRecipeGui(String inputId, Object... ingredients) {
|
||||
|
||||
if ("item".equals(inputId)) {
|
||||
ingredients = Arrays.asList(ingredients).stream().map(ingr -> normalizeItemStack((ItemStack) ingr))
|
||||
.toArray();
|
||||
for (int i = 0; i < ingredients.length; i++) {
|
||||
ingredients[i] = normalizeItemStack((ItemStack) ingredients[i]);
|
||||
}
|
||||
}
|
||||
|
||||
final ArrayList<IUsageHandler> handlers = getUsageHandlers(inputId, ingredients);
|
||||
@@ -52,7 +53,7 @@ public class GuiUsageRecipe extends GuiRecipe<IUsageHandler> {
|
||||
"inputId: " + inputId,
|
||||
"ingredients: " + Arrays.toString(ingredients));
|
||||
|
||||
return recipeQuery.runWithProfiling("recipe.concurrent.usage");
|
||||
return recipeQuery.runWithProfiling(NEIClientUtils.translate("recipe.concurrent.usage"));
|
||||
}
|
||||
|
||||
private static ItemStack normalizeItemStack(ItemStack stack) {
|
||||
|
||||
Reference in new issue
Block a user