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.
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: string
Type: string
- The ID of the fertilizer. minTicks: int
Type: int
- The minimum amount of ticks that the fertilizer applies. maxTicks: int
Type: int
- The maximum amount of ticks that the fertilizer applies. cropIngredient: IIngredient
(optional) Type: IIngredient
- The ingredient for the crop that the fertilizer affects.
Default Value: null
soilIngredient: IIngredient
(optional) Type: IIngredient
- The ingredient for the soil that the fertilizer affects.
Default Value: null
Getter
// FertilizerManager.commandString as string<recipetype:botanypots:fertilizer>.commandString
Return Type:
string
commandString() as string
// FertilizerManager.commandString() as string;<recipetype:botanypots:fertilizer>.commandString();
Return Type:
string
getRecipesByOutput(output as IIngredient) as List<Recipe>
<recipetype:botanypots:fertilizer>.getRecipesByOutput(myIIngredient);
Parameters:
output: IIngredient
Type: IIngredient
Return Type:
List<Recipe>
modify(id as string, modifier as BiFunction<BasicFertilizer, ResourceLocation, BasicFertilizer>) as bool
Modifies the given script.zs
BasicFertilizer
, replacing it with the new one from the function.Returns: true if the fertilizer was found, and is a BasicFertilizer
, false otherwise.
// 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: string
Type: string
- The id of the fertilizer to replace. modifier: BiFunction<BasicFertilizer, ResourceLocation, BasicFertilizer>
Type: BiFunction<BasicFertilizer, ResourceLocation, BasicFertilizer>
- the modifier to apply to the fertilizer.
Return Type:
bool
Getter
<recipetype:botanypots:fertilizer>.recipeMap
Return Type:
Recipe[ResourceLocation]
recipeMap() as Recipe[ResourceLocation]
removeAll()
// FertilizerManager.removeAll();<recipetype:botanypots:fertilizer>.removeAll();
removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false)
// 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: string
Type: string
exclude: function(t as string) as bool
(optional) Type: function(t as string) as bool
Default Value: (name as string) as bool => false
removeByName(names as string[])
// FertilizerManager.removeByName(names as string[]);<recipetype:botanypots:fertilizer>.removeByName(myString[]);
Parameters:
names: string[]
Type: string[]
removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false)
// 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: string
Type: string
exclude: function(t as string) as bool
(optional) Type: function(t as string) as bool
Default Value: (name as string) as bool => false