2010-12-22 15:21:16 +00:00
|
|
|
|
2011-01-15 21:20:59 +00:00
|
|
|
package org.bukkit.entity;
|
2010-12-22 15:21:16 +00:00
|
|
|
|
2011-01-10 17:24:35 -05:00
|
|
|
import java.net.InetSocketAddress;
|
2011-01-20 02:05:31 -08:00
|
|
|
import org.bukkit.Location;
|
2011-01-29 16:23:56 +00:00
|
|
|
import org.bukkit.command.CommandSender;
|
2011-01-10 17:24:35 -05:00
|
|
|
|
2010-12-22 15:21:16 +00:00
|
|
|
/**
|
|
|
|
* Represents a player, connected or not
|
2011-01-29 16:23:56 +00:00
|
|
|
*
|
2010-12-22 15:21:16 +00:00
|
|
|
*/
|
2011-01-29 16:23:56 +00:00
|
|
|
public interface Player extends HumanEntity, CommandSender {
|
2010-12-22 15:21:16 +00:00
|
|
|
/**
|
|
|
|
* Checks if this player is currently online
|
|
|
|
*
|
|
|
|
* @return true if they are online
|
|
|
|
*/
|
|
|
|
public boolean isOnline();
|
2010-12-30 04:52:26 +00:00
|
|
|
|
2011-01-07 13:27:09 +00:00
|
|
|
/**
|
|
|
|
* Gets the "friendly" name to display of this player. This may include color.
|
|
|
|
*
|
|
|
|
* Note that this name will not be displayed in game, only in chat and places
|
|
|
|
* defined by plugins
|
|
|
|
*
|
|
|
|
* @return String containing a color formatted name to display for this player
|
|
|
|
*/
|
|
|
|
public String getDisplayName();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the "friendly" name to display of this player. This may include color.
|
|
|
|
*
|
|
|
|
* Note that this name will not be displayed in game, only in chat and places
|
|
|
|
* defined by plugins
|
|
|
|
*
|
|
|
|
* @return String containing a color formatted name to display for this player
|
|
|
|
*/
|
2011-01-07 13:33:36 +00:00
|
|
|
public void setDisplayName(String name);
|
2011-01-29 16:23:56 +00:00
|
|
|
|
2011-01-20 02:05:31 -08:00
|
|
|
/**
|
|
|
|
* Set the target of the player's compass.
|
2011-01-29 16:23:56 +00:00
|
|
|
*
|
2011-01-20 02:05:31 -08:00
|
|
|
* @param loc
|
|
|
|
*/
|
|
|
|
public void setCompassTarget(Location loc);
|
2011-01-29 16:23:56 +00:00
|
|
|
|
2011-01-10 17:24:35 -05:00
|
|
|
/**
|
|
|
|
* Gets the socket address of this player
|
|
|
|
* @return the player's address
|
|
|
|
*/
|
|
|
|
public InetSocketAddress getAddress();
|
2011-01-15 09:20:29 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Kicks player with custom kick message.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public void kickPlayer(String message);
|
2011-01-28 09:15:43 +00:00
|
|
|
|
2011-02-16 21:23:29 -08:00
|
|
|
/**
|
|
|
|
* Says a message (or runs a command).
|
|
|
|
*
|
|
|
|
* @param msg message to print
|
|
|
|
*/
|
|
|
|
public void chat(String msg);
|
|
|
|
|
2011-01-28 09:15:43 +00:00
|
|
|
/**
|
|
|
|
* Makes the player perform the given command
|
|
|
|
*
|
|
|
|
* @param command Command to perform
|
|
|
|
* @return true if the command was successful, otherwise false
|
|
|
|
*/
|
|
|
|
public boolean performCommand(String command);
|
2011-01-25 19:04:52 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns if the player is in sneak mode
|
|
|
|
* @return true if player is in sneak mode
|
|
|
|
*/
|
|
|
|
public boolean isSneaking();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the sneak mode the player
|
|
|
|
* @param sneak true if player should appear sneaking
|
|
|
|
*/
|
|
|
|
public void setSneaking(boolean sneak);
|
2011-02-13 00:22:00 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Forces an update of the player's entire inventory.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*
|
|
|
|
* @deprecated This method should not be relied upon as it is a temporary work-around for a larger, more complicated issue.
|
|
|
|
*/
|
|
|
|
public void updateInventory();
|
2010-12-22 15:21:16 +00:00
|
|
|
}
|