fix invisible legacy skins which have empty geometry names

This commit is contained in:
Dylan K. Taylor 2019-12-07 10:02:22 +00:00
parent 82d9e481d2
commit c10ce84035
2 changed files with 7 additions and 5 deletions

View File

@ -97,9 +97,7 @@ class FloatingTextParticle extends Particle{
$add = new PlayerListPacket();
$add->type = PlayerListPacket::TYPE_ADD;
$add->entries = [PlayerListEntry::createAdditionEntry($uuid, $this->entityId, $name, SkinAdapterSingleton::get()->toSkinData(new Skin(
"Standard_Custom", str_repeat("\x00", 8192), "", "geometry.humanoid.custom"
)))];
$add->entries = [PlayerListEntry::createAdditionEntry($uuid, $this->entityId, $name, SkinAdapterSingleton::get()->toSkinData(new Skin("Standard_Custom", str_repeat("\x00", 8192))))];
$p[] = $add;
$pk = new AddPlayerPacket();

View File

@ -35,9 +35,13 @@ class LegacySkinAdapter implements SkinAdapter{
if($skin->getCapeData() === ""){
$capeData = new SkinImage(0, 0, $skin->getCapeData());
}
$geometryName = $skin->getGeometryName();
if($geometryName === ""){
$geometryName = "geometry.humanoid.custom";
}
return new SkinData(
$skin->getSkinId(),
json_encode(["geometry" => ["default" => $skin->getGeometryName()]]),
json_encode(["geometry" => ["default" => $geometryName]]),
SkinImage::fromLegacy($skin->getSkinData()), [],
$capeData,
$skin->getGeometryData()
@ -54,7 +58,7 @@ class LegacySkinAdapter implements SkinAdapter{
//TODO: Kick for invalid skin
}
if($data->isPersona()){
return new Skin("Standard_Custom", str_repeat(random_bytes(3) . "\xff", 2048), "", "geometry.humanoid.custom");
return new Skin("Standard_Custom", str_repeat(random_bytes(3) . "\xff", 2048));
}elseif($data->isPersonaCapeOnClassic()){
$capeData = "";
}