public class BroadcastMessageEvent extends ServerEvent implements Cancellable
Server.broadcast(String, String)
.Event.Result
构造器和说明 |
---|
BroadcastMessageEvent(java.lang.String message,
java.util.Set<CommandSender> recipients) |
限定符和类型 | 方法和说明 |
---|---|
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
java.lang.String |
getMessage()
Get the message to broadcast.
|
java.util.Set<CommandSender> |
getRecipients()
Gets a set of recipients that this chat message will be displayed to.
|
boolean |
isCancelled()
获取这个事件是否被取消.一个被取消的事件不会在服务器里被执行,但是仍然会传递事件到其他插件。
|
void |
setCancelled(boolean cancelled)
取消这个事件.
|
void |
setMessage(java.lang.String message)
Set the message to broadcast.
|
getEventName, isAsynchronous
public BroadcastMessageEvent(java.lang.String message, java.util.Set<CommandSender> recipients)
public java.lang.String getMessage()
public void setMessage(java.lang.String message)
message
- New message to broadcastpublic java.util.Set<CommandSender> getRecipients()
The set returned is not guaranteed to be mutable and may auto-populate on access. Any listener accessing the returned set should be aware that it may reduce performance for a lazy set implementation.
Listeners should be aware that modifying the list may throw UnsupportedOperationException
if the event caller provides an
unmodifiable set.
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 cancelled)
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
cancelled
- 如果你想取消这个事件,则为truepublic HandlerList getHandlers()
getHandlers
在类中 Event
public static HandlerList getHandlerList()