Files
src
build.gradle
Code
10 708
src/main/java/com/fairpvp/FairPvP.java
package com.fairpvp;
import com.fairpvp.check.AutoClickerCheck;
import com.fairpvp.check.KillAuraCheck;
import com.fairpvp.check.ReachCheck;
import com.fairpvp.check.VelocityCheck;
import com.fairpvp.command.FairPvPCommand;
import com.fairpvp.manager.ViolationManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class FairPvP extends JavaPlugin {
private ViolationManager violationManager;
@Override
public void onEnable() {
saveDefaultConfig();
this.violationManager = new ViolationManager(this);
registerListeners();
registerCommands();
getLogger().info("FairPvP Anticheat has been enabled!");
getLogger().info("Reach Check: " + getConfig().getBoolean("reach.enabled"));
getLogger().info("KillAura Check: " + getConfig().getBoolean("killaura.enabled"));
getLogger().info("Velocity Check: " + getConfig().getBoolean("velocity.enabled"));
}
@Override
public void onDisable() {
if (violationManager != null) {
violationManager.shutdown();
}
getLogger().info("FairPvP Anticheat has been disabled!");
}
private void registerListeners() {
if (getConfig().getBoolean("reach.enabled")) {
getServer().getPluginManager().registerEvents(new ReachCheck(this), this);
}
if (getConfig().getBoolean("killaura.enabled")) {
getServer().getPluginManager().registerEvents(new KillAuraCheck(this), this);
}
if (getConfig().getBoolean("velocity.enabled")) {
getServer().getPluginManager().registerEvents(new VelocityCheck(this), this);
}
}
private void registerCommands() {
getCommand("fairpvp").setExecutor(new FairPvPCommand(this));
}
}