Enable various types of interaction to return items to the player, without needing to have a bunch of boilerplate creative mode and held item checks

it became glaringly obvious that this was needed because of #4827 and #4868.

this is further needed with the addition of cauldrons.
This commit is contained in:
Dylan K. Taylor
2022-07-16 19:50:33 +01:00
parent 4afd3dcabf
commit d0ff6d2e36
69 changed files with 177 additions and 155 deletions

View File

@ -127,7 +127,7 @@ class Lectern extends Transparent{
return $this;
}
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
if($this->book === null && $item instanceof WritableBookBase){
$this->position->getWorld()->setBlock($this->position, $this->setBook($item));
$this->position->getWorld()->addSound($this->position, new LecternPlaceBookSound());