// Path: src/main/java/top/dreamcity/AntiCheat/AntiCheatAPI.java
// public interface AntiCheatAPI {
// 
//     static AntiCheat getInstance() {
//         return AntiCheat.getInstance();
//     }
// 
//     MasterConfig getMasterConfig();
// 
//     void addRecord(Player player, top.dreamcity.AntiCheat.Cheat.AntiCheat.CheatType cheatType);
// 
// }
// 
// 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 top.dreamcity.AntiCheat.AntiCheatAPI;
import top.dreamcity.AntiCheat.Event.CheckCheatEvent;
import top.dreamcity.AntiCheat.Event.PlayerCheating;
import java.util.ArrayList;

package top.dreamcity.AntiCheat.Cheat.chat;



/**
 * 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 CheckWords extends Chat {

    public CheckWords(Player player, String message) {
        super(player, message);
    }

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

    @Override
    public boolean isCheat() {
        CheckCheatEvent event = new CheckCheatEvent(player, getCheatType());
        Server.getInstance().getPluginManager().callEvent(event);
        if (event.isCancelled()) return false;
        ArrayList<String> list = AntiCheatAPI.getInstance().getMasterConfig().getSensitiveWords();
        for (String sw : list) {
            if (message.contains(sw)) {
                PlayerCheating event2 = new PlayerCheating(player, getCheatType());
                Server.getInstance().getPluginManager().callEvent(event2);
                return !event.isCancelled();
            }
        }
        return false;
    }

    public String ChangeMessage() {
        if (isCheat()) {

// Path: src/main/java/top/dreamcity/AntiCheat/AntiCheatAPI.java
// public interface AntiCheatAPI {
// 
//     static AntiCheat getInstance() {
//         return AntiCheat.getInstance();
//     }
// 
//     MasterConfig getMasterConfig();
// 
//     void addRecord(Player player, top.dreamcity.AntiCheat.Cheat.AntiCheat.CheatType cheatType);
// 
// }
// 
// 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/chat/CheckWords.java
import cn.nukkit.Player;
import cn.nukkit.Server;
import top.dreamcity.AntiCheat.AntiCheatAPI;
import top.dreamcity.AntiCheat.Event.CheckCheatEvent;
import top.dreamcity.AntiCheat.Event.PlayerCheating;
import java.util.ArrayList;

package top.dreamcity.AntiCheat.Cheat.chat;



/**
 * 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 CheckWords extends Chat {

    public CheckWords(Player player, String message) {
        super(player, message);
    }

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

    @Override
    public boolean isCheat() {
        CheckCheatEvent event = new CheckCheatEvent(player, getCheatType());
        Server.getInstance().getPluginManager().callEvent(event);
        if (event.isCancelled()) return false;
        ArrayList<String> list = AntiCheatAPI.getInstance().getMasterConfig().getSensitiveWords();
        for (String sw : list) {
            if (message.contains(sw)) {
                PlayerCheating event2 = new PlayerCheating(player, getCheatType());
                Server.getInstance().getPluginManager().callEvent(event2);
                return !event.isCancelled();
            }
        }
        return false;
    }

    public String ChangeMessage() {
        if (isCheat()) {

            ArrayList<String> list = AntiCheatAPI.getInstance().getMasterConfig().getSensitiveWords();
