42 if($blockClicked instanceof
Liquid && $blockClicked->isSource()){
46 $resultItem = match($blockClicked->
getTypeId()){
47 BlockTypeIds::LAVA => VanillaItems::LAVA_BUCKET(),
48 BlockTypeIds::WATER => VanillaItems::WATER_BUCKET(),
51 if($resultItem ===
null){
52 return ItemUseResult::FAIL;
57 if(!$ev->isCancelled()){
58 $player->getWorld()->setBlock($blockClicked->getPosition(), VanillaBlocks::AIR());
59 $player->getWorld()->addSound($blockClicked->getPosition()->add(0.5, 0.5, 0.5), $blockClicked->getBucketFillSound());
62 $returnedItems[] = $ev->getItem();
63 return ItemUseResult::SUCCESS;
66 return ItemUseResult::FAIL;
69 return ItemUseResult::NONE;