<commit_before>package com.github.Kory33.minecartchestfilter.util;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.github.Kory33.minecartchestfilter.core.MinecartChestFilter;

/**
 * Util class for processing commands
 * @author Kory33
 */
public class CommandProcessorUtil {
    /**
     * Execute "/spawnFilteredStorageMinecart <type>"
     * 
     * @param sender
     * @param command
     * @param label
     * @param args
     * @return whether the command is executed successfully
     */
    public static boolean spawnFSMinecart(CommandSender sender, Command command, String label, String[] args){
        if(!(sender instanceof Player)){
            sender.sendMessage("Command only available for players.");
            return true;
        }
        
        //TODO implement argument(type) processing
        
        Player pSender = (Player) sender;
        String filterKey = MinecartChestFilter.FILTERED_MINECART_TAG_FURNACE;
        
        if(!EntityUtil.spawnFilteredMinecart(pSender.getWorld(), pSender.getLocation(), filterKey)){
            pSender.getServer().getLogger().info("Something went wrong; could not spawn filtered minecart!");
        }
        
        return true;
    }
}<commit_msg>implemented argument(type) processing<commit_after>package com.github.Kory33.minecartchestfilter.util;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.github.Kory33.minecartchestfilter.core.MinecartChestFilter;

/**
 * Util class for processing commands
 * @author Kory33
 */
public class CommandProcessorUtil {
    /**
     * Execute "/spawnFilteredStorageMinecart <type>"
     * 
     * @param sender
     * @param command
     * @param label
     * @param args
     * @return whether the command is executed successfully
     */
    public static boolean spawnFSMinecart(CommandSender sender, Command command, String label, String[] args){
        if(!(sender instanceof Player)){
            sender.sendMessage("Command only available for players.");
            return true;
        }
        
        if(args.length > 1){
            return false;
        }
        
        // tag defaults to the furnace filter
        String filterKey = MinecartChestFilter.FILTERED_MINECART_TAG_FURNACE;

        if(args.length == 1){
            if(args[0].equalsIgnoreCase("fuel")){
                filterKey = MinecartChestFilter.FILTERED_MINECART_TAG_FUEL;
            }else{
                return false;
            }
        }
        
        Player pSender = (Player) sender;
        
        if(!EntityUtil.spawnFilteredMinecart(pSender.getWorld(), pSender.getLocation(), filterKey)){
            pSender.getServer().getLogger().info("Something went wrong; could not spawn filtered minecart!");
        }
        
        return true;
    }
}
{'fraction_non_alphanumeric': 0.09571183533447684, 'fraction_numerical': 0.005145797598627788, 'mean_word_length': 2.5911330049261085, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '6544719', 'n_tokens_mistral': 814, 'n_tokens_neox': 789, 'n_words': 182}