SoilManager
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.SoilManager;
Description
Implements
SoilManager
implements the following interfaces:
IRecipeManager<Soil>
,CommandStringDisplayable
Undocumented Interfaces
Iterable<Recipe>
Members
addSoil(id as string, ingredient as IIngredient, displayState as DisplayState, categories as List<string>, growthModifier as float = 1.0, lightLevel as int = 0)
Adds a new soil.script.zs
// SoilManager.addSoil(id as string, ingredient as IIngredient, displayState as DisplayState, categories as List<string>, growthModifier as float = 1.0, lightLevel as int = 0);<recipetype:botanypots:soil>.addSoil("soil_test", <item:minecraft:dirt>, SimpleDisplayState.of(<blockstate:minecraft:diamond_block>), ["category1", "category2"], 1.5, 7);
Parameters:
id: string
Type: string
- The ID of the soil. categories: List<string>
Type: List<string>
- The categories that the soil belongs to. growthModifier: float
(optional) Type: float
- The optional growth modifier of the soil. Defaults to 1.
Default Value: 1.0
lightLevel: int
(optional) Type: int
- The optional light level that the soil gives. Defaults to 0.
Default Value: 0
Getter
// SoilManager.commandString as string<recipetype:botanypots:soil>.commandString
Return Type:
string
commandString() as string
// SoilManager.commandString() as string;<recipetype:botanypots:soil>.commandString();
Return Type:
string
getRecipesByOutput(output as IIngredient) as List<Recipe>
<recipetype:botanypots:soil>.getRecipesByOutput(myIIngredient);
Parameters:
output: IIngredient
Type: IIngredient
Return Type:
List<Recipe>
modify(id as string, modifier as BiFunction<BasicSoil, ResourceLocation, BasicSoil>) as bool
Modifies the given script.zs
BasicSoil
, replacing it with the new one from the function.Returns: true if the soil was found, and is a BasicSoil
, false otherwise.
// SoilManager.modify(id as string, modifier as BiFunction<BasicSoil, ResourceLocation, BasicSoil>) as bool;<recipetype:botanypots:soil>.modify("botanypots:minecraft/soil/dirt", (id, old) => BasicSoil.of(id, old. ingredient, old.displayState, old.categories, old.growthModifier, old.lightLevel));
Parameters:
id: string
Type: string
- The id of the soil to replace. modifier: BiFunction<BasicSoil, ResourceLocation, BasicSoil>
Type: BiFunction<BasicSoil, ResourceLocation, BasicSoil>
- the modifier to apply to the soil.
Return Type:
bool
Getter
<recipetype:botanypots:soil>.recipeMap
Return Type:
Recipe[ResourceLocation]
recipeMap() as Recipe[ResourceLocation]
removeAll()
// SoilManager.removeAll();<recipetype:botanypots:soil>.removeAll();
removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false)
// SoilManager.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);<recipetype:botanypots:soil>.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[])
// SoilManager.removeByName(names as string[]);<recipetype:botanypots:soil>.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)
// SoilManager.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);<recipetype:botanypots:soil>.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