Package codechicken.multipart.util
Class MultipartHelper
java.lang.Object
codechicken.multipart.util.MultipartHelper
Mostly internal methods.
Some things here are user facing, refer to code regions.
Methods within the INTERNAL region are subject to change without notice.
Created by covers1624 on 4/12/20.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TileMultipartINTERNAL METHOD Performs the necessary operations to add a part to a tile.static @Nullable TileMultipartgetOrConvertTile(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Overload ofgetOrConvertTile2(net.minecraft.world.level.Level, net.minecraft.core.BlockPos)but does not return the converted flag.static org.apache.commons.lang3.tuple.Pair<@Nullable TileMultipart, Boolean> getOrConvertTile2(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Queries the tile in world at the provided position and performs conversion if possible.static TileMultipartpartRemoved(TileMultipart tile) INTERNAL METHOD Checks if there are redundant traits on the tile and strips them.static voidsilentAddTile(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.entity.BlockEntity tile) INTERNAL METHOD Swaps the tile directly on the chunk.
-
Constructor Details
-
MultipartHelper
public MultipartHelper()
-
-
Method Details
-
getOrConvertTile
@Nullable public static @Nullable TileMultipart getOrConvertTile(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Overload ofgetOrConvertTile2(net.minecraft.world.level.Level, net.minecraft.core.BlockPos)but does not return the converted flag. Useful for checking if a part can be added to the current block space.- Parameters:
world- The world.pos- The position.- Returns:
- The tile.
-
getOrConvertTile2
public static org.apache.commons.lang3.tuple.Pair<@Nullable TileMultipart,Boolean> getOrConvertTile2(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Queries the tile in world at the provided position and performs conversion if possible. Does NOT modify the world.- Parameters:
world- The world.pos- The position.- Returns:
- A Pair result of, the tile if it exists null otherwise, and a boolean flag if the tile exists as a result of conversion.
-
partRemoved
INTERNAL METHOD Checks if there are redundant traits on the tile and strips them. -
addPart
public static TileMultipart addPart(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, MultiPart part) INTERNAL METHOD Performs the necessary operations to add a part to a tile. Checks if any new traits need to be applied to the tile instance, and replaces if so. -
silentAddTile
public static void silentAddTile(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.entity.BlockEntity tile) INTERNAL METHOD Swaps the tile directly on the chunk.
-