PandacraftUtils/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java

130 lines
5.1 KiB
Java
Raw Normal View History

2014-11-22 17:18:10 +01:00
package net.mc_pandacraft.java.plugin.pandacraftutils;
import java.sql.SQLException;
2014-11-22 17:18:10 +01:00
import net.mc_pandacraft.java.plugin.pandacraftutils.afk.CommandAfk;
import net.mc_pandacraft.java.plugin.pandacraftutils.calculator.CalculatorManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.chat_analyzer.ChatAnalysisManager;
2014-11-29 13:42:25 +01:00
import net.mc_pandacraft.java.plugin.pandacraftutils.cheat_protect.creative.CreativCheatManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.cheat_protect.no_pvp.NoPvpProtectManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.login_message.LoginLogoutManager;
2014-11-22 17:18:10 +01:00
import net.mc_pandacraft.java.plugin.pandacraftutils.player_count_list.PacketOutServerInfoListener;
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands._command_alias.CommandAliasManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands.broadcast.CommandBroadcast;
2014-11-29 13:42:25 +01:00
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands.list.CommandList;
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands.me.CommandMe;
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands.ping.CommandPing;
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands.setblock.CommandSetblock;
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands.speed_message.CommandSpeedMessage;
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands.staff_player_help.CommandStaff;
2014-11-22 17:18:10 +01:00
import net.mc_pandacraft.java.plugin.pandacraftutils.spawntime.SpawnTimeManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.survival_cuboid.CommandCubo;
2014-11-22 17:18:10 +01:00
import net.mc_pandacraft.java.plugin.pandacraftutils.survival_cuboid.CommandWandSelection;
2014-11-29 13:42:25 +01:00
import net.mc_pandacraft.java.plugin.pandacraftutils.system_analyzer.CommandSystem;
import net.mc_pandacraft.java.util.mysql.DBConnection;
2014-11-22 17:18:10 +01:00
import org.bukkit.plugin.java.JavaPlugin;
public class PandacraftUtils extends JavaPlugin {
private static PandacraftUtils instance;
public static PandacraftUtils getInstance() { return instance; }
public DBConnection databaseConnection;
2014-11-22 17:18:10 +01:00
public CommandAfk commandAfk;
public CommandList commandPlayers;
public CommandSetblock commandSetblock;
public CommandSystem commandSystem;
public CommandPing commandPing;
public CommandMe commandMe;
public CommandSpeedMessage commandSpeedMessage;
public CommandWandSelection commandWandSelection;
public CommandStaff commandStaff;
public CommandCubo commandCubo;
public CommandBroadcast commandBroadcast;
2014-11-22 17:18:10 +01:00
public CommandAliasManager commandAliasManager;
2014-11-22 17:18:10 +01:00
public SpawnTimeManager spawnTimeManager;
public ChatAnalysisManager chatAnalysisManager;
2014-11-22 17:18:10 +01:00
public CreativCheatManager creativCheatManager;
public NoPvpProtectManager noPvpProtectManager;
public LoginLogoutManager loginLogoutManager;
public CalculatorManager calculatorManager;
2014-11-22 17:18:10 +01:00
public PacketOutServerInfoListener serverPingListener;
@Override
public void onEnable(){
instance = this;
try {
databaseConnection = new DBConnection(ConfigManager.getInstance().Database_host,
ConfigManager.getInstance().Database_port,
ConfigManager.getInstance().Database_database,
ConfigManager.getInstance().Database_username,
ConfigManager.getInstance().Database_password);
} catch (ClassNotFoundException | SQLException e) {
getLogger().severe("Impossible de se connecter à la base de donnée !");
e.printStackTrace();
}
2014-11-22 17:18:10 +01:00
commandPlayers = new CommandList(this);
commandSetblock = new CommandSetblock(this);
commandAfk = new CommandAfk(this);
commandSystem = new CommandSystem(this);
commandPing = new CommandPing(this);
commandMe = new CommandMe(this);
commandSpeedMessage = new CommandSpeedMessage(this); // messages rapides
commandWandSelection = new CommandWandSelection(this);
commandStaff = new CommandStaff(this);
commandCubo = new CommandCubo(this);
commandBroadcast = new CommandBroadcast(this);
2014-11-22 17:18:10 +01:00
commandAliasManager = new CommandAliasManager(this);
2014-11-22 17:18:10 +01:00
spawnTimeManager = new SpawnTimeManager(this);
chatAnalysisManager = new ChatAnalysisManager(this);
2014-11-22 17:18:10 +01:00
creativCheatManager = new CreativCheatManager(this);
noPvpProtectManager = new NoPvpProtectManager(this);
loginLogoutManager = new LoginLogoutManager(this);
calculatorManager = new CalculatorManager(this);
2014-11-22 17:18:10 +01:00
serverPingListener = new PacketOutServerInfoListener(this);
}
@Override
public void onDisable(){
commandPlayers = null;
commandSetblock = null;
commandAfk = null;
commandSystem = null;
commandPing = null;
commandMe = null;
commandSpeedMessage = null;
commandWandSelection = null;
commandStaff = null;
commandCubo = null;
commandBroadcast = null;
2014-11-22 17:18:10 +01:00
commandAliasManager = null;
2014-11-22 17:18:10 +01:00
spawnTimeManager = null;
chatAnalysisManager = null;
2014-11-22 17:18:10 +01:00
creativCheatManager = null;
noPvpProtectManager = null;
calculatorManager = null;
2014-11-22 17:18:10 +01:00
serverPingListener = null;
ConfigManager.reloadConfig();
try { databaseConnection.getConnection().close(); } catch (SQLException e) { }
2014-11-22 17:18:10 +01:00
}
}