Boosters/velocity/src/main/java/com/alttd/vboosters/VelocityBoosters.java

68 lines
2.1 KiB
Java
Raw Normal View History

2021-11-04 16:57:55 +00:00
package com.alttd.vboosters;
2021-09-06 17:35:04 +00:00
2021-11-04 16:57:55 +00:00
import com.alttd.proxydiscordlink.DiscordLink;
import com.alttd.proxydiscordlink.bot.api.DiscordSendMessage;
import com.alttd.vboosters.commands.BoosterCommand;
import com.alttd.vboosters.listeners.PluginMessageListener;
2021-09-06 17:35:04 +00:00
import com.google.inject.Inject;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.plugin.Dependency;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
import org.slf4j.Logger;
// TODO use the version created in build.gradle.kts
@Plugin(id = "boosterplugin", name = "BoosterPlugin", version = "1.0.0",
description = "Easily manage all boosters on the Altitude Minecraft Server Network.",
authors = {"destro174", "teri"},
2021-11-04 16:57:55 +00:00
dependencies = {@Dependency(id = "luckperms"),@Dependency(id = "proxydiscordlink")}
2021-09-06 17:35:04 +00:00
)
public class VelocityBoosters {
private static VelocityBoosters plugin;
private final ProxyServer server;
private final Logger logger;
private ChannelIdentifier channelIdentifier = MinecraftChannelIdentifier.from("altitude:boosterplugin");
@Inject
public VelocityBoosters(ProxyServer proxyServer, Logger proxyLogger) {
plugin = this;
server = proxyServer;
logger = proxyLogger;
}
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
server.getChannelRegistrar().register(channelIdentifier);
server.getEventManager().register(this, new PluginMessageListener(channelIdentifier));
loadCommands();
}
public static VelocityBoosters getPlugin() {
return plugin;
}
public Logger getLogger() {
return logger;
}
public ProxyServer getProxy() {
return server;
}
public void loadCommands() {
// all (proxy)commands go here
2021-11-04 16:57:55 +00:00
new BoosterCommand(server);
2021-09-06 17:35:04 +00:00
}
public ChannelIdentifier getChannelIdentifier() {
return channelIdentifier;
}
}