Added overridden-commands. Commands beginning with /e will also give Essentials precedence.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1193 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
zenexer 2011-04-15 01:41:42 +00:00
parent 7463d06594
commit a8ef55e057
5 changed files with 52 additions and 19 deletions

View file

@ -98,6 +98,19 @@ public class Settings implements IConf
return config.getBoolean("restrict-" + label.toLowerCase(), false);
}
public boolean isCommandOverridden(String name)
{
List<String> defaultList = new ArrayList<String>(1);
defaultList.add("god");
for (String c : config.getStringList("overridden-commands", defaultList))
{
if (!c.equalsIgnoreCase(name))
continue;
return true;
}
return config.getBoolean("override-" + name.toLowerCase(), false);
}
public int getCommandCost(IEssentialsCommand cmd)
{
return getCommandCost(cmd.getName());
@ -436,12 +449,12 @@ public class Settings implements IConf
return epBreakList;
}
public Boolean spawnIfNoHome()
public boolean spawnIfNoHome()
{
return config.getBoolean("spawn-if-no-home", false);
}
public Boolean warnOnBuildDisallow()
public boolean warnOnBuildDisallow()
{
return config.getBoolean("warn-on-build-disallow", false);
}