mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 20:28:31 +00:00
Merge branch 'release/3.5'
This commit is contained in:
commit
ae497a828f
12
composer.lock
generated
12
composer.lock
generated
@ -233,16 +233,16 @@
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/binaryutils",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/BinaryUtils.git",
|
||||
"reference": "2c1628f08a9cdeca4d3c682e13f24420944ca845"
|
||||
"reference": "925001c8eff97a36519b16bbd095964b0fc52772"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/2c1628f08a9cdeca4d3c682e13f24420944ca845",
|
||||
"reference": "2c1628f08a9cdeca4d3c682e13f24420944ca845",
|
||||
"url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/925001c8eff97a36519b16bbd095964b0fc52772",
|
||||
"reference": "925001c8eff97a36519b16bbd095964b0fc52772",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -260,10 +260,10 @@
|
||||
],
|
||||
"description": "Classes and methods for conveniently handling binary data",
|
||||
"support": {
|
||||
"source": "https://github.com/pmmp/BinaryUtils/tree/0.1.2",
|
||||
"source": "https://github.com/pmmp/BinaryUtils/tree/0.1.3",
|
||||
"issues": "https://github.com/pmmp/BinaryUtils/issues"
|
||||
},
|
||||
"time": "2018-12-22T12:29:30+00:00"
|
||||
"time": "2018-12-30T12:17:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/math",
|
||||
|
@ -3346,9 +3346,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
public function onChunkChanged(Chunk $chunk){
|
||||
if(isset($this->usedChunks[$hash = Level::chunkHash($chunk->getX(), $chunk->getZ())])){
|
||||
$this->usedChunks[$hash] = false;
|
||||
if(!$this->spawned){
|
||||
$this->nextChunkOrderRun = 0;
|
||||
}
|
||||
$this->nextChunkOrderRun = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,8 +110,8 @@ class Attribute{
|
||||
}
|
||||
|
||||
public function setMinValue(float $minValue){
|
||||
if($minValue > $this->getMaxValue()){
|
||||
throw new \InvalidArgumentException("Value $minValue is bigger than the maxValue!");
|
||||
if($minValue > ($max = $this->getMaxValue())){
|
||||
throw new \InvalidArgumentException("Minimum $minValue is greater than the maximum $max");
|
||||
}
|
||||
|
||||
if($this->minValue != $minValue){
|
||||
@ -126,8 +126,8 @@ class Attribute{
|
||||
}
|
||||
|
||||
public function setMaxValue(float $maxValue){
|
||||
if($maxValue < $this->getMinValue()){
|
||||
throw new \InvalidArgumentException("Value $maxValue is bigger than the minValue!");
|
||||
if($maxValue < ($min = $this->getMinValue())){
|
||||
throw new \InvalidArgumentException("Maximum $maxValue is less than the minimum $min");
|
||||
}
|
||||
|
||||
if($this->maxValue != $maxValue){
|
||||
@ -143,7 +143,7 @@ class Attribute{
|
||||
|
||||
public function setDefaultValue(float $defaultValue){
|
||||
if($defaultValue > $this->getMaxValue() or $defaultValue < $this->getMinValue()){
|
||||
throw new \InvalidArgumentException("Value $defaultValue exceeds the range!");
|
||||
throw new \InvalidArgumentException("Default $defaultValue is outside the range " . $this->getMinValue() . " - " . $this->getMaxValue());
|
||||
}
|
||||
|
||||
if($this->defaultValue !== $defaultValue){
|
||||
@ -171,7 +171,7 @@ class Attribute{
|
||||
public function setValue(float $value, bool $fit = false, bool $forceSend = false){
|
||||
if($value > $this->getMaxValue() or $value < $this->getMinValue()){
|
||||
if(!$fit){
|
||||
throw new \InvalidArgumentException("Value $value exceeds the range!");
|
||||
throw new \InvalidArgumentException("Value $value is outside the range " . $this->getMinValue() . " - " . $this->getMaxValue());
|
||||
}
|
||||
$value = min(max($value, $this->getMinValue()), $this->getMaxValue());
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user