Added ability to remove fluidgenerator recipe via CT. Closes #1404

This commit is contained in:
drcrazy 2018-01-19 11:17:36 +03:00
parent 91a56077d8
commit c69b9f46b6
2 changed files with 44 additions and 0 deletions

View file

@ -27,6 +27,7 @@ package techreborn.api.generator;
import net.minecraftforge.fluids.Fluid;
import java.util.EnumMap;
import java.util.Optional;
public class GeneratorRecipeHelper {
@ -62,4 +63,18 @@ public class GeneratorRecipeHelper {
public static FluidGeneratorRecipeList getFluidRecipesForGenerator(EFluidGenerator generatorType) {
return fluidRecipes.get(generatorType);
}
/**
* Removes recipe
*
* @param generatorType A value of the EFluidGenerator type for which we should remove recipe
* @param fluidType Fluid to remove from generator recipes
*/
public static void removeFluidRecipe(EFluidGenerator generatorType, Fluid fluidType) {
FluidGeneratorRecipeList recipeList = getFluidRecipesForGenerator(generatorType);
Optional<FluidGeneratorRecipe> recipe = recipeList.getRecipeForFluid(fluidType);
if (recipe.isPresent()) {
recipeList.removeRecipe(recipe.get());
}
}
}