mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-12-28 17:37:52 +01:00
Tweak the main command a bit more
This commit is contained in:
parent
cb1538d376
commit
ad7bca010f
@ -32,13 +32,17 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class DiscordSRVCommand implements GameCommandExecutor {
|
||||
|
||||
private static Map<String, GameCommand> INSTANCES = new ConcurrentHashMap<>();
|
||||
private static final Map<String, GameCommand> INSTANCES = new ConcurrentHashMap<>();
|
||||
private static DiscordSRVCommand COMMAND;
|
||||
|
||||
public static GameCommand get(DiscordSRV discordSRV, String alias) {
|
||||
if (COMMAND == null) {
|
||||
COMMAND = new DiscordSRVCommand(discordSRV);
|
||||
}
|
||||
return INSTANCES.computeIfAbsent(alias, key ->
|
||||
GameCommand.literal(alias)
|
||||
.requiredPermission("discordsrv.player.command")
|
||||
.executor(new DiscordSRVCommand(discordSRV))
|
||||
.executor(COMMAND)
|
||||
.then(BroadcastCommand.discord(discordSRV))
|
||||
.then(BroadcastCommand.minecraft(discordSRV))
|
||||
.then(BroadcastCommand.json(discordSRV))
|
||||
|
Loading…
Reference in New Issue
Block a user