use of mekanism.common.integration.projecte.NSSGas in project Mekanism by mekanism.
the class ItemStackGasToItemStackRecipeMapper method handleRecipe.
@Override
public boolean handleRecipe(IMappingCollector<NormalizedSimpleStack, Long> mapper, IRecipe<?> iRecipe, INSSFakeGroupManager groupManager) {
if (!(iRecipe instanceof ItemStackGasToItemStackRecipe)) {
// Double check that we have a type of recipe we know how to handle
return false;
}
boolean handled = false;
ItemStackGasToItemStackRecipe recipe = (ItemStackGasToItemStackRecipe) iRecipe;
List<@NonNull ItemStack> itemRepresentations = recipe.getItemInput().getRepresentations();
List<@NonNull GasStack> gasRepresentations = recipe.getChemicalInput().getRepresentations();
for (GasStack gasRepresentation : gasRepresentations) {
NSSGas nssGas = NSSGas.createGas(gasRepresentation);
long gasAmount = gasRepresentation.getAmount() * TileEntityAdvancedElectricMachine.BASE_TICKS_REQUIRED;
for (ItemStack itemRepresentation : itemRepresentations) {
ItemStack output = recipe.getOutput(itemRepresentation, gasRepresentation);
if (!output.isEmpty()) {
IngredientHelper ingredientHelper = new IngredientHelper(mapper);
ingredientHelper.put(itemRepresentation);
ingredientHelper.put(nssGas, gasAmount);
if (ingredientHelper.addAsConversion(output)) {
handled = true;
}
}
}
}
return handled;
}
use of mekanism.common.integration.projecte.NSSGas 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;
}
Aggregations