48 lines
1.2 KiB
Java
48 lines
1.2 KiB
Java
package eu.oskar3123.spigot2fa;
|
|
|
|
import eu.oskar3123.spigot2fa.command.TFACommand;
|
|
import eu.oskar3123.spigot2fa.config.Config;
|
|
import eu.oskar3123.spigot2fa.config.ConfigHandler;
|
|
import eu.oskar3123.spigot2fa.handler.TFAHandler;
|
|
import eu.oskar3123.spigot2fa.listener.JoinQuitListener;
|
|
import org.bukkit.plugin.PluginManager;
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
|
|
public class Main extends JavaPlugin
|
|
{
|
|
|
|
public TFAHandler tfaHandler;
|
|
public ConfigHandler configHandler;
|
|
public Config config;
|
|
public Config players;
|
|
|
|
@Override
|
|
public void onEnable()
|
|
{
|
|
this.configHandler = new ConfigHandler(this);
|
|
this.config = this.configHandler.addConfig(new Config("config"));
|
|
this.players = this.configHandler.addConfig(new Config("players"));
|
|
this.tfaHandler = new TFAHandler(this);
|
|
registerCommands();
|
|
registerListeners();
|
|
}
|
|
|
|
@Override
|
|
public void onDisable()
|
|
{
|
|
|
|
}
|
|
|
|
private void registerCommands()
|
|
{
|
|
getCommand("2fa").setExecutor(new TFACommand(this));
|
|
}
|
|
|
|
private void registerListeners()
|
|
{
|
|
PluginManager pm = this.getServer().getPluginManager();
|
|
pm.registerEvents(new JoinQuitListener(this), this);
|
|
}
|
|
|
|
}
|