mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 08:49:42 +00:00
WritableBookBase: Don't expose page deque on the API
putting this stuff on the API creates a nightmare because DS structures are both mutable and by-reference, so they have to be manually copied everywhere.
This commit is contained in:
parent
27352486a0
commit
3d0e47ba14
@ -149,17 +149,17 @@ abstract class WritableBookBase extends Item{
|
||||
/**
|
||||
* Returns an array containing all pages of this book.
|
||||
*
|
||||
* @return WritableBookPage[]|Deque
|
||||
* @return WritableBookPage[]
|
||||
*/
|
||||
public function getPages() : Deque{
|
||||
return $this->pages;
|
||||
public function getPages() : array{
|
||||
return $this->pages->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param WritableBookPage[]|Deque $pages
|
||||
* @param WritableBookPage[] $pages
|
||||
*/
|
||||
public function setPages(Deque $pages) : void{
|
||||
$this->pages = $pages;
|
||||
public function setPages(array $pages) : void{
|
||||
$this->pages = new Deque($pages);
|
||||
}
|
||||
|
||||
protected function deserializeCompoundTag(CompoundTag $tag) : void{
|
||||
|
Loading…
x
Reference in New Issue
Block a user