mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Human: fixed NPC skin crash after ByteArray change
This commit is contained in:
parent
b445825467
commit
b7bd8dc7f1
@ -85,7 +85,10 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
public function __construct(Level $level, CompoundTag $nbt){
|
||||
if($this->skin === null){
|
||||
$skinTag = $nbt->getCompoundTag("Skin");
|
||||
if($skinTag === null or !self::isValidSkin($skinTag->getString("Data", "", true))){
|
||||
if($skinTag === null or !self::isValidSkin($skinTag->hasTag("Data", ByteArrayTag::class) ?
|
||||
$skinTag->getByteArray("Data") :
|
||||
$skinTag->getString("Data", "")
|
||||
)){
|
||||
throw new \InvalidStateException((new \ReflectionClass($this))->getShortName() . " must have a valid skin set");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user