Improve CraftTweaker logging of gases

This commit is contained in:
pupnewfster committed 2019-03-12 22:46:50 -04:00
1 parent 5a4c86dacc
commit 6afbd88b91
3 files changed
+12 -8

No files matched your search

@@ -140,11 +140,11 @@ public class CraftTweakerGasStack implements IGasStack {
@Override
public String toCommandString() {
return toString();
return String.format("<gas:%s>", stack.getGas().getName());
}
@Override
public String toString() {
return String.format("<gas:%sx%dmb>", stack.getGas().getName(), stack.amount);
return String.format("<gas:%s> * %s", stack.getGas().getName(), stack.amount);
}
}
@@ -2,6 +2,7 @@ package mekanism.common.integration.crafttweaker.helpers;
import com.blamejared.mtlib.helpers.LogHelper;
import java.util.Map;
import mekanism.api.gas.GasStack;
import mekanism.common.recipe.inputs.MachineInput;
import mekanism.common.recipe.machines.MachineRecipe;
import mekanism.common.recipe.outputs.ChanceOutput;
@@ -22,20 +23,23 @@ public class RecipeInfoHelper {
if (output instanceof ItemStackOutput) {
return LogHelper.getStackDescription(((ItemStackOutput) output).output);
} else if (output instanceof GasOutput) {
return LogHelper.getStackDescription(((GasOutput) output).output);
return getGasName(((GasOutput) output).output);
} else if (output instanceof FluidOutput) {
return LogHelper.getStackDescription(((FluidOutput) output).output);
} else if (output instanceof ChemicalPairOutput) {
ChemicalPairOutput out = (ChemicalPairOutput) output;
return "[" + LogHelper.getStackDescription(out.leftGas) + ", " + LogHelper.getStackDescription(out.rightGas)
+ "]";
return "[" + getGasName(out.leftGas) + ", " + getGasName(out.rightGas) + "]";
} else if (output instanceof ChanceOutput) {
return LogHelper.getStackDescription(((ChanceOutput) output).primaryOutput);
} else if (output instanceof PressurizedOutput) {
PressurizedOutput out = (PressurizedOutput) output;
return "[" + LogHelper.getStackDescription(out.getItemOutput()) + ", " + LogHelper
.getStackDescription(out.getGasOutput()) + "]";
return "[" + LogHelper.getStackDescription(out.getItemOutput()) + ", " + getGasName(out.getGasOutput())
+ "]";
}
return null;
}
public static String getGasName(GasStack stack) {
return String.format("<gas:%s>", stack.getGas().getName());
}
}
@@ -84,6 +84,6 @@ public class IngredientWrapper {
}
private String getDescriptor(IIngredient ingredient) {
return ingredient instanceof IGasStack ? ingredient.toString() : LogHelper.getStackDescription(ingredient);
return ingredient instanceof IGasStack ? ingredient.toCommandString() : LogHelper.getStackDescription(ingredient);
}
}