<commit_before>package org.royaldev.royalcommands;

import org.bukkit.plugin.Plugin;

import java.util.HashMap;
import java.util.Map;

@SuppressWarnings("unchecked")
public class Help {

    public static HashMap<String, String> helpdb = new HashMap<String, String>();
    static Map<String, Map<String, Object>> commands = (Map<String, Map<String, Object>>) RoyalCommands.commands;

    public static void reloadHelp() {
        helpdb.clear();
        for (String cmd : commands.keySet()) {
            if (commands.get(cmd) == null || commands.get(cmd).get("description") == null) continue;
            String desc = commands.get(cmd).get("description").toString();
            helpdb.put(cmd, desc);
        }
        if (RoyalCommands.otherHelp) {<commit_msg>Fixed: NPE with help loading on bad CBs<commit_after>package org.royaldev.royalcommands;

import org.bukkit.plugin.Plugin;

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

@SuppressWarnings("unchecked")
public class Help {

    public static HashMap<String, String> helpdb = new HashMap<String, String>();
    static Map<String, Map<String, Object>> commands = (Map<String, Map<String, Object>>) RoyalCommands.commands;

    public static void reloadHelp() {
        helpdb.clear();
        if (commands == null) {
            Logger.getLogger("Minecraft").severe("[RoyalCommands] Could not grab list of commands!");
            return;
        }
        for (String cmd : commands.keySet()) {
            if (cmd == null || commands.get(cmd) == null || commands.get(cmd).get("description") == null) continue;
            String desc = commands.get(cmd).get("description").toString();
            helpdb.put(cmd, desc);
        }
        if (RoyalCommands.otherHelp) {
{'fraction_non_alphanumeric': 0.13703284258210646, 'fraction_numerical': 0.0, 'mean_word_length': 3.3415233415233416, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7474247', 'n_tokens_mistral': 502, 'n_tokens_neox': 501, 'n_words': 124}