use of gregtech.api.recipes.FluidKey in project GregTech by GregTechCE.
the class FuelRecipeMap method addRecipe.
@ZenMethod
public void addRecipe(FuelRecipe fuelRecipe) {
FluidKey fluidKey = new FluidKey(fuelRecipe.getRecipeFluid());
if (recipeFluidMap.containsKey(fluidKey)) {
FuelRecipe oldRecipe = recipeFluidMap.remove(fluidKey);
recipeList.remove(oldRecipe);
}
recipeFluidMap.put(fluidKey, fuelRecipe);
recipeList.add(fuelRecipe);
}
use of gregtech.api.recipes.FluidKey in project GregTech by GregTechCE.
the class FuelRecipeMap method removeRecipe.
@ZenMethod
public boolean removeRecipe(FuelRecipe recipe) {
if (recipeList.contains(recipe)) {
this.recipeList.remove(recipe);
this.recipeFluidMap.remove(new FluidKey(recipe.getRecipeFluid()));
return true;
}
return false;
}
use of gregtech.api.recipes.FluidKey in project GregTech by GregTechCE.
the class FuelRecipeMap method findRecipe.
public FuelRecipe findRecipe(long maxVoltage, FluidStack inputFluid) {
if (inputFluid == null)
return null;
FluidKey fluidKey = new FluidKey(inputFluid);
FuelRecipe fuelRecipe = recipeFluidMap.get(fluidKey);
return fuelRecipe != null && fuelRecipe.matches(maxVoltage, inputFluid) ? fuelRecipe : null;
}
Aggregations