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 long
NOT_ADDED_UNIQUE_ID
-
Method Summary
Modifier and Type Method Description void
addRequiredPart(AbstractPart other)
Makes thisAbstractPart
depend on another part.default void
enqueueFirstTickTask(Runnable runnable)
IfMultipartContainer.hasTicked()
returns true then this will just call the runnable directly, and return.MultipartContainer
getContainer()
AbstractPart
getPart()
long
getUniqueId()
boolean
isPresent()
void
remove()
Removes thisgetPart()
from the container.void
removeRequiredPart(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_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
Makes thisAbstractPart
depend on another part. -
removeRequiredPart
Removes the requirement this has for the given part. (This invertsaddRequiredPart(AbstractPart)
-
enqueueFirstTickTask
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 aRunnable
to be run on the firstPartTickEvent
-