22declare(strict_types=1);
24namespace pocketmine\block\utils;
29use pocketmine\utils\LegacyEnumShimTrait;
30use
function spl_object_id;
55 use LegacyEnumShimTrait;
63 case DISK_CREATOR_MUSIC_BOX;
80 private function getMetadata() : array{
84 return $cache[spl_object_id($this)] ??= match($this){
85 self::DISK_13 => [
"C418 - 13", LevelSoundEvent::RECORD_13, KnownTranslationFactory::item_record_13_desc()],
86 self::DISK_5 => [
"Samuel Ã…berg - 5", LevelSoundEvent::RECORD_5, KnownTranslationFactory::item_record_5_desc()],
87 self::DISK_CAT => [
"C418 - cat", LevelSoundEvent::RECORD_CAT, KnownTranslationFactory::item_record_cat_desc()],
88 self::DISK_BLOCKS => [
"C418 - blocks", LevelSoundEvent::RECORD_BLOCKS, KnownTranslationFactory::item_record_blocks_desc()],
89 self::DISK_CHIRP => [
"C418 - chirp", LevelSoundEvent::RECORD_CHIRP, KnownTranslationFactory::item_record_chirp_desc()],
90 self::DISK_CREATOR => [
"Lena Raine - Creator", LevelSoundEvent::RECORD_CREATOR, KnownTranslationFactory::item_record_creator_desc()],
91 self::DISK_CREATOR_MUSIC_BOX => [
"Lena Raine - Creator (Music Box)", LevelSoundEvent::RECORD_CREATOR_MUSIC_BOX, KnownTranslationFactory::item_record_creator_music_box_desc()],
92 self::DISK_FAR => [
"C418 - far", LevelSoundEvent::RECORD_FAR, KnownTranslationFactory::item_record_far_desc()],
93 self::DISK_MALL => [
"C418 - mall", LevelSoundEvent::RECORD_MALL, KnownTranslationFactory::item_record_mall_desc()],
94 self::DISK_MELLOHI => [
"C418 - mellohi", LevelSoundEvent::RECORD_MELLOHI, KnownTranslationFactory::item_record_mellohi_desc()],
95 self::DISK_OTHERSIDE => [
"Lena Raine - otherside", LevelSoundEvent::RECORD_OTHERSIDE, KnownTranslationFactory::item_record_otherside_desc()],
96 self::DISK_PIGSTEP => [
"Lena Raine - Pigstep", LevelSoundEvent::RECORD_PIGSTEP, KnownTranslationFactory::item_record_pigstep_desc()],
97 self::DISK_PRECIPICE => [
"Aaron Cherof - Precipice", LevelSoundEvent::RECORD_PRECIPICE, KnownTranslationFactory::item_record_precipice_desc()],
98 self::DISK_RELIC => [
"Aaron Cherof - Relic", LevelSoundEvent::RECORD_RELIC, KnownTranslationFactory::item_record_relic_desc()],
99 self::DISK_STAL => [
"C418 - stal", LevelSoundEvent::RECORD_STAL, KnownTranslationFactory::item_record_stal_desc()],
100 self::DISK_STRAD => [
"C418 - strad", LevelSoundEvent::RECORD_STRAD, KnownTranslationFactory::item_record_strad_desc()],
101 self::DISK_WARD => [
"C418 - ward", LevelSoundEvent::RECORD_WARD, KnownTranslationFactory::item_record_ward_desc()],
102 self::DISK_11 => [
"C418 - 11", LevelSoundEvent::RECORD_11, KnownTranslationFactory::item_record_11_desc()],
103 self::DISK_WAIT => [
"C418 - wait", LevelSoundEvent::RECORD_WAIT, KnownTranslationFactory::item_record_wait_desc()]
107 public function getSoundName() : string{
108 return $this->getMetadata()[0];
111 public function getSoundId() : int{
112 return $this->getMetadata()[1];
115 public function getTranslatableName() : Translatable{
116 return $this->getMetadata()[2];