📚 Update changelog
Also minor codestyle fixes
This commit is contained in:
parent
5b610df013
commit
544c344f18
3 changed files with 8 additions and 10 deletions
|
|
@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Use the correct default range for Double and Float parsers in the StandardParserRegistry
|
- Use the correct default range for Double and Float parsers in the StandardParserRegistry
|
||||||
- Fix Bukkit alias command suggestions without Brigadier
|
- Fix Bukkit alias command suggestions without Brigadier
|
||||||
- Fix Bukkit command alias registration when using Brigadier
|
- Fix Bukkit command alias registration when using Brigadier
|
||||||
|
- Fixed a bug where providing valid input for an argument caused cloud to no longer make suggestions
|
||||||
|
|
||||||
## [1.1.0] - 2020-10-24
|
## [1.1.0] - 2020-10-24
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -493,10 +493,10 @@ public final class CommandTree<C> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private @NonNull List<String> suggestionsForDynamicArgument(
|
private @NonNull List<@NonNull String> suggestionsForDynamicArgument(
|
||||||
final @NonNull CommandContext<C> commandContext,
|
final @NonNull CommandContext<C> commandContext,
|
||||||
final @NonNull Queue<@NonNull String> commandQueue,
|
final @NonNull Queue<@NonNull String> commandQueue,
|
||||||
final @NonNull Node<CommandArgument<C, ?>> child
|
final @NonNull Node<@Nullable CommandArgument<C, ?>> child
|
||||||
) {
|
) {
|
||||||
/* When we get in here, we need to treat compound arguments a little differently */
|
/* When we get in here, we need to treat compound arguments a little differently */
|
||||||
if (child.getValue() instanceof CompoundArgument) {
|
if (child.getValue() instanceof CompoundArgument) {
|
||||||
|
|
@ -552,7 +552,7 @@ public final class CommandTree<C> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store original input command queue before the parsers below modify it
|
// Store original input command queue before the parsers below modify it
|
||||||
final Queue<String> commandQueueOriginal = new LinkedList<String>(commandQueue);
|
final Queue<String> commandQueueOriginal = new LinkedList<>(commandQueue);
|
||||||
|
|
||||||
// START: Preprocessing
|
// START: Preprocessing
|
||||||
final ArgumentParseResult<Boolean> preParseResult = child.getValue().preprocess(
|
final ArgumentParseResult<Boolean> preParseResult = child.getValue().preprocess(
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ package cloud.commandframework.minecraft.extras;
|
||||||
|
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.TextComponent;
|
import net.kyori.adventure.text.TextComponent;
|
||||||
import net.kyori.adventure.text.TextReplacementConfig;
|
|
||||||
import net.kyori.adventure.text.format.TextColor;
|
import net.kyori.adventure.text.format.TextColor;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
|
|
@ -42,12 +41,10 @@ final class ComponentHelper {
|
||||||
final @NonNull Component component,
|
final @NonNull Component component,
|
||||||
final @NonNull TextColor highlightColor
|
final @NonNull TextColor highlightColor
|
||||||
) {
|
) {
|
||||||
return component.replaceText(
|
return component.replaceText(config -> {
|
||||||
TextReplacementConfig.builder()
|
config.match(SPECIAL_CHARACTERS_PATTERN);
|
||||||
.match(SPECIAL_CHARACTERS_PATTERN)
|
config.replacement(match -> match.color(highlightColor));
|
||||||
.replacement(match -> match.color(highlightColor))
|
});
|
||||||
.build()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static @NonNull Component repeat(
|
public static @NonNull Component repeat(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue