Updated NBT dependency

This commit is contained in:
Dylan K. Taylor 2019-03-29 19:47:15 +00:00
parent 8e9f787d33
commit f4480c07ee
3 changed files with 9 additions and 8 deletions

12
composer.lock generated
View File

@ -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",

View File

@ -2983,7 +2983,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)));

View File

@ -89,7 +89,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");
}