Straw (Industrial Foregoing)
Description
Converts an fluid block in-world into various effects for the player when consumed via a straw.
Identifier
Refer to this via any of the following:
mods.industrialforegoing.straw/* Used as page default */
mods.industrialforegoing.Straw
Adding Recipes
Adds a Straw recipe in the format
fluidInput
,effect
:groovymods.industrialforegoing.straw.add(FluidStack, Collection<PotionEffect>)
Adds a Straw recipe in the format
name
,fluidInput
,effect
:groovymods.industrialforegoing.straw.add(String, FluidStack, Collection<PotionEffect>)
Recipe Builder
Just like other recipe types, the Straw also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.industrialforegoing.straw.recipeBuilder()
ResourceLocation
. Sets the Resource Location of the recipe.groovyname(String) name(ResourceLocation)
FluidStackList
. Sets the fluid inputs of the recipe. Requires exactly 1.groovyfluidInput(FluidStack) fluidInput(FluidStack...) fluidInput(Collection<FluidStack>)
Collection<PotionEffect>
. Sets what potion effects are given upon consuming the fluid. Requires greater than or equal to 1.groovyeffect(PotionEffect) effect(PotionEffect...) effect(Collection<PotionEffect>)
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
orcom.buuz135.industrial.api.straw.StrawHandler
).groovyregister()
Example
mods.industrialforegoing.straw.recipeBuilder()
.fluidInput(fluid('if.pink_slime'))
.effect(new PotionEffect(potion('minecraft:strength'), 1800, 3))
.register()
Removing Recipes
Removes all registered recipes:
groovymods.industrialforegoing.straw.removeAll()
Example
mods.industrialforegoing.straw.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.industrialforegoing.straw.streamRecipes()