public abstract class InventoryInteractEvent extends InventoryEvent implements Cancellable
Event.Result
transaction
构造器和说明 |
---|
InventoryInteractEvent(InventoryView transaction) |
限定符和类型 | 方法和说明 |
---|---|
Event.Result |
getResult()
Gets the
Event.Result of this event. |
HumanEntity |
getWhoClicked()
Gets the player who performed the click.
|
boolean |
isCancelled()
Gets whether or not this event is cancelled.
|
void |
setCancelled(boolean toCancel)
Proxy method to
setResult(Event.Result) for the Cancellable
interface. |
void |
setResult(Event.Result newResult)
Sets the result of this event.
|
getHandlerList, getHandlers, getInventory, getView, getViewers
getEventName, isAsynchronous
public InventoryInteractEvent(InventoryView transaction)
public HumanEntity getWhoClicked()
public void setResult(Event.Result newResult)
newResult
- the new Event.Result
for this eventisCancelled()
public Event.Result getResult()
Event.Result
of this event. The Result describes the
behavior that will be applied to the inventory in relation to this
event.public boolean isCancelled()
getResult()
. Result.ALLOW and
Result.DEFAULT will result in a returned value of false, but
Result.DENY will result in a returned value of true.
获取这个事件是否被取消.一个被取消的事件不会在服务器里被执行,但是仍然会传递事件到其他插件。
原文: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 toCancel)
setResult(Event.Result)
for the Cancellable
interface. setResult(Event.Result)
is preferred, as it allows
you to specify the Result beyond Result.DENY and Result.ALLOW.
取消这个事件. 一个被取消的事件不会在 服务器里被执行,但是仍然会传递事件到其他插件。
原文: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
toCancel
- result becomes DENY if true, ALLOW if false