use of io.github.darkkronicle.advancedchatbox.config.GuiChatBoxConfig in project AdvancedChatBox by DarkKronicle.
the class ChatBoxInitHandler method registerModHandlers.
@Override
public void registerModHandlers() {
ConfigManager.getInstance().registerConfigHandler(AdvancedChatBox.MOD_ID, new ChatBoxConfigStorage());
GuiConfigHandler.getInstance().addTab(GuiConfigHandler.children("box", "advancedchat.config.tab.advancedchatbox", GuiConfigHandler.wrapScreen("box_general", "advancedchatbox.config.tab.general", parent -> new GuiChatBoxConfig()), GuiConfigHandler.wrapSaveableOptions("spellchecker", "advancedchatbox.config.tab.spellchecker", ChatBoxConfigStorage.SpellChecker.OPTIONS)));
ChatFormatterRegistry chatRegistry = ChatFormatterRegistry.getInstance();
chatRegistry.register(CommandColorer::getInstance, "commandcolorer", "advancedchatbox.config.chatformatter.commandcolorer", "advancedchatbox.config.chatformatter.info.commandcolorer", true, true);
chatRegistry.register(JSONFormatter::new, "jsonformatter", "advancedchatbox.config.chatformatter.jsonformatter", "advancedchatbox.config.chatformatter.info.jsonformatter", true, false);
chatRegistry.register(ColorCodeFormatter::new, "colorcodeformatter", "advancedchatbox.config.chatformatter.colorcodeformatter", "advancedchatbox.config.chatformatter.info.colorcodeformatter", true, false);
// Initiate chat suggestors
ChatSuggestorRegistry suggestorRegistry = ChatSuggestorRegistry.getInstance();
suggestorRegistry.register(PlayerSuggestor::new, "players", "advancedchatbox.config.chatsuggestor.players", "advancedchatbox.config.chatsuggestor.info.players", true, false);
suggestorRegistry.register(CalculatorSuggestor::new, "calculator", "advancedchatbox.config.chatsuggestor.calculator", "advancedchatbox.config.chatsuggestor.info.calculator", true, false);
suggestorRegistry.register(ShortcutSuggestor::new, "shortcut", "advancedchatbox.config.chatsuggestor.shortcut", "advancedchatbox.config.chatsuggestor.info.shortcut", true, false);
try {
suggestorRegistry.register(SpellCheckSuggestor::getInstance, "spellcheck", "advancedchatbox.config.chatsuggestor.spellcheck", "advancedchatbox.config.chatsuggestor.info.spellcheck", true, false);
} catch (Exception e) {
LogManager.getLogger().log(Level.ERROR, "[AdvancedChat] {}", "Couldn't load SpellCheckSuggestor", e);
}
AdvancedChatCore.CREATE_SUGGESTOR = false;
ChatScreenSectionHolder.getInstance().addSectionSupplier(ChatBoxSection::new);
}
Aggregations