Guest User

Main

a guest
Mar 31st, 2019
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. public SQLConnection sql;
  2. private static Main instance;
  3. public TephrasManager tephrasManager;
  4.  
  5. @Override
  6. public void onEnable() {
  7. /*
  8. Plugin startup logic
  9. */
  10. saveDefaultConfig();
  11. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  12. getCommand("test").setExecutor(new CommandTest());
  13. PluginManager pm = Bukkit.getServer().getPluginManager();
  14. pm.registerEvents(new PlayerJoinEvent(), this);
  15.  
  16. console.sendMessage(ChatColor.GREEN + "Started Linosa");
  17.  
  18. this.sql = new SQLConnection("jdbc:mysql://", this.getConfig().getString("database.host"), "" + this.getConfig().getString("database.database") + "?autoReconnect=true", this.getConfig().getString("database.user"), this.getConfig().getString("database.password"));
  19. this.sql.connection();
  20.  
  21. getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
  22. }
  23.  
  24. @Override
  25. public void onDisable() {
  26. /*
  27. Plugin shutdown logic
  28. */
  29. ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  30.  
  31. console.sendMessage(ChatColor.RED + "Stopped Linosa");
  32.  
  33. sql.disconnect();
  34. }
Add Comment
Please, Sign In to add comment