Home Commands Examples Getting Started With Scripts Global Keywords
Generic Recipe Manipulation
CropManager FertilizerManager PotInteractionManager SoilManager

FertilizerManager

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import mods.botanypots.FertilizerManager;

Description

Implements

FertilizerManager implements the following interfaces:

IRecipeManager<Fertilizer>,CommandStringDisplayable

Undocumented Interfaces

Iterable<Recipe>

Members

addFertilizer(id as string, ingredient as IIngredient, minTicks as int, maxTicks as int, cropIngredient as IIngredient = null, soilIngredient as IIngredient = null)
Adds a fertilizer.
script.zs
// FertilizerManager.addFertilizer(id as string, ingredient as IIngredient, minTicks as int, maxTicks as int, cropIngredient as IIngredient = null, soilIngredient as IIngredient = null);
<recipetype:botanypots:fertilizer>.addFertilizer("fertilizer_test", <item:minecraft:diamond>, 20, 40, <item:minecraft:carrot>, <item:minecraft:dirt>);

Parameters:

id Type: string - The ID of the fertilizer.
ingredient Type: IIngredient - The item that triggers the fertilization.
minTicks Type: int - The minimum amount of ticks that the fertilizer applies.
maxTicks Type: int - The maximum amount of ticks that the fertilizer applies.
cropIngredient (optional) Type: IIngredient - The ingredient for the crop that the fertilizer affects.

Default Value: null

soilIngredient (optional) Type: IIngredient - The ingredient for the soil that the fertilizer affects.

Default Value: null

addJsonRecipe(name as string, mapData as MapData)
script.zs
// FertilizerManager.addJsonRecipe(name as string, mapData as MapData);
<recipetype:botanypots:fertilizer>.addJsonRecipe(myString, myMapData);

Parameters:

name Type: string
mapData Type: MapData
Getter
script.zs
// FertilizerManager.allRecipes as List<Recipe>
<recipetype:botanypots:fertilizer>.allRecipes

Return Type: List<Recipe>

allRecipes() as List<Recipe>
script.zs
// FertilizerManager.allRecipes() as List<Recipe>;
<recipetype:botanypots:fertilizer>.allRecipes();

Return Type: List<Recipe>

Getter
script.zs
// FertilizerManager.commandString as string
<recipetype:botanypots:fertilizer>.commandString

Return Type: string

commandString() as string
script.zs
// FertilizerManager.commandString() as string;
<recipetype:botanypots:fertilizer>.commandString();

Return Type: string

getRecipeByName(name as string) as Recipe
script.zs
// FertilizerManager.getRecipeByName(name as string) as Recipe;
<recipetype:botanypots:fertilizer>.getRecipeByName(myString);

Parameters:

name Type: string

Return Type: Recipe

getRecipesByOutput(output as IIngredient) as List<Recipe>
script.zs
// FertilizerManager.getRecipesByOutput(output as IIngredient) as List<Recipe>;
<recipetype:botanypots:fertilizer>.getRecipesByOutput(myIIngredient);

Parameters:

output Type: IIngredient

Return Type: List<Recipe>

modify(id as string, modifier as BiFunction<BasicFertilizer, ResourceLocation, BasicFertilizer>) as bool
Modifies the given BasicFertilizer, replacing it with the new one from the function.

Returns: true if the fertilizer was found, and is a BasicFertilizer, false otherwise.

script.zs
// FertilizerManager.modify(id as string, modifier as BiFunction<BasicFertilizer, ResourceLocation, BasicFertilizer>) as bool;
<recipetype:botanypots:fertilizer>.modify("botanypots:minecraft/fertilizer/bonemeal", (id, old) => BasicFertilizer.of(id, old.ingredient, old.minTicks, old.maxTicks * 10, old.cropIngredient, old.soilIngredient));

Parameters:

id Type: string - The id of the fertilizer to replace.
modifier Type: BiFunction<BasicFertilizer, ResourceLocation, BasicFertilizer> - the modifier to apply to the fertilizer.

Return Type: bool

Getter
script.zs
// FertilizerManager.recipeMap as Recipe[ResourceLocation]
<recipetype:botanypots:fertilizer>.recipeMap

Return Type: Recipe[ResourceLocation]

recipeMap() as Recipe[ResourceLocation]
script.zs
// FertilizerManager.recipeMap() as Recipe[ResourceLocation];
<recipetype:botanypots:fertilizer>.recipeMap();

Return Type: Recipe[ResourceLocation]

removeAll()
script.zs
// FertilizerManager.removeAll();
<recipetype:botanypots:fertilizer>.removeAll();
removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false)
script.zs
// FertilizerManager.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);
<recipetype:botanypots:fertilizer>.removeByModid(myString, myPredicate);

Parameters:

modid Type: string
exclude (optional) Type: function(t as string) as bool

Default Value: (name as string) as bool => false

removeByName(names as string[])
script.zs
// FertilizerManager.removeByName(names as string[]);
<recipetype:botanypots:fertilizer>.removeByName(myString[]);

Parameters:

names Type: string[]
removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false)
script.zs
// FertilizerManager.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);
<recipetype:botanypots:fertilizer>.removeByRegex(myString, myPredicate);

Parameters:

regex Type: string
exclude (optional) Type: function(t as string) as bool

Default Value: (name as string) as bool => false