mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
RuntimeBlockMapping: use SingletonTrait
This commit is contained in:
parent
3a42c21cc1
commit
a75241ef03
@ -30,6 +30,7 @@ use pocketmine\nbt\tag\CompoundTag;
|
|||||||
use pocketmine\nbt\tag\ListTag;
|
use pocketmine\nbt\tag\ListTag;
|
||||||
use pocketmine\network\mcpe\protocol\types\CacheableNbt;
|
use pocketmine\network\mcpe\protocol\types\CacheableNbt;
|
||||||
use pocketmine\network\mcpe\serializer\NetworkNbtSerializer;
|
use pocketmine\network\mcpe\serializer\NetworkNbtSerializer;
|
||||||
|
use pocketmine\utils\SingletonTrait;
|
||||||
use function file_get_contents;
|
use function file_get_contents;
|
||||||
use function getmypid;
|
use function getmypid;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
@ -40,16 +41,7 @@ use function shuffle;
|
|||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
final class RuntimeBlockMapping{
|
final class RuntimeBlockMapping{
|
||||||
/** @var self|null */
|
use SingletonTrait;
|
||||||
private static $instance = null;
|
|
||||||
|
|
||||||
public static function getInstance() : self{
|
|
||||||
if(self::$instance === null){
|
|
||||||
self::$instance = new self;
|
|
||||||
}
|
|
||||||
|
|
||||||
return self::$instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @var int[] */
|
/** @var int[] */
|
||||||
private $legacyToRuntimeMap = [];
|
private $legacyToRuntimeMap = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user