Block: Clean up internal constructor inconsistencies

I don't dare look how big this commit is or how many bugs it introduced...
This commit is contained in:
Dylan K. Taylor
2019-02-20 19:21:51 +00:00
parent e93464f318
commit 89fce7712a
141 changed files with 427 additions and 1609 deletions

View File

@ -25,17 +25,18 @@ namespace pocketmine\block;
class RedstoneLamp extends Solid{
protected $itemId = self::REDSTONE_LAMP;
/** @var BlockIdentifierFlattened */
protected $idInfo;
/** @var bool */
protected $lit = false;
public function __construct(){
public function __construct(BlockIdentifierFlattened $idInfo, string $name){
parent::__construct($idInfo, $name);
}
public function getId() : int{
return $this->lit ? self::LIT_REDSTONE_LAMP : self::REDSTONE_LAMP;
return $this->lit ? $this->idInfo->getSecondId() : parent::getId();
}
public function isLit() : bool{
@ -56,10 +57,6 @@ class RedstoneLamp extends Solid{
return $this->lit ? 15 : 0;
}
public function getName() : string{
return "Redstone Lamp";
}
public function getHardness() : float{
return 0.3;
}