Merge 'minor-next' into 'major-next'

Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17168505072
This commit is contained in:
pmmp-admin-bot[bot] 2025-08-23 00:03:09 +00:00
commit 6d5c46b091
2 changed files with 24 additions and 1 deletions

View File

@ -114,6 +114,18 @@ class ChiseledBookshelf extends Opaque implements HorizontalFacing{
return $this->slots; return $this->slots;
} }
/**
* @param ChiseledBookshelfSlot[] $slots
* @return $this
*/
public function setSlots(array $slots) : self{
$this->slots = [];
foreach($slots as $slot){
$this->setSlot($slot, true);
}
return $this;
}
/** /**
* Returns the last slot interacted by a player or null if no slot has been interacted with yet. * Returns the last slot interacted by a player or null if no slot has been interacted with yet.
*/ */

View File

@ -23,11 +23,12 @@ declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\block\utils\Lightable;
use pocketmine\block\utils\PoweredByRedstone; use pocketmine\block\utils\PoweredByRedstone;
use pocketmine\block\utils\PoweredByRedstoneTrait; use pocketmine\block\utils\PoweredByRedstoneTrait;
use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\data\runtime\RuntimeDataDescriber;
class RedstoneLamp extends Opaque implements PoweredByRedstone{ class RedstoneLamp extends Opaque implements PoweredByRedstone, Lightable{
use PoweredByRedstoneTrait; use PoweredByRedstoneTrait;
protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{ protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
@ -37,4 +38,14 @@ class RedstoneLamp extends Opaque implements PoweredByRedstone{
public function getLightLevel() : int{ public function getLightLevel() : int{
return $this->powered ? 15 : 0; return $this->powered ? 15 : 0;
} }
public function isLit() : bool{
return $this->powered;
}
/** @return $this */
public function setLit(bool $lit = true) : self{
$this->powered = $lit;
return $this;
}
} }