// Path: src/main/java/top/dreamcity/AntiCheat/Event/CheckCheatEvent.java
// public class CheckCheatEvent extends PlayerEvent implements Cancellable {
// 
//     public AntiCheat.CheatType cheatType;
// 
//     private static final HandlerList handlers = new HandlerList();
// 
//     public static HandlerList getHandlers() {
//         return handlers;
//     }
// 
//     public CheckCheatEvent(Player player, AntiCheat.CheatType cheatType) {
//         this.player = player;
//         this.cheatType = cheatType;
//     }
// 
//     public AntiCheat.CheatType getCheatType() {
//         return cheatType;
//     }
// 
// }
// 
// Path: src/main/java/top/dreamcity/AntiCheat/Event/PlayerCheating.java
// public class PlayerCheating extends PlayerEvent implements Cancellable {
// 
//     public AntiCheat.CheatType cheatType;
// 
//     private static final HandlerList handlers = new HandlerList();
// 
//     public static HandlerList getHandlers() {
//         return handlers;
//     }
// 
//     public PlayerCheating(Player player, AntiCheat.CheatType cheatType) {
//         this.player = player;
//         this.cheatType = cheatType;
//     }
// 
//     public AntiCheat.CheatType getCheatType() {
//         return cheatType;
//     }
// 
// }


import cn.nukkit.Player;
import cn.nukkit.Server;
import cn.nukkit.block.Block;
import cn.nukkit.entity.Entity;
import top.dreamcity.AntiCheat.Event.CheckCheatEvent;
import top.dreamcity.AntiCheat.Event.PlayerCheating;


    public Reach(Player player, Entity entity) {
        super(player);
        this.entity = entity;
    }

    @Override
    public CheatType getCheatType() {
        return CheatType.REACH;
    }


    @Override
    public boolean isCheat() {
        CheckCheatEvent event = new CheckCheatEvent(player, getCheatType());
        Server.getInstance().getPluginManager().callEvent(event);
        if (player.getGamemode() != 0) event.setCancelled();

        if (event.isCancelled()) return false;
        boolean flag = false;
        if (entity != null) {
            if (entity.distance(player) >= 4) {
                flag = true;
            }
        } else if (block != null) {
            if (block.distance(player) >= 6) {
                flag = true;
            }
        }
        if (flag) {

// Path: src/main/java/top/dreamcity/AntiCheat/Event/CheckCheatEvent.java
// public class CheckCheatEvent extends PlayerEvent implements Cancellable {
// 
//     public AntiCheat.CheatType cheatType;
// 
//     private static final HandlerList handlers = new HandlerList();
// 
//     public static HandlerList getHandlers() {
//         return handlers;
//     }
// 
//     public CheckCheatEvent(Player player, AntiCheat.CheatType cheatType) {
//         this.player = player;
//         this.cheatType = cheatType;
//     }
// 
//     public AntiCheat.CheatType getCheatType() {
//         return cheatType;
//     }
// 
// }
// 
// Path: src/main/java/top/dreamcity/AntiCheat/Event/PlayerCheating.java
// public class PlayerCheating extends PlayerEvent implements Cancellable {
// 
//     public AntiCheat.CheatType cheatType;
// 
//     private static final HandlerList handlers = new HandlerList();
// 
//     public static HandlerList getHandlers() {
//         return handlers;
//     }
// 
//     public PlayerCheating(Player player, AntiCheat.CheatType cheatType) {
//         this.player = player;
//         this.cheatType = cheatType;
//     }
// 
//     public AntiCheat.CheatType getCheatType() {
//         return cheatType;
//     }
// 
// }


// Path: src/main/java/top/dreamcity/AntiCheat/Cheat/combat/Reach.java
import cn.nukkit.Player;
import cn.nukkit.Server;
import cn.nukkit.block.Block;
import cn.nukkit.entity.Entity;
import top.dreamcity.AntiCheat.Event.CheckCheatEvent;
import top.dreamcity.AntiCheat.Event.PlayerCheating;


    public Reach(Player player, Entity entity) {
        super(player);
        this.entity = entity;
    }

    @Override
    public CheatType getCheatType() {
        return CheatType.REACH;
    }


    @Override
    public boolean isCheat() {
        CheckCheatEvent event = new CheckCheatEvent(player, getCheatType());
        Server.getInstance().getPluginManager().callEvent(event);
        if (player.getGamemode() != 0) event.setCancelled();

        if (event.isCancelled()) return false;
        boolean flag = false;
        if (entity != null) {
            if (entity.distance(player) >= 4) {
                flag = true;
            }
        } else if (block != null) {
            if (block.distance(player) >= 6) {
                flag = true;
            }
        }
        if (flag) {

            PlayerCheating event2 = new PlayerCheating(player, getCheatType());
