2010-11-27 13:35:23 +01:00
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
2010-11-28 08:10:14 +01:00
|
|
|
//=====================================================================
|
|
|
|
//Class: vMinecraftPlugin
|
|
|
|
//Use: Starts the plugin
|
|
|
|
//Author: nossr50, TrapAlice, cerevisiae
|
|
|
|
//=====================================================================
|
2010-10-13 00:49:56 +02:00
|
|
|
public class vminecraftPlugin extends Plugin {
|
|
|
|
static final vminecraftListener listener = new vminecraftListener();
|
2010-11-28 08:10:14 +01:00
|
|
|
protected static final Logger log = Logger.getLogger("Minecraft");
|
|
|
|
|
|
|
|
public void enable() {
|
2010-11-29 02:30:34 +01:00
|
|
|
vminecraftSettings.getInstance().loadSettings();
|
2010-11-28 08:10:14 +01:00
|
|
|
vminecraftCommands.loadCommands();
|
2010-10-13 00:49:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void disable() {
|
|
|
|
//And remove the commands here.
|
|
|
|
}
|
|
|
|
|
|
|
|
public void initialize() {
|
|
|
|
//Here we add the hook we're going to use. In this case it's the arm swing event.
|
|
|
|
etc.getLoader().addListener(PluginLoader.Hook.CHAT, listener, this, PluginListener.Priority.MEDIUM);
|
|
|
|
etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.HIGH);
|
2010-11-29 02:30:34 +01:00
|
|
|
etc.getLoader().addListener(PluginLoader.Hook.IGNITE, listener, this, PluginListener.Priority.HIGH);
|
2010-11-30 03:51:30 +01:00
|
|
|
etc.getLoader().addListener(PluginLoader.Hook.DAMAGE, listener, this, PluginListener.Priority.MEDIUM);
|
2010-11-29 02:30:34 +01:00
|
|
|
etc.getLoader().addListener(PluginLoader.Hook.EXPLODE, listener, this, PluginListener.Priority.HIGH);
|
2010-11-27 13:35:23 +01:00
|
|
|
if(etc.getInstance().isHealthEnabled()){
|
2010-11-28 08:10:14 +01:00
|
|
|
etc.getLoader().addListener(PluginLoader.Hook.HEALTH_CHANGE, listener, this, PluginListener.Priority.MEDIUM);
|
|
|
|
}
|
2010-10-13 00:49:56 +02:00
|
|
|
}
|
|
|
|
}
|