mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Merge branch 'release/3.5'
This commit is contained in:
@ -114,7 +114,9 @@ class ClientboundMapItemDataPacket extends DataPacket{
|
||||
$this->yOffset = $this->getVarInt();
|
||||
|
||||
$count = $this->getUnsignedVarInt();
|
||||
assert($count === $this->width * $this->height);
|
||||
if($count !== $this->width * $this->height){
|
||||
throw new \UnexpectedValueException("Expected colour count of " . ($this->height * $this->width) . " (height $this->height * width $this->width), got $count");
|
||||
}
|
||||
|
||||
for($y = 0; $y < $this->height; ++$y){
|
||||
for($x = 0; $x < $this->width; ++$x){
|
||||
|
@ -69,7 +69,9 @@ abstract class DataPacket extends NetworkBinaryStream{
|
||||
|
||||
protected function decodeHeader() : void{
|
||||
$pid = $this->getUnsignedVarInt();
|
||||
assert($pid === static::NETWORK_ID);
|
||||
if($pid !== static::NETWORK_ID){
|
||||
throw new \UnexpectedValueException("Expected " . static::NETWORK_ID . " for packet ID, got $pid");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user