AlloyRecipe
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.
import mods.tfc.AlloyRecipe;
Implemented Interfaces
AlloyRecipe implements the following interfaces. That means all methods defined in these interfaces are also available in AlloyRecipe
Methods
AlloyRecipe.addJsonRecipe(name as string, mapData as MapData)
Parameter | Type |
---|---|
Parameter name | Type string |
Parameter mapData | Type MapData |
Add an alloy recipe
// 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 |
Return Type: stdlib.List<T>
// AlloyRecipe.getAllRecipes() as stdlib.List<T>
<recipetype:tfc:alloy>.getAllRecipes();
Return Type: T
AlloyRecipe.getRecipeByName(name as string) as T
Parameter | Type |
---|---|
Parameter name | Type string |
Return Type: T[ResourceLocation]
// AlloyRecipe.getRecipeMap() as T[ResourceLocation]
<recipetype:tfc:alloy>.getRecipeMap();
Return Type: stdlib.List<T>
AlloyRecipe.getRecipesByOutput(output as IIngredient) as stdlib.List<T>
Parameter | Type |
---|---|
Parameter output | Type IIngredient |
AlloyRecipe.remove(output as IIngredient)
Parameter | Type |
---|---|
Parameter output | Type IIngredient |
// AlloyRecipe.removeAll()
<recipetype:tfc:alloy>.removeAll();
AlloyRecipe.removeByInput(input as IItemStack)
Parameter | Type |
---|---|
Parameter input | Type IItemStack |
AlloyRecipe.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 |
AlloyRecipe.removeByName(names as string[])
Parameter | Type |
---|---|
Parameter names | Type string[] |
AlloyRecipe.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
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 |