Search in sources :

Example 1 with Manager

use of net.dzikoysk.funnyguilds.data.Manager 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)

Example 2 with Manager

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

the class FunnyGuilds method onEnable.

@Override
public void onEnable() {
    new ScoreboardStack(this).start();
    new Manager().start();
    new MetricsCollector(this).start();
    AsynchronouslyRepeater repeater = AsynchronouslyRepeater.getInstance();
    repeater.start();
    PluginManager pluginManager = Bukkit.getPluginManager();
    PluginConfig config = Settings.getConfig();
    pluginManager.registerEvents(new GuiActionHandler(), this);
    pluginManager.registerEvents(new EntityDamage(), this);
    pluginManager.registerEvents(new EntityInteract(), this);
    pluginManager.registerEvents(new PlayerChat(), this);
    pluginManager.registerEvents(new PlayerDeath(), this);
    pluginManager.registerEvents(new PlayerJoin(this), this);
    pluginManager.registerEvents(new PlayerKick(), this);
    pluginManager.registerEvents(new PlayerLogin(), this);
    pluginManager.registerEvents(new PlayerQuit(), this);
    if (config.regionsEnabled) {
        pluginManager.registerEvents(new BlockBreak(), this);
        pluginManager.registerEvents(new BlockIgnite(), this);
        pluginManager.registerEvents(new BlockPlace(), this);
        pluginManager.registerEvents(new BucketAction(), this);
        pluginManager.registerEvents(new EntityExplode(), this);
        pluginManager.registerEvents(new HangingBreak(), this);
        pluginManager.registerEvents(new HangingPlace(), this);
        pluginManager.registerEvents(new PlayerCommand(), this);
        pluginManager.registerEvents(new PlayerInteract(), this);
        if (config.eventMove) {
            pluginManager.registerEvents(new PlayerMove(), this);
        }
        if (config.eventPhysics) {
            pluginManager.registerEvents(new BlockPhysics(), this);
        }
    }
    this.eventManager.enable();
    this.patch();
    Version.isNewAvailable(getServer().getConsoleSender(), true);
    PluginHook.init();
    FunnyLogger.info("~ Created by FunnyGuilds Team ~");
}
Also used : GuiActionHandler(net.dzikoysk.funnyguilds.element.gui.GuiActionHandler) EventManager(net.dzikoysk.funnyguilds.system.event.EventManager) ConcurrencyManager(net.dzikoysk.funnyguilds.concurrency.ConcurrencyManager) Manager(net.dzikoysk.funnyguilds.data.Manager) DescriptionManager(net.dzikoysk.funnyguilds.util.DescriptionManager) PluginManager(org.bukkit.plugin.PluginManager) AsynchronouslyRepeater(net.dzikoysk.funnyguilds.system.AsynchronouslyRepeater) PluginManager(org.bukkit.plugin.PluginManager) MetricsCollector(net.dzikoysk.funnyguilds.util.metrics.MetricsCollector) ScoreboardStack(net.dzikoysk.funnyguilds.element.ScoreboardStack) PluginConfig(net.dzikoysk.funnyguilds.data.configs.PluginConfig)

Aggregations

Manager (net.dzikoysk.funnyguilds.data.Manager)2 PluginConfig (net.dzikoysk.funnyguilds.data.configs.PluginConfig)2 ConcurrencyManager (net.dzikoysk.funnyguilds.concurrency.ConcurrencyManager)1 Messages (net.dzikoysk.funnyguilds.data.Messages)1 Settings (net.dzikoysk.funnyguilds.data.Settings)1 ScoreboardStack (net.dzikoysk.funnyguilds.element.ScoreboardStack)1 GuiActionHandler (net.dzikoysk.funnyguilds.element.gui.GuiActionHandler)1 AsynchronouslyRepeater (net.dzikoysk.funnyguilds.system.AsynchronouslyRepeater)1 EventManager (net.dzikoysk.funnyguilds.system.event.EventManager)1 DescriptionManager (net.dzikoysk.funnyguilds.util.DescriptionManager)1 MetricsCollector (net.dzikoysk.funnyguilds.util.metrics.MetricsCollector)1 Player (org.bukkit.entity.Player)1 PluginManager (org.bukkit.plugin.PluginManager)1