Oil Gen (Actually Additions)
Description
Turns a fluid into power at a rate.
Identifier
Refer to this via any of the following:
mods.aa.oil_gen
mods.aa.oilgen
mods.aa.oilGen
mods.aa.OilGen
mods.actuallyadditions.oil_gen/* Used as page default */
mods.actuallyadditions.oilgen
mods.actuallyadditions.oilGen
mods.actuallyadditions.OilGen
Adding Recipes
Recipe Builder
Just like other recipe types, the Oil Gen also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.actuallyadditions.oil_gen.recipeBuilder()
FluidStackList
. Sets the fluid inputs of the recipe. Requires exactly 1.groovyfluidInput(FluidStack) fluidInput(FluidStack...) fluidInput(Collection<FluidStack>)
int
. Sets how long the fluid burns for. Requires greater than or equal to 0. (Default0
).groovytime(int)
int
. Sets how much power is generated per tick while fluid is being consumed. Requires greater than or equal to 0. (Default0
).groovyamount(int) fluidInput(FluidStack)
First validates the builder, returning
null
and outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returnsnull
orde.ellpeck.actuallyadditions.api.recipe.OilGenRecipe
).groovyregister()
Example
mods.actuallyadditions.oil_gen.recipeBuilder()
.fluidInput(fluid('water'))
.amount(1000)
.time(50)
.register()
mods.actuallyadditions.oil_gen.recipeBuilder()
.fluidInput(fluid('lava') * 50)
.time(100)
.register()
Removing Recipes
Removes all recipes that match the given input:
groovymods.actuallyadditions.oil_gen.removeByInput(Fluid)
Removes all recipes that match the given input:
groovymods.actuallyadditions.oil_gen.removeByInput(FluidStack)
Removes all recipes that match the given input:
groovymods.actuallyadditions.oil_gen.removeByInput(String)
Removes all registered recipes:
groovymods.actuallyadditions.oil_gen.removeAll()
Example
mods.actuallyadditions.oil_gen.removeByInput(fluid('canolaoil').getFluid())
mods.actuallyadditions.oil_gen.removeByInput(fluid('canolaoil'))
mods.actuallyadditions.oil_gen.removeByInput('refinedcanolaoil')
mods.actuallyadditions.oil_gen.removeAll()
Getting the value of recipes
Iterates through every entry in the registry, with the ability to call remove on any element to remove it:
groovymods.actuallyadditions.oil_gen.streamRecipes()