Home Commands Examples Getting Started With Scripts Global Keywords
Generic JSON Recipes

Metal

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.

script.zs
import mods.tfc.api.Metal;

Static Methods

Get all the registered metals

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

script.zs
// Metal.getAllMetals() as Metal[]
Metal.getAllMetals();

get the metal from ingot

Returns: metal found
Return Type: Metal

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

Methods

Return Type: string

script.zs
// Metal.getCommandString() as string
myMetal.getCommandString();

get a fluidstack from a metal

Returns:
Return Type: IFluidStack

script.zs
// Metal.getFluidStack(amount as int) as IFluidStack
<metal:tfc:copper>.getFluidStack(100);
ParameterTypeDescription
Parameter
amount
Type
int
Description
amount

return the item corresponding to that metal part

Returns:
Return Type: IItemStack

script.zs
// Metal.getMetalPart(partName as string) as IItemStack
<tfc:metal:copper>.getMetalPart("ingot");
ParameterTypeDescription
Parameter
partName
Type
string
Description
metal part name

Properties

NameTypeHas GetterHas Setter
Name
commandString
Type
string
Has Getter
true
Has Setter
false