mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +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->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();
|
||||
|
@ -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 = "";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user