package me.trouper.sentinel.data.config;

import io.github.itzispyder.pdk.utils.misc.config.JsonSerializable;
import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.data.config.lists.SwearList;

import java.io.File;
import java.util.Arrays;
import java.util.List;

public class ViolationConfig implements JsonSerializable<SwearList> {
    @Override
    public File getFile() {
        File file = new File(Sentinel.getInstance().getDirector().io.getDataFolder(), "/violation-config.json");
        file.getParentFile().mkdirs();
        return file;
    }


    public CommandBlockWhitelist commandBlockWhitelist = new CommandBlockWhitelist();
    public CommandBlockMinecartPlace commandBlockMinecartPlace = new CommandBlockMinecartPlace();
    public CommandBlockMinecartUse commandBlockMinecartUse = new CommandBlockMinecartUse();
    public CommandBlockMinecartEdit commandBlockMinecartEdit = new CommandBlockMinecartEdit();
    public CommandBlockMinecartBreak commandBlockMinecartBreak = new CommandBlockMinecartBreak();
    public CommandBlockPlace commandBlockPlace = new CommandBlockPlace();
    public CommandBlockUse commandBlockUse = new CommandBlockUse();
    public CommandBlockEdit commandBlockEdit = new CommandBlockEdit();
    public CommandBlockBreak commandBlockBreak = new CommandBlockBreak();
    public CommandExecute commandExecute = new CommandExecute();
    public CreativeHotbarAction creativeHotbarAction = new CreativeHotbarAction();
    public StructureBlockPlace structureBlockPlace = new StructureBlockPlace();
    public StructureBlockBreak structureBlockBreak = new StructureBlockBreak();
    public StructureBlockUse structureBlockUse = new StructureBlockUse();
    public JigsawBlockPlace jigsawBlockPlace = new JigsawBlockPlace();
    public JigsawBlockBreak jigsawBlockBreak = new JigsawBlockBreak();
    public JigsawBlockUse jigsawBlockUse = new JigsawBlockUse();

    public class JigsawBlockPlace {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    } 

    public class JigsawBlockBreak {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    }

    public class JigsawBlockUse {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    }
    
    public class StructureBlockPlace {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    } 

    public class StructureBlockBreak {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    }

    public class StructureBlockUse {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    }

    public class CommandBlockMinecartBreak {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    }

    public class CommandBlockBreak {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    }

    public class CommandBlockEdit {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    }

    public class CommandBlockMinecartEdit {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    }

    public class CommandBlockMinecartPlace {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    }

    public class CommandBlockMinecartUse {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    }

    public class CommandBlockPlace {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    }

    public class CommandBlockUse {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
        );
    }

    public class CreativeHotbarAction {
        public boolean enabled = true;
        public boolean deop = true;
        public boolean logToDiscord = true;
        public boolean punish = false;
        public List<String> punishmentCommands = Arrays.asList(
                "gamemode survival %player%"
        );
    }

    public class CommandExecute {
        public Dangerous dangerous = new Dangerous();
        public Logged logged = new Logged();
        public Specific specific = new Specific();
        public class Dangerous {
            public boolean enabled = true;
            public List<String> commands = Arrays.asList(
                    "op",
                    "deop",
                    "stop",
                    "restart",
                    "execute",
                    "sudo",
                    "esudo",
                    "fill",
                    "setblock",
                    "data",
                    "whitelist",
                    "lp",
                    "luckperms",
                    "perms",
                    "perm",
                    "permission",
                    "permissions",
                    "pm",
                    "pluginmanager",
                    "rl",
                    "reload",
                    "plugman",
                    "spigot",
                    "paper"
            );
            public boolean deop = true;
            public boolean logToDiscord = true;
            public boolean punish = false;
            public List<String> punishmentCommands = Arrays.asList(
                    "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
            );
        }
        public class Logged {
            public boolean enabled = true;
            public List<String> commands = Arrays.asList(
                    "give",
                    "item"
            );
            public boolean logToDiscord = true;
        }
        public class Specific {
            public boolean enabled = true;
            public boolean logToDiscord = false;
            public boolean punish = false;
            public List<String> punishmentCommands = Arrays.asList(
                    "ban %player% ]=- Sentinel -=[ \nYou have been banned for attempting a dangerous action. \nIf you believe this to be a mistake, please contact the server owner."
            );
            public List<String> whitelist = Arrays.asList(
                    "pluginwithstupidgui:callback"
            );
        }
    }

    public class CommandBlockWhitelist {
        public boolean enabled = true;
        public boolean destroyBlock = false;
        public boolean destroyCart = false;
        public boolean attemptRestore = true;
        public boolean logToDiscord = false;
        public List<String> disabledCommands = Arrays.asList(
                "op",
                "deop",
                "minecraft:op",
                "minecraft:deop"
        );
    }

}
