package org.royaldev.rcommands;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.royaldev.royalcommands.RoyalCommands;

public class Rcmds implements CommandExecutor {

    RoyalCommands plugin;

    public Rcmds(RoyalCommands plugin) {
        this.plugin = plugin;
    }

    @Override
    public boolean onCommand(CommandSender cs, Command cmd, String label,
                             String[] args) {
        if (cmd.getName().equalsIgnoreCase("rcmds")) {
            if (!plugin.isAuthorized(cs, "rcmds.rcmds")) {
                cs.sendMessage(ChatColor.RED
                        + "You don't have permission for that!");
                plugin.log.warning("[RoyalCommands] " + cs.getName()
                        + " was denied access to the command!");
                return true;
            }
            plugin.reloadConfig();
            plugin.showcommands = plugin.getConfig()
                    .getBoolean("view_commands");
            plugin.disablegetip = plugin.getConfig()
                    .getBoolean("disable_getip");
            plugin.useWelcome = plugin.getConfig().getBoolean(
                    "enable_welcome_message");
            plugin.buildPerm = plugin.getConfig().getBoolean("use_build_perm");
            plugin.backDeath = plugin.getConfig().getBoolean("back_on_death");
            plugin.motdLogin = plugin.getConfig().getBoolean("motd_on_login");
            plugin.banMessage = plugin.getConfig()
                    .getString("default_ban_message")
                    .replaceAll("(&([a-f0-9]))", "\u00A7$2");
            plugin.noBuildMessage = plugin.getConfig().getString("no_build_message")
                    .replaceAll("(&([a-f0-9]))", "\u00A7$2");
            plugin.kickMessage = plugin.getConfig()
                    .getString("default_kick_message")
                    .replaceAll("(&([a-f0-9]))", "\u00A7$2");
            plugin.defaultStack = plugin.getConfig().getInt(
                    "default_stack_size");
            plugin.defaultWarn = plugin.getConfig().getString(
                    "default_warn_message");
            plugin.welcomeMessage = plugin.getConfig()
                    .getString("welcome_message")
                    .replaceAll("(&([a-f0-9]))", "\u00A7$2");
            plugin.warnBan = plugin.getConfig().getInt("max_warns_before_ban");
            plugin.muteCmds = plugin.getConfig().getStringList("mute_blocked_commands");
            plugin.blockedItems = plugin.getConfig().getStringList("blocked_spawn_items");
            plugin.motd = plugin.getConfig().getStringList("motd");
            cs.sendMessage(ChatColor.GREEN + "RoyalCommands " + ChatColor.BLUE
                    + "v" + plugin.version + " reloaded.");
            return true;
        }
        return false;
    }
}

@@ -469,37 +469,8 @@
 bel,
-%0A                            
  Str
@@ -645,32 +645,8 @@
 .RED
-%0A                       
  + %22
@@ -756,32 +756,8 @@
 me()
-%0A                       
  + %22
@@ -872,16 +872,17 @@
 nfig();%0A
+%0A
         
@@ -925,37 +925,16 @@
 Config()
-%0A                    
 .getBool
@@ -1007,37 +1007,16 @@
 Config()
-%0A                    
 .getBool
@@ -1099,37 +1099,16 @@
 Boolean(
-%0A                    
 %22enable_
@@ -1360,24 +1360,25 @@
 on_login%22);%0A
+%0A
             
@@ -1415,37 +1415,16 @@
 Config()
-%0A                    
 .getStri
@@ -1448,37 +1448,16 @@
 essage%22)
-%0A                    
 .replace
@@ -1574,37 +1574,16 @@
 essage%22)
-%0A                    
 .replace
@@ -1667,37 +1667,16 @@
 Config()
-%0A                    
 .getStri
@@ -1701,37 +1701,16 @@
 essage%22)
-%0A                    
 .replace
@@ -1747,112 +1747,8 @@
 %22);%0A
-            plugin.defaultStack = plugin.getConfig().getInt(%0A                    %22default_stack_size%22);%0A
     
@@ -1805,37 +1805,16 @@
 tString(
-%0A                    
 %22default
@@ -1884,37 +1884,16 @@
 Config()
-%0A                    
 .getStri
@@ -1913,37 +1913,16 @@
 essage%22)
-%0A                    
 .replace
@@ -1947,32 +1947,33 @@
 %22, %22%5Cu00A7$2%22);%0A
+%0A
             plug
@@ -2032,24 +2032,188 @@
 fore_ban%22);%0A
+            plugin.defaultStack = plugin.getConfig().getInt(%22default_stack_size%22);%0A            plugin.spawnmobLimit = plugin.getConfig().getInt(%22spawnmob_limit%22);%0A%0A
             
@@ -2444,24 +2444,25 @@
 st(%22motd%22);%0A
+%0A
             
@@ -2531,28 +2531,8 @@
 BLUE
-%0A                   
  + %22

Support for spawnmob limit