ClientDataToSkinDataHelper: Remove SingletonTrait

SingletonTrait is pointless here for multiple reasons:
1) the class is final
2) this is protocol-specific translation of types, no loss of data or alternative mutation of it needs to occur

Using SingletonTrait is an obstacle to separating the protocol library from the core code, so it has to go.
This commit is contained in:
Dylan K. Taylor
2021-07-14 14:50:59 +01:00
parent 1ad38d499c
commit c474aa42e5
2 changed files with 2 additions and 4 deletions

View File

@ -105,7 +105,7 @@ class LoginPacketHandler extends PacketHandler{
$clientData = $this->parseClientData($packet->clientDataJwt);
try{
$skin = SkinAdapterSingleton::get()->fromSkinData(ClientDataToSkinDataHelper::getInstance()->fromClientData($clientData));
$skin = SkinAdapterSingleton::get()->fromSkinData(ClientDataToSkinDataHelper::fromClientData($clientData));
}catch(\InvalidArgumentException | InvalidSkinException $e){
$this->session->getLogger()->debug("Invalid skin: " . $e->getMessage());
$this->session->disconnect("disconnectionScreen.invalidSkin");