Package alexiil.mc.lib.multipart.api
Class MultipartUtil
java.lang.Object
alexiil.mc.lib.multipart.api.MultipartUtil
public final class MultipartUtil extends Object
Contains various utilities for creating, accessing, or interacting with
MultipartContainer
's in a
World
.-
Method Summary
Modifier and Type Method Description static MultipartContainer
get(BlockView view, BlockPos pos)
Checks to see if the block at the given position currently contains a fullMultipartContainer
.static MultipartContainer
get(World world, BlockPos pos)
Checks to see if the block at the given position currently contains a fullMultipartContainer
.static MultipartContainer.PartOffer
offerNewPart(World world, BlockPos pos, MultipartContainer.MultipartCreator creator)
Offers the givenAbstractPart
into the block at the given position, respecting nearby entities' bounding boxes.static MultipartContainer.PartOffer
offerNewPart(World world, BlockPos pos, MultipartContainer.MultipartCreator creator, boolean respectEntityBBs)
Offers the givenAbstractPart
into the block at the given position.static MultipartContainer
turnIntoMultipart(World world, BlockPos pos)
-
Method Details
-
get
Checks to see if the block at the given position currently contains a fullMultipartContainer
. This does not take into accountNativeMultipart
. -
get
Checks to see if the block at the given position currently contains a fullMultipartContainer
. This does not take into accountNativeMultipart
. -
offerNewPart
@Nullable public static MultipartContainer.PartOffer offerNewPart(World world, BlockPos pos, MultipartContainer.MultipartCreator creator)Offers the givenAbstractPart
into the block at the given position, respecting nearby entities' bounding boxes. This may return a non-nullMultipartContainer.PartOffer
if -
offerNewPart
@Nullable public static MultipartContainer.PartOffer offerNewPart(World world, BlockPos pos, MultipartContainer.MultipartCreator creator, boolean respectEntityBBs)Offers the givenAbstractPart
into the block at the given position. This may return a non-nullMultipartContainer.PartOffer
if -
turnIntoMultipart
Turns an existingNativeMultipart
block into aBlockEntity
basedMultipartContainer
. This is only useful for updating old blocks, as adding new parts can be done viaofferNewPart(World, BlockPos, MultipartCreator)
.
-