File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
commands/src/main/java/com/wizardlybump17/wlib/command/result Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,10 @@ public interface CommandResult<T> {
8282 return new NotFoundResult <>(lastInputIndex , lastNode );
8383 }
8484
85+ static <T > @ NotNull ConflictResult <T > conflict (int lastInputIndex , @ NotNull CommandNode <?> lastNode ) {
86+ return new ConflictResult <>(lastInputIndex , lastNode );
87+ }
88+
8589 //with context
8690
8791 static <T > @ NotNull SuccessResult <T > successful (@ NotNull CommandContext context , @ Nullable T data ) {
@@ -115,4 +119,8 @@ public interface CommandResult<T> {
115119 static <T > @ NotNull NotFoundResult <T > notFound (@ NotNull CommandContext context ) {
116120 return notFound (context .lastInputIndex (), context .lastNode ());
117121 }
122+
123+ static <T > @ NotNull ConflictResult <T > conflict (@ NotNull CommandContext context ) {
124+ return conflict (context .lastInputIndex (), context .lastNode ());
125+ }
118126}
Original file line number Diff line number Diff line change 1+ package com .wizardlybump17 .wlib .command .result .error ;
2+
3+ import com .wizardlybump17 .wlib .command .node .CommandNode ;
4+ import org .jetbrains .annotations .NotNull ;
5+
6+ public record ConflictResult <T >(int lastInputIndex , @ NotNull CommandNode <?> lastNode ) implements UnsuccessResult <T > {
7+
8+ public static final @ NotNull String ID = "WLib:Error/Conflict" ;
9+
10+ @ Override
11+ public @ NotNull String id () {
12+ return ID ;
13+ }
14+ }
You can’t perform that action at this time.
0 commit comments