From bd5d064bd0e6446cf0da8aa514ec9bc7dcd3b017 Mon Sep 17 00:00:00 2001 From: pupnewfster Date: Mon, 11 Mar 2019 18:12:57 -0400 Subject: [PATCH] Fix error logging of gas stacks. --- .../crafttweaker/util/IngredientWrapper.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/mekanism/common/integration/crafttweaker/util/IngredientWrapper.java b/src/main/java/mekanism/common/integration/crafttweaker/util/IngredientWrapper.java index 286211882ef..566a312a03e 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/util/IngredientWrapper.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/util/IngredientWrapper.java @@ -3,6 +3,7 @@ import com.blamejared.mtlib.helpers.LogHelper; import crafttweaker.api.item.IIngredient; import crafttweaker.api.item.IngredientAny; +import mekanism.common.integration.crafttweaker.gas.IGasStack; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; public class IngredientWrapper { @@ -63,13 +64,13 @@ public int getAmount() { public String toString() { String output = ""; if (!left.equals(IngredientAny.INSTANCE)) { - output += LogHelper.getStackDescription(left); + output += getDescriptor(left); } if (!middle.equals(IngredientAny.INSTANCE)) { - output += ", " + LogHelper.getStackDescription(middle); + output += ", " + getDescriptor(middle); } if (!right.equals(IngredientAny.INSTANCE)) { - output += ", " + LogHelper.getStackDescription(right); + output += ", " + getDescriptor(right); } if (!infuseType.isEmpty()) { output += ", " + infuseType; @@ -81,4 +82,8 @@ public boolean isEmpty() { return left.equals(IngredientAny.INSTANCE) && middle.equals(IngredientAny.INSTANCE) && right .equals(IngredientAny.INSTANCE) && infuseType.isEmpty(); } + + private String getDescriptor(IIngredient ingredient) { + return ingredient instanceof IGasStack ? ingredient.toString() : LogHelper.getStackDescription(ingredient); + } } \ No newline at end of file