I created a simple example plugin. It was made to explain how to create a command structure (with subcommands).
It is a simple server mail plugin with 4 commands:
/mail
/mail read
/mail clear
/mail send
Features:
Config file mail storage
Notifications about new mails
It uses Gradle for dependency management and comes with a Gradle wrapper.
There are a few TODO
comments in the code, to mark the features which are missing for productive use.
You can find the source on GitHub: GitHub - boformer/SimpleMail: Simple Sponge Mail Plugin for educational use
6 Likes
Looks nice. The biggest problem with using this on a production server would be the fact that there’s no loading/saving of mail. A reload/restart would lose all saved mail.
doot
March 31, 2015, 5:42pm
3
That doesn’t seem like too big of an issue, because it just takes a few lines to save it do to file.
I wasn’t commenting on how easy the issue was to fix, merely why you wouldn’t use this as-is on a production server, as @boformer has already said.
This looks interesting Perhaps some functionalities, such as recording the emails, could be added to help those who are learning to write plugins.
If you want, submit a pull request. I think some of the TODO markings can also be removed with little work.
I’d love to, but my suggestion is somewhat selfish iykwim
Very good! Good structured. Can we use your AbstractCommand?
1 Like
Yes, you can use it. It is licensed under MIT.
1 Like
I updated the plugin.
It now saves mails to a config file and notifies players about new mails.
Another Update: Use the new commands API and Sponge API 2.0
This is the part where the new commands API is used.
1 Like
Dizzy
April 30, 2015, 6:50pm
14
Thanks much for this boformer. Really helped.
1 Like
serubi
May 4, 2015, 10:12pm
15
Thank you for sharing this. This is a great resource for people like me, who are still learning.
2 Likes