Material
Link to material
A Material is what an item is made of, for example Platinum.
Импорт пакета
Link to импорт-пакета
It might be required for you to import the package if you encounter any issues, so better be safe than sorry and add the import.
import mods.contenttweaker.Material;
Retrieving such an object
Link to retrieving-such-an-object
You can either retrieve an existing Material using the MaterialSystem or create an entirely new one using the Material Builder
Fields
Link to fields
You can retrieve the following information from a Material:
ZenMethod | Возвращаемый тип | Описание |
---|---|---|
ZenMethod getName() | Возвращаемый тип string | Описание Returns the Material's name |
ZenMethod getColor() | Возвращаемый тип int | Описание Returns the Material's color |
ZenMethod isHasEffect() | Возвращаемый тип boolean | Описание Returns if the material has the glowing effect |
ZenMethod getUnlocalizedName() | Возвращаемый тип string | Описание Returns the Material's unlocalized name |
Register
Link to register-material-parts
You can either register parts using the part object or it's name string.
You can also either register a single part or multiple at once.
So you got 4 options in total:
ZenScript CopyregisterParts(String[] partNames);
registerParts(IPart[] parts);
registerPart(String partName);
registerPart(IPart part);
The registerPart Methods return a single MaterialPart object.
The registerParts Methods return a MaterialPart list.