1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-31 04:36:33 +00:00

Remove commands from autocomplete/help list that cannot be run (#2602)

* only tabcomplete for commands the sender has permission for

* set permission defaults for spigot

* Make velocity autocomplete on arg length 0 and 1

* fix advancements perm in spigot plugin.yml and add settings perm

(whoops)

* don't show bedrock commands to java players

* modify spigot perm defaults

* censor help menu, abstract tab complete code

* Bedrock players don't get cmd argument suggestions

* update spigot plugin.yml
This commit is contained in:
Konicai
2021-10-30 21:57:54 -04:00
committed by GitHub
parent c115afba85
commit f883dfdf2c
14 changed files with 132 additions and 30 deletions

View File

@@ -40,8 +40,8 @@ import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
@@ -82,9 +82,9 @@ public class GeyserSpongeCommandExecutor extends CommandExecutor implements Comm
@Override
public List<String> getSuggestions(CommandSource source, String arguments, @Nullable Location<World> targetPosition) {
if (arguments.split(" ").length == 1) {
return connector.getCommandManager().getCommandNames();
return tabComplete(new SpongeCommandSender(source));
}
return new ArrayList<>();
return Collections.emptyList();
}
@Override

View File

@@ -51,4 +51,9 @@ public class SpongeCommandSender implements CommandSender {
public boolean isConsole() {
return handle instanceof ConsoleSource;
}
@Override
public boolean hasPermission(String permission) {
return handle.hasPermission(permission);
}
}