Merge branch 'release/3.4' into release/3.5

This commit is contained in:
Dylan K. Taylor 2018-12-22 13:29:41 +00:00
commit 42f8e061a5
4 changed files with 19 additions and 12 deletions

12
composer.lock generated
View File

@ -48,16 +48,16 @@
},
{
"name": "pocketmine/binaryutils",
"version": "0.1.1",
"version": "0.1.2",
"source": {
"type": "git",
"url": "https://github.com/pmmp/BinaryUtils.git",
"reference": "54efeb978be0ff9335022729fe63c1e2077bf1be"
"reference": "2c1628f08a9cdeca4d3c682e13f24420944ca845"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/54efeb978be0ff9335022729fe63c1e2077bf1be",
"reference": "54efeb978be0ff9335022729fe63c1e2077bf1be",
"url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/2c1628f08a9cdeca4d3c682e13f24420944ca845",
"reference": "2c1628f08a9cdeca4d3c682e13f24420944ca845",
"shasum": ""
},
"require": {
@ -75,10 +75,10 @@
],
"description": "Classes and methods for conveniently handling binary data",
"support": {
"source": "https://github.com/pmmp/BinaryUtils/tree/master",
"source": "https://github.com/pmmp/BinaryUtils/tree/0.1.2",
"issues": "https://github.com/pmmp/BinaryUtils/issues"
},
"time": "2018-08-26T18:11:05+00:00"
"time": "2018-12-22T12:29:30+00:00"
},
{
"name": "pocketmine/math",

View File

@ -171,7 +171,7 @@ class Attribute{
}
public function resetToDefault() : void{
$this->setValue($this->getDefaultValue());
$this->setValue($this->getDefaultValue(), true);
}
public function getValue() : float{

View File

@ -283,6 +283,11 @@ class LevelDB extends BaseLevelProvider{
/** @var SubChunk[] $subChunks */
$subChunks = [];
/** @var int[] $heightMap */
$heightMap = [];
/** @var string $biomeIds */
$biomeIds = "";
/** @var bool $lightPopulated */
$lightPopulated = true;
@ -325,10 +330,12 @@ class LevelDB extends BaseLevelProvider{
}
}
$binaryStream->setBuffer($this->db->get($index . self::TAG_DATA_2D), 0);
if(($maps2d = $this->db->get($index . self::TAG_DATA_2D)) !== false){
$binaryStream->setBuffer($maps2d, 0);
$heightMap = array_values(unpack("v*", $binaryStream->get(512)));
$biomeIds = $binaryStream->get(256);
$heightMap = array_values(unpack("v*", $binaryStream->get(512)));
$biomeIds = $binaryStream->get(256);
}
break;
case 2: // < MCPE 1.0
$binaryStream->setBuffer($this->db->get($index . self::TAG_LEGACY_TERRAIN));

View File

@ -313,8 +313,8 @@ class Utils{
++$processors;
}
}
}else{
if(preg_match("/^([0-9]+)\\-([0-9]+)$/", trim(@file_get_contents("/sys/devices/system/cpu/present")), $matches) > 0){
}elseif(is_readable("/sys/devices/system/cpu/present")){
if(preg_match("/^([0-9]+)\\-([0-9]+)$/", trim(file_get_contents("/sys/devices/system/cpu/present")), $matches) > 0){
$processors = (int) ($matches[2] - $matches[1]);
}
}