Separate ItemTypeDictionary implementation from initialization

we're not going to want implementation details like how it's setup getting in the way when we separate protocol from the core.
This commit is contained in:
Dylan K. Taylor
2021-05-29 14:24:05 +01:00
parent f68b9e79e1
commit 8171b18002
6 changed files with 76 additions and 37 deletions

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\handler;
use pocketmine\network\mcpe\cache\CraftingDataCache;
use pocketmine\network\mcpe\cache\StaticPacketCache;
use pocketmine\network\mcpe\convert\ItemTypeDictionary;
use pocketmine\network\mcpe\convert\GlobalItemTypeDictionary;
use pocketmine\network\mcpe\convert\TypeConverter;
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\protocol\RequestChunkRadiusPacket;
@ -87,7 +87,7 @@ class PreSpawnPacketHandler extends PacketHandler{
$pk->experiments = new Experiments([], false);
$pk->levelId = "";
$pk->worldName = $this->server->getMotd();
$pk->itemTable = ItemTypeDictionary::getInstance()->getEntries(); //TODO: check if this is actually needed
$pk->itemTable = GlobalItemTypeDictionary::getInstance()->getDictionary()->getEntries(); //TODO: check if this is actually needed
$pk->playerMovementSettings = new PlayerMovementSettings(PlayerMovementType::LEGACY, 0, false);
$this->session->sendDataPacket($pk);