Uses of Interface
net.minecraftforge.common.util.NonNullConsumer
Packages that use NonNullConsumer
-
Uses of NonNullConsumer in net.minecraftforge.common.util
Fields in net.minecraftforge.common.util with type parameters of type NonNullConsumerModifier and TypeFieldDescriptionprivate Set<NonNullConsumer<LazyOptional<T>>>
LazyOptional.listeners
Methods in net.minecraftforge.common.util with parameters of type NonNullConsumerModifier 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.