Cookbook icon indicating copy to clipboard operation
Cookbook copied to clipboard

API + Implementation Gradle Multiproject

Open boformer opened this issue 9 years ago • 1 comments

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

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...

boformer avatar Mar 01 '15 19:03 boformer