mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Fixed sub-optimal code in WritableBook
This commit is contained in:
parent
cdebb62c35
commit
a547e2cca8
@ -181,11 +181,11 @@ class WritableBook extends Item{
|
||||
* @return bool
|
||||
*/
|
||||
private function pushPages(int $pageId, CompoundTag $namedTag, bool $downwards = true) : bool{
|
||||
if(empty($this->getPages())){
|
||||
$pages = $this->getPages();
|
||||
if(empty($pages)){
|
||||
return false;
|
||||
}
|
||||
|
||||
$pages = $this->getPages();
|
||||
$type = $downwards ? -1 : 1;
|
||||
foreach($pages as $key => $page){
|
||||
if(($key <= $pageId and $downwards) or ($key < $pageId and !$downwards)){
|
||||
|
Loading…
x
Reference in New Issue
Block a user