Compare commits

...
2 Commits
Author SHA1 Message Date
rayzsyt 57ada83bfe Corrected wrong information 2026-02-17 03:23:46 +01:00
rayzsyt 8a86f05133 Fixed that proxies would create non-existing command tab-completions 2026-02-17 03:10:57 +01:00
3 changed files with 18 additions and 13 deletions

No files matched your search

@@ -78,6 +78,7 @@ public class SubArguments {
}
final List<String> inputs = source.getAllInputs();
final List<String> actuallyExistingCommands = helper.getChildrenNames();
if (turn) {
List<String> allEntries = inputs.stream().map(StringUtils::getFirstArg).toList();
@@ -98,8 +99,9 @@ public class SubArguments {
if (!negated) {
if (turn) helper.add(input, true);
else helper.removeSubArguments(input);
if (turn && actuallyExistingCommands.contains(StringUtils.getFirstArg(input))) {
helper.add(input, true);
} else helper.removeSubArguments(input);
continue;
}
@@ -112,7 +114,9 @@ public class SubArguments {
input = Storage.Blacklist.BlockTypeFetcher.cleanse(input);
if (turn) helper.removeSubArguments(input);
else helper.add(input, true);
else if (actuallyExistingCommands.contains(StringUtils.getFirstArg(input))) {
helper.add(input, true);
}
}
}
@@ -150,8 +150,13 @@ public class ProxyCommandNodeHelper<T> {
String part = args[index];
if (index == 0)
if (index == 0) {
part = Storage.Blacklist.BlockTypeFetcher.modify(Storage.Blacklist.BlockTypeFetcher.modify(part));
}
if (part.length() > 1 && part.startsWith("%") && part.endsWith("%")) {
return;
}
String next = index + 1 >= args.length ? null : args[index + 1];
CommandNode<T> childNode = parent.getChild(part);
@@ -21,22 +21,19 @@
# Example: alert
# Execute console command:
# Syntax: console::command
# Example: console::say %player% is an evil player
# Example: console::send %player% lobby
# Execute player command:
# Syntax: execute::command
# Example: execute::help
# Example: execute::server lobby
# Send actionbar:
# Syntax: actionbar::text
# Example: actionbar::&cThis is not cool %player%!
# Send title:
# Syntax: title::title::subtitle::5::20::5
# Example: title::&aTest title::&cHello %player%!
# Play sound: (Available sounds: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html)
# Play sound: (Available sounds: https://www.digminecraft.com/lists/sound_list_pc.php)
# Syntax: sound::soundName::volume::pitch
# Example: sound::ENTITY_ENDER_DRAGON_GROWL::1.0::1.0
# Give potion effect:
# Syntax: effect::potionEffect::duration::amplifier
# Example: effect::BLINDNESS::45::1
# Example: sound::entity.ender_dragon.growl::1.0::1.0
# Send console message to backend server:
# Syntax: p2b-message::text
# Example: p2b-message::&cPlayer &4%player% &cdid something bad.
@@ -125,7 +122,6 @@
# - "&cThis sub-command does not exist. Please type: &e/ah help"
# actions:
# - "console::say That's not nice %player%!"
# - "effect::BLINDNESS::45::1"
# - "sound::ENTITY_ENDER_DRAGON_GROWL::1.0::1.0"
# - "sound::entity.ender_dragon.growl::1.0::1.0"
# - "title::&cHey!::&cYou can't do that %player%!::5::20::5"
# - "actionbar::&cNop, sorry %player%"