use of minechem.item.element.Element in project Minechem by iopleke.
the class ChemicalTurtlePeripheral method synthesisRecipeToMap.
private HashMap<String, Object> synthesisRecipeToMap(SynthesisRecipe recipe) {
HashMap<String, Object> result = new HashMap<String, Object>();
result.put("output", stackToMap(recipe.getOutput()));
result.put("shaped", recipe.isShaped());
result.put("energyCost", recipe.energyCost());
HashMap<Number, Object> inputs = new HashMap<Number, Object>();
PotionChemical[] recipeInputs = recipe.isShaped() ? recipe.getShapedRecipe() : recipe.getShapelessRecipe();
int i = 1;
for (PotionChemical chemical : recipeInputs) {
if (chemical != null) {
HashMap<String, Object> input = new HashMap<String, Object>();
if (chemical instanceof Element) {
input.put("element", ((Element) chemical).element.getLongName());
input.put("quantity", chemical.amount);
} else if (chemical instanceof Molecule) {
input.put("element", ((Molecule) chemical).molecule.name());
input.put("quantity", chemical.amount);
}
inputs.put(i++, input);
}
}
result.put("ingredients", inputs);
return result;
}
use of minechem.item.element.Element in project Minechem by iopleke.
the class MinechemBucketHandler method registerBucketDecomposerRecipe.
private void registerBucketDecomposerRecipe(ItemStack itemStack, MinechemChemicalType type) {
ArrayList<PotionChemical> tubes = new ArrayList<PotionChemical>();
tubes.add(new Element(ElementEnum.Fe, 48));
if (type instanceof ElementEnum) {
tubes.add(new Element((ElementEnum) type, 8));
} else if (type instanceof MoleculeEnum) {
tubes.add(new Molecule((MoleculeEnum) type, 8));
}
DecomposerRecipe.add(new DecomposerRecipe(itemStack, tubes));
}
Aggregations