mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-08 04:38:35 +00:00
fix invisible legacy skins which have empty geometry names
This commit is contained in:
parent
82d9e481d2
commit
c10ce84035
@ -97,9 +97,7 @@ class FloatingTextParticle extends Particle{
|
|||||||
|
|
||||||
$add = new PlayerListPacket();
|
$add = new PlayerListPacket();
|
||||||
$add->type = PlayerListPacket::TYPE_ADD;
|
$add->type = PlayerListPacket::TYPE_ADD;
|
||||||
$add->entries = [PlayerListEntry::createAdditionEntry($uuid, $this->entityId, $name, SkinAdapterSingleton::get()->toSkinData(new Skin(
|
$add->entries = [PlayerListEntry::createAdditionEntry($uuid, $this->entityId, $name, SkinAdapterSingleton::get()->toSkinData(new Skin("Standard_Custom", str_repeat("\x00", 8192))))];
|
||||||
"Standard_Custom", str_repeat("\x00", 8192), "", "geometry.humanoid.custom"
|
|
||||||
)))];
|
|
||||||
$p[] = $add;
|
$p[] = $add;
|
||||||
|
|
||||||
$pk = new AddPlayerPacket();
|
$pk = new AddPlayerPacket();
|
||||||
|
@ -35,9 +35,13 @@ class LegacySkinAdapter implements SkinAdapter{
|
|||||||
if($skin->getCapeData() === ""){
|
if($skin->getCapeData() === ""){
|
||||||
$capeData = new SkinImage(0, 0, $skin->getCapeData());
|
$capeData = new SkinImage(0, 0, $skin->getCapeData());
|
||||||
}
|
}
|
||||||
|
$geometryName = $skin->getGeometryName();
|
||||||
|
if($geometryName === ""){
|
||||||
|
$geometryName = "geometry.humanoid.custom";
|
||||||
|
}
|
||||||
return new SkinData(
|
return new SkinData(
|
||||||
$skin->getSkinId(),
|
$skin->getSkinId(),
|
||||||
json_encode(["geometry" => ["default" => $skin->getGeometryName()]]),
|
json_encode(["geometry" => ["default" => $geometryName]]),
|
||||||
SkinImage::fromLegacy($skin->getSkinData()), [],
|
SkinImage::fromLegacy($skin->getSkinData()), [],
|
||||||
$capeData,
|
$capeData,
|
||||||
$skin->getGeometryData()
|
$skin->getGeometryData()
|
||||||
@ -54,7 +58,7 @@ class LegacySkinAdapter implements SkinAdapter{
|
|||||||
//TODO: Kick for invalid skin
|
//TODO: Kick for invalid skin
|
||||||
}
|
}
|
||||||
if($data->isPersona()){
|
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()){
|
}elseif($data->isPersonaCapeOnClassic()){
|
||||||
$capeData = "";
|
$capeData = "";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user