Add missing getter
import org.spongepowered.api.text.Text;
import org.spongepowered.api.util.ResettableBuilder;
+import java.util.Optional;
+
/**
* Represents the result of a command in Sponge.
*/
@@ -68,7 +70,7 @@ static CommandResult empty() {
* @param errorMessage The error message to send
* @return The {@link CommandResult}
*/
- static CommandResult error(Text errorMessage) {
+ static CommandResult error(final Text errorMessage) {
return builder().error(errorMessage).build();
}
@@ -86,6 +88,13 @@ static CommandResult error(Text errorMessage) {
*/
int getResult();
+ /**
+ * If present, returns the error message associated with this result.
+ *
+ * @return The error {@link Text}
+ */
+ Optional<Text> getErrorMessage();
+
/**
* Builds {@link CommandResult}s.
*/
