Skip to content

Commit 770ed60

Browse files
committed
fix #129
1 parent d4a27ba commit 770ed60

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

brigadier/src/main/java/revxrsal/commands/brigadier/BrigadierParser.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,12 @@ public static <S> void addChild(final CommandNode<S> p, final CommandNode<S> nod
138138
}
139139
if (parameter.isSwitch()) {
140140
BNode<S> ofSwitch = ofSwitch(parameter);
141-
if (!addOptionalsTo.isEmpty()) {
142-
addOptionalsTo.forEach(genNode -> {
143-
genNode.then(ofSwitch);
144-
genNode.executes(createAction(command));
145-
});
146-
} else {
147-
lastNode.then(ofSwitch);
148-
lastNode.executes(createAction(command));
149-
}
141+
addOptionalsTo.forEach(genNode -> {
142+
genNode.then(ofSwitch);
143+
genNode.executes(createAction(command));
144+
});
145+
lastNode.then(ofSwitch);
146+
lastNode.executes(createAction(command));
150147
addOptionalsTo.add(ofSwitch);
151148
} else if (parameter.isFlag()) {
152149
BNode<S> ofFlag = ofFlag(parameter);

0 commit comments

Comments
 (0)