Package net.luckperms.api.event.context
Interface ContextUpdateEvent
- All Superinterfaces:
LuckPermsEvent
Called when a subject's current/active contexts are updated.
There are no guarantees that this event will be called for every update. It is merely to be used as a "hint" for plugins which depend on the current active contexts for a player.
It will always be fired following a call to
ContextManager.signalContextUpdate(Object).
The subject is always an instance of the platform's subject type. See
ContextManager for details.
Unlike most other LuckPerms events, this event is not fired asynchronously. Care should be taken to ensure listeners are lightweight. Additionally, listeners should ensure they do not cause further updates to player context, thus possibly causing a stack overflow.
- Since:
- 5.2
-
Method Summary
Modifier and TypeMethodDescriptionGets the subject whose contexts were updated.getSubject(@NonNull Class<T> subjectClass) Gets the subject whose contexts were updated, casted to a given type.Methods inherited from interface net.luckperms.api.event.LuckPermsEvent
getEventType, getLuckPerms
-
Method Details
-
getSubject
Gets the subject whose contexts were updated.- Returns:
- the subject
-
getSubject
Gets the subject whose contexts were updated, casted to a given type.- Type Parameters:
T- the subject type- Parameters:
subjectClass- the type to cast to- Returns:
- the casted subject
-