mirror of
https://github.com/funkemunky/AntiVPN.git
synced 2026-05-31 17:31:55 +00:00
Implementing commands system into antivpn [v1.1]
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package dev.brighten.antivpn;
|
||||
|
||||
import dev.brighten.antivpn.api.PlayerExecutor;
|
||||
import dev.brighten.antivpn.api.VPNConfig;
|
||||
import dev.brighten.antivpn.api.VPNExecutor;
|
||||
import dev.brighten.antivpn.command.Command;
|
||||
import dev.brighten.antivpn.utils.VPNResponse;
|
||||
import dev.brighten.antivpn.utils.json.JSONException;
|
||||
import dev.brighten.antivpn.utils.json.JSONObject;
|
||||
@@ -11,6 +13,8 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter(AccessLevel.PRIVATE)
|
||||
@@ -19,17 +23,23 @@ public class AntiVPN {
|
||||
private static AntiVPN INSTANCE;
|
||||
private VPNConfig config;
|
||||
private VPNExecutor executor;
|
||||
private PlayerExecutor playerExecutor;
|
||||
private List<Command> commands = new ArrayList<>();
|
||||
|
||||
public static void start(VPNConfig config, VPNExecutor executor) {
|
||||
public static void start(VPNConfig config, VPNExecutor executor, PlayerExecutor playerExecutor) {
|
||||
//Initializing
|
||||
|
||||
INSTANCE = new AntiVPN();
|
||||
|
||||
INSTANCE.setConfig(config);
|
||||
INSTANCE.setExecutor(executor);
|
||||
INSTANCE.config = config;
|
||||
INSTANCE.executor = executor;
|
||||
INSTANCE.playerExecutor = playerExecutor;
|
||||
|
||||
getInstance().getExecutor().registerListeners();
|
||||
getInstance().getConfig().update();
|
||||
INSTANCE.executor.registerListeners();
|
||||
INSTANCE.config.update();
|
||||
|
||||
//Registering commands
|
||||
registerCommands();
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
@@ -51,4 +61,7 @@ public class AntiVPN {
|
||||
return VPNResponse.fromJson(result);
|
||||
}
|
||||
|
||||
private static void registerCommands() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user