mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-25 20:54:56 +00:00
Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17168505072
This commit is contained in:
commit
6d5c46b091
@ -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.
|
||||||
*/
|
*/
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user