// 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.math.AxisAlignedBB;
import top.dreamcity.AntiCheat.Event.CheckCheatEvent;
import top.dreamcity.AntiCheat.Event.PlayerCheating;

package top.dreamcity.AntiCheat.Cheat.move;



/**
 * Copyright © 2017 WetABQ&DreamCityAdminGroup All right reserved.
 * Welcome to DreamCity Server Address:dreamcity.top:19132
 * Created by WetABQ(Administrator) on 2017/10/8.
 * |||    ||    ||||                           ||        ||||||||     |||||||
 * |||   |||    |||               ||         ||  |      |||     ||   |||    |||
 * |||   |||    ||     ||||||  ||||||||     ||   ||      ||  ||||   |||      ||
 * ||  |||||   ||   |||   ||  ||||        ||| |||||     ||||||||   |        ||
 * ||  || ||  ||    ||  ||      |        |||||||| ||    ||     ||| ||      ||
 * ||||   ||||     ||    ||    ||  ||  |||       |||  ||||   |||   ||||||||
 * ||     |||      |||||||     |||||  |||       |||| ||||||||      |||||    |
 * ||||
 */
public class CheckBB extends Move {

    public CheckBB(Player player) {
        super(player);
    }

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

    @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;
        double radius = (double) player.getWidth() / 2.0D;
        AxisAlignedBB bb = player.getBoundingBox().clone().setBounds(
                player.x - radius + 0.3D, player.y + 1.1D, player.z - radius + 0.3D,
                player.x + radius - 0.3D, player.y + (double) (player.getHeight() * player.scale) - 0.1D, player.z + radius - 0.3D
        );
        for (Block block : player.getBlocksAround()) {
            if (block.collidesWithBB(bb) && !block.canPassThrough() && block.getId() != Block.LADDER) {

// 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/move/CheckBB.java
import cn.nukkit.Player;
import cn.nukkit.Server;
import cn.nukkit.block.Block;
import cn.nukkit.math.AxisAlignedBB;
import top.dreamcity.AntiCheat.Event.CheckCheatEvent;
import top.dreamcity.AntiCheat.Event.PlayerCheating;

package top.dreamcity.AntiCheat.Cheat.move;



/**
 * Copyright © 2017 WetABQ&DreamCityAdminGroup All right reserved.
 * Welcome to DreamCity Server Address:dreamcity.top:19132
 * Created by WetABQ(Administrator) on 2017/10/8.
 * |||    ||    ||||                           ||        ||||||||     |||||||
 * |||   |||    |||               ||         ||  |      |||     ||   |||    |||
 * |||   |||    ||     ||||||  ||||||||     ||   ||      ||  ||||   |||      ||
 * ||  |||||   ||   |||   ||  ||||        ||| |||||     ||||||||   |        ||
 * ||  || ||  ||    ||  ||      |        |||||||| ||    ||     ||| ||      ||
 * ||||   ||||     ||    ||    ||  ||  |||       |||  ||||   |||   ||||||||
 * ||     |||      |||||||     |||||  |||       |||| ||||||||      |||||    |
 * ||||
 */
public class CheckBB extends Move {

    public CheckBB(Player player) {
        super(player);
    }

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

    @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;
        double radius = (double) player.getWidth() / 2.0D;
        AxisAlignedBB bb = player.getBoundingBox().clone().setBounds(
                player.x - radius + 0.3D, player.y + 1.1D, player.z - radius + 0.3D,
                player.x + radius - 0.3D, player.y + (double) (player.getHeight() * player.scale) - 0.1D, player.z + radius - 0.3D
        );
        for (Block block : player.getBlocksAround()) {
            if (block.collidesWithBB(bb) && !block.canPassThrough() && block.getId() != Block.LADDER) {

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