<commit_before>package net.simpvp.Misc;

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

/**
 * Adds the /tp, /tpc, /tpw and /tpo commands
 */
public class AdminTeleport implements CommandExecutor {

	public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
		Player player = null;
		if (sender instanceof Player)
			player = (Player) sender;

		if (player != null && !player.isOp()) {
			player.sendMessage(ChatColor.RED
					+ "You do not have permission to use this command.");
			return true;
		}

		String scmd = cmd.getName();

		if (scmd.equals("tpc")) {
			tpc(sender, args);
		} else if (scmd.equals("tpo")) {
			tpo(player, args);
		} else if (scmd.equals("tpw")) {
			tpw(player, args);
		}

		return true;

	}

	/**
	 * Teleports the sender (or other player if specified) to the given coords
	 *
	 * This command takes a CommandSender instead of player, so that we can
	 * get the coords of command blocks, if set, so that we can understand
	 * relative coordinates from command blocks.
	 */
	private void tpc(CommandSender sender, String[] args) {
		Player player = null;
		if (sender instanceof Player)
			player = (Player) sender;

		BlockCommandSender cb = null;
		if (sender instanceof BlockCommandSender)
			cb = (BlockCommandSender) sender;

		if (args.length > 5 || args.length < 3) {
			tpc_usage(player, "Invalid amount of arguments.");
			return;
		}

		if (args.length < 5 && player == null) {
			tpc_usage(player, "If you want to use this command as a non-player,"
					+ " you must specify a player.");
			return;
		}<commit_msg>Amount -> Number<commit_after>package net.simpvp.Misc;

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

/**
 * Adds the /tp, /tpc, /tpw and /tpo commands
 */
public class AdminTeleport implements CommandExecutor {

	public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
		Player player = null;
		if (sender instanceof Player)
			player = (Player) sender;

		if (player != null && !player.isOp()) {
			player.sendMessage(ChatColor.RED
					+ "You do not have permission to use this command.");
			return true;
		}

		String scmd = cmd.getName();

		if (scmd.equals("tpc")) {
			tpc(sender, args);
		} else if (scmd.equals("tpo")) {
			tpo(player, args);
		} else if (scmd.equals("tpw")) {
			tpw(player, args);
		}

		return true;

	}

	/**
	 * Teleports the sender (or other player if specified) to the given coords
	 *
	 * This command takes a CommandSender instead of player, so that we can
	 * get the coords of command blocks, if set, so that we can understand
	 * relative coordinates from command blocks.
	 */
	private void tpc(CommandSender sender, String[] args) {
		Player player = null;
		if (sender instanceof Player)
			player = (Player) sender;

		BlockCommandSender cb = null;
		if (sender instanceof BlockCommandSender)
			cb = (BlockCommandSender) sender;

		if (args.length > 5 || args.length < 3) {
			tpc_usage(player, "Invalid number of arguments.");
			return;
		}

		if (args.length < 5 && player == null) {
			tpc_usage(player, "If you want to use this command as a non-player,"
					+ " you must specify a player.");
			return;
		}
{'fraction_non_alphanumeric': 0.11624763449580967, 'fraction_numerical': 0.0016220600162206002, 'mean_word_length': 3.6954314720812182, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7520810', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1137, 'n_words': 379}