Package alexiil.mc.lib.multipart.api
Interface MultipartHolder
public interface MultipartHolder
Wrapper interface for an
AbstractPart in a MultipartContainer.-
Field Summary
Fields Modifier and Type Field Description static longNOT_ADDED_UNIQUE_ID -
Method Summary
Modifier and Type Method Description voidaddRequiredPart(AbstractPart other)Makes thisAbstractPartdepend on another part.default voidenqueueFirstTickTask(java.lang.Runnable runnable)IfMultipartContainer.hasTicked()returns true then this will just call the runnable directly, and return.MultipartContainergetContainer()AbstractPartgetPart()longgetUniqueId()booleanisPresent()voidremove()Removes thisgetPart()from the container.voidremoveRequiredPart(AbstractPart other)Removes the requirement this has for the given part.
-
Field Details
-
NOT_ADDED_UNIQUE_ID
static final long NOT_ADDED_UNIQUE_ID- See Also:
- Constant Field Values
-
-
Method Details
-
getContainer
MultipartContainer getContainer() -
getPart
AbstractPart getPart() -
remove
void remove()Removes thisgetPart()from the container. -
getUniqueId
long getUniqueId()- Returns:
- The (container-only) unique ID for this part holder, or
NOT_ADDED_UNIQUE_IDif 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
Makes thisAbstractPartdepend on another part. -
removeRequiredPart
Removes the requirement this has for the given part. (This invertsaddRequiredPart(AbstractPart) -
enqueueFirstTickTask
default void enqueueFirstTickTask(java.lang.Runnable runnable)IfMultipartContainer.hasTicked()returns true then this will just call the runnable directly, and return. Otherwise this will add an event listener for thePartTickEvent, and remove it when it is first ran. Enqueue's aRunnableto be run on the firstPartTickEvent
-