diff --git a/composer.lock b/composer.lock index 32846cebf..73f2f0e92 100644 --- a/composer.lock +++ b/composer.lock @@ -160,16 +160,16 @@ }, { "name": "pocketmine/nbt", - "version": "0.2.6", + "version": "0.2.7", "source": { "type": "git", "url": "https://github.com/pmmp/NBT.git", - "reference": "92eaf84dd61f700d3ec02ebd01b606cb5b1590d4" + "reference": "2f176c9f2fd9b31db8bc2ada2f38990157ec8f1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/NBT/zipball/92eaf84dd61f700d3ec02ebd01b606cb5b1590d4", - "reference": "92eaf84dd61f700d3ec02ebd01b606cb5b1590d4", + "url": "https://api.github.com/repos/pmmp/NBT/zipball/2f176c9f2fd9b31db8bc2ada2f38990157ec8f1a", + "reference": "2f176c9f2fd9b31db8bc2ada2f38990157ec8f1a", "shasum": "" }, "require": { @@ -194,10 +194,10 @@ ], "description": "PHP library for working with Named Binary Tags", "support": { - "source": "https://github.com/pmmp/NBT/tree/0.2.6", + "source": "https://github.com/pmmp/NBT/tree/0.2.7", "issues": "https://github.com/pmmp/NBT/issues" }, - "time": "2019-02-07T16:28:11+00:00" + "time": "2019-03-29T19:39:42+00:00" }, { "name": "pocketmine/raklib", diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 2b7efe412..6cef02903 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -2985,7 +2985,8 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $t = $this->level->getTile($pos); if($t instanceof Spawnable){ $nbt = new NetworkLittleEndianNBTStream(); - $compound = $nbt->read($packet->namedtag); + $_ = 0; + $compound = $nbt->read($packet->namedtag, false, $_, 512); if(!($compound instanceof CompoundTag)){ throw new \InvalidArgumentException("Expected " . CompoundTag::class . " in block entity NBT, got " . (is_object($compound) ? get_class($compound) : gettype($compound))); diff --git a/src/pocketmine/network/mcpe/NetworkBinaryStream.php b/src/pocketmine/network/mcpe/NetworkBinaryStream.php index cbef4a9ab..5dc1fb885 100644 --- a/src/pocketmine/network/mcpe/NetworkBinaryStream.php +++ b/src/pocketmine/network/mcpe/NetworkBinaryStream.php @@ -90,7 +90,7 @@ class NetworkBinaryStream extends BinaryStream{ if($c !== 1){ throw new \UnexpectedValueException("Unexpected NBT count $c"); } - $nbt = (new NetworkLittleEndianNBTStream())->read($this->buffer, false, $this->offset); + $nbt = (new NetworkLittleEndianNBTStream())->read($this->buffer, false, $this->offset, 512); }elseif($nbtLen !== 0){ throw new \UnexpectedValueException("Unexpected fake NBT length $nbtLen"); }