mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Centralize all conversion-related stuff under TypeConverter
instead of having singletons for everything, which are a nightmare to manage for multi version
This commit is contained in:
@ -32,8 +32,6 @@ use pocketmine\item\Item;
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
use pocketmine\network\mcpe\protocol\serializer\ItemTypeDictionary;
|
||||
use pocketmine\utils\AssumptionFailedError;
|
||||
use pocketmine\utils\SingletonTrait;
|
||||
use pocketmine\world\format\io\GlobalItemDataHandlers;
|
||||
|
||||
/**
|
||||
* This class handles translation between network item ID+metadata to PocketMine-MP internal ID+metadata and vice versa.
|
||||
@ -41,17 +39,6 @@ use pocketmine\world\format\io\GlobalItemDataHandlers;
|
||||
final class ItemTranslator{
|
||||
public const NO_BLOCK_RUNTIME_ID = 0;
|
||||
|
||||
use SingletonTrait;
|
||||
|
||||
private static function make() : self{
|
||||
return new self(
|
||||
GlobalItemTypeDictionary::getInstance()->getDictionary(),
|
||||
RuntimeBlockMapping::getInstance()->getBlockStateDictionary(),
|
||||
GlobalItemDataHandlers::getSerializer(),
|
||||
GlobalItemDataHandlers::getDeserializer()
|
||||
);
|
||||
}
|
||||
|
||||
public function __construct(
|
||||
private ItemTypeDictionary $itemTypeDictionary,
|
||||
private BlockStateDictionary $blockStateDictionary,
|
||||
|
Reference in New Issue
Block a user