Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor 2019-07-22 17:39:44 +01:00
commit 72c0af2e82
15 changed files with 54 additions and 47 deletions

View File

@ -44,3 +44,11 @@ Plugin developers should **only** update their required API to this version if y
- Fixed `Entity->setFireTicks()` with a value of `0` setting the on-fire flag. - Fixed `Entity->setFireTicks()` with a value of `0` setting the on-fire flag.
- Silenced a debug message which appeared every time a player right-clicked a block. - Silenced a debug message which appeared every time a player right-clicked a block.
- Updated constants for `LevelSoundEventPacket`. - Updated constants for `LevelSoundEventPacket`.
# 3.9.2
- Logger warnings for illegal player movements have been lowered to debug.
- TNT explosions now start from the center instead of the base. This fixes unexpected results when TNT is lit on top of obsidian.
- Fixed the `loadbefore` directive in `plugin.yml` sometimes being ignored.
- Fixed `Item->setCustomName()` with an empty string leaving behind an empty tag.
- Fixed incorrect positioning of bucket empty sound.
- Fixed some incorrect tag parsing in `/give` involving quoted numbers.

View File

@ -22,7 +22,7 @@
"ext-openssl": "*", "ext-openssl": "*",
"ext-pcre": "*", "ext-pcre": "*",
"ext-phar": "*", "ext-phar": "*",
"ext-pthreads": ">=3.1.7dev", "ext-pthreads": "~3.2.0",
"ext-reflection": "*", "ext-reflection": "*",
"ext-sockets": "*", "ext-sockets": "*",
"ext-spl": "*", "ext-spl": "*",
@ -32,7 +32,7 @@
"mdanter/ecc": "^0.5.0", "mdanter/ecc": "^0.5.0",
"pocketmine/raklib": "dev-master", "pocketmine/raklib": "dev-master",
"pocketmine/spl": "dev-master", "pocketmine/spl": "dev-master",
"pocketmine/binaryutils": "^0.1.7", "pocketmine/binaryutils": "^0.1.9",
"pocketmine/nbt": "dev-master", "pocketmine/nbt": "dev-master",
"pocketmine/math": "dev-master", "pocketmine/math": "dev-master",
"pocketmine/snooze": "^0.1.0", "pocketmine/snooze": "^0.1.0",

49
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "7d9bec9f6226ca3ec19b06f6ed406718", "content-hash": "3f4e9e3e4dfdd48390caf564839e8b46",
"packages": [ "packages": [
{ {
"name": "adhocore/json-comment", "name": "adhocore/json-comment",
@ -277,7 +277,7 @@
{ {
"name": "Berry Langerak", "name": "Berry Langerak",
"email": "berry@berryllium.nl", "email": "berry@berryllium.nl",
"role": "developer" "role": "Developer"
}, },
{ {
"name": "Rick van der Staaij", "name": "Rick van der Staaij",
@ -295,16 +295,16 @@
}, },
{ {
"name": "pocketmine/binaryutils", "name": "pocketmine/binaryutils",
"version": "0.1.8", "version": "0.1.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pmmp/BinaryUtils.git", "url": "https://github.com/pmmp/BinaryUtils.git",
"reference": "33f511715d22418c03368b49b45a6c25d6b33806" "reference": "8b3b1160679398387cb896fd5d06018413437dfa"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/33f511715d22418c03368b49b45a6c25d6b33806", "url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/8b3b1160679398387cb896fd5d06018413437dfa",
"reference": "33f511715d22418c03368b49b45a6c25d6b33806", "reference": "8b3b1160679398387cb896fd5d06018413437dfa",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -322,10 +322,10 @@
], ],
"description": "Classes and methods for conveniently handling binary data", "description": "Classes and methods for conveniently handling binary data",
"support": { "support": {
"source": "https://github.com/pmmp/BinaryUtils/tree/0.1.8", "source": "https://github.com/pmmp/BinaryUtils/tree/0.1.9",
"issues": "https://github.com/pmmp/BinaryUtils/issues" "issues": "https://github.com/pmmp/BinaryUtils/issues"
}, },
"time": "2019-01-16T17:31:44+00:00" "time": "2019-07-22T13:15:53+00:00"
}, },
{ {
"name": "pocketmine/math", "name": "pocketmine/math",
@ -372,19 +372,19 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pmmp/NBT.git", "url": "https://github.com/pmmp/NBT.git",
"reference": "ddbc9909228c6fcedc13809a650ced2a0c432cf0" "reference": "0976fcea814978c4ca7e53f5c19e459ae8e341e5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pmmp/NBT/zipball/ddbc9909228c6fcedc13809a650ced2a0c432cf0", "url": "https://api.github.com/repos/pmmp/NBT/zipball/0976fcea814978c4ca7e53f5c19e459ae8e341e5",
"reference": "ddbc9909228c6fcedc13809a650ced2a0c432cf0", "reference": "0976fcea814978c4ca7e53f5c19e459ae8e341e5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-zlib": "*", "ext-zlib": "*",
"php": ">=7.2.0", "php": ">=7.2.0",
"php-64bit": "*", "php-64bit": "*",
"pocketmine/binaryutils": "^0.1.7" "pocketmine/binaryutils": "^0.1.9"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -405,7 +405,7 @@
"source": "https://github.com/pmmp/NBT/tree/master", "source": "https://github.com/pmmp/NBT/tree/master",
"issues": "https://github.com/pmmp/NBT/issues" "issues": "https://github.com/pmmp/NBT/issues"
}, },
"time": "2019-07-16T18:51:45+00:00" "time": "2019-07-22T15:30:11+00:00"
}, },
{ {
"name": "pocketmine/raklib", "name": "pocketmine/raklib",
@ -413,22 +413,22 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pmmp/RakLib.git", "url": "https://github.com/pmmp/RakLib.git",
"reference": "b4799d6ecc0914b6d47ead8c70b50e53b043d828" "reference": "df98f7e1a67629ee743939318810d3d2bafc5ba3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pmmp/RakLib/zipball/b4799d6ecc0914b6d47ead8c70b50e53b043d828", "url": "https://api.github.com/repos/pmmp/RakLib/zipball/df98f7e1a67629ee743939318810d3d2bafc5ba3",
"reference": "b4799d6ecc0914b6d47ead8c70b50e53b043d828", "reference": "df98f7e1a67629ee743939318810d3d2bafc5ba3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-bcmath": "*", "ext-bcmath": "*",
"ext-pthreads": ">=3.1.7dev", "ext-pthreads": "~3.2.0",
"ext-sockets": "*", "ext-sockets": "*",
"php": ">=7.2.0", "php": ">=7.2.0",
"php-64bit": "*", "php-64bit": "*",
"php-ipv6": "*", "php-ipv6": "*",
"pocketmine/binaryutils": "^0.1.0", "pocketmine/binaryutils": "^0.1.9",
"pocketmine/snooze": "^0.1.0", "pocketmine/snooze": "^0.1.0",
"pocketmine/spl": "dev-master" "pocketmine/spl": "dev-master"
}, },
@ -446,7 +446,7 @@
"source": "https://github.com/pmmp/RakLib/tree/master", "source": "https://github.com/pmmp/RakLib/tree/master",
"issues": "https://github.com/pmmp/RakLib/issues" "issues": "https://github.com/pmmp/RakLib/issues"
}, },
"time": "2019-05-13T17:14:39+00:00" "time": "2019-07-22T15:27:51+00:00"
}, },
{ {
"name": "pocketmine/snooze", "name": "pocketmine/snooze",
@ -488,12 +488,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pmmp/SPL.git", "url": "https://github.com/pmmp/SPL.git",
"reference": "7b80cbebd90a320b109154a7ff594688c1e0efcf" "reference": "49a4b0187f2aa9daa1a9457aefa1f4cbcc5ead92"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pmmp/SPL/zipball/7b80cbebd90a320b109154a7ff594688c1e0efcf", "url": "https://api.github.com/repos/pmmp/SPL/zipball/49a4b0187f2aa9daa1a9457aefa1f4cbcc5ead92",
"reference": "7b80cbebd90a320b109154a7ff594688c1e0efcf", "reference": "49a4b0187f2aa9daa1a9457aefa1f4cbcc5ead92",
"shasum": "" "shasum": ""
}, },
"type": "library", "type": "library",
@ -509,14 +509,13 @@
"support": { "support": {
"source": "https://github.com/pmmp/SPL/tree/master" "source": "https://github.com/pmmp/SPL/tree/master"
}, },
"time": "2019-05-18T14:07:32+00:00" "time": "2019-07-20T14:32:24+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": { "stability-flags": {
"ext-pthreads": 20,
"pocketmine/raklib": 20, "pocketmine/raklib": 20,
"pocketmine/spl": 20, "pocketmine/spl": 20,
"pocketmine/nbt": 20, "pocketmine/nbt": 20,
@ -543,7 +542,7 @@
"ext-openssl": "*", "ext-openssl": "*",
"ext-pcre": "*", "ext-pcre": "*",
"ext-phar": "*", "ext-phar": "*",
"ext-pthreads": ">=3.1.7dev", "ext-pthreads": "~3.2.0",
"ext-reflection": "*", "ext-reflection": "*",
"ext-sockets": "*", "ext-sockets": "*",
"ext-spl": "*", "ext-spl": "*",

View File

@ -108,8 +108,8 @@ namespace pocketmine {
if(substr_count($pthreads_version, ".") < 2){ if(substr_count($pthreads_version, ".") < 2){
$pthreads_version = "0.$pthreads_version"; $pthreads_version = "0.$pthreads_version";
} }
if(version_compare($pthreads_version, "3.1.7dev") < 0){ if(version_compare($pthreads_version, "3.2.0") < 0){
$messages[] = "pthreads >= 3.1.7dev is required, while you have $pthreads_version."; $messages[] = "pthreads >= 3.2.0 is required, while you have $pthreads_version.";
} }
} }

View File

@ -74,14 +74,14 @@ class FormattedCommandAlias extends Command{
$index = strpos($formatString, '$'); $index = strpos($formatString, '$');
while($index !== false){ while($index !== false){
$start = $index; $start = $index;
if($index > 0 and $formatString{$start - 1} === "\\"){ if($index > 0 and $formatString[$start - 1] === "\\"){
$formatString = substr($formatString, 0, $start - 1) . substr($formatString, $start); $formatString = substr($formatString, 0, $start - 1) . substr($formatString, $start);
$index = strpos($formatString, '$', $index); $index = strpos($formatString, '$', $index);
continue; continue;
} }
$required = false; $required = false;
if($formatString{$index + 1} == '$'){ if($formatString[$index + 1] == '$'){
$required = true; $required = true;
++$index; ++$index;
@ -91,7 +91,7 @@ class FormattedCommandAlias extends Command{
$argStart = $index; $argStart = $index;
while($index < strlen($formatString) and self::inRange(ord($formatString{$index}) - 48, 0, 9)){ while($index < strlen($formatString) and self::inRange(ord($formatString[$index]) - 48, 0, 9)){
++$index; ++$index;
} }
@ -109,7 +109,7 @@ class FormattedCommandAlias extends Command{
$rest = false; $rest = false;
if($index < strlen($formatString) and $formatString{$index} === "-"){ if($index < strlen($formatString) and $formatString[$index] === "-"){
$rest = true; $rest = true;
++$index; ++$index;
} }

View File

@ -65,7 +65,7 @@ abstract class VanillaCommand extends Command{
* @return float * @return float
*/ */
protected function getRelativeDouble(float $original, CommandSender $sender, string $input, float $min = self::MIN_COORD, float $max = self::MAX_COORD) : float{ protected function getRelativeDouble(float $original, CommandSender $sender, string $input, float $min = self::MIN_COORD, float $max = self::MAX_COORD) : float{
if($input{0} === "~"){ if($input[0] === "~"){
$value = $this->getDouble($sender, substr($input, 1)); $value = $this->getDouble($sender, substr($input, 1));
return $original + $value; return $original + $value;

View File

@ -79,8 +79,8 @@ class ShapedRecipe implements CraftingRecipe{
} }
for($x = 0; $x < $this->width; ++$x){ for($x = 0; $x < $this->width; ++$x){
if($row{$x} !== ' ' and !isset($ingredients[$row{$x}])){ if($row[$x] !== ' ' and !isset($ingredients[$row[$x]])){
throw new \InvalidArgumentException("No item specified for symbol '" . $row{$x} . "'"); throw new \InvalidArgumentException("No item specified for symbol '" . $row[$x] . "'");
} }
} }
} }

View File

@ -64,7 +64,7 @@ class LiquidBucket extends Item{
$ev->call(); $ev->call();
if(!$ev->isCancelled()){ if(!$ev->isCancelled()){
$player->getWorld()->setBlock($blockReplace, $resultBlock->getFlowingForm()); $player->getWorld()->setBlock($blockReplace, $resultBlock->getFlowingForm());
$player->getWorld()->addSound($blockClicked->add(0.5, 0.5, 0.5), $resultBlock->getBucketEmptySound()); $player->getWorld()->addSound($blockReplace->add(0.5, 0.5, 0.5), $resultBlock->getBucketEmptySound());
if($player->hasFiniteResources()){ if($player->hasFiniteResources()){
$player->getInventory()->setItemInHand($ev->getItem()); $player->getInventory()->setItemInHand($ev->getItem());

View File

@ -186,7 +186,7 @@ class Language{
$len = strlen($text); $len = strlen($text);
for($i = 0; $i < $len; ++$i){ for($i = 0; $i < $len; ++$i){
$c = $text{$i}; $c = $text[$i];
if($replaceString !== null){ if($replaceString !== null){
$ord = ord($c); $ord = ord($c);
if( if(

View File

@ -37,7 +37,7 @@ class UnknownPacket extends DataPacket{
public function pid() : int{ public function pid() : int{
if(strlen($this->payload ?? "") > 0){ if(strlen($this->payload ?? "") > 0){
return ord($this->payload{0}); return ord($this->payload[0]);
} }
return self::NETWORK_ID; return self::NETWORK_ID;
} }

View File

@ -151,7 +151,7 @@ class BanList{
$fp = @fopen($this->file, "r"); $fp = @fopen($this->file, "r");
if(is_resource($fp)){ if(is_resource($fp)){
while(($line = fgets($fp)) !== false){ while(($line = fgets($fp)) !== false){
if($line{0} !== "#"){ if($line[0] !== "#"){
try{ try{
$entry = BanEntry::fromString($line); $entry = BanEntry::fromString($line);
if($entry !== null){ if($entry !== null){

View File

@ -351,7 +351,7 @@ class Utils{
public static function javaStringHash(string $string) : int{ public static function javaStringHash(string $string) : int{
$hash = 0; $hash = 0;
for($i = 0, $len = strlen($string); $i < $len; $i++){ for($i = 0, $len = strlen($string); $i < $len; $i++){
$ord = ord($string{$i}); $ord = ord($string[$i]);
if($ord & 0x80){ if($ord & 0x80){
$ord -= 0x100; $ord -= 0x100;
} }

View File

@ -385,7 +385,7 @@ class Chunk{
* @return int 0-255 * @return int 0-255
*/ */
public function getBiomeId(int $x, int $z) : int{ public function getBiomeId(int $x, int $z) : int{
return ord($this->biomeIds{($z << 4) | $x}); return ord($this->biomeIds[($z << 4) | $x]);
} }
/** /**
@ -397,7 +397,7 @@ class Chunk{
*/ */
public function setBiomeId(int $x, int $z, int $biomeId) : void{ public function setBiomeId(int $x, int $z, int $biomeId) : void{
$this->hasChanged = true; $this->hasChanged = true;
$this->biomeIds{($z << 4) | $x} = chr($biomeId & 0xff); $this->biomeIds[($z << 4) | $x] = chr($biomeId & 0xff);
} }
/** /**

View File

@ -65,15 +65,15 @@ final class LightArray{
} }
public function get(int $x, int $y, int $z) : int{ public function get(int $x, int $y, int $z) : int{
return (ord($this->data{($x << 7) | ($z << 3) | ($y >> 1)}) >> (($y & 1) << 2)) & 0xf; return (ord($this->data[($x << 7) | ($z << 3) | ($y >> 1)]) >> (($y & 1) << 2)) & 0xf;
} }
public function set(int $x, int $y, int $z, int $level) : void{ public function set(int $x, int $y, int $z, int $level) : void{
$i = ($x << 7) | ($z << 3) | ($y >> 1); $i = ($x << 7) | ($z << 3) | ($y >> 1);
$shift = ($y & 1) << 2; $shift = ($y & 1) << 2;
$byte = ord($this->data{$i}); $byte = ord($this->data[$i]);
$this->data{$i} = chr(($byte & ~(0xf << $shift)) | (($level & 0xf) << $shift)); $this->data[$i] = chr(($byte & ~(0xf << $shift)) | (($level & 0xf) << $shift));
} }
public function collectGarbage() : void{ public function collectGarbage() : void{

View File

@ -38,7 +38,7 @@ class ChunkUtils{
public static function convertBiomeColors(array $array) : string{ public static function convertBiomeColors(array $array) : string{
$result = str_repeat("\x00", 256); $result = str_repeat("\x00", 256);
foreach($array as $i => $color){ foreach($array as $i => $color){
$result{$i} = chr(($color >> 24) & 0xff); $result[$i] = chr(($color >> 24) & 0xff);
} }
return $result; return $result;
} }