<commit_before>package com.lagopusempire.multihomes.commands.admin;

import com.lagopusempire.multihomes.HomeManager;
import com.lagopusempire.multihomes.MultiHomes;
import com.lagopusempire.multihomes.commands.CommandBase;
import com.lagopusempire.multihomes.messages.MessageFormatter;
import com.lagopusempire.multihomes.messages.MessageKeys;
import com.lagopusempire.multihomes.messages.Messages;
import com.lagopusempire.multihomes.permissions.NumeralPermissions;
import com.lagopusempire.multihomes.permissions.Permissions;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

/**
 *
 * @author MrZoraman
 */
public class SetOthersHomeCommand extends CommandBase
{
    public SetOthersHomeCommand(MultiHomes plugin, HomeManager homeManager)
    {
        super(plugin, homeManager);
    }
    
    @Override
    protected boolean onCommand(Player player, String[] args)
    {
        // /home set other [playername] (homename)
        // /home set other [playername] (homename) force_m
        
        String targetName_m = null;
        boolean usingImplicitHome_m = true;
        String homeName_m = null;
        boolean force_m = false;
        
        switch(args.length)
        {
            default:
                if(args[2].equalsIgnoreCase("force"))
                    force_m = true;
                //FALL THROUGH
            case 2:
                if(args[1].equalsIgnoreCase("force"))
                {
                    force_m = true;
                    break;
                }
                else
                {
                    homeName_m = args[1];
                    usingImplicitHome_m = false;
                }
                //FALL THROUGH
            case 1:
                targetName_m = args[0];
                //FALL THROUGH
            case 0:
                final String message = Messages.getMessage(MessageKeys.MUST_SPECIFY_PLAYER).colorize().toString();<commit_msg>permissions<commit_after>package com.lagopusempire.multihomes.commands.admin;

import com.lagopusempire.multihomes.HomeManager;
import com.lagopusempire.multihomes.MultiHomes;
import com.lagopusempire.multihomes.commands.CommandBase;
import com.lagopusempire.multihomes.messages.MessageFormatter;
import com.lagopusempire.multihomes.messages.MessageKeys;
import com.lagopusempire.multihomes.messages.Messages;
import com.lagopusempire.multihomes.permissions.NumeralPermissions;
import com.lagopusempire.multihomes.permissions.Permissions;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

/**
 *
 * @author MrZoraman
 */
public class SetOthersHomeCommand extends CommandBase
{
    public SetOthersHomeCommand(MultiHomes plugin, HomeManager homeManager)
    {
        super(plugin, homeManager);
    }
    
    @Override
    protected boolean onCommand(Player player, String[] args)
    {
        // /home set other [playername] (homename)
        // /home set other [playername] (homename) force
        
        if(!checkPerms(player, Permissions.SET_HOME_OTHER))
            return true;
        
        String targetName_m = null;
        boolean usingImplicitHome_m = true;
        String homeName_m = null;
        boolean force_m = false;
        
        switch(args.length)
        {
            default:
                if(args[2].equalsIgnoreCase("force"))
                    force_m = true;
                //FALL THROUGH
            case 2:
                if(args[1].equalsIgnoreCase("force"))
                {
                    force_m = true;
                    break;
                }
                else
                {
                    homeName_m = args[1];
                    usingImplicitHome_m = false;
                }
                //FALL THROUGH
            case 1:
                targetName_m = args[0];
                //FALL THROUGH
            case 0:
                final String message = Messages.getMessage(MessageKeys.MUST_SPECIFY_PLAYER).colorize().toString();
{'fraction_non_alphanumeric': 0.08447142134547293, 'fraction_numerical': 0.0035407182599898838, 'mean_word_length': 1.9804069329314242, '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': '7154459', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1091, 'n_words': 199}