package pl.qotrek.terxan; import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; import pl.qotrek.terxan.commands.AlertCommand; import pl.qotrek.terxan.commands.BlockCommand; import pl.qotrek.terxan.commands.ChatCommand; import pl.qotrek.terxan.commands.DiscordCommand; import pl.qotrek.terxan.commands.FeedCommand; import pl.qotrek.terxan.commands.FlyCommand; import pl.qotrek.terxan.commands.GmCommand; import pl.qotrek.terxan.commands.HealCommand; import pl.qotrek.terxan.commands.PomocCommand; import pl.qotrek.terxan.commands.SmsCommand; import pl.qotrek.terxan.commands.TpAllCommand; import pl.qotrek.terxan.commands.TpCommand; import pl.qotrek.terxan.commands.TpHereCommand; import pl.qotrek.terxan.commands.VipCommand; import pl.qotrek.terxan.commands.sVipCommand; import pl.qotrek.terxan.config.Config; import pl.qotrek.terxan.listeners.JoinQuitListener; import pl.qotrek.terxan.listeners.MotdListener; public class Main extends JavaPlugin { private static Main plugin; public static Main getPlugin() { return plugin; } @Override public void onDisable() { getLogger().info("Deaktywacja pluginu TerXan by Qotrek"); } public void onLoad(){ plugin = this; } @Override public void onEnable() { getLogger().info("Uruchamianie pluginu TerXan by Qotrek"); getLogger().info("Wczytywanie configu"); saveDefaultConfig(); Config.reloadConfig(); plugin = this; getLogger().info("Wczytano config"); getLogger().info("Wczytytwanie eventow"); Bukkit.getServer().getPluginManager().registerEvents(new ChatCommand(), this); Bukkit.getServer().getPluginManager().registerEvents(new MotdListener(), this); Bukkit.getServer().getPluginManager().registerEvents(new JoinQuitListener(), this); getLogger().info("Wczytano eventy"); getLogger().info("Wczytywanie komend"); getCommand("chat").setExecutor(new ChatCommand()); getCommand("pomoc").setExecutor(new PomocCommand()); getCommand("discord").setExecutor(new DiscordCommand()); getCommand("vip").setExecutor(new VipCommand()); getCommand("svip").setExecutor(new sVipCommand()); getCommand("alert").setExecutor(new AlertCommand()); getCommand("gm").setExecutor(new GmCommand()); getCommand("gamemode").setExecutor(new GmCommand()); getCommand("sms").setExecutor(new SmsCommand()); getCommand("fly").setExecutor(new FlyCommand()); getCommand("heal").setExecutor(new HealCommand()); getCommand("feed").setExecutor(new FeedCommand()); getCommand("tp").setExecutor(new TpCommand()); getCommand("teleport").setExecutor(new TpCommand()); getCommand("tphere").setExecutor(new TpHereCommand()); getCommand("about").setExecutor(new BlockCommand()); getCommand("ver").setExecutor(new BlockCommand()); getCommand("version").setExecutor(new BlockCommand()); getCommand("bukkit:about").setExecutor(new BlockCommand()); getCommand("bukkit:version").setExecutor(new BlockCommand()); getCommand("bukkit:ver").setExecutor(new BlockCommand()); getCommand("s").setExecutor(new TpHereCommand()); getCommand("tpall").setExecutor(new TpAllCommand()); getLogger().info("Wczytano komendy"); getLogger().info("Plugin zostal pomyslnie wczytany"); } }