Merge branch 'next-minor' into next-major

This commit is contained in:
Dylan K. Taylor
2022-07-20 20:55:33 +01:00
40 changed files with 189 additions and 136 deletions

View File

@ -115,6 +115,7 @@ class FlowerPot extends Flowable{
}
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
$world = $this->position->getWorld();
$plant = $item->getBlock();
if($this->plant !== null){
if($this->isValidPlant($plant)){
@ -130,16 +131,16 @@ class FlowerPot extends Flowable{
$removedItems = $player->getInventory()->addItem(...$removedItems);
}
foreach($removedItems as $drops){
$this->position->getWorld()->dropItem($this->position->add(0.5, 0.5, 0.5), $drops);
$world->dropItem($this->position->add(0.5, 0.5, 0.5), $drops);
}
$this->setPlant(null);
$this->position->getWorld()->setBlock($this->position, $this);
$world->setBlock($this->position, $this);
return true;
}elseif($this->isValidPlant($plant)){
$this->setPlant($plant);
$item->pop();
$this->position->getWorld()->setBlock($this->position, $this);
$world->setBlock($this->position, $this);
return true;
}