package pw.yumc.MiaoLobby; import org.bukkit.Bukkit; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import pw.yumc.MiaoLobby.hook.AuthMeHook; import pw.yumc.MiaoLobby.hook.LoginHook; import pw.yumc.MiaoLobby.hook.VBossAuthHook; import pw.yumc.YumCore.bukkit.Log; import pw.yumc.YumCore.commands.CommandArgument; import pw.yumc.YumCore.commands.CommandExecutor; import pw.yumc.YumCore.commands.CommandManager; import pw.yumc.YumCore.commands.annotation.Cmd; import pw.yumc.YumCore.commands.annotation.Cmd.Executor; import pw.yumc.YumCore.commands.annotation.Help; import pw.yumc.YumCore.statistic.Statistics; import pw.yumc.YumCore.update.SubscribeTask; public class MiaoLobby extends JavaPlugin implements CommandExecutor { Config config; @Cmd(permission = "MiaoLobby.default", executor = Executor.PLAYER) @Help("进行随机服务器传送") public boolean def(final CommandArgument e) { Util.random((Player) e.getSender()); return true; } @Override public FileConfiguration getConfig() { return config.getConfig(); } @Override public void onEnable() { new CommandManager("MiaoLobby", this); Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord"); if (config.AutoTP) { new LoginHook(); } else if (config.LoginAutoTP) { if (Bukkit.getPluginManager().isPluginEnabled("AuthMe")) { new AuthMeHook(); } if (Bukkit.getPluginManager().isPluginEnabled("VBossAuth")) { new VBossAuthHook(); } } new Statistics(); new SubscribeTask(true, true); } @Override public void onLoad() { config = new Config(); } @Cmd(permission = "MiaoLobby.reload") @Help("重载配置文件") public void reload(final CommandArgument e) { config.reload(); Log.toSender(e.getSender(), "§a配置文件已重载!"); } }