mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +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.
|
* Returns an array containing all pages of this book.
|
||||||
*
|
*
|
||||||
* @return WritableBookPage[]|Deque
|
* @return WritableBookPage[]
|
||||||
*/
|
*/
|
||||||
public function getPages() : Deque{
|
public function getPages() : array{
|
||||||
return $this->pages;
|
return $this->pages->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WritableBookPage[]|Deque $pages
|
* @param WritableBookPage[] $pages
|
||||||
*/
|
*/
|
||||||
public function setPages(Deque $pages) : void{
|
public function setPages(array $pages) : void{
|
||||||
$this->pages = $pages;
|
$this->pages = new Deque($pages);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function deserializeCompoundTag(CompoundTag $tag) : void{
|
protected function deserializeCompoundTag(CompoundTag $tag) : void{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user