Developer
Resources
Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
Maven Repository
<repositories> ... <repository> <id>postalservice-repo</id> <url>http://www.mythicacraft.com/maven/</url> </repository> ... </repositories> <dependencies> ... <dependency> <groupId>com.ebiggz.postalservice</groupId> <artifactId>PostalService</artifactId> <version>1.0.6</version> </dependency> ... </dependencies>
Events
PlayerOpenMailMenuEvent
PlayerSendMailEvent
PlayerRegisterMailboxEvent
PlayerUnregisterMailboxEvent
PlayerUnregisterAllMailboxesEvent
Custom Mail Types
Creating The Class
Creating a custom mail type is easy. All you have to do is create a class that implements MailType and define all the required methods.
public class MyMailType implements MailType { ... }
Depending on your IDE, you can have it auto-generate all the required methods that you must define.
You can take a look at the MailType interface on GitHub to get a description for what each method does.
The Payment built-in mail type is a good example to take a look at as well.
Registering The MailType
Once you've created your mail type, you must register it with PostalService.
PostalService.getMailManager().registerMailType(new MyMailType());
Typically you will want to do this in your onEnable method. Don't forget to make sure PostalService loads before your plugin. The easiest way this is usually done is by putting "softdepends: [PostalService]" in your plugin.yml.
Comments