PocketMine-MP 5.44.4 git-bc94a0da0c87abe7eb99d229a9ec672b3c405d11
Loading...
Searching...
No Matches
RecordType.php
1<?php
2
3/*
4 *
5 * ____ _ _ __ __ _ __ __ ____
6 * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
7 * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
8 * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
9 * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
10 *
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * @author PocketMine Team
17 * @link http://www.pocketmine.net/
18 *
19 *
20 */
21
22declare(strict_types=1);
23
24namespace pocketmine\block\utils;
25
28use function spl_object_id;
29
33enum RecordType{
34 case DISK_13;
35 case DISK_5;
36 case DISK_CAT;
37 case DISK_BLOCKS;
38 case DISK_CHIRP;
39 case DISK_CREATOR;
40 case DISK_CREATOR_MUSIC_BOX;
41 case DISK_FAR;
42 case DISK_LAVA_CHICKEN;
43 case DISK_MALL;
44 case DISK_MELLOHI;
45 case DISK_OTHERSIDE;
46 case DISK_PIGSTEP;
47 case DISK_PRECIPICE;
48 case DISK_RELIC;
49 case DISK_STAL;
50 case DISK_STRAD;
51 case DISK_WARD;
52 case DISK_11;
53 case DISK_WAIT;
54
58 private function getMetadata() : array{
60 static $cache = [];
61
62 return $cache[spl_object_id($this)] ??= match($this){
63 self::DISK_13 => ["C418 - 13", KnownTranslationFactory::item_record_13_desc()],
64 self::DISK_5 => ["Samuel Ã…berg - 5", KnownTranslationFactory::item_record_5_desc()],
65 self::DISK_CAT => ["C418 - cat", KnownTranslationFactory::item_record_cat_desc()],
66 self::DISK_BLOCKS => ["C418 - blocks", KnownTranslationFactory::item_record_blocks_desc()],
67 self::DISK_CHIRP => ["C418 - chirp", KnownTranslationFactory::item_record_chirp_desc()],
68 self::DISK_CREATOR => ["Lena Raine - Creator", KnownTranslationFactory::item_record_creator_desc()],
69 self::DISK_CREATOR_MUSIC_BOX => ["Lena Raine - Creator (Music Box)", KnownTranslationFactory::item_record_creator_music_box_desc()],
70 self::DISK_FAR => ["C418 - far", KnownTranslationFactory::item_record_far_desc()],
71 self::DISK_LAVA_CHICKEN => ["Hyper Potions - Lava Chicken", KnownTranslationFactory::item_record_lava_chicken_desc()],
72 self::DISK_MALL => ["C418 - mall", KnownTranslationFactory::item_record_mall_desc()],
73 self::DISK_MELLOHI => ["C418 - mellohi", KnownTranslationFactory::item_record_mellohi_desc()],
74 self::DISK_OTHERSIDE => ["Lena Raine - otherside", KnownTranslationFactory::item_record_otherside_desc()],
75 self::DISK_PIGSTEP => ["Lena Raine - Pigstep", KnownTranslationFactory::item_record_pigstep_desc()],
76 self::DISK_PRECIPICE => ["Aaron Cherof - Precipice", KnownTranslationFactory::item_record_precipice_desc()],
77 self::DISK_RELIC => ["Aaron Cherof - Relic", KnownTranslationFactory::item_record_relic_desc()],
78 self::DISK_STAL => ["C418 - stal", KnownTranslationFactory::item_record_stal_desc()],
79 self::DISK_STRAD => ["C418 - strad", KnownTranslationFactory::item_record_strad_desc()],
80 self::DISK_WARD => ["C418 - ward", KnownTranslationFactory::item_record_ward_desc()],
81 self::DISK_11 => ["C418 - 11", KnownTranslationFactory::item_record_11_desc()],
82 self::DISK_WAIT => ["C418 - wait", KnownTranslationFactory::item_record_wait_desc()]
83 };
84 }
85
86 public function getSoundName() : string{
87 return $this->getMetadata()[0];
88 }
89
93 public function getSoundId() : int{
94 return 0;
95 }
96
97 public function getTranslatableName() : Translatable{
98 return $this->getMetadata()[1];
99 }
100}