Create normalizeRecipeQueryStack (#772)

Co-authored-by: Martin Robertz <[email protected]>
This commit is contained in:
slprimeandMartin Robertz authored and GitHub committed 2025-11-05 23:15:45 +02:00
1 parent adc5a5df16
commit ef8a7d8bd5
5 files changed
+46 -34

No files matched your search

@@ -12,7 +12,6 @@ import codechicken.nei.ItemPanels;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.NEIClientUtils;
import codechicken.nei.recipe.Recipe.RecipeId;
import codechicken.nei.recipe.stackinfo.GTFluidStackStringifyHandler;
public class GuiUsageRecipe extends GuiRecipe<IUsageHandler> {
@@ -22,9 +21,9 @@ public class GuiUsageRecipe extends GuiRecipe<IUsageHandler> {
public static boolean openRecipeGui(String inputId, Object... ingredients) {
if ("item".equals(inputId)) {
for (int i = 0; i < ingredients.length; i++) {
ingredients[i] = normalizeItemStack((ItemStack) ingredients[i]);
for (int i = 0; i < ingredients.length; i++) {
if (ingredients[i] instanceof ItemStack stack) {
ingredients[i] = StackInfo.normalizeRecipeQueryStack(stack.copy());
}
}
@@ -66,13 +65,6 @@ public class GuiUsageRecipe extends GuiRecipe<IUsageHandler> {
return recipeQuery.runWithProfiling(NEIClientUtils.translate("recipe.concurrent.usage"));
}
private static ItemStack normalizeItemStack(ItemStack stack) {
GTFluidStackStringifyHandler.replaceAE2FCFluidDrop = true;
stack = StackInfo.loadFromNBT(StackInfo.itemStackToNBT(stack));
GTFluidStackStringifyHandler.replaceAE2FCFluidDrop = false;
return stack;
}
public static void registerUsageHandler(IUsageHandler handler) {
final String handlerId = handler.getHandlerId();