Skip to content

Commit

Permalink
Fix If command.
Browse files Browse the repository at this point in the history
  • Loading branch information
aufdemrand committed Jun 30, 2013
1 parent 620f3f7 commit ae4b010
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
Expand Up @@ -45,7 +45,7 @@ public void setComparable(String arg) {
else if (arg.equalsIgnoreCase("false")) comparable = false;

// If a List<Object>
else if (dList.matches(arg)) {
else if (arg.contains("|") || arg.startsWith("li@")) {
comparable = dList.valueOf(arg);
}

Expand Down
Expand Up @@ -18,15 +18,32 @@

/**
* Runs a task script in a new ScriptQueue.
* This replaces the now-deprecated runtask queue command.
*
*
* This replaces the now-deprecated runtask command with queue argument.
*
* @author Jeremy Schroeder
*
*/
public class RunCommand extends AbstractCommand {

public String getHelp() {
return "Runs a script in a new ScriptQueue. By using a new and separate" +
"queue, scripts can be delayed, run instantly, and even used to" +
"create loops. If wanting to run a series of commands in the same" +
"queue, use the 'inject' command. \n" +
" \n" +
"Use to start an 'event' that is independent of the current script. \n" +
"- run giant_door_open_script \n" +
"Use the 'as' argument to attach a player or npc. \n" +
"- run start_walking as:n@4 \n" +
"Name the queue with an 'id' argument. \n" +
"- run goal_tracker id:<p.name>'s_goal_tracker \n" +
"Put a script's execution off by specifying a delay. \n" +
"- run gate_closer delay:10s \n" +
"Use run with a delay and 'loop' argument to create a script on a " +
"timer. You can even specify the amount of loops.\n" +
"- run server_announcement loop";
}

@Override
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {

Expand Down
@@ -1,6 +1,5 @@
package net.aufdemrand.denizen.scripts.commands.player;

import net.aufdemrand.denizen.utilities.ExpUtil;
import org.bukkit.entity.Player;

import net.aufdemrand.denizen.exceptions.CommandExecutionException;
Expand Down
Expand Up @@ -90,7 +90,7 @@ else if (aH.matchesValueArg("target, targets", arg, ArgumentType.Custom)) {
// to the targets
if (targets.size() == 0) {

if (scriptEntry.getPlayer() == null) {
if (scriptEntry.getPlayer() == null || !scriptEntry.getPlayer().isOnline()) {
throw new InvalidArgumentsException(Messages.ERROR_NO_PLAYER);
}
else {
Expand Down

0 comments on commit ae4b010

Please sign in to comment.