Class MultipartHelper

java.lang.Object
codechicken.multipart.util.MultipartHelper

public class MultipartHelper extends Object
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 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 of getOrConvertTile2(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

      public static TileMultipart partRemoved(TileMultipart tile)
      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.