-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSwitchCommand.java
More file actions
30 lines (24 loc) · 1.06 KB
/
SwitchCommand.java
File metadata and controls
30 lines (24 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.eternalcode.example.command;
import com.eternalcode.example.notice.ExampleMultification;
import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.server.RegisteredServer;
import dev.rollczi.litecommands.annotations.argument.Arg;
import dev.rollczi.litecommands.annotations.command.Command;
import dev.rollczi.litecommands.annotations.context.Context;
import dev.rollczi.litecommands.annotations.execute.Execute;
@Command(name = "switch")
public class SwitchCommand {
private final ExampleMultification multification;
public SwitchCommand(ExampleMultification multification) {
this.multification = multification;
}
@Execute
void execute(@Context Player player, @Arg RegisteredServer server) {
player.createConnectionRequest(server).fireAndForget();
this.multification.create()
.player(player.getUniqueId())
.notice(messagesConfig -> messagesConfig.switchedServer)
.placeholder("<server>", server.getServerInfo().getName())
.send();
}
}