2015-07-10 16:46:19 +02:00
|
|
|
package modtweaker2.mods.mekanism.util;
|
|
|
|
|
|
|
|
|
|
import java.util.Map;
|
2015-07-13 17:34:06 +02:00
|
|
|
import java.util.Map.Entry;
|
2015-07-10 16:46:19 +02:00
|
|
|
|
2015-07-13 17:34:06 +02:00
|
|
|
import mekanism.common.recipe.inputs.MachineInput;
|
|
|
|
|
import mekanism.common.recipe.machines.CombinerRecipe;
|
|
|
|
|
import mekanism.common.recipe.machines.CrusherRecipe;
|
|
|
|
|
import mekanism.common.recipe.machines.CrystallizerRecipe;
|
|
|
|
|
import mekanism.common.recipe.machines.MachineRecipe;
|
|
|
|
|
import mekanism.common.recipe.outputs.ItemStackOutput;
|
|
|
|
|
import mekanism.common.recipe.outputs.MachineOutput;
|
|
|
|
|
import modtweaker2.helpers.LogHelper;
|
2015-07-10 16:46:19 +02:00
|
|
|
import modtweaker2.utils.BaseMapAddition;
|
|
|
|
|
|
2015-07-13 17:34:06 +02:00
|
|
|
@SuppressWarnings("rawtypes")
|
|
|
|
|
public class AddMekanismRecipe extends BaseMapAddition<MachineInput, MachineRecipe> {
|
|
|
|
|
public AddMekanismRecipe(String name, Map<MachineInput, MachineRecipe> map, Map<MachineInput, MachineRecipe> recipes) {
|
|
|
|
|
super(name, map, recipes);
|
2015-07-10 16:46:19 +02:00
|
|
|
}
|
2015-07-13 17:34:06 +02:00
|
|
|
|
|
|
|
|
public AddMekanismRecipe(String name, Map<MachineInput, MachineRecipe> map, MachineRecipe recipe) {
|
|
|
|
|
super(name, map);
|
|
|
|
|
|
|
|
|
|
recipes.put(recipe.getInput(), recipe);
|
2015-07-10 16:46:19 +02:00
|
|
|
}
|
2015-07-13 17:34:06 +02:00
|
|
|
|
2015-07-10 16:46:19 +02:00
|
|
|
@Override
|
2015-07-13 17:34:06 +02:00
|
|
|
protected String getRecipeInfo(Entry<MachineInput, MachineRecipe> recipe) {
|
|
|
|
|
MachineRecipe machineRecipe = recipe.getValue();
|
|
|
|
|
MachineOutput output = recipe.getValue().recipeOutput;
|
|
|
|
|
|
|
|
|
|
if(machineRecipe instanceof CombinerRecipe) {
|
|
|
|
|
return LogHelper.getStackDescription(((ItemStackOutput)output).output);
|
|
|
|
|
} else if (machineRecipe instanceof CrusherRecipe) {
|
|
|
|
|
return LogHelper.getStackDescription(((ItemStackOutput)output).output);
|
|
|
|
|
} else if (machineRecipe instanceof CrystallizerRecipe) {
|
|
|
|
|
return LogHelper.getStackDescription(((ItemStackOutput)output).output);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
2015-07-10 16:46:19 +02:00
|
|
|
}
|
|
|
|
|
}
|