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,21 +25,18 @@ namespace pocketmine\block;
class RedstoneTorch extends Torch{
protected $itemId = self::REDSTONE_TORCH;
/** @var BlockIdentifierFlattened */
protected $idInfo;
/** @var bool */
protected $lit = true;
public function __construct(){
parent::__construct(self::REDSTONE_TORCH, 0, "Redstone Torch", self::REDSTONE_TORCH);
public function __construct(BlockIdentifierFlattened $idInfo, string $name){
parent::__construct($idInfo, $name);
}
public function getId() : int{
return $this->lit ? self::REDSTONE_TORCH : self::UNLIT_REDSTONE_TORCH;
}
public function getName() : string{
return "Redstone Torch";
return $this->lit ? parent::getId() : $this->idInfo->getSecondId();
}
public function isLit() : bool{