2010-11-27 04:35:23 -08:00
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
2010-11-28 01:10:14 -06:00
|
|
|
//=====================================================================
|
|
|
|
//Class: vMinecraftPlugin
|
|
|
|
//Use: Starts the plugin
|
|
|
|
//Author: nossr50, TrapAlice, cerevisiae
|
|
|
|
//=====================================================================
|
2010-10-12 15:49:56 -07:00
|
|
|
public class vminecraftPlugin extends Plugin {
|
|
|
|
static final vminecraftListener listener = new vminecraftListener();
|
2010-11-28 01:10:14 -06:00
|
|
|
protected static final Logger log = Logger.getLogger("Minecraft");
|
|
|
|
|
|
|
|
public void enable() {
|
2010-11-28 19:30:34 -06:00
|
|
|
vminecraftSettings.getInstance().loadSettings();
|
2010-11-28 01:10:14 -06:00
|
|
|
vminecraftCommands.loadCommands();
|
2010-10-12 15:49:56 -07: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-28 19:30:34 -06:00
|
|
|
etc.getLoader().addListener(PluginLoader.Hook.IGNITE, listener, this, PluginListener.Priority.HIGH);
|
2010-11-29 18:51:30 -08:00
|
|
|
etc.getLoader().addListener(PluginLoader.Hook.DAMAGE, listener, this, PluginListener.Priority.MEDIUM);
|
2010-11-28 19:30:34 -06:00
|
|
|
etc.getLoader().addListener(PluginLoader.Hook.EXPLODE, listener, this, PluginListener.Priority.HIGH);
|
2010-11-27 04:35:23 -08:00
|
|
|
if(etc.getInstance().isHealthEnabled()){
|
2010-11-28 01:10:14 -06:00
|
|
|
etc.getLoader().addListener(PluginLoader.Hook.HEALTH_CHANGE, listener, this, PluginListener.Priority.MEDIUM);
|
|
|
|
}
|
2010-10-12 15:49:56 -07:00
|
|
|
}
|
|
|
|
}
|