package org.poopki.duckdns.user_db; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import org.poopki.duckdns.user_db.DB.*; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; public final class User_DB extends JavaPlugin implements Listener { UserInfoArray m_InfoArrayInstance = new UserInfoArray(); DBUpdate Database_backup = new DBUpdate(m_InfoArrayInstance); @Override public void onEnable() { // Plugin startup logic try { Database_backup.InitDB(); Database_backup.LoadDB(); } catch (SQLException e) { throw new RuntimeException(e); } getServer().getPluginManager().registerEvents(new UserJoin(m_InfoArrayInstance),this); } @Override public void onDisable() { // Plugin shutdown logic try{ Database_backup.UpdateDB(); } catch (SQLException e){ throw new RuntimeException(e); } } }