Class CommandResult
java.lang.Object
org.mockbukkit.mockbukkit.command.CommandResult
Represents the result of a command invocation.
-
Constructor Summary
ConstructorsConstructorDescriptionCommandResult(boolean success, @NotNull MessageTarget sender) Constructs a newCommandResultwith the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.voidassertResponse(@NotNull String format, Object... objects) Deprecated, for removal: This API element is subject to removal in a future version.voidassertResponse(String message) Deprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.@NotNull MessageTargetbooleanCheck if the command executed successfully.
-
Constructor Details
-
CommandResult
Constructs a newCommandResultwith the provided parameters.- Parameters:
success- Whether the command succeeded (returned true).sender- The message target who executed the command.
-
-
Method Details
-
hasSucceeded
public boolean hasSucceeded()Check if the command executed successfully.- Returns:
trueif the command executed successfully,falseif a problem occurred.
-
assertSucceeded
Deprecated, for removal: This API element is subject to removal in a future version.Asserts if the returned code of the executed command is nottrue. -
assertFailed
Deprecated, for removal: This API element is subject to removal in a future version.Asserts if the returned code of the executed command is notfalse. -
assertResponse
Deprecated, for removal: This API element is subject to removal in a future version.Assets if the given message was not the next message send to the command sender.- Parameters:
message- The message to check for.- See Also:
-
assertResponse
@Deprecated(forRemoval=true) public void assertResponse(@NotNull @NotNull String format, Object... objects) Deprecated, for removal: This API element is subject to removal in a future version.Asserts if a given formatted message was not the next message sent to the command sender.- Parameters:
format- The formatted message to check for.objects- The objects to place into the formatted message.- See Also:
-
assertNoResponse
Deprecated, for removal: This API element is subject to removal in a future version.Asserts if more messages have been sent to the command sender.- See Also:
-
getSender
- Returns:
- The sender of this command
-