public function onUpdate($type)
{
if ($type === Level::BLOCK_UPDATE_NORMAL) {
$side = $this->getDamage();
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]);
if ($block->isTransparent()) {
$this->getLevel()->useBreakOn($this);
return Level::BLOCK_UPDATE_NORMAL;
}
}
return false;
}