Search in sources :

Example 1 with Settings

use of net.dzikoysk.funnyguilds.data.Settings in project FunnyGuilds by FunnyGuilds.

the class ExcFunnyGuilds method reload.

private void reload(CommandSender sender) {
    if (!sender.hasPermission("funnyguilds.reload")) {
        sender.sendMessage(Messages.getInstance().permission);
        return;
    }
    Thread thread = new Thread(() -> {
        Manager dm = Manager.getInstance();
        dm.stop();
        dm.save();
        new Messages();
        new Settings();
        dm.start();
        if (Settings.getConfig().playerlistEnable) {
            PluginConfig config = Settings.getConfig();
            AbstractTablist.wipeCache();
            for (Player player : Bukkit.getOnlinePlayers()) {
                AbstractTablist.createTablist(config.playerList, config.playerListHeader, config.playerListFooter, config.playerListPing, player);
            }
        }
        sender.sendMessage(ChatColor.AQUA + "FunnyGuilds " + ChatColor.GRAY + "przeladowano!");
    });
    sender.sendMessage(ChatColor.GRAY + "Przeladowywanie...");
    thread.start();
}
Also used : PluginConfig(net.dzikoysk.funnyguilds.data.configs.PluginConfig) Player(org.bukkit.entity.Player) Messages(net.dzikoysk.funnyguilds.data.Messages) Manager(net.dzikoysk.funnyguilds.data.Manager) Settings(net.dzikoysk.funnyguilds.data.Settings)

Aggregations

Manager (net.dzikoysk.funnyguilds.data.Manager)1 Messages (net.dzikoysk.funnyguilds.data.Messages)1 Settings (net.dzikoysk.funnyguilds.data.Settings)1 PluginConfig (net.dzikoysk.funnyguilds.data.configs.PluginConfig)1 Player (org.bukkit.entity.Player)1