Concurrent recipe profiler (#478)

* concurrent recipe profiler

* eliminate NPE by giving nulls a name
This commit is contained in:
Lasm Gratel authored and GitHub committed 2024-05-04 13:50:56 +02:00
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) {