Merge pull request #104 from wizjany/opPerms

Added config for op permissions
This commit is contained in:
MonsieurApple 2011-05-16 17:09:59 -07:00
commit 64ce904ec1
2 changed files with 11 additions and 1 deletions

View File

@ -57,6 +57,7 @@ public class WorldConfiguration {
private SignChestProtection chestProtection = new SignChestProtection();
/* Configuration data start */
public boolean opPermissions;
public boolean fireSpreadDisableToggle;
public boolean enforceOneSession;
public boolean itemDurability;
@ -147,6 +148,8 @@ private void loadConfiguration() {
Configuration config = new Configuration(this.configFile);
config.load();
opPermissions = config.getBoolean("op-permissions", true);
enforceOneSession = config.getBoolean("protection.enforce-single-session", true);
itemDurability = config.getBoolean("protection.item-durability", true);
removeInfiniteStacks = config.getBoolean("protection.remove-infinite-stacks", false);

View File

@ -276,7 +276,14 @@ public String toName(CommandSender sender) {
*/
public boolean hasPermission(CommandSender sender, String perm) {
if (sender.isOp()) {
return true;
if (sender instanceof Player) {
if (this.getGlobalConfiguration().get(((Player) sender).
getWorld()).opPermissions) {
return true;
}
} else {
return true;
}
}
// Invoke the permissions resolver