Updated PocketMine-NBT dependency

This commit is contained in:
Dylan K. Taylor
2018-02-17 14:29:20 +00:00
parent 3f41628bf3
commit 093cb5b39e
10 changed files with 46 additions and 62 deletions

View File

@@ -2789,9 +2789,12 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$t = $this->level->getTile($pos);
if($t instanceof Spawnable){
$nbt = new NetworkLittleEndianNBTStream();
$nbt->read($packet->namedtag);
$nbt = $nbt->getData();
if(!$t->updateCompoundTag($nbt, $this)){
$compound = $nbt->read($packet->namedtag);
if(!($compound instanceof CompoundTag)){
throw new \InvalidArgumentException("Expected " . CompoundTag::class . " in block entity NBT, got " . (is_object($compound) ? get_class($compound) : gettype($compound)));
}
if(!$t->updateCompoundTag($compound, $this)){
$t->spawnTo($this);
}
}