Move SkinAdapter under TypeConverter, remove SkinAdapterSingleton

this is legacy cruft from PM3, which didn't have TypeConverter or SingletonTrait.
This commit is contained in:
Dylan K. Taylor
2023-05-06 17:53:24 +01:00
parent ed11fd5a83
commit 926f68d8c5
6 changed files with 18 additions and 53 deletions

View File

@ -45,7 +45,6 @@ use pocketmine\math\Facing;
use pocketmine\math\Vector3;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\StringTag;
use pocketmine\network\mcpe\convert\SkinAdapterSingleton;
use pocketmine\network\mcpe\InventoryManager;
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\protocol\ActorEventPacket;
@ -837,7 +836,7 @@ class InGamePacketHandler extends PacketHandler{
$this->session->getLogger()->debug("Processing skin change request");
try{
$skin = SkinAdapterSingleton::get()->fromSkinData($packet->skin);
$skin = $this->session->getTypeConverter()->getSkinAdapter()->fromSkinData($packet->skin);
}catch(InvalidSkinException $e){
throw PacketHandlingException::wrap($e, "Invalid skin in PlayerSkinPacket");
}