Class PermissionsSetupEvent
java.lang.Object
com.velocitypowered.api.event.permission.PermissionsSetupEvent
Called when a
PermissionSubject's permissions are being setup. This event is typically
called for the ConsoleCommandSource and any
Players who join the proxy.
This event is only called once per subject, on initialisation.
Velocity will wait for this event to finish firing before proceeding further with server startup (for the console command source) and logins (for players) but it is strongly recommended to minimize the amount of work that must be done in this event.
-
Constructor Summary
ConstructorsConstructorDescriptionPermissionsSetupEvent(PermissionSubject subject, PermissionProvider provider) Constructs a newPermissionsSetupEvent. -
Method Summary
Modifier and TypeMethodDescriptioncreateFunction(PermissionSubject subject) Uses the provider function to obtain aPermissionFunctionfor the subject.Gets the currentPermissionProviderin use for this subject.Gets the subject whose permissions are being initialized.voidsetProvider(@Nullable PermissionProvider provider) Sets thePermissionFunctionthat should be used for the subject.toString()
-
Constructor Details
-
PermissionsSetupEvent
Constructs a newPermissionsSetupEvent.- Parameters:
subject- the subject (e.g., player or console) whose permissions are being initializedprovider- the default permission provider used for the subject
-
-
Method Details
-
getSubject
Gets the subject whose permissions are being initialized.- Returns:
- the permission subject
-
createFunction
Uses the provider function to obtain aPermissionFunctionfor the subject.- Parameters:
subject- the subject- Returns:
- the obtained permission function
-
getProvider
Gets the currentPermissionProviderin use for this subject.- Returns:
- the permission provider
-
setProvider
Sets thePermissionFunctionthat should be used for the subject.Specifying
nullwill reset the provider to the default instance given when the event was posted.- Parameters:
provider- the provider
-
toString
-