Make more use of PoweredByRedstoneTrait

This commit is contained in:
Dylan K. Taylor
2021-02-06 18:43:33 +00:00
parent 48ef8771cd
commit 5be03c3196
4 changed files with 8 additions and 30 deletions

View File

@ -25,6 +25,7 @@ namespace pocketmine\block;
use pocketmine\block\utils\BlockDataSerializer;
use pocketmine\block\utils\HorizontalFacingTrait;
use pocketmine\block\utils\PoweredByRedstoneTrait;
use pocketmine\item\Item;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;
@ -34,12 +35,11 @@ use pocketmine\world\BlockTransaction;
class RedstoneRepeater extends Flowable{
use HorizontalFacingTrait;
use PoweredByRedstoneTrait;
/** @var BlockIdentifierFlattened */
protected $idInfo;
/** @var bool */
protected $powered = false;
/** @var int */
protected $delay = 1;
@ -72,18 +72,6 @@ class RedstoneRepeater extends Flowable{
return [AxisAlignedBB::one()->trim(Facing::UP, 7 / 8)];
}
public function isPowered() : bool{
return $this->powered;
}
/**
* @return $this
*/
public function setPowered(bool $powered = true) : self{
$this->powered = $powered;
return $this;
}
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if(!$blockReplace->getSide(Facing::DOWN)->isTransparent()){
if($player !== null){