Skip to content

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:

groovy
mods.industrialforegoing.straw/* Used as page default */
mods.industrialforegoing.Straw

Adding Recipes

  • Adds a Straw recipe in the format fluidInput, effect:

    groovy
    mods.industrialforegoing.straw.add(FluidStack, Collection<PotionEffect>)
  • Adds a Straw recipe in the format name, fluidInput, effect:

    groovy
    mods.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.

    groovy
    name(String)
    name(ResourceLocation)
  • FluidStackList. Sets the fluid inputs of the recipe. Requires exactly 1.

    groovy
    fluidInput(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.

    groovy
    effect(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. (returns null or com.buuz135.industrial.api.straw.StrawHandler).

    groovy
    register()
Example
groovy
mods.industrialforegoing.straw.recipeBuilder()
    .fluidInput(fluid('if.pink_slime'))
    .effect(new PotionEffect(potion('minecraft:strength'), 1800, 3))
    .register()

Removing Recipes

  • Removes all registered recipes:

    groovy
    mods.industrialforegoing.straw.removeAll()
Example
groovy
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:

    groovy
    mods.industrialforegoing.straw.streamRecipes()

Contributors

Changelog

© 2024 CleanroomMC. All Rights Reserved.