<commit_before>package net.glowstone.command;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.defaults.BukkitCommand;
import org.bukkit.entity.Player;
import org.bukkit.title.Title;
import org.bukkit.title.TitleOptions;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;

import java.util.Arrays;

public class TitleCommand extends BukkitCommand {

    public TitleCommand() {
        super("title");
        this.description = "Sends a title to the specified player(s)";
        this.usageMessage = "/title <player> <title|subtitle|clear|reset|times> ...";
        this.setAliases(Arrays.<String>asList());
        this.setPermission("glowstone.command.title");
    }

    @Override
    public boolean execute(CommandSender sender, String commandLabel, String[] args) {
        if (!testPermission(sender)) return true;
        if (args.length < 2) {
            sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
            return false;
        }

        Player player = Bukkit.getPlayerExact(args[0]);

        if (player == null || (sender instanceof Player && !((Player) sender).canSee(player))) {
            sender.sendMessage("There's no player by that name online.");
        } else {
            if (args[1].equalsIgnoreCase("clear")) {
                player.clearTitle();
                sender.sendMessage("Cleared " + player.getName() + "'s title");
            } else if (args[1].equalsIgnoreCase("reset")) {
                player.resetTitle();
                sender.sendMessage("Reset " + player.getName() + "'s title");
            } else if (args[1].equalsIgnoreCase("times")) {
                if (args.length < 5) {
                    sender.sendMessage(ChatColor.RED + "Usage: /title <player> times <fadeIn> <stay> <fadeOut>");
                    return false;
                }

                TitleOptions options = player.getTitleOptions();

                int in = tryParseInt(sender, args[2], 0);
                int stay = tryParseInt(sender, args[3], in);
                int out = tryParseInt(sender, args[4], stay);<commit_msg>Failed command = return false<commit_after>package net.glowstone.command;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.defaults.BukkitCommand;
import org.bukkit.entity.Player;
import org.bukkit.title.Title;
import org.bukkit.title.TitleOptions;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;

import java.util.Arrays;

public class TitleCommand extends BukkitCommand {

    public TitleCommand() {
        super("title");
        this.description = "Sends a title to the specified player(s)";
        this.usageMessage = "/title <player> <title|subtitle|clear|reset|times> ...";
        this.setAliases(Arrays.<String>asList());
        this.setPermission("glowstone.command.title");
    }

    @Override
    public boolean execute(CommandSender sender, String commandLabel, String[] args) {
        if (!testPermission(sender)) return true;
        if (args.length < 2) {
            sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
            return false;
        }

        Player player = Bukkit.getPlayerExact(args[0]);

        if (player == null || (sender instanceof Player && !((Player) sender).canSee(player))) {
            sender.sendMessage("There's no player by that name online.");
            return false;
        } else {
            if (args[1].equalsIgnoreCase("clear")) {
                player.clearTitle();
                sender.sendMessage("Cleared " + player.getName() + "'s title");
            } else if (args[1].equalsIgnoreCase("reset")) {
                player.resetTitle();
                sender.sendMessage("Reset " + player.getName() + "'s title");
            } else if (args[1].equalsIgnoreCase("times")) {
                if (args.length < 5) {
                    sender.sendMessage(ChatColor.RED + "Usage: /title <player> times <fadeIn> <stay> <fadeOut>");
                    return false;
                }

                TitleOptions options = player.getTitleOptions();

                int in = tryParseInt(sender, args[2], 0);
                int stay = tryParseInt(sender, args[3], in);
                int out = tryParseInt(sender, args[4], stay);
{'fraction_non_alphanumeric': 0.1298876404494382, 'fraction_numerical': 0.0044943820224719105, 'mean_word_length': 2.5185770750988143, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 17, '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': '5212750', 'n_tokens_mistral': 1280, 'n_tokens_neox': 1215, 'n_words': 274}