Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public final class Main extends JavaPlugin {
- public SQLConnection sql;
- private static Main instance;
- public TephrasManager tephrasManager;
- @Override
- public void onEnable() {
- /*
- Plugin startup logic
- */
- saveDefaultConfig();
- instance = this;
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- getCommand("test").setExecutor(new CommandTest(this));
- PluginManager pm = Bukkit.getServer().getPluginManager();
- pm.registerEvents(new PlayerJoinEvent(), this);
- console.sendMessage(ChatColor.GREEN + "Started Linosa");
- 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"));
- this.sql.connection();
- getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
- }
- @Override
- public void onDisable() {
- /*
- Plugin shutdown logic
- */
- ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
- console.sendMessage(ChatColor.RED + "Stopped Linosa");
- sql.disconnect();
- }
- public static Main getInstance() {
- return instance;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement