This commit is contained in:
Emalios 2023-03-30 23:29:57 +09:00 committed by GitHub
commit f02900b177
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,19 +23,25 @@ public abstract class ArgumentBuilder<S, T extends ArgumentBuilder<S, T>> {
protected abstract T getThis();
public T then(final ArgumentBuilder<S, ?> argument) {
@SafeVarargs
public final T then(final ArgumentBuilder<S, ?>... arguments) {
if (target != null) {
throw new IllegalStateException("Cannot add children to a redirected node");
}
arguments.addChild(argument.build());
for (ArgumentBuilder<S, ?> argument : arguments) {
this.arguments.addChild(argument.build());
}
return getThis();
}
public T then(final CommandNode<S> argument) {
@SafeVarargs
public final T then(final CommandNode<S>... arguments) {
if (target != null) {
throw new IllegalStateException("Cannot add children to a redirected node");
}
arguments.addChild(argument);
for (CommandNode<S> argument : arguments) {
this.arguments.addChild(argument);
}
return getThis();
}