Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/aufdemrand/Denizen
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeebiss committed Mar 25, 2013
2 parents 650e4fa + a39586f commit f1a0b37
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException
for (String arg : scriptEntry.getArguments()) {
if (aH.matchesArg("ADD, REMOVE, REMOVEALL", arg)) {
action = Action.valueOf(aH.getStringFrom(arg).toUpperCase());
} else if (aH.matchesValueArg("TARGET", arg, ArgumentType.String)) {
target = aH.getStringFrom(arg);
} else if (aH.matchesItem(arg)) {
item = aH.getItemFrom(arg);
} else throw new InvalidArgumentsException(Messages.ERROR_UNKNOWN_ARGUMENT, arg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException
for (String arg : scriptEntry.getArguments()) {
if (aH.matchesArg("ADD, REMOVE", arg)) {
action = Action.valueOf(aH.getStringFrom(arg).toUpperCase());
} else if (aH.matchesValueArg("PLAYER", arg, ArgumentType.String)) {
player = aH.getPlayerFrom(arg);
} else if (aH.matchesValueArg("WORLD", arg, ArgumentType.String)) {
group = aH.getStringFrom(arg);
} else group = arg;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException
for (String arg : scriptEntry.getArguments()) {
if (aH.matchesArg("ADD, REMOVE", arg)) {
action = Action.valueOf(aH.getStringFrom(arg).toUpperCase());
} else if (aH.matchesValueArg("PLAYER", arg, ArgumentType.String)) {
player = aH.getPlayerFrom(arg);
} else if (aH.matchesValueArg("GROUP", arg, ArgumentType.String)) {
group = aH.getStringFrom(arg);
} else if (aH.matchesValueArg("WORLD", arg, ArgumentType.String)) {
Expand All @@ -54,6 +52,11 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
String permission = String.valueOf(scriptEntry.getObject("permission"));
String group = String.valueOf(scriptEntry.getObject("group"));
String world = String.valueOf(scriptEntry.getObject("world"));

if(group.equals("null"))
group = null;
if(world.equals("null"))
world = null;

// Report to dB
dB.report(getName(),
Expand All @@ -65,7 +68,7 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {

switch (action) {
case ADD:
if(group != null && !group.equals("null")) {
if(group != null) {
if(Depends.permissions.groupHas(world, group, permission)) {
dB.echoDebug("Group " + group + " already has permission " + permission);
} else Depends.permissions.groupAdd(world, group, permission);
Expand All @@ -76,7 +79,7 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
}
return;
case REMOVE:
if(group != null&& !group.equals("null")) {
if(group != null) {
if(!Depends.permissions.groupHas(world, group, permission)) {
dB.echoDebug("Group " + group + " does not have access to permission " + permission);
} else Depends.permissions.groupRemove(world, group, permission);
Expand Down

0 comments on commit f1a0b37

Please sign in to comment.