PocketMine-MP 5.15.1 git-5ef247620a7c6301a849b54e5ef1009217729fc8
pocketmine\event\player\PlayerEditBookEvent Class Reference
+ Inheritance diagram for pocketmine\event\player\PlayerEditBookEvent:
+ Collaboration diagram for pocketmine\event\player\PlayerEditBookEvent:

Public Member Functions

 __construct (Player $player, private WritableBookBase $oldBook, private WritableBookBase $newBook, private int $action, private array $modifiedPages)
 
 call ()
 
 getAction ()
 
 getEventName ()
 
 getModifiedPages ()
 
 getNewBook ()
 
 getOldBook ()
 
 getPlayer ()
 
 isCancelled ()
 
 setNewBook (WritableBookBase $book)
 

Static Public Member Functions

static hasHandlers ()
 

Public Attributes

const ACTION_ADD_PAGE = 1
 
const ACTION_DELETE_PAGE = 2
 
const ACTION_REPLACE_PAGE = 0
 
const ACTION_SIGN_BOOK = 4
 
const ACTION_SWAP_PAGES = 3
 

Protected Attributes

string $eventName = null
 
Player $player
 

Detailed Description

Definition at line 31 of file PlayerEditBookEvent.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\event\player\PlayerEditBookEvent::__construct ( Player  $player,
private WritableBookBase  $oldBook,
private WritableBookBase  $newBook,
private int  $action,
private array  $modifiedPages 
)
Parameters
int[]$modifiedPages

Definition at line 43 of file PlayerEditBookEvent.php.

Member Function Documentation

◆ call()

pocketmine\event\Event::call ( )
inherited

Calls event handlers registered for this event.

Exceptions

RuntimeException if event call recursion reaches the max depth limit

Definition at line 49 of file Event.php.

◆ getAction()

pocketmine\event\player\PlayerEditBookEvent::getAction ( )

Returns the action of the event.

Definition at line 56 of file PlayerEditBookEvent.php.

◆ getEventName()

pocketmine\event\Event::getEventName ( )
finalinherited

Definition at line 40 of file Event.php.

◆ getModifiedPages()

pocketmine\event\player\PlayerEditBookEvent::getModifiedPages ( )

Returns an array containing the page IDs of modified pages.

Returns
int[]

Definition at line 87 of file PlayerEditBookEvent.php.

◆ getNewBook()

pocketmine\event\player\PlayerEditBookEvent::getNewBook ( )

Returns the book after it was modified. The new book may be a written book, if the book was signed.

Definition at line 71 of file PlayerEditBookEvent.php.

◆ getOldBook()

pocketmine\event\player\PlayerEditBookEvent::getOldBook ( )

Returns the book before it was modified.

Definition at line 63 of file PlayerEditBookEvent.php.

◆ getPlayer()

pocketmine\event\player\PlayerEvent::getPlayer ( )
inherited

Definition at line 35 of file PlayerEvent.php.

◆ hasHandlers()

static pocketmine\event\Event::hasHandlers ( )
staticinherited

Returns whether the current class context has any registered global handlers. This can be used in hot code paths to avoid unnecessary event object creation.

Usage: SomeEventClass::hasHandlers()

Definition at line 77 of file Event.php.

◆ isCancelled()

pocketmine\event\Cancellable::isCancelled ( )
inherited

Returns whether this instance of the event is currently cancelled.

If it is cancelled, only downstream handlers that declare @handleCancelled will be called with this event.

◆ setNewBook()

pocketmine\event\player\PlayerEditBookEvent::setNewBook ( WritableBookBase  $book)

Sets the new book as the given instance.

Definition at line 78 of file PlayerEditBookEvent.php.

Member Data Documentation

◆ $eventName

string pocketmine\event\Event::$eventName = null
protectedinherited

Definition at line 38 of file Event.php.

◆ $player

Player pocketmine\event\player\PlayerEvent::$player
protectedinherited

Definition at line 33 of file PlayerEvent.php.

◆ ACTION_ADD_PAGE

const pocketmine\event\player\PlayerEditBookEvent::ACTION_ADD_PAGE = 1

Definition at line 35 of file PlayerEditBookEvent.php.

◆ ACTION_DELETE_PAGE

const pocketmine\event\player\PlayerEditBookEvent::ACTION_DELETE_PAGE = 2

Definition at line 36 of file PlayerEditBookEvent.php.

◆ ACTION_REPLACE_PAGE

const pocketmine\event\player\PlayerEditBookEvent::ACTION_REPLACE_PAGE = 0

Definition at line 34 of file PlayerEditBookEvent.php.

◆ ACTION_SIGN_BOOK

const pocketmine\event\player\PlayerEditBookEvent::ACTION_SIGN_BOOK = 4

Definition at line 38 of file PlayerEditBookEvent.php.

◆ ACTION_SWAP_PAGES

const pocketmine\event\player\PlayerEditBookEvent::ACTION_SWAP_PAGES = 3

Definition at line 37 of file PlayerEditBookEvent.php.


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