43 if($blockClicked instanceof
Liquid && $blockClicked->isSource()){
47 $resultItem = match($blockClicked->
getTypeId()){
48 BlockTypeIds::LAVA => VanillaItems::LAVA_BUCKET(),
49 BlockTypeIds::WATER => VanillaItems::WATER_BUCKET(),
52 if($resultItem ===
null){
53 return ItemUseResult::FAIL;
58 if(!$ev->isCancelled()){
59 $player->getWorld()->setBlock($blockClicked->getPosition(), VanillaBlocks::AIR());
60 $player->getWorld()->addSound($blockClicked->getPosition()->add(0.5, 0.5, 0.5), $blockClicked->getBucketFillSound());
63 $returnedItems[] = $ev->getItem();
64 return ItemUseResult::SUCCESS;
67 return ItemUseResult::FAIL;
70 return ItemUseResult::NONE;