Package net.kyori.adventure.util
Class Listenable<L>
java.lang.Object
net.kyori.adventure.util.Listenable<L>
- Type Parameters:
L
- the listener type
Something that has listeners.
- Since:
- 4.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
addListener0
(L listener) Adds a listener.protected final void
forEachListener
(@NotNull Consumer<L> consumer) Process an action for each listener.protected final void
removeListener0
(L listener) Removes a listener.
-
Constructor Details
-
Listenable
public Listenable()
-
-
Method Details
-
forEachListener
Process an action for each listener.- Parameters:
consumer
- the consumer- Since:
- 4.0.0
-
addListener0
Adds a listener.- Parameters:
listener
- the listener- Since:
- 4.0.0
-
removeListener0
Removes a listener.- Parameters:
listener
- the listener- Since:
- 4.0.0
-