Files
src
build.gradle
IMPORTANT.txt
manifest.kod
Code
28 1,455
src/main/java/com/secureauth/secureauth/SecureAuth.java
package com.secureauth.secureauth;
import com.secureauth.secureauth.commands.AuthCommand;
import com.secureauth.secureauth.data.AuthDataManager;
import com.secureauth.secureauth.inventory.gui.GUIListener;
import com.secureauth.secureauth.inventory.gui.GUIManager;
import com.secureauth.secureauth.listeners.*;
import com.secureauth.secureauth.managers.*;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class SecureAuth extends JavaPlugin {
@Getter
private static SecureAuth instance;
private GUIManager guiManager;
private AuthDataManager authDataManager;
private RestrictionManager restrictionManager;
private TeleportManager teleportManager;
private SessionManager sessionManager;
private AntiBotManager antiBotManager;
private AuthManager authManager;
@Override
public void onEnable() {
instance = this;
saveDefaultConfig();
this.guiManager = new GUIManager();
this.authDataManager = new AuthDataManager(this);
this.restrictionManager = new RestrictionManager(this);
this.teleportManager = new TeleportManager(this);
this.sessionManager = new SessionManager(this);
this.antiBotManager = new AntiBotManager(this);
this.authManager = new AuthManager(this);
registerListeners();
registerCommands();
getLogger().info("SecureAuth enabled successfully!");
}
@Override
public void onDisable() {
if (authDataManager != null) {
authDataManager.saveAll();
}
getLogger().info("SecureAuth disabled successfully!");
}
private void registerListeners() {
PluginManager pm = Bukkit.getPluginManager();
pm.registerEvents(new GUIListener(guiManager), this);
pm.registerEvents(new PlayerJoinListener(this), this);
pm.registerEvents(new PlayerQuitListener(this), this);
pm.registerEvents(new PlayerMoveListener(this), this);
pm.registerEvents(new PlayerChatListener(this), this);
pm.registerEvents(new PlayerCommandListener(this), this);
pm.registerEvents(new PlayerInteractListener(this), this);
}
private void registerCommands() {
getCommand("auth").setExecutor(new AuthCommand(this));
}
public void debug(String message) {
if (getConfig().getBoolean("debug.enabled") && getConfig().getBoolean("debug.log-to-console")) {
getLogger().info("[DEBUG] " + message);
}
}
}