Package alexiil.mc.lib.multipart.api
Class MultipartUtil
java.lang.Object
alexiil.mc.lib.multipart.api.MultipartUtil
public final class MultipartUtil
extends java.lang.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(net.minecraft.world.BlockView view, net.minecraft.util.math.BlockPos pos)
Checks to see if the block at the given position currently contains a fullMultipartContainer
.static MultipartContainer
get(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
Checks to see if the block at the given position currently contains a fullMultipartContainer
.static MultipartContainer.PartOffer
offerNewPart(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, MultipartContainer.MultipartCreator creator)
Offers the givenAbstractPart
into the block at the given position, respecting nearby entities' bounding boxes.static MultipartContainer.PartOffer
offerNewPart(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, MultipartContainer.MultipartCreator creator, boolean respectEntityBBs)
Offers the givenAbstractPart
into the block at the given position.static MultipartContainer
turnIntoMultipart(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
-
Method Details
-
get
@Nullable public static MultipartContainer get(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)Checks to see if the block at the given position currently contains a fullMultipartContainer
. This does not take into accountNativeMultipart
. -
get
@Nullable public static MultipartContainer get(net.minecraft.world.BlockView view, net.minecraft.util.math.BlockPos pos)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(net.minecraft.world.World world, net.minecraft.util.math.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(net.minecraft.world.World world, net.minecraft.util.math.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
@Nullable public static MultipartContainer turnIntoMultipart(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)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)
.
-