mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-11 00:09:39 +00:00
StartGamePacket: fixed possible type violation on decoding block table
This commit is contained in:
parent
d20d9fb689
commit
e3cffca34b
@ -211,7 +211,11 @@ class StartGamePacket extends DataPacket{
|
||||
|
||||
$this->enchantmentSeed = $this->getVarInt();
|
||||
|
||||
$this->blockTable = (new NetworkLittleEndianNBTStream())->read($this->buffer, false, $this->offset, 512);
|
||||
$blockTable = (new NetworkLittleEndianNBTStream())->read($this->buffer, false, $this->offset, 512);
|
||||
if(!($blockTable instanceof ListTag)){
|
||||
throw new \UnexpectedValueException("Wrong block table root NBT tag type");
|
||||
}
|
||||
$this->blockTable = $blockTable;
|
||||
|
||||
$this->itemTable = [];
|
||||
for($i = 0, $count = $this->getUnsignedVarInt(); $i < $count; ++$i){
|
||||
|
Loading…
x
Reference in New Issue
Block a user