Merge branch 'legacy/pm4' into stable

This commit is contained in:
Dylan K. Taylor 2023-06-03 21:23:00 +01:00
commit 8d7f8ff3f5
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -27,6 +27,7 @@ use pocketmine\item\Item;
use pocketmine\item\Record;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\network\mcpe\convert\TypeConverter;
use pocketmine\world\sound\RecordStopSound;
class Jukebox extends Spawnable{
private const TAG_RECORD = "RecordItem"; //Item CompoundTag
@ -62,4 +63,8 @@ class Jukebox extends Spawnable{
$nbt->setTag(self::TAG_RECORD, TypeConverter::getInstance()->getItemTranslator()->toNetworkNbt($this->record));
}
}
protected function onBlockDestroyedHook() : void{
$this->position->getWorld()->addSound($this->position, new RecordStopSound());
}
}