Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.slixfx.slixban.main;
- import java.io.File;
- import java.io.IOException;
- import de.slixfx.slixban.mysql.MySQL;
- import net.md_5.bungee.api.plugin.Plugin;
- import net.md_5.bungee.config.Configuration;
- import net.md_5.bungee.config.ConfigurationProvider;
- import net.md_5.bungee.config.YamlConfiguration;
- public class Main extends Plugin {
- public String prefix = "§8[§6Slix§3Ban§8] §r";
- public String noperm = prefix+"§cDazu hast Du keine Berechtigung";
- public void onEnable() {
- instance = this;
- readMySQLFile();
- MySQL.connect();
- MySQL.createTables();
- }
- public void onDisable() {
- MySQL.close();
- }
- public static Main instance;
- public static Main getInstance() {
- return instance;
- }
- public void readMySQLFile() {
- File configFile = new File(this.getDataFolder(), "mysql.yml");
- try {
- Configuration cfg = ConfigurationProvider.getProvider(YamlConfiguration.class).load(configFile);
- MySQL.username = cfg.getString("mysql.username");
- MySQL.password = cfg.getString("mysql.password");
- MySQL.database = cfg.getString("mysql.database");
- MySQL.host = cfg.getString("mysql.host");
- MySQL.port = cfg.getString("mysql.port");
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
Add Comment
Please, Sign In to add comment