use of mekanism.common.integration.projecte.IngredientHelper in project Mekanism by mekanism.
the class ChemicalDissolutionRecipeMapper method handleRecipe.
@Override
public boolean handleRecipe(IMappingCollector<NormalizedSimpleStack, Long> mapper, IRecipe<?> iRecipe, INSSFakeGroupManager groupManager) {
if (!(iRecipe instanceof ChemicalDissolutionRecipe)) {
// Double check that we have a type of recipe we know how to handle
return false;
}
boolean handled = false;
ChemicalDissolutionRecipe recipe = (ChemicalDissolutionRecipe) iRecipe;
List<@NonNull ItemStack> itemRepresentations = recipe.getItemInput().getRepresentations();
List<@NonNull GasStack> gasRepresentations = recipe.getGasInput().getRepresentations();
for (GasStack gasRepresentation : gasRepresentations) {
NSSGas nssGas = NSSGas.createGas(gasRepresentation);
long gasAmount = gasRepresentation.getAmount() * TileEntityChemicalDissolutionChamber.BASE_TICKS_REQUIRED;
for (ItemStack itemRepresentation : itemRepresentations) {
BoxedChemicalStack output = recipe.getOutput(itemRepresentation, gasRepresentation);
if (!output.isEmpty()) {
IngredientHelper ingredientHelper = new IngredientHelper(mapper);
ingredientHelper.put(itemRepresentation);
ingredientHelper.put(nssGas, gasAmount);
if (ingredientHelper.addAsConversion(output.getChemicalStack())) {
handled = true;
}
}
}
}
return handled;
}
use of mekanism.common.integration.projecte.IngredientHelper in project Mekanism by mekanism.
the class FluidToFluidRecipeMapper method handleRecipe.
@Override
public boolean handleRecipe(IMappingCollector<NormalizedSimpleStack, Long> mapper, IRecipe<?> iRecipe, INSSFakeGroupManager groupManager) {
if (!(iRecipe instanceof FluidToFluidRecipe)) {
// Double check that we have a type of recipe we know how to handle
return false;
}
boolean handled = false;
FluidToFluidRecipe recipe = (FluidToFluidRecipe) iRecipe;
for (FluidStack representation : recipe.getInput().getRepresentations()) {
FluidStack output = recipe.getOutput(representation);
if (!output.isEmpty()) {
IngredientHelper ingredientHelper = new IngredientHelper(mapper);
ingredientHelper.put(representation);
if (ingredientHelper.addAsConversion(output)) {
handled = true;
}
}
}
return handled;
}
use of mekanism.common.integration.projecte.IngredientHelper in project Mekanism by mekanism.
the class ItemStackToGasRecipeMapper method handleRecipe.
@Override
public boolean handleRecipe(IMappingCollector<NormalizedSimpleStack, Long> mapper, IRecipe<?> iRecipe, INSSFakeGroupManager groupManager) {
if (!(iRecipe instanceof ItemStackToGasRecipe)) {
// Double check that we have a type of recipe we know how to handle
return false;
}
boolean handled = false;
ItemStackToGasRecipe recipe = (ItemStackToGasRecipe) iRecipe;
for (ItemStack representation : recipe.getInput().getRepresentations()) {
GasStack output = recipe.getOutput(representation);
if (!output.isEmpty()) {
IngredientHelper ingredientHelper = new IngredientHelper(mapper);
ingredientHelper.put(representation);
if (ingredientHelper.addAsConversion(output)) {
handled = true;
}
}
}
return handled;
}
use of mekanism.common.integration.projecte.IngredientHelper in project Mekanism by mekanism.
the class ItemStackToInfuseTypeRecipeMapper method handleRecipe.
@Override
public boolean handleRecipe(IMappingCollector<NormalizedSimpleStack, Long> mapper, IRecipe<?> iRecipe, INSSFakeGroupManager groupManager) {
if (!(iRecipe instanceof ItemStackToInfuseTypeRecipe)) {
// Double check that we have a type of recipe we know how to handle
return false;
}
boolean handled = false;
ItemStackToInfuseTypeRecipe recipe = (ItemStackToInfuseTypeRecipe) iRecipe;
for (ItemStack representation : recipe.getInput().getRepresentations()) {
InfusionStack output = recipe.getOutput(representation);
if (!output.isEmpty()) {
IngredientHelper ingredientHelper = new IngredientHelper(mapper);
ingredientHelper.put(representation);
if (ingredientHelper.addAsConversion(output)) {
handled = true;
}
}
}
return handled;
}
Aggregations