Package alexiil.mc.lib.multipart.api
Interface NativeMultipart
public interface NativeMultipart
A
Block
that can be converted (in-place) to an AbstractPart
. (Usually called in
MultipartUtil.offerNewPart(World, BlockPos, MultipartCreator)
. If you want to add support for other blocks
then you can use LOOKUP
.
This is generally only useful if your block does NOT already have a BlockEntity
.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BlockApiLookup<NativeMultipart,
Void> Only used after checking if a targetBlock
implementsNativeMultipart
. -
Method Summary
Modifier and TypeMethodDescriptiongetMultipartConversion
(World world, BlockPos pos, BlockState state)
-
Field Details
-
LOOKUP
Only used after checking if a targetBlock
implementsNativeMultipart
.
-
-
Method Details
-
getMultipartConversion
@Nullable List<MultipartContainer.MultipartCreator> getMultipartConversion(World world, BlockPos pos, BlockState state) - Returns:
- A List of
MultipartContainer.MultipartCreator
's that can create a newAbstractPart
based on the current state at the given position, or null if the current state cannot be converted into anAbstractPart
. An empty list will let this block be replaced with multiparts.Note that neither this function call, nor the
Function
that this returns should modify theWorld
in any way!
-