// Path: src/main/java/de/jeter/chatex/ChatEx.java
// public class ChatEx extends JavaPlugin {
// 
//     private static ChatEx INSTANCE;
//     private UpdateChecker updatechecker = null;
// 
//     @Override
//     public void onEnable() {
//         INSTANCE = this;
// 
//         Config.load();
//         Locales.load();
//         PluginManager.load();
//         ChatLogger.load();
//         RGBColors.load();
// 
//         getServer().getPluginManager().registerEvents(new ChatListener(), this);
//         getServer().getPluginManager().registerEvents(new PlayerListener(), this);
//         getCommand("chatex").setExecutor(new CommandHandler());
// 
//         if (Config.CHECK_UPDATE.getBoolean()) {
//             updatechecker = new UpdateChecker(this, 71041);
//         }
// 
//         ChannelHandler.load();
// 
//         if (Config.B_STATS.getBoolean()) {
//             Metrics metrics = new Metrics(this, 7744);
//             getLogger().info("Thanks for using bstats, it was enabled!");
//         }
// 
//         getLogger().info("is now enabled!");
//     }
// 
//     @Override
//     public void onDisable() {
//         ChatLogger.close();
//         getServer().getScheduler().cancelTasks(this);
//         getLogger().info("is now disabled!");
//     }
// 
//     public static ChatEx getInstance() {
//         return INSTANCE;
//     }
// 
//     public UpdateChecker getUpdateChecker() {
//         return this.updatechecker;
//     }
// }


import de.jeter.chatex.ChatEx;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import java.io.File;
import java.io.IOException;
/*
 * This file is part of ChatEx
 * Copyright (C) 2020 ChatEx Team
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
package de.jeter.chatex.utils;


public enum Locales {

    COMMAND_RELOAD_DESCRIPTION("Commands.Reload.Description", "Reloads the plugin and its configuration."),
    COMMAND_CLEAR_DESCRIPTION("Commands.Clear.Description", "Clears the chat."),
    COMMAND_CLEAR_CONSOLE("Commands.Clear.Console", "CONSOLE"),
    COMMAND_CLEAR_UNKNOWN("Commands.Clear.Unknown", "UNKNOWN"),
    MESSAGES_RELOAD("Messages.Commands.Reload.Success", "&aConfig was reloaded."),
    MESSAGES_CLEAR("Messages.Commands.Clear.Success", "&aThe chat has been cleared by "),
    MESSAGES_AD("Messages.Chat.AdDetected", "&4[ERROR] &7Advertising is not allowed! &c(%perm)"),
    MESSAGES_BLOCKED("Messages.Chat.BlockedWord", "&4[ERROR] &7You tried to write a word that is blocked!"),
    MESSAGES_AD_NOTIFY("Messages.Chat.AdNotify", "&c%player tried to write an ad in chat. He wrote: \n&a %message"),
    COMMAND_RESULT_NO_PERM("Messages.CommandResult.NoPermission", "&4[ERROR] &7You don't have permission for this! &c(%perm)"),
    COMMAND_RESULT_WRONG_USAGE("Messages.CommandResult.WrongUsage", "&c[ERROR] &7Wrong usage! Please type &6%cmd help&7!"),
    ANTI_SPAM_DENIED("Messages.AntiSpam.Denied", "&e[AntiSpam] &7You are not allowed to spam! Please wait another &e%time% &7seconds!"),
    PLAYER_JOIN("Messages.Player.Join", "%prefix%displayname%suffix &ejoined the game!"),
    PLAYER_KICK("Messages.Player.Kick", "%prefix%displayname%suffix &ewas kicked from the game!"),
    PLAYER_QUIT("Messages.Player.Quit", "%prefix%displayname%suffix &eleft the game!"),
    NO_LISTENING_PLAYERS("Messages.Chat.NoOneListens", "&cNo players are near you to hear you talking! Use the ranged mode to chat."),
    UPDATE_FOUND("Messages.UpdateFound", "&a[ChatEx]&7 A new update has been found on SpigotMC. Current version: %oldversion New version: %newversion"),
    ;

    private final String value;
    private final String path;
    private static YamlConfiguration cfg;
// Path: src/main/java/de/jeter/chatex/ChatEx.java
// public class ChatEx extends JavaPlugin {
// 
//     private static ChatEx INSTANCE;
//     private UpdateChecker updatechecker = null;
// 
//     @Override
//     public void onEnable() {
//         INSTANCE = this;
// 
//         Config.load();
//         Locales.load();
//         PluginManager.load();
//         ChatLogger.load();
//         RGBColors.load();
// 
//         getServer().getPluginManager().registerEvents(new ChatListener(), this);
//         getServer().getPluginManager().registerEvents(new PlayerListener(), this);
//         getCommand("chatex").setExecutor(new CommandHandler());
// 
//         if (Config.CHECK_UPDATE.getBoolean()) {
//             updatechecker = new UpdateChecker(this, 71041);
//         }
// 
//         ChannelHandler.load();
// 
//         if (Config.B_STATS.getBoolean()) {
//             Metrics metrics = new Metrics(this, 7744);
//             getLogger().info("Thanks for using bstats, it was enabled!");
//         }
// 
//         getLogger().info("is now enabled!");
//     }
// 
//     @Override
//     public void onDisable() {
//         ChatLogger.close();
//         getServer().getScheduler().cancelTasks(this);
//         getLogger().info("is now disabled!");
//     }
// 
//     public static ChatEx getInstance() {
//         return INSTANCE;
//     }
// 
//     public UpdateChecker getUpdateChecker() {
//         return this.updatechecker;
//     }
// }


// Path: src/main/java/de/jeter/chatex/utils/Locales.java
import de.jeter.chatex.ChatEx;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import java.io.File;
import java.io.IOException;

/*
 * This file is part of ChatEx
 * Copyright (C) 2020 ChatEx Team
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
package de.jeter.chatex.utils;


public enum Locales {

    COMMAND_RELOAD_DESCRIPTION("Commands.Reload.Description", "Reloads the plugin and its configuration."),
    COMMAND_CLEAR_DESCRIPTION("Commands.Clear.Description", "Clears the chat."),
    COMMAND_CLEAR_CONSOLE("Commands.Clear.Console", "CONSOLE"),
    COMMAND_CLEAR_UNKNOWN("Commands.Clear.Unknown", "UNKNOWN"),
    MESSAGES_RELOAD("Messages.Commands.Reload.Success", "&aConfig was reloaded."),
    MESSAGES_CLEAR("Messages.Commands.Clear.Success", "&aThe chat has been cleared by "),
    MESSAGES_AD("Messages.Chat.AdDetected", "&4[ERROR] &7Advertising is not allowed! &c(%perm)"),
    MESSAGES_BLOCKED("Messages.Chat.BlockedWord", "&4[ERROR] &7You tried to write a word that is blocked!"),
    MESSAGES_AD_NOTIFY("Messages.Chat.AdNotify", "&c%player tried to write an ad in chat. He wrote: \n&a %message"),
    COMMAND_RESULT_NO_PERM("Messages.CommandResult.NoPermission", "&4[ERROR] &7You don't have permission for this! &c(%perm)"),
    COMMAND_RESULT_WRONG_USAGE("Messages.CommandResult.WrongUsage", "&c[ERROR] &7Wrong usage! Please type &6%cmd help&7!"),
    ANTI_SPAM_DENIED("Messages.AntiSpam.Denied", "&e[AntiSpam] &7You are not allowed to spam! Please wait another &e%time% &7seconds!"),
    PLAYER_JOIN("Messages.Player.Join", "%prefix%displayname%suffix &ejoined the game!"),
    PLAYER_KICK("Messages.Player.Kick", "%prefix%displayname%suffix &ewas kicked from the game!"),
    PLAYER_QUIT("Messages.Player.Quit", "%prefix%displayname%suffix &eleft the game!"),
    NO_LISTENING_PLAYERS("Messages.Chat.NoOneListens", "&cNo players are near you to hear you talking! Use the ranged mode to chat."),
    UPDATE_FOUND("Messages.UpdateFound", "&a[ChatEx]&7 A new update has been found on SpigotMC. Current version: %oldversion New version: %newversion"),
    ;

    private final String value;
    private final String path;
    private static YamlConfiguration cfg;
    private static final File localeFolder = new File(ChatEx.getInstance().getDataFolder(), "locales");