AlloyRecipe
Link to alloyrecipe
Importing the class
Link to importing-the-class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport mods.tfc.AlloyRecipe;
Implemented Interfaces
Link to implemented-interfaces
AlloyRecipe implements the following interfaces. That means all methods defined in these interfaces are also available in AlloyRecipe
Methods
Link to methods
Name: addJsonRecipe
ZenScript CopyAlloyRecipe.addJsonRecipe(name as string, mapData as MapData)
Parameter | Type |
---|---|
Parameter name | Type string |
Parameter mapData | Type MapData |
Name: addRecipe
Add an alloy recipe
ZenScript Copy// AlloyRecipe.addRecipe(name as string, consumer as Consumer<AlloyBuilder>)
<recipetype:tfc:alloy>.addRecipe("alloy_test", (alloy) => {
alloy.Add("tfc:tin", 0.08, 0.12);
alloy.Add("tfc:copper", 0.88, 0.92);
alloy.Output("tfc:bronze");
// can also do it this way
// alloy.Add(<metal:tfc:tin>, 0.08, 0.12);
// alloy.Add(<metal:tfc:copper>, 0.88, 0.92);
// alloy.Output(<metal:tfc:bronze>);
});
Parameter | Type | Description |
---|---|---|
Parameter name | Type string | Description recipe name |
Parameter consumer | Type Consumer<AlloyBuilder> | Description builder |
Name: getAllRecipes
Return Type: stdlib.List<T>
ZenScript Copy// AlloyRecipe.getAllRecipes() as stdlib.List<T>
<recipetype:tfc:alloy>.getAllRecipes();
Name: getRecipeByName
Return Type: T
ZenScript CopyAlloyRecipe.getRecipeByName(name as string) as T
Parameter | Type |
---|---|
Parameter name | Type string |
Name: getRecipeMap
Return Type: T[ResourceLocation]
ZenScript Copy// AlloyRecipe.getRecipeMap() as T[ResourceLocation]
<recipetype:tfc:alloy>.getRecipeMap();
Name: getRecipesByOutput
Return Type: stdlib.List<T>
ZenScript CopyAlloyRecipe.getRecipesByOutput(output as IIngredient) as stdlib.List<T>
Parameter | Type |
---|---|
Parameter output | Type IIngredient |
Name: remove
ZenScript CopyAlloyRecipe.remove(output as IIngredient)
Parameter | Type |
---|---|
Parameter output | Type IIngredient |
Name: removeAll
ZenScript Copy// AlloyRecipe.removeAll()
<recipetype:tfc:alloy>.removeAll();
Name: removeByInput
ZenScript CopyAlloyRecipe.removeByInput(input as IItemStack)
Parameter | Type |
---|---|
Parameter input | Type IItemStack |
Name: removeByModid
ZenScript CopyAlloyRecipe.removeByModid(modid as string, exclude as Predicate<string>)
Parameter | Type | Optional | Default Value |
---|---|---|---|
Parameter modid | Type string | Optional false | Default Value |
Parameter exclude | Type Predicate<string> | Optional true | Default Value (name as string) as bool => false |
Name: removeByName
ZenScript CopyAlloyRecipe.removeByName(names as string[])
Parameter | Type |
---|---|
Parameter names | Type string[] |
Name: removeByRegex
ZenScript CopyAlloyRecipe.removeByRegex(regex as string, exclude as Predicate<string>)
Parameter | Type | Optional | Default Value |
---|---|---|---|
Parameter regex | Type string | Optional false | Default Value |
Parameter exclude | Type Predicate<string> | Optional true | Default Value (name as string) as bool => false |
Properties
Link to properties
Name | Type | Has Getter | Has Setter |
---|---|---|---|
Name allRecipes | Type stdlib.List<T> | Has Getter true | Has Setter false |
Name recipeMap | Type T[ResourceLocation] | Has Getter true | Has Setter false |