Rotting Food (Better With Addons)
Description
Converts an input item into an output itemstack after the given time has passed. Has the ability to customize the terminology used to indicate the age.
Warning
When an item (regardless of metadata) is the input of any entry in the Rotting map, all items will gain a new NBT tag with the day they were obtained. This may be them annoying to interact with.
Identifier
Refer to this via any of the following:
mods.betterwithaddons.rotting/* Used as page default */
mods.betterwithaddons.Rotting
Adding Entries
Adds the given entry to the Rotting map:
groovymods.betterwithaddons.rotting.add(RotHandler.RotInfo)
Recipe Builder
Just like other recipe types, the Rotting Food also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.betterwithaddons.rotting.recipeBuilder()
IngredientList<IIngredient>
. Sets the item inputs of the recipe. Requires exactly 1.groovyinput(IIngredient) input(IIngredient...) input(Collection<IIngredient>)
String
. Sets the base key for the lang keys used to localize the stage the rotting is at. Requires not null. (Defaultfood
).groovykey(String)
long
. Sets how long the item takes to rot. Requires greater than or equal to 1. (DefaultInteractionBWA.MISC_ROT_TIME
).groovytime(long)
ItemStack
. Sets the item the rotted item turns into when the time has passed. Requires not empty. (Defaultnew ItemStack(ModItems.ROTTEN_FOOD)
).groovyrotted(ItemStack)
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
orbetterwithaddons.handler.RotHandler$RotInfo
).groovyregister()
Example
mods.betterwithaddons.rotting.recipeBuilder()
.input(item('minecraft:gold_ingot'))
.register()
mods.betterwithaddons.rotting.recipeBuilder()
.input(item('placeholdername:snack'))
.time(100)
.key('groovy_example')
.rotted(item('minecraft:clay') * 4)
.register()
Removing Entries
Adds the given entry to the Rotting map:
groovymods.betterwithaddons.rotting.add(Map.Entry<Item, RotHandler.RotInfo>)
Removes the given entry from the Rotting map:
groovymods.betterwithaddons.rotting.remove(Map.Entry<Item, RotHandler.RotInfo>)
Removes the given entry from the Rotting map:
groovymods.betterwithaddons.rotting.remove(RotHandler.RotInfo)
Removes all recipes that match the given input:
groovymods.betterwithaddons.rotting.removeByInput(IIngredient)
Removes all recipes that match the given output:
groovymods.betterwithaddons.rotting.removeByOutput(IIngredient)
Removes all registered recipes:
groovymods.betterwithaddons.rotting.removeAll()
Example
mods.betterwithaddons.rotting.removeByInput(item('betterwithaddons:food_cooked_rice'))
mods.betterwithaddons.rotting.removeByOutput(item('minecraft:rotten_flesh'))
mods.betterwithaddons.rotting.removeAll()
Getting the value of entries
Iterates through every entry in the registry, with the ability to call remove on any element to remove it:
groovymods.betterwithaddons.rotting.streamRecipes()