Package dan200.computercraft.api.turtle
Class TurtleCommandResult
java.lang.Object
dan200.computercraft.api.turtle.TurtleCommandResult
Used to indicate the result of executing a turtle command.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TurtleCommandResult
failure()
Create a failed command result with no error message.static TurtleCommandResult
Create a failed command result with an error message.@Nullable String
Get the error message of this command result.@Nullable Object @Nullable []
Get the resulting values of this command result.boolean
Determine whether the command executed successfully.static TurtleCommandResult
success()
Create a successful command result with no result.static TurtleCommandResult
Create a successful command result with the given result values.
-
Method Details
-
success
Create a successful command result with no result.- Returns:
- A successful command result with no values.
-
success
Create a successful command result with the given result values.- Parameters:
results
- The results of executing this command.- Returns:
- A successful command result with the given values.
-
failure
Create a failed command result with no error message.- Returns:
- A failed command result with no message.
-
failure
Create a failed command result with an error message.- Parameters:
errorMessage
- The error message to provide.- Returns:
- A failed command result with a message.
-
isSuccess
public boolean isSuccess()Determine whether the command executed successfully.- Returns:
- If the command was successful.
-
getErrorMessage
Get the error message of this command result.- Returns:
- The command's error message, or
null
if it was a success.
-
getResults
Get the resulting values of this command result.- Returns:
- The command's result, or
null
if it was a failure.
-