Specify that ASK_SERVER is required for dynamic write callback

This commit is contained in:
Felix Cravic 2020-11-22 23:04:06 +01:00
parent 0705ab34ed
commit daa72719a0
2 changed files with 5 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import net.minestom.server.command.builder.arguments.Argument;
import net.minestom.server.command.builder.arguments.ArgumentDynamicStringArray;
import net.minestom.server.command.builder.arguments.ArgumentDynamicWord;
import net.minestom.server.command.builder.arguments.ArgumentType;
import net.minestom.server.command.builder.arguments.minecraft.SuggestionType;
import net.minestom.server.command.builder.condition.CommandCondition;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -187,7 +188,8 @@ public class Command {
/**
* Allows for tab auto completion, this is called everytime the player press a key in the chat
* when in a dynamic argument ({@link ArgumentDynamicWord} and {@link ArgumentDynamicStringArray}).
* when in a dynamic argument ({@link ArgumentDynamicWord} (when {@link SuggestionType#ASK_SERVER} is used)
* and {@link ArgumentDynamicStringArray}).
*
* @param text the whole player's text
* @return the array containing all the suggestion for the current arg (split " "), can be null

View File

@ -7,7 +7,8 @@ import org.jetbrains.annotations.Nullable;
/**
* Same as {@link ArgumentWord} with the exception
* that this argument can trigger {@link net.minestom.server.command.builder.Command#onDynamicWrite(String)}.
* that this argument can trigger {@link net.minestom.server.command.builder.Command#onDynamicWrite(String)}
* when the suggestion type is {@link SuggestionType#ASK_SERVER}, or any other suggestions available in the enum.
*/
public class ArgumentDynamicWord extends Argument<String> {