<commit_before>package com.gmail.nossr50.commands.general;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.gmail.nossr50.Users;
import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.runnables.SQLConversionTask;

public class MmoupdateCommand implements CommandExecutor {
<<<<<<< HEAD
	@Override
	public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
	    Player player = null;
	    
	    if(sender instanceof Player) {
	        player = (Player)sender;
	    }
	    
		if (sender instanceof Player && !mcPermissions.getInstance().admin(player)) {
			sender.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
			return true;
		}
		
		sender.sendMessage(ChatColor.GRAY + "Starting conversion..."); //TODO: Needs more locale.
		Users.clearUsers();
		convertToMySQL();
		for (Player x : Bukkit.getServer().getOnlinePlayers()) {
			Users.addUser(x);
		}
		sender.sendMessage(ChatColor.GREEN + "Conversion finished!"); //TODO: Needs more locale.

		return true;
	}
	
	/**
=======

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (CommandHelper.noConsoleUsage(sender)) {
            return true;
        }

        if (CommandHelper.noCommandPermissions(sender, "mcmmo.admin")) {
            return true;
        }

        sender.sendMessage(ChatColor.GRAY + "Starting conversion..."); //TODO: Needs more locale.
        Users.clearUsers();
        convertToMySQL();

        for (Player x : Bukkit.getServer().getOnlinePlayers()) {
            Users.addUser(x);
        }

        sender.sendMessage(ChatColor.GREEN + "Conversion finished!"); //TODO: Needs more locale.

        return true;
    }

    /**
>>>>>>> d9b4647cf5b277ae33d20e4e78ca67e1712f1ec7
     * Convert FlatFile data to MySQL data.<commit_msg>Fixed nossr50's crappy merge. :D<commit_after>package com.gmail.nossr50.commands.general;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.gmail.nossr50.Users;
import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.runnables.SQLConversionTask;

public class MmoupdateCommand implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (CommandHelper.noCommandPermissions(sender, "mcmmo.admin")) {
            return true;
        }

        sender.sendMessage(ChatColor.GRAY + "Starting conversion..."); //TODO: Needs more locale.
        Users.clearUsers();
        convertToMySQL();

        for (Player x : Bukkit.getServer().getOnlinePlayers()) {
            Users.addUser(x);
        }

        sender.sendMessage(ChatColor.GREEN + "Conversion finished!"); //TODO: Needs more locale.

        return true;
    }

    /**
     * Convert FlatFile data to MySQL data.
{'fraction_non_alphanumeric': 0.11858300810567397, 'fraction_numerical': 0.013809666766736716, 'mean_word_length': 3.460508701472557, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '4334119', 'n_tokens_mistral': 1086, 'n_tokens_neox': 998, 'n_words': 206}