Part
Link to part
A Part is the form an item is in, for example a gear or an ore.
Импорт пакета
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.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):
Items:
Link to undefined
- Beam
- Bolt
- Casing
- Clump
- Crystal Crystal
- Crushed Ore (crushed_ore)
- Dense Plate (dense_plate)
- Dirty Dust (dirty_dust)
- Dust
- Gear
- Ingot
- Nugget
- Plate
- Rod
- Shard
Blocks:
Link to undefined
- Block
Ores:
Link to undefined
- Ore
- Dense Ore (dense_ore)
- Poor Ore(poor_ore)
Fluids:
Link to undefined
- Molten
Armor:
Link to undefined
- Armor
Minecart
Link to undefined
- Minecart
Fields
Link to fields
You can retrieve the following information from a Part:
ZenMethod | Возвращаемый тип |
---|---|
ZenMethod hasOverlay() | Возвращаемый тип boolean |
ZenMethod getName() | Возвращаемый тип string |
ZenMethod getUnlocalizedName() | Возвращаемый тип string |
ZenMethod getShortUnlocalizedName() | Возвращаемый тип string |
ZenMethod getPartType() | Возвращаемый тип PartType |
ZenMethod getPartTypeName() | Возвращаемый тип string |
ZenMethod getOreDictPrefix() | Возвращаемый тип string |
ZenMethod getData() | Возвращаемый тип 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 Copypart.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.