SHARE
TWEET

Untitled

a guest Apr 2nd, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public final class Main extends JavaPlugin {
  2.  
  3.     public SQLConnection sql;
  4.     private static Main instance;
  5.     public TephrasManager tephrasManager;
  6.  
  7.     @Override
  8.     public void onEnable() {
  9.         /*
  10.         Plugin startup logic
  11.          */
  12.         saveDefaultConfig();
  13.         instance = this;
  14.         ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  15.         getCommand("test").setExecutor(new CommandTest(this));
  16.         PluginManager pm = Bukkit.getServer().getPluginManager();
  17.         pm.registerEvents(new PlayerJoinEvent(), this);
  18.  
  19.         console.sendMessage(ChatColor.GREEN + "Started Linosa");
  20.  
  21.         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"));
  22.         this.sql.connection();
  23.  
  24.         getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
  25.     }
  26.  
  27.     @Override
  28.     public void onDisable() {
  29.         /*
  30.         Plugin shutdown logic
  31.          */
  32.         ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
  33.  
  34.         console.sendMessage(ChatColor.RED + "Stopped Linosa");
  35.  
  36.         sql.disconnect();
  37.     }
  38.  
  39.     public static Main getInstance() {
  40.         return instance;
  41.     }
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top