vminecraftPlugin.java 1.2 KB

1234567891011121314151617181920212223242526272829
  1. import java.util.logging.Logger;
  2. //=====================================================================
  3. //Class: vMinecraftPlugin
  4. //Use: Starts the plugin
  5. //Author: nossr50, TrapAlice, cerevisiae
  6. //=====================================================================
  7. public class vminecraftPlugin extends Plugin {
  8. static final vminecraftListener listener = new vminecraftListener();
  9. protected static final Logger log = Logger.getLogger("Minecraft");
  10. public void enable() {
  11. vminecraftSettings.getInstance().loadSettings();
  12. vminecraftCommands.loadCommands();
  13. }
  14. public void disable() {
  15. //And remove the commands here.
  16. }
  17. public void initialize() {
  18. //Here we add the hook we're going to use. In this case it's the arm swing event.
  19. etc.getLoader().addListener(PluginLoader.Hook.CHAT, listener, this, PluginListener.Priority.MEDIUM);
  20. etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.HIGH);
  21. if(etc.getInstance().isHealthEnabled()){
  22. etc.getLoader().addListener(PluginLoader.Hook.HEALTH_CHANGE, listener, this, PluginListener.Priority.MEDIUM);
  23. }
  24. }
  25. }