/FileExtraction/Java_unseen/Wind-Development_WindSpigot/WindSpigot-API/src/main/java/org/bukkit/command/CommandSender.java
package org.bukkit.command;

import org.bukkit.Server;
import org.bukkit.permissions.Permissible;

public interface CommandSender extends Permissible {

	/**
	 * Sends this sender a message
	 *
	 * @param message Message to be displayed
	 */
	public void sendMessage(String message);

	/**
	 * Sends this sender multiple messages
	 *
	 * @param messages An array of messages to be displayed
	 */
	public void sendMessage(String[] messages);

	/**
	 * Returns the server instance that this command is running on
	 *
	 * @return Server instance
	 */
	public Server getServer();

	/**
	 * Gets the name of this command sender
	 *
	 * @return Name of the sender
	 */
	public String getName();

	// Paper start
	/**
	 * Sends the component to the sender
	 *
	 * <p>
	 * If this sender does not support sending full components then the component
	 * will be sent as legacy text.
	 * </p>
	 *
	 * @param component the component to send
	 */
	default void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) {
		this.sendMessage(component.toLegacyText());
	}

	/**
	 * Sends an array of components as a single message to the sender
	 *
	 * <p>
	 * If this sender does not support sending full components then the components
	 * will be sent as legacy text.
	 * </p>
	 *
	 * @param components the components to send
	 */
	default void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) {
		this.sendMessage(new net.md_5.bungee.api.chat.TextComponent(components).toLegacyText());
	}
	// Paper end
}
