<commit_before>package in.twizmwaz.cardinal.command;

import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandContext;
import com.sk89q.minecraft.util.commands.CommandException;
import in.twizmwaz.cardinal.Cardinal;
import in.twizmwaz.cardinal.chat.ChatConstant;
import in.twizmwaz.cardinal.chat.LocalizedChatMessage;
import in.twizmwaz.cardinal.chat.UnlocalizedChatMessage;
import in.twizmwaz.cardinal.util.ChatUtil;
import in.twizmwaz.cardinal.util.Players;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;

public class SnowflakesCommand {

    @Command(aliases = {"snowflakes"}, desc = "View your own or another player's snowflake count.", usage = "[player]")
    public static void settings(final CommandContext cmd, CommandSender sender) throws CommandException {
        if (cmd.argsLength() == 0) {
            Bukkit.dispatchCommand(sender, "snowflakes " + sender.getName());
        } else {
            OfflinePlayer player = Bukkit.getOfflinePlayer(cmd.getString(0));
            if (sender.equals(player)) {
                sender.sendMessage(new UnlocalizedChatMessage(ChatColor.DARK_PURPLE + "{0} " + ChatColor.GOLD + "{1} {2}", ChatConstant.MISC_YOU_HAVE.asMessage(), new UnlocalizedChatMessage("{0}", Cardinal.getCardinalDatabase().get(player, "snowflakes")), Cardinal.getCardinalDatabase().get(player, "snowflakes").equals("1") ? ChatConstant.SNOWFLAKES_SNOWFLAKE.asMessage() : ChatConstant.SNOWFLAKES_SNOWFLAKES.asMessage()).getMessage(ChatUtil.getLocale(sender)));
            } else {
                sender.sendMessage(new UnlocalizedChatMessage(ChatColor.DARK_PURPLE + "{0} " + ChatColor.GOLD + "{1} {2}", new LocalizedChatMessage(ChatConstant.MISC_HAS, Players.getName(player) + ChatColor.DARK_PURPLE), new UnlocalizedChatMessage("{0}", Cardinal.getCardinalDatabase().get(player, "snowflakes")), Cardinal.getCardinalDatabase().get(player, "snowflakes").equals("1") ? ChatConstant.SNOWFLAKES_SNOWFLAKE.asMessage() : ChatConstant.SNOWFLAKES_SNOWFLAKES.asMessage()).getMessage(ChatUtil.getLocale(sender)));
            }
        }
    }

}<commit_msg>Fix empty count displayed on snowflakes command.<commit_after>package in.twizmwaz.cardinal.command;

import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandContext;
import com.sk89q.minecraft.util.commands.CommandException;
import in.twizmwaz.cardinal.Cardinal;
import in.twizmwaz.cardinal.chat.ChatConstant;
import in.twizmwaz.cardinal.chat.LocalizedChatMessage;
import in.twizmwaz.cardinal.chat.UnlocalizedChatMessage;
import in.twizmwaz.cardinal.util.ChatUtil;
import in.twizmwaz.cardinal.util.Players;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;

public class SnowflakesCommand {

    @Command(aliases = {"snowflakes"}, desc = "View your own or another player's snowflake count.", usage = "[player]")
    public static void settings(final CommandContext cmd, CommandSender sender) throws CommandException {
        if (cmd.argsLength() == 0) {
            Bukkit.dispatchCommand(sender, "snowflakes " + sender.getName());
        } else {
            OfflinePlayer player = Bukkit.getOfflinePlayer(cmd.getString(0));
            String snowflakes = Cardinal.getCardinalDatabase().get(player, "snowflakes");
            if (snowflakes.equals("")) snowflakes = "0";
            if (sender.equals(player)) {
                sender.sendMessage(new UnlocalizedChatMessage(ChatColor.DARK_PURPLE + "{0} " + ChatColor.GOLD + "{1} {2}", ChatConstant.MISC_YOU_HAVE.asMessage(), new UnlocalizedChatMessage("{0}", snowflakes), snowflakes.equals("1") ? ChatConstant.SNOWFLAKES_SNOWFLAKE.asMessage() : ChatConstant.SNOWFLAKES_SNOWFLAKES.asMessage()).getMessage(ChatUtil.getLocale(sender)));
            } else {
                sender.sendMessage(new UnlocalizedChatMessage(ChatColor.DARK_PURPLE + "{0} " + ChatColor.GOLD + "{1} {2}", new LocalizedChatMessage(ChatConstant.MISC_HAS, Players.getName(player) + ChatColor.DARK_PURPLE), new UnlocalizedChatMessage("{0}", snowflakes), snowflakes.equals("1") ? ChatConstant.SNOWFLAKES_SNOWFLAKE.asMessage() : ChatConstant.SNOWFLAKES_SNOWFLAKES.asMessage()).getMessage(ChatUtil.getLocale(sender)));
            }
        }
    }

}
{'fraction_non_alphanumeric': 0.12745098039215685, 'fraction_numerical': 0.0084359325125399, 'mean_word_length': 4.936400541271989, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4153812', 'n_tokens_mistral': 1463, 'n_tokens_neox': 1394, 'n_words': 210}