Files
src
pom.xml
Code
26 1,595
src/main/java/com/advancedanticheat/AdvancedAntiCheat.java
package com.advancedanticheat;
import com.advancedanticheat.command.AACCommand;
import com.advancedanticheat.command.PanelCommand;
import com.advancedanticheat.config.ConfigManager;
import com.advancedanticheat.data.PlayerDataManager;
import com.advancedanticheat.data.ViolationManager;
import com.advancedanticheat.gui.AdminPanelGUI;
import com.advancedanticheat.gui.GUIManager;
import com.advancedanticheat.gui.GUIListener;
import com.advancedanticheat.punishment.PunishmentManager;
import org.bukkit.plugin.java.JavaPlugin;
public class AdvancedAntiCheat extends JavaPlugin {
private static AdvancedAntiCheat instance;
private ConfigManager configManager;
private PlayerDataManager playerDataManager;
private ViolationManager violationManager;
private PunishmentManager punishmentManager;
private AlertManager alertManager;
private AdminPanelGUI adminPanelGUI;
private GUIManager guiManager;
@Override
public void onEnable() {
instance = this;
saveDefaultConfig();
this.configManager = new ConfigManager(this);
this.alertManager = new AlertManager(this);
this.playerDataManager = new PlayerDataManager();
this.violationManager = new ViolationManager(this, configManager);
this.punishmentManager = new PunishmentManager(this, configManager, violationManager);
this.guiManager = new GUIManager();
this.adminPanelGUI = new AdminPanelGUI(this);
getCommand("panel").setExecutor(new PanelCommand(this));
getCommand("aac").setExecutor(new AACCommand(this));
getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
getServer().getPluginManager().registerEvents(
new com.advancedanticheat.checks.combat.KillAuraCheck(this), this
);
getServer().getPluginManager().registerEvents(
new com.advancedanticheat.checks.combat.WallHitCheck(this), this
);
getServer().getPluginManager().registerEvents(
new com.advancedanticheat.checks.exploit.WallPlaceCheck(this), this
);
getServer().getPluginManager().registerEvents(
new com.advancedanticheat.checks.exploit.EnderPearlCheck(this), this
);
getServer().getPluginManager().registerEvents(
new com.advancedanticheat.checks.movement.NoPushCheck(this), this
);
getServer().getPluginManager().registerEvents(
new com.advancedanticheat.checks.movement.WebCheck(this), this
);
getServer().getPluginManager().registerEvents(
new com.advancedanticheat.checks.world.XRayCheck(this), this
);
getServer().getPluginManager().registerEvents(
new com.advancedanticheat.checks.movement.BoatFlyCheck(this), this
);
getServer().getPluginManager().registerEvents(
new com.advancedanticheat.checks.player.HealthDisplayCheck(this), this
);
getLogger().info("AdvancedAntiCheat v" + getDescription().getVersion() + " enabled.");
}
@Override
public void onDisable() {
if (playerDataManager != null) playerDataManager.cleanup();
instance = null;
getLogger().info("AdvancedAntiCheat disabled.");
}
public static AdvancedAntiCheat getInstance() { return instance; }
public ConfigManager getConfigManager() { return configManager; }
public PlayerDataManager getPlayerDataManager() { return playerDataManager; }
public ViolationManager getViolationManager() { return violationManager; }
public PunishmentManager getPunishmentManager() { return punishmentManager; }
public AlertManager getAlertManager() { return alertManager; }
public AdminPanelGUI getAdminPanelGUI() { return adminPanelGUI; }
public GUIManager getGUIManager() { return guiManager; }
}