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.listenersMethods in net.minecraftforge.common.util with parameters of type NonNullConsumerModifier and TypeMethodDescriptionvoidLazyOptional.addListener(NonNullConsumer<LazyOptional<T>> listener) Register alistenerthat will be called when thisLazyOptionalbecomes invalid (viaLazyOptional.invalidate()).voidLazyOptional.ifPresent(NonNullConsumer<? super T> consumer) If non-empty, invoke the specifiedNonNullConsumerwith the object, otherwise do nothing.voidLazyOptional.removeListener(NonNullConsumer<LazyOptional<T>> listener) Unregisters alistenerfrom the list to be notified when thisLazyOptionalbecomes 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.