public function onEntityCollide(Entity $entity)
{
if ($this->getLevel()->getServer()->redstoneEnabled and $this->canActivate) {
if (!$this->isActivated()) {
$this->meta = 1;
$this->getLevel()->setBlock($this, $this, true, false);
$this->getLevel()->addSound(new GenericSound($this, 1000));
}
if (!$this->isActivated() or $this->isActivated() and $this->getLevel()->getServer()->getTick() % 30 == 0) {
$this->activate();
}
}
}