Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.event.player.PlayerEditBookEvent Class Reference
Inheritance diagram for org.bukkit.event.player.PlayerEditBookEvent:
org.bukkit.event.player.PlayerEvent org.bukkit.event.Cancellable org.bukkit.event.Event

Public Member Functions

 PlayerEditBookEvent (Player who, int slot, BookMeta previousBookMeta, BookMeta newBookMeta, boolean isSigning)
 
BookMeta getPreviousBookMeta ()
 
BookMeta getNewBookMeta ()
 
int getSlot ()
 
void setNewBookMeta (BookMeta newBookMeta) throws IllegalArgumentException
 
boolean isSigning ()
 
void setSigning (boolean signing)
 
HandlerList getHandlers ()
 
boolean isCancelled ()
 
void setCancelled (boolean cancel)
 
- Public Member Functions inherited from org.bukkit.event.player.PlayerEvent
 PlayerEvent (final Player who)
 
final Player getPlayer ()
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 
 Event (boolean isAsync)
 
String getEventName ()
 
abstract HandlerList getHandlers ()
 
final boolean isAsynchronous ()
 

Static Public Member Functions

static HandlerList getHandlerList ()
 

Additional Inherited Members

- Protected Attributes inherited from org.bukkit.event.player.PlayerEvent
Player player
 

Detailed Description

Called when a player edits or signs a book and quill item. If the event is cancelled, no changes are made to the BookMeta

Definition at line 14 of file PlayerEditBookEvent.java.

Member Function Documentation

BookMeta org.bukkit.event.player.PlayerEditBookEvent.getNewBookMeta ( )

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 book.

Returns
the book meta that the player is attempting to add

Definition at line 60 of file PlayerEditBookEvent.java.

60  {
61  return newBookMeta.clone();
62  }
BookMeta org.bukkit.event.player.PlayerEditBookEvent.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.

Returns
the book meta currently on the book

Definition at line 47 of file PlayerEditBookEvent.java.

47  {
48  return previousBookMeta.clone();
49  }
int org.bukkit.event.player.PlayerEditBookEvent.getSlot ( )

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.

Returns
the inventory slot number that the book item occupies

Definition at line 72 of file PlayerEditBookEvent.java.

72  {
73  return slot;
74  }
boolean org.bukkit.event.player.PlayerEditBookEvent.isCancelled ( )

Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

Returns
true if this event is cancelled

Implements org.bukkit.event.Cancellable.

Definition at line 117 of file PlayerEditBookEvent.java.

117  {
118  return cancel;
119  }
boolean org.bukkit.event.player.PlayerEditBookEvent.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.

Returns
true if the book is being signed

Definition at line 94 of file PlayerEditBookEvent.java.

94  {
95  return isSigning;
96  }
void org.bukkit.event.player.PlayerEditBookEvent.setCancelled ( boolean  cancel)

Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Parameters
canceltrue if you wish to cancel this event

Implements org.bukkit.event.Cancellable.

Definition at line 121 of file PlayerEditBookEvent.java.

121  {
122  this.cancel = cancel;
123  }
void org.bukkit.event.player.PlayerEditBookEvent.setNewBookMeta ( BookMeta  newBookMeta) throws IllegalArgumentException

Sets the book meta that will actually be added to the book.

Parameters
newBookMetanew book meta
Exceptions
IllegalArgumentExceptionif the new book meta is null

Definition at line 82 of file PlayerEditBookEvent.java.

References org.bukkit.inventory.ItemFactory.equals(), and org.bukkit.Bukkit.getItemFactory().

82  {
83  Validate.notNull(newBookMeta, "New book meta must not be null");
84  Bukkit.getItemFactory().equals(newBookMeta, null);
85  this.newBookMeta = newBookMeta.clone();
86  }
void org.bukkit.event.player.PlayerEditBookEvent.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.

Parameters
signingwhether or not the book is being signed.

Definition at line 104 of file PlayerEditBookEvent.java.

104  {
105  isSigning = signing;
106  }

The documentation for this class was generated from the following file: