This repository was archived by the owner on Feb 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
API
zml edited this page Jan 28, 2014
·
4 revisions
The NetEvents API is very simple. The API has been designed to keep as much of the inner workings of the server network hidden from developers (This does require the tradeoff of plugins not knowing exactly where their events will go). The functionality is split into several sections.
An instance of the NetEvents plugin can be retrieved in the normal way, by calling Server.getPluginManager().getPlugin("NetEvents") and casting.
NetEvents is available in the Maven repository at http://pex-repo.zachsthings.com The dependency block is:
<dependency>
<groupId>com.zachsthings</groupId>
<artifactId>netevents</artifactId>
<version>${neteventsVersion}</version> <!-- Set this to latest -->
</dependency>NetEventsPlugin#callEvent(Event)
- This method calls an event both on the local server and on remote servers connected. The event passed must extend Serializable.
NetEventsPlugin#getServerUUID()
- This method returns a persistent (remains constant across server runs) UUID for the local server. This can be used to determine whether events originated locally or from a remote server in listeners.