Skip to content

Commit

Permalink
Fix error logging of gas stacks.
Browse files Browse the repository at this point in the history
  • Loading branch information
pupnewfster authored and dizzyd committed Mar 12, 2019
1 parent 3d6b202 commit bd5d064
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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);
}
}

0 comments on commit bd5d064

Please sign in to comment.