mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
block/Light: fixed placement when clicking on another light block
closes #5132
This commit is contained in:
parent
46b79fbe85
commit
5c4288de01
@ -58,6 +58,11 @@ final class Light extends Flowable{
|
||||
|
||||
public function canBeReplaced() : bool{ return true; }
|
||||
|
||||
public function canBePlacedAt(Block $blockReplace, Vector3 $clickVector, int $face, bool $isClickedBlock) : bool{
|
||||
//light blocks behave like solid blocks when placing them on another light block
|
||||
return $blockReplace->canBeReplaced() && $blockReplace->getTypeId() !== $this->getTypeId();
|
||||
}
|
||||
|
||||
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
||||
$this->level = $this->level === self::MAX_LIGHT_LEVEL ?
|
||||
self::MIN_LIGHT_LEVEL :
|
||||
|
Loading…
x
Reference in New Issue
Block a user