public class PlayerEditBookEvent extends PlayerEvent implements Cancellable
Event.Resultplayer| 构造器和说明 |
|---|
PlayerEditBookEvent(Player who,
int slot,
BookMeta previousBookMeta,
BookMeta newBookMeta,
boolean isSigning) |
| 限定符和类型 | 方法和说明 |
|---|---|
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
BookMeta |
getNewBookMeta()
获取玩家试图新增的书本元数据。
|
BookMeta |
getPreviousBookMeta()
获取当前书本元数据。
|
int |
getSlot()
获取触发事件时,书本在物品栏所在的格子序号。
|
boolean |
isCancelled()
获取这个事件是否被取消.一个被取消的事件不会在服务器里被执行,但是仍然会传递事件到其他插件。
|
boolean |
isSigning()
检测书本是否正在被签名。
|
void |
setCancelled(boolean cancel)
取消这个事件.
|
void |
setNewBookMeta(BookMeta newBookMeta)
设置新增的书本元数据。
|
void |
setSigning(boolean signing)
设置书本是否正在被签名。
|
getPlayergetEventName, isAsynchronouspublic BookMeta getPreviousBookMeta()
注意:获取书本的元数据副本。你无法使用该对象来修改书本元数据。
原文:Gets the book meta currently on the book.
Note: this is a copy of the book meta. You cannot use this object to change the existing book meta.
public BookMeta getNewBookMeta()
注意:获取的元数据为副本。使用 setNewBookMeta(BookMeta)修改实际想要更新的书本元数据
原文:Gets the book meta that the player is attempting to add to the book.
Note: this is a copy of the proposed new book meta. Use setNewBookMeta(BookMeta) to change what will actually be added to the
public int getSlot()
对应为玩家快捷操作栏,取值范围 0-8。
原文:Gets the inventory slot number for the book item that triggered this event.
This is a slot number on the player's hotbar in the range 0-8.
public void setNewBookMeta(BookMeta newBookMeta) throws java.lang.IllegalArgumentException
原文:Sets the book meta that will actually be added to the book.
newBookMeta - 构造书本元数据java.lang.IllegalArgumentException - 当构造的书本元数据不为空值时抛出异常public boolean isSigning()
原文:Gets whether or not the book is being signed. If a book is signed the Material changes from BOOK_AND_QUILL to WRITTEN_BOOK.
public void setSigning(boolean signing)
原文:Sets whether or not the book is being signed. If a book is signed the Material changes from BOOK_AND_QUILL to WRITTEN_BOOK.
signing - 书本是否正在被签名public HandlerList getHandlers()
getHandlers 在类中 Eventpublic static HandlerList getHandlerList()
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 在接口中 Cancellablepublic 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 在接口中 Cancellablecancel - 如果你想取消这个事件,则为true