|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bukkit.event.Event org.bukkit.event.player.PlayerEvent org.bukkit.event.player.PlayerEditBookEvent
public class PlayerEditBookEvent
Called when a player edits or signs a book and quill item. If the event is cancelled, no changes are made to the BookMeta
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.bukkit.event.Event |
---|
Event.Result |
Field Summary |
---|
Fields inherited from class org.bukkit.event.player.PlayerEvent |
---|
player |
Constructor Summary | |
---|---|
PlayerEditBookEvent(Player who,
int slot,
BookMeta previousBookMeta,
BookMeta newBookMeta,
boolean isSigning)
|
Method Summary | |
---|---|
static HandlerList |
getHandlerList()
|
HandlerList |
getHandlers()
|
BookMeta |
getNewBookMeta()
Gets the book meta that the player is attempting to add to the book. |
BookMeta |
getPreviousBookMeta()
Gets the book meta currently on the book. |
int |
getSlot()
Gets the inventory slot number for the book item that triggered this event. |
boolean |
isCancelled()
Gets the cancellation state of this event. |
boolean |
isSigning()
Gets whether or not the book is being signed. |
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event. |
void |
setNewBookMeta(BookMeta newBookMeta)
Sets the book meta that will actually be added to the book. |
void |
setSigning(boolean signing)
Sets whether or not the book is being signed. |
Methods inherited from class org.bukkit.event.player.PlayerEvent |
---|
getPlayer |
Methods inherited from class org.bukkit.event.Event |
---|
getEventName, isAsynchronous |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PlayerEditBookEvent(Player who, int slot, BookMeta previousBookMeta, BookMeta newBookMeta, boolean isSigning)
Method Detail |
---|
public BookMeta getPreviousBookMeta()
Note: this is a copy of the book meta. You cannot use this object to change the existing book meta.
public BookMeta getNewBookMeta()
Note: this is a copy of the proposed new book meta. Use setNewBookMeta(BookMeta)
to change what will actually be
added to the book.
public int getSlot()
This is a slot number on the player's hotbar in the range 0-8.
public void setNewBookMeta(BookMeta newBookMeta) throws IllegalArgumentException
newBookMeta
- new book meta
IllegalArgumentException
- if the new book meta is nullpublic boolean isSigning()
public void setSigning(boolean signing)
signing
- whether or not the book is being signed.public HandlerList getHandlers()
getHandlers
in class Event
public static HandlerList getHandlerList()
public boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |