From d9deb571eda71f29e34ee47411097ff1b8a1bee2 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 15 Jan 2022 22:26:56 +0000 Subject: [PATCH] Added LecternPlaceBookSound --- src/block/Lectern.php | 2 ++ src/world/sound/LecternPlaceBookSound.php | 35 +++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/world/sound/LecternPlaceBookSound.php diff --git a/src/block/Lectern.php b/src/block/Lectern.php index 11e9f2653..095824a16 100644 --- a/src/block/Lectern.php +++ b/src/block/Lectern.php @@ -33,6 +33,7 @@ use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\player\Player; +use pocketmine\world\sound\LecternPlaceBookSound; class Lectern extends Transparent{ use FacesOppositePlacingPlayerTrait; @@ -122,6 +123,7 @@ class Lectern extends Transparent{ public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : 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()); $item->pop(); } return true; diff --git a/src/world/sound/LecternPlaceBookSound.php b/src/world/sound/LecternPlaceBookSound.php new file mode 100644 index 000000000..f7cf5df7e --- /dev/null +++ b/src/world/sound/LecternPlaceBookSound.php @@ -0,0 +1,35 @@ +