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
Copy
import mods.tfc.api.Metal;

Name: getAllMetals

Get all the registered metals

Returns: an array containing all registered metals
Return Type: Metal[]

ZenScript
Copy
// Metal.getAllMetals() as Metal[]

Metal.getAllMetals();

Link to getMetalFromIngot

Name: getMetalFromIngot

get the metal from ingot

Returns: metal found
Return Type: Metal

ZenScript
Copy
// Metal.getMetalFromIngot(stack as IItemStack) as Metal

Metal.getMetalFromIngot(<item:tfc:metal/ingot/copper>);
ParameterTypeDescription
Parameter
stack
Type
IItemStack
Description
ingot

Link to getCommandString

Name: getCommandString

Return Type: string

ZenScript
Copy
// Metal.getCommandString() as string

myMetal.getCommandString();

Name: getFluidStack

get a fluidstack from a metal

Returns:
Return Type: IFluidStack

ZenScript
Copy
// Metal.getFluidStack(amount as int) as IFluidStack

<metal:tfc:copper>.getFluidStack(100);
ParameterTypeDescription
Parameter
amount
Type
int
Description
amount

Name: getMetalPart

return the item corresponding to that metal part

Returns:
Return Type: IItemStack

ZenScript
Copy
// Metal.getMetalPart(partName as string) as IItemStack

<tfc:metal:copper>.getMetalPart("ingot");
ParameterTypeDescription
Parameter
partName
Type
string
Description
metal part name
NameTypeHas GetterHas Setter
Name
commandString
Type
string
Has Getter
true
Has Setter
false