AsyncPlayerChatEvent
.
监听这个事件迫使聊天等待主线程,会导致聊天消息延迟展现。建议使用线程安全的AsyncPlayerChatEvent
@Deprecated public class PlayerChatEvent extends PlayerEvent implements Cancellable
Event.Result
player
构造器和说明 |
---|
PlayerChatEvent(Player player,
java.lang.String message)
已过时。
|
PlayerChatEvent(Player player,
java.lang.String message,
java.lang.String format,
java.util.Set<Player> recipients)
已过时。
|
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
getFormat()
已过时。
获取用于展示这条消息的格式。
|
static HandlerList |
getHandlerList()
已过时。
|
HandlerList |
getHandlers()
已过时。
|
java.lang.String |
getMessage()
已过时。
获取这个玩家尝试发送的消息。
|
java.util.Set<Player> |
getRecipients()
已过时。
获取一个将被展示这条消息的玩家的集合。
|
boolean |
isCancelled()
已过时。
获取这个事件是否被取消.一个被取消的事件不会在服务器里被执行,但是仍然会传递事件到其他插件。
|
void |
setCancelled(boolean cancel)
已过时。
取消这个事件.
|
void |
setFormat(java.lang.String format)
已过时。
设置用于展示这条消息的格式。
|
void |
setMessage(java.lang.String message)
已过时。
设置这个玩家将发送的消息。
|
void |
setPlayer(Player player)
已过时。
设置这条消息显示成的玩家,或谁将执行这条命令.
|
getPlayer
getEventName, isAsynchronous
public PlayerChatEvent(Player player, java.lang.String message)
public boolean isCancelled()
Cancellable
原文:Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins
isCancelled
在接口中 Cancellable
public void setCancelled(boolean cancel)
Cancellable
原文:Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
setCancelled
在接口中 Cancellable
cancel
- 如果你想取消这个事件,则为truepublic java.lang.String getMessage()
原文:Gets the message that the player is attempting to send
public void setMessage(java.lang.String message)
原文:Sets the message that the player will send
message
- 玩家将发送的新消息public void setPlayer(Player player)
原文:Sets the player that this message will display as, or command will be executed as
player
- 作为这个新玩家执行这个事件public java.lang.String getFormat()
原文:Gets the format to use to display this chat message
public void setFormat(java.lang.String format)
原文:Sets the format to use to display this chat message
format
- 字符串格式:String.Formatpublic java.util.Set<Player> getRecipients()
原文:Gets a set of recipients that this chat message will be displayed to
public HandlerList getHandlers()
getHandlers
在类中 Event
public static HandlerList getHandlerList()