3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-19 14:30:16 +01:00

Reference command permission to filter root suggestions (/via<tab>) (#3018)

Dieser Commit ist enthalten in:
_tomcraft 2022-07-13 10:24:14 +02:00 committet von GitHub
Ursprung 56e1d0a69d
Commit 2262681351
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
3 geänderte Dateien mit 7 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -8,5 +8,6 @@ loadbefore: [ProtocolLib, ProxyPipe, SpigotLib, SkinRestorer]
softdepend: [ProtocolSupport, PacketListenerApi]
commands:
viaversion:
permission: viaversion.admin # The permission is also referenced here to filter root suggestions (/via<tab>)
description: Shows ViaVersion Version and more.
aliases: [viaver, vvbukkit]

Datei anzeigen

@ -25,7 +25,7 @@ public class BungeeCommand extends Command implements TabExecutor {
private final BungeeCommandHandler handler;
public BungeeCommand(BungeeCommandHandler handler) {
super("viaversion", "", "viaver", "vvbungee"); // The CommandHandler will handle the permission
super("viaversion", "viaversion.admin", "viaver", "vvbungee"); // The permission is also referenced here to filter root suggestions (/via<tab>)
this.handler = handler;
}

Datei anzeigen

@ -41,4 +41,9 @@ public class VelocityCommandHandler extends ViaCommandHandler implements SimpleC
public List<String> suggest(Invocation invocation) {
return onTabComplete(new VelocityCommandSender(invocation.source()), invocation.arguments());
}
@Override
public boolean hasPermission(Invocation invocation) {
return invocation.source().hasPermission("viaversion.admin"); // The permission is also referenced here to filter root suggestions (/via<tab>)
}
}