PartType
A PartType can be seen as a group that several parts fit in, e.g. items
Importing the package
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.PartType;
Retrieving such an object
You can use the MaterialSystem to either retrieve an existing PartType object or create an entirely new one.
Check out below entry to learn how to create a new PartType.
Following types are pre-registered:
- item
- block
- ore
- fluid
- armor
- minecart
ZenMethods
You can retrieve the following information from a PartType:
ZenMethod | Return Type |
---|---|
ZenMethod getName() | Return Type string |
You can set the following information on a PartType:
ZenMethod | Parameter Type |
---|---|
ZenMethod setData(IPartDataPiece[] data); | Parameter Type IPartDataPiece[] data |
Create a new PartType
If you, for whatever reason would ever need to register a new PartType, you will need to know two things:
- What name the new partType will have
- How MaterialParts created from Parts that are of this type will be registered
The first is simple, it’s a string.
The second is a bit trickier, it’s a function that takes a MaterialPart as input: