Interface MultipartHolder


public interface MultipartHolder
Wrapper interface for an AbstractPart in a MultipartContainer.
  • Field Details

  • Method Details

    • getContainer

      MultipartContainer getContainer()
    • getPart

      AbstractPart getPart()
    • remove

      void remove()
      Removes this getPart() from the container.
    • remove

      void remove(MultipartHolder.PartRemoval... options)
      Calls remove(), but also performs some actions before removing the part depending on what values are passed in.
    • dropItems

      void dropItems(PlayerEntity player)
      Drops items at the position of the AbstractPart (by default).
      Parameters:
      player - The player entity, or null if no player is present.
    • collectDrops

      DefaultedList<ItemStack> collectDrops(PlayerEntity player)
      Collects all items that can drop from the part.
      Parameters:
      player - The player, or null if no player is present.
    • getUniqueId

      long getUniqueId()
      Returns:
      The (container-only) unique ID for this part holder, or NOT_ADDED_UNIQUE_ID if this hasn't been added to it's container.
    • isPresent

      boolean isPresent()
      Returns:
      True if this holder is contained in it's getContainer(), false otherwise.
    • addRequiredPart

      void addRequiredPart(AbstractPart other)
      Makes this AbstractPart depend on another part.
    • removeRequiredPart

      void removeRequiredPart(AbstractPart other)
      Removes the requirement this has for the given part. (This inverts addRequiredPart(AbstractPart)
    • enqueueFirstTickTask

      default void enqueueFirstTickTask(Runnable runnable)
      If MultipartContainer.hasTicked() returns true then this will just call the runnable directly, and return. Otherwise this will add an event listener for the PartTickEvent, and remove it when it is first ran. Enqueue's a Runnable to be run on the first PartTickEvent