Package net.sacredlabyrinth.phaed.simpleclans.commands

Source Code of net.sacredlabyrinth.phaed.simpleclans.commands.ReloadCommand

package net.sacredlabyrinth.phaed.simpleclans.commands;

import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

/**
* @author phaed
*/
public class ReloadCommand
{
    public ReloadCommand()
    {
    }

    /**
     * Execute the command
     *
     * @param sender
     * @param arg
     */
    public void execute(CommandSender sender, String[] arg)
    {
        SimpleClans plugin = SimpleClans.getInstance();

        if (sender instanceof Player)
        {
            if (!plugin.getPermissionsManager().has((Player)sender, "simpleclans.admin.reload"))
            {
                ChatBlock.sendMessage(sender, ChatColor.RED + "Think you're slick don't ya");
            }
        }

        plugin.getSettingsManager().load();
        plugin.getStorageManager().importFromDatabase();
        SimpleClans.getInstance().getPermissionsManager().loadPermissions();

        for (Clan clan : plugin.getClanManager().getClans())
        {
            SimpleClans.getInstance().getPermissionsManager().updateClanPermissions(clan);
        }
        ChatBlock.sendMessage(sender, ChatColor.AQUA + plugin.getLang("configuration.reloaded"));

    }
}
TOP

Related Classes of net.sacredlabyrinth.phaed.simpleclans.commands.ReloadCommand

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.