public function onActivate(Item $item, Player $player = null)
{
$tile = $this->getLevel()->getTile($this);
if ($this->meta == 0) {
switch ($item->getId()) {
case Item::BUCKET:
if ($item->getDamage() === 8) {
$this->meta = 6;
$this->getLevel()->setBlock($this, $this, true, false);
if ($player->isSurvival()) {
$item->setDamage(0);
$player->getInventory()->setItemInHand($item(), $player);
}
}
return true;
break;
}
}
return false;
}