mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Improve CraftTweaker logging of gases
This commit is contained in:
3 files changed
+12
-8
No files matched your search
+2
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
+9
-5
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user