Package appeng.api.parts
Interface IPartItem<P extends IPart>
- All Superinterfaces:
net.minecraft.world.level.ItemLike
When implementing a custom part, you must create an item to both represent the part in NBT and Packet data, and to
actually place the part onto the bus. Implement this interface on your part
Item
.
To help with placing parts onto buses, use PartHelper.usePartItem(UseOnContext)
to implement your items
Item.useOn(UseOnContext)
method.-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable IPartItem
<?> byId
(net.minecraft.resources.ResourceLocation id) Retrieve a part item by itsid
.static @Nullable IPartItem
<?> byNetworkId
(int id) Retrieve a part item by itsid
.create a new part INSTANCEstatic net.minecraft.resources.ResourceLocation
static int
getNetworkId
(IPartItem<?> item) Methods inherited from interface net.minecraft.world.level.ItemLike
asItem
-
Method Details
-
getPartClass
- Returns:
- The class of the parts that will be created by this part item.
-
createPart
P createPart()create a new part INSTANCE- Returns:
- part from item
-
getId
- Returns:
- The registry id for this item.
-
getNetworkId
- Returns:
- The registry id for this item, suitable for network serialization.
-
byId
Retrieve a part item by itsid
. -
byNetworkId
Retrieve a part item by itsid
.
-