Uses of Interface
net.minecraftforge.common.util.NonNullConsumer
-
Uses of NonNullConsumer in net.minecraftforge.common.util
Modifier and TypeFieldDescriptionprivate Set<NonNullConsumer<LazyOptional<T>>>
LazyOptional.listeners
Modifier and TypeMethodDescriptionvoid
LazyOptional.addListener
(NonNullConsumer<LazyOptional<T>> listener) Register alistener
that will be called when thisLazyOptional
becomes invalid (viaLazyOptional.invalidate()
).void
LazyOptional.ifPresent
(NonNullConsumer<? super T> consumer) If non-empty, invoke the specifiedNonNullConsumer
with the object, otherwise do nothing.void
LazyOptional.removeListener
(NonNullConsumer<LazyOptional<T>> listener) Unregisters alistener
from the list to be notified when thisLazyOptional
becomes invalid (viaLazyOptional.invalidate()
).
This allows modder who know they will not need to be notified, to remove the hard reference that this holds to their listener.