A Part is the form an item is in, for example a gear or an ore.

Importing the package

Link to 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.Part;

Retrieving such an object

Link to retrieving-such-an-object

You can either retrieve an existing Part using the MaterialSystem or create an entirely new one using the Part Builder

Following types are pre-registered (Headlines are the Part types):
  • Beamicon
  • Bolticon
  • Casingicon
  • Clumpicon
  • Crystal Crystalicon
  • Crushed Ore (crushed_ore)icon
  • Dense Plate (dense_plate)icon
  • Dirty Dust (dirty_dust)icon
  • Dusticon
  • Gearicon
  • Ingoticon
  • Nuggeticon
  • Plateicon
  • Rodicon
  • Shardicon
  • Blockicon
  • Ore
  • Dense Ore (dense_ore)
  • Poor Ore(poor_ore)
  • Molten

  • Armor head iconchest iconlegs iconfeet icon
  • Minecart

You can retrieve the following information from a Part:

ZenMethodReturn Type
ZenMethod
hasOverlay()
Return Type
boolean
ZenMethod
getName()
Return Type
string
ZenMethod
getUnlocalizedName()
Return Type
string
ZenMethod
getShortUnlocalizedName()
Return Type
string
ZenMethod
getPartType()
Return Type
PartType
ZenMethod
getPartTypeName()
Return Type
string
ZenMethod
getOreDictPrefix()
Return Type
string
ZenMethod
getData()
Return Type
List<IPartDataPiece>

Register to Material(s)

Link to register-to-materials

You can use this to register one or several Materials to this part

ZenScript
Copy
part.registerToMaterial(Material material);
part.registerToMaterials(Material[] materials);

The function will either return a single MaterialPart object or a List of them, depending on whether you registered one or multiple materials at once.