mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-13 13:25:16 +00:00
GlassBottle: implement filling using API changes from 4afd3dcabfa6b9c645ab8b15fade1e37f889482f
closes #4827
This commit is contained in:
parent
d0ff6d2e36
commit
81edb1bed4
@ -23,6 +23,21 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
|
use pocketmine\block\Block;
|
||||||
|
use pocketmine\block\BlockTypeIds;
|
||||||
|
use pocketmine\math\Vector3;
|
||||||
|
use pocketmine\player\Player;
|
||||||
|
|
||||||
class GlassBottle extends Item{
|
class GlassBottle extends Item{
|
||||||
|
|
||||||
|
public function onInteractBlock(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, array &$returnedItems) : ItemUseResult{
|
||||||
|
if($blockClicked->getTypeId() === BlockTypeIds::WATER){
|
||||||
|
$this->pop();
|
||||||
|
$returnedItems[] = VanillaItems::POTION()->setType(PotionType::WATER());
|
||||||
|
|
||||||
|
return ItemUseResult::SUCCESS();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ItemUseResult::NONE();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user