com.cliffblaster.game.api
Class JavaPlugin

java.lang.Object
  extended by com.cliffblaster.game.api.JavaPlugin

public abstract class JavaPlugin
extends java.lang.Object


Constructor Summary
JavaPlugin()
           
 
Method Summary
abstract  void destroy()
          Called when the plug-in is supposed to be unloaded by the PluginManager
 PluginManager getManager()
          Returns the PluginManager
 java.io.File getPluginDirectory()
          Returns the directory for the plugin's configuration files.
 Server getServer()
          returns the PluginManager's MinecraftServer instance
abstract  void init()
          Called when the plug-in is first initialized by the PluginManager
 Command registerCommand(java.lang.String title, Command executor, boolean replace)
          Registers a command executor to a command title Plug-ins are required to use registerCommand, unlike in the precious API Returns an old Command or the passed in executor if succeeded, null if failed.
 RegisteredEvent registerEvent(Event.Type type, EventListener listener, Event.Priority priority)
          Registers an event that the plug-in will listen to and returns a RegisteredEvent object.
 void unregisterEvent(RegisteredEvent event)
          Unregisters a RegisteredEvent from the event list and returns true if event was registered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaPlugin

public JavaPlugin()
Method Detail

getManager

public final PluginManager getManager()
Returns the PluginManager


getServer

public final Server getServer()
returns the PluginManager's MinecraftServer instance


getPluginDirectory

public final java.io.File getPluginDirectory()
Returns the directory for the plugin's configuration files.
In the future, this is the only directory that the plugin will be able to modify without explicit permission. Can only be called during or after initialization


registerCommand

public final Command registerCommand(java.lang.String title,
                                     Command executor,
                                     boolean replace)
Registers a command executor to a command title Plug-ins are required to use registerCommand, unlike in the precious API Returns an old Command or the passed in executor if succeeded, null if failed.


registerEvent

public final RegisteredEvent registerEvent(Event.Type type,
                                           EventListener listener,
                                           Event.Priority priority)
Registers an event that the plug-in will listen to and returns a RegisteredEvent object. Priorities are the order in which an event will be called upon occurring.

Highest recommended is Event.HIGHEST, with Event.REALTIME reserved for mission critical plug-ins such as permission managers.


unregisterEvent

public final void unregisterEvent(RegisteredEvent event)
Unregisters a RegisteredEvent from the event list and returns true if event was registered.


init

public abstract void init()
Called when the plug-in is first initialized by the PluginManager


destroy

public abstract void destroy()
Called when the plug-in is supposed to be unloaded by the PluginManager