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

PotInteractionManager

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.PotInteractionManager;

Description

Implements

PotInteractionManager implements the following interfaces:

IRecipeManager<PotInteraction>,CommandStringDisplayable

Undocumented Interfaces

Iterable<Recipe>

Members

addInteraction(id as string, heldTest as IIngredient, damageHeld as bool, soilTest as IIngredient = null, seedTest as IIngredient = null, newSoilStack as IItemStack = null, newSeedStack as IItemStack = null, sound as Sound = null, extraDrops as IItemStack[] = [] as crafttweaker.api.item.IItemStack[])
Adds a new interaction to the pot.
script.zs
// PotInteractionManager.addInteraction(id as string, heldTest as IIngredient, damageHeld as bool, soilTest as IIngredient = null, seedTest as IIngredient = null, newSoilStack as IItemStack = null, newSeedStack as IItemStack = null, sound as Sound = null, extraDrops as IItemStack[] = [] as crafttweaker.api.item.IItemStack[]);
<recipetype:botanypots:pot_interaction>.addInteraction("interaction_test", <item:minecraft:diamond>, false, null, null, null, <item:minecraft:iron_ingot>, Sound.of(<soundevent:minecraft:ambient.basalt_deltas.additions>, <constant:minecraft:sound/source:neutral>, 1,1), [<item:minecraft:stick>]);

Parameters:

id Type: string - The ID of the interaction.
heldTest Type: IIngredient - The ingredient that should be held
damageHeld Type: bool - Whether the held item should be damaged during the interaction.
soilTest (optional) Type: IIngredient - What soil does this interaction happen on.

Default Value: null

seedTest (optional) Type: IIngredient - What seed is this interaction for

Default Value: null

newSoilStack (optional) Type: IItemStack - The new soil stack to replace the current soil.

Default Value: null

newSeedStack (optional) Type: IItemStack - The new seed stack to replace the current seed.

Default Value: null

sound (optional) Type: Sound - The sound to play during the interaction.

Default Value: null

extraDrops (optional) Type: IItemStack[] - Additional items to drop during the interaction.

Default Value: [] as crafttweaker.api.item.IItemStack[]

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

Parameters:

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

Return Type: List<Recipe>

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

Return Type: List<Recipe>

Getter
script.zs
// PotInteractionManager.commandString as string
<recipetype:botanypots:pot_interaction>.commandString

Return Type: string

commandString() as string
script.zs
// PotInteractionManager.commandString() as string;
<recipetype:botanypots:pot_interaction>.commandString();

Return Type: string

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

Parameters:

name Type: string

Return Type: Recipe

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

Parameters:

output Type: IIngredient

Return Type: List<Recipe>

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

Returns: true if the interaction was found, and is a BasicPotInteraction, false otherwise.

script.zs
// PotInteractionManager.modify(id as string, modifier as BiFunction<BasicPotInteraction, ResourceLocation, BasicPotInteraction>) as bool;
<recipetype:botanypots:pot_interaction>.modify("botanypots:minecraft/pot_interaction/till_farmland", (id, old) => BasicPotInteraction.of(id, old.heldTest, old.damageHeld, old.soilTest, old.seedTest, old.newSoilStack, old.newSeedStack, old.sound, old.extraDrops));

Parameters:

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

Return Type: bool

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

Return Type: Recipe[ResourceLocation]

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

Return Type: Recipe[ResourceLocation]

removeAll()
script.zs
// PotInteractionManager.removeAll();
<recipetype:botanypots:pot_interaction>.removeAll();
removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false)
script.zs
// PotInteractionManager.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);
<recipetype:botanypots:pot_interaction>.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
// PotInteractionManager.removeByName(names as string[]);
<recipetype:botanypots:pot_interaction>.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
// PotInteractionManager.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);
<recipetype:botanypots:pot_interaction>.removeByRegex(myString, myPredicate);

Parameters:

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

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