Search in sources :

Example 1 with FluidKey

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);
}
Also used : FluidKey(gregtech.api.recipes.FluidKey) FuelRecipe(gregtech.api.recipes.recipes.FuelRecipe) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 2 with FluidKey

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;
}
Also used : FluidKey(gregtech.api.recipes.FluidKey) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 3 with FluidKey

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;
}
Also used : FluidKey(gregtech.api.recipes.FluidKey) FuelRecipe(gregtech.api.recipes.recipes.FuelRecipe)

Aggregations

FluidKey (gregtech.api.recipes.FluidKey)3 FuelRecipe (gregtech.api.recipes.recipes.FuelRecipe)2 ZenMethod (stanhebben.zenscript.annotations.ZenMethod)2