diff --git a/src/pocketmine/item/PaintingItem.php b/src/pocketmine/item/PaintingItem.php index 939603337..d8e139de9 100644 --- a/src/pocketmine/item/PaintingItem.php +++ b/src/pocketmine/item/PaintingItem.php @@ -29,8 +29,8 @@ use pocketmine\entity\object\Painting; use pocketmine\entity\object\PaintingMotive; use pocketmine\math\Facing; use pocketmine\math\Vector3; -use pocketmine\network\mcpe\protocol\LevelEventPacket; use pocketmine\player\Player; +use pocketmine\world\sound\PaintingPlaceSound; use function array_rand; class PaintingItem extends Item{ @@ -95,7 +95,7 @@ class PaintingItem extends Item{ $this->pop(); $entity->spawnToAll(); - $player->getWorld()->broadcastLevelEvent($blockReplace->add(0.5, 0.5, 0.5), LevelEventPacket::EVENT_SOUND_ITEMFRAME_PLACE); //item frame and painting have the same sound + $player->getWorld()->addSound($blockReplace->add(0.5, 0.5, 0.5), new PaintingPlaceSound()); return ItemUseResult::SUCCESS(); } } diff --git a/src/pocketmine/world/sound/PaintingPlaceSound.php b/src/pocketmine/world/sound/PaintingPlaceSound.php new file mode 100644 index 000000000..3f8792f3d --- /dev/null +++ b/src/pocketmine/world/sound/PaintingPlaceSound.php @@ -0,0 +1,33 @@ +