API + Implementation Gradle Multiproject
It would be great to have a "boilerplate" for plugins with a separate API. The plugin should contain a simple service interface and an implementation. This way we can also show how to register and use custom services.
Structure:
- Project: notification
- Subproject: notification-api
- Interface: NotificationService
- Subproject: notification-sponge
- Class: NotificationPlugin
- Class: SimpleNotificationService
- Subproject: notification-api
The plugin displays a notification to players when they login.
They can mark the notification as read with /notification clear.
Admins can set the notification with /notification set <msg> or delete it with /notification delete.
The command uses the SimpleDispatcher class for subcommands.
Other plugins can get the NotificationService from the service manager and modify the notification. Plugins can also set an expiration date for the notification.
For simplicity, the notification is not persistent when the server restarts.
Right now I don't have the time to work on this, that's why I created this issue as a reminder. If you want to work on this, go ahead...
This isn't done yet, but if anyone comes here, for now you can find an example of a project with a separate API using services and similar with Nucleus.