Fixed BB and right-click action for daylight sensor

This commit is contained in:
Dylan K. Taylor 2018-09-24 16:37:18 +01:00
parent a77e05f875
commit a195e940db

View File

@ -23,6 +23,10 @@ declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\math\AxisAlignedBB;
use pocketmine\Player;
class DaylightSensor extends Transparent{
protected $itemId = self::DAYLIGHT_SENSOR;
@ -77,5 +81,15 @@ class DaylightSensor extends Transparent{
return BlockToolType::TYPE_AXE;
}
protected function recalculateBoundingBox() : ?AxisAlignedBB{
return new AxisAlignedBB(0, 0, 0, 1, 0.5, 1);
}
public function onActivate(Item $item, Player $player = null) : bool{
$this->inverted = !$this->inverted;
$this->level->setBlock($this, $this);
return true;
}
//TODO
}