public function activate(array $ignore = [])
{
parent::activate($ignore);
$side = $this->meta;
if ($this->isActivated()) {
$side ^= 0x8;
}
$faces = [5 => 0, 6 => 0, 3 => 2, 1 => 4, 4 => 3, 2 => 5, 0 => 1, 7 => 1];
$block = $this->getSide($faces[$side])->getSide(Vector3::SIDE_UP);
if (!$this->isRightPlace($this, $block)) {
if ($block instanceof Door or $block instanceof Trapdoor) {
if (!$block->isOpened()) {
$block->onActivate(new Item(0));
}
}
if ($block->getId() == Block::TNT) {
$block->onActivate(new Item(Item::FLINT_AND_STEEL));
}
/** @var ActiveRedstoneLamp $block */
if ($block->getId() == Block::INACTIVE_REDSTONE_LAMP or $block->getId() == Block::ACTIVE_REDSTONE_LAMP) {
$block->turnOn();
}
if ($block->getId() == Block::REDSTONE_WIRE) {
/** @var RedstoneWire $wire */
$wire = $block;
$wire->calcSignal($this->maxStrength, RedstoneWire::ON);
}
}
$this->checkTorchOn($this->getSide($faces[$side]), [$this->getOppositeSide($faces[$side])]);
}