Fix error logging of gas stacks.

This commit is contained in:
pupnewfster authored and Dave Smith committed 2019-03-12 11:36:52 -06:00
1 parent 3d6b202bd5
commit bd5d064bd0
1 file changed
+8 -3
@@ -3,6 +3,7 @@ package mekanism.common.integration.crafttweaker.util;
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 class IngredientWrapper {
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 class IngredientWrapper {
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);
}
}