From b788982d6000aff12182d4e3d726153581c5420c Mon Sep 17 00:00:00 2001 From: "Eren A. Akyol" Date: Fri, 19 Jul 2019 22:07:53 +0300 Subject: [PATCH 1/6] Item: fixed setCustomName() not removing display NBT tag with empty name (#3049) --- src/pocketmine/item/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index 5b4ae890a..6187487dc 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -467,7 +467,7 @@ class Item implements ItemIds, \JsonSerializable{ */ public function setCustomName(string $name) : Item{ if($name === ""){ - $this->clearCustomName(); + return $this->clearCustomName(); } /** @var CompoundTag $display */ From 622f93df455f6f01f62409d2d3ef3e5509c2cc8e Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 22 Jul 2019 16:39:33 +0100 Subject: [PATCH 2/6] remove usages of deprecated {} string access, closes #3035 --- .../command/FormattedCommandAlias.php | 8 ++--- .../command/defaults/VanillaCommand.php | 2 +- src/pocketmine/inventory/ShapedRecipe.php | 4 +-- src/pocketmine/lang/BaseLang.php | 2 +- src/pocketmine/level/format/Chunk.php | 4 +-- src/pocketmine/level/format/SubChunk.php | 34 +++++++++---------- src/pocketmine/level/format/io/ChunkUtils.php | 14 ++++---- .../level/generator/populator/GroundCover.php | 6 ++-- .../network/mcpe/VerifyLoginTask.php | 4 +-- .../network/mcpe/protocol/UnknownPacket.php | 2 +- src/pocketmine/network/query/QueryHandler.php | 2 +- src/pocketmine/permission/BanList.php | 2 +- src/pocketmine/utils/Utils.php | 2 +- 13 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/pocketmine/command/FormattedCommandAlias.php b/src/pocketmine/command/FormattedCommandAlias.php index 2c6a335d2..87655da02 100644 --- a/src/pocketmine/command/FormattedCommandAlias.php +++ b/src/pocketmine/command/FormattedCommandAlias.php @@ -74,14 +74,14 @@ class FormattedCommandAlias extends Command{ $index = strpos($formatString, '$'); while($index !== false){ $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); $index = strpos($formatString, '$', $index); continue; } $required = false; - if($formatString{$index + 1} == '$'){ + if($formatString[$index + 1] == '$'){ $required = true; ++$index; @@ -91,7 +91,7 @@ class FormattedCommandAlias extends Command{ $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; } @@ -109,7 +109,7 @@ class FormattedCommandAlias extends Command{ $rest = false; - if($index < strlen($formatString) and $formatString{$index} === "-"){ + if($index < strlen($formatString) and $formatString[$index] === "-"){ $rest = true; ++$index; } diff --git a/src/pocketmine/command/defaults/VanillaCommand.php b/src/pocketmine/command/defaults/VanillaCommand.php index 8d26e5c8d..50c5313a1 100644 --- a/src/pocketmine/command/defaults/VanillaCommand.php +++ b/src/pocketmine/command/defaults/VanillaCommand.php @@ -65,7 +65,7 @@ abstract class VanillaCommand extends Command{ * @return 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)); return $original + $value; diff --git a/src/pocketmine/inventory/ShapedRecipe.php b/src/pocketmine/inventory/ShapedRecipe.php index 04103cbfb..fb13d96f6 100644 --- a/src/pocketmine/inventory/ShapedRecipe.php +++ b/src/pocketmine/inventory/ShapedRecipe.php @@ -79,8 +79,8 @@ class ShapedRecipe implements CraftingRecipe{ } for($x = 0; $x < $this->width; ++$x){ - if($row{$x} !== ' ' and !isset($ingredients[$row{$x}])){ - throw new \InvalidArgumentException("No item specified for symbol '" . $row{$x} . "'"); + if($row[$x] !== ' ' and !isset($ingredients[$row[$x]])){ + throw new \InvalidArgumentException("No item specified for symbol '" . $row[$x] . "'"); } } } diff --git a/src/pocketmine/lang/BaseLang.php b/src/pocketmine/lang/BaseLang.php index b4222bab8..aece04221 100644 --- a/src/pocketmine/lang/BaseLang.php +++ b/src/pocketmine/lang/BaseLang.php @@ -190,7 +190,7 @@ class BaseLang{ $len = strlen($text); for($i = 0; $i < $len; ++$i){ - $c = $text{$i}; + $c = $text[$i]; if($replaceString !== null){ $ord = ord($c); if( diff --git a/src/pocketmine/level/format/Chunk.php b/src/pocketmine/level/format/Chunk.php index deadc83df..8bbdefe19 100644 --- a/src/pocketmine/level/format/Chunk.php +++ b/src/pocketmine/level/format/Chunk.php @@ -460,7 +460,7 @@ class Chunk{ * @return int 0-255 */ public function getBiomeId(int $x, int $z) : int{ - return ord($this->biomeIds{($z << 4) | $x}); + return ord($this->biomeIds[($z << 4) | $x]); } /** @@ -472,7 +472,7 @@ class Chunk{ */ public function setBiomeId(int $x, int $z, int $biomeId){ $this->hasChanged = true; - $this->biomeIds{($z << 4) | $x} = chr($biomeId & 0xff); + $this->biomeIds[($z << 4) | $x] = chr($biomeId & 0xff); } /** diff --git a/src/pocketmine/level/format/SubChunk.php b/src/pocketmine/level/format/SubChunk.php index 5e067440f..20207c563 100644 --- a/src/pocketmine/level/format/SubChunk.php +++ b/src/pocketmine/level/format/SubChunk.php @@ -71,31 +71,31 @@ class SubChunk implements SubChunkInterface{ } public function getBlockId(int $x, int $y, int $z) : int{ - return ord($this->ids{($x << 8) | ($z << 4) | $y}); + return ord($this->ids[($x << 8) | ($z << 4) | $y]); } public function setBlockId(int $x, int $y, int $z, int $id) : bool{ - $this->ids{($x << 8) | ($z << 4) | $y} = chr($id); + $this->ids[($x << 8) | ($z << 4) | $y] = chr($id); return true; } public function getBlockData(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 setBlockData(int $x, int $y, int $z, int $data) : bool{ $i = ($x << 7) | ($z << 3) | ($y >> 1); $shift = ($y & 1) << 2; - $byte = ord($this->data{$i}); - $this->data{$i} = chr(($byte & ~(0xf << $shift)) | (($data & 0xf) << $shift)); + $byte = ord($this->data[$i]); + $this->data[$i] = chr(($byte & ~(0xf << $shift)) | (($data & 0xf) << $shift)); return true; } public function getFullBlock(int $x, int $y, int $z) : int{ $i = ($x << 8) | ($z << 4) | $y; - return (ord($this->ids{$i}) << 4) | ((ord($this->data{$i >> 1}) >> (($y & 1) << 2)) & 0xf); + return (ord($this->ids[$i]) << 4) | ((ord($this->data[$i >> 1]) >> (($y & 1) << 2)) & 0xf); } public function setBlock(int $x, int $y, int $z, ?int $id = null, ?int $data = null) : bool{ @@ -103,8 +103,8 @@ class SubChunk implements SubChunkInterface{ $changed = false; if($id !== null){ $block = chr($id); - if($this->ids{$i} !== $block){ - $this->ids{$i} = $block; + if($this->ids[$i] !== $block){ + $this->ids[$i] = $block; $changed = true; } } @@ -113,10 +113,10 @@ class SubChunk implements SubChunkInterface{ $i >>= 1; $shift = ($y & 1) << 2; - $oldPair = ord($this->data{$i}); + $oldPair = ord($this->data[$i]); $newPair = ($oldPair & ~(0xf << $shift)) | (($data & 0xf) << $shift); if($newPair !== $oldPair){ - $this->data{$i} = chr($newPair); + $this->data[$i] = chr($newPair); $changed = true; } } @@ -125,29 +125,29 @@ class SubChunk implements SubChunkInterface{ } public function getBlockLight(int $x, int $y, int $z) : int{ - return (ord($this->blockLight{($x << 7) | ($z << 3) | ($y >> 1)}) >> (($y & 1) << 2)) & 0xf; + return (ord($this->blockLight[($x << 7) | ($z << 3) | ($y >> 1)]) >> (($y & 1) << 2)) & 0xf; } public function setBlockLight(int $x, int $y, int $z, int $level) : bool{ $i = ($x << 7) | ($z << 3) | ($y >> 1); $shift = ($y & 1) << 2; - $byte = ord($this->blockLight{$i}); - $this->blockLight{$i} = chr(($byte & ~(0xf << $shift)) | (($level & 0xf) << $shift)); + $byte = ord($this->blockLight[$i]); + $this->blockLight[$i] = chr(($byte & ~(0xf << $shift)) | (($level & 0xf) << $shift)); return true; } public function getBlockSkyLight(int $x, int $y, int $z) : int{ - return (ord($this->skyLight{($x << 7) | ($z << 3) | ($y >> 1)}) >> (($y & 1) << 2)) & 0xf; + return (ord($this->skyLight[($x << 7) | ($z << 3) | ($y >> 1)]) >> (($y & 1) << 2)) & 0xf; } public function setBlockSkyLight(int $x, int $y, int $z, int $level) : bool{ $i = ($x << 7) | ($z << 3) | ($y >> 1); $shift = ($y & 1) << 2; - $byte = ord($this->skyLight{$i}); - $this->skyLight{$i} = chr(($byte & ~(0xf << $shift)) | (($level & 0xf) << $shift)); + $byte = ord($this->skyLight[$i]); + $this->skyLight[$i] = chr(($byte & ~(0xf << $shift)) | (($level & 0xf) << $shift)); return true; } @@ -156,7 +156,7 @@ class SubChunk implements SubChunkInterface{ $low = ($x << 8) | ($z << 4); $i = $low | 0x0f; for(; $i >= $low; --$i){ - if($this->ids{$i} !== "\x00"){ + if($this->ids[$i] !== "\x00"){ return $i & 0x0f; } } diff --git a/src/pocketmine/level/format/io/ChunkUtils.php b/src/pocketmine/level/format/io/ChunkUtils.php index fcb980076..d14f11a51 100644 --- a/src/pocketmine/level/format/io/ChunkUtils.php +++ b/src/pocketmine/level/format/io/ChunkUtils.php @@ -47,7 +47,7 @@ if(!extension_loaded('pocketmine_chunkutils')){ for($z = $x; $z < $zM; $z += 16){ $yM = $z + 4096; for($y = $z; $y < $yM; $y += 256){ - $result{$i} = $array{$y}; + $result[$i] = $array[$y]; ++$i; } } @@ -76,13 +76,13 @@ if(!extension_loaded('pocketmine_chunkutils')){ for($y = 0; $y < 8; ++$y){ $j = (($y << 8) | $zx); $j80 = ($j | 0x80); - if($array{$j} === $commonValue and $array{$j80} === $commonValue){ + if($array[$j] === $commonValue and $array[$j80] === $commonValue){ //values are already filled }else{ - $i1 = ord($array{$j}); - $i2 = ord($array{$j80}); - $result{$i} = chr(($i2 << 4) | ($i1 & 0x0f)); - $result{$i | 0x80} = chr(($i1 >> 4) | ($i2 & 0xf0)); + $i1 = ord($array[$j]); + $i2 = ord($array[$j80]); + $result[$i] = chr(($i2 << 4) | ($i1 & 0x0f)); + $result[$i | 0x80] = chr(($i1 >> 4) | ($i2 & 0xf0)); } $i++; } @@ -104,7 +104,7 @@ if(!extension_loaded('pocketmine_chunkutils')){ public static function convertBiomeColors(array $array) : string{ $result = str_repeat("\x00", 256); foreach($array as $i => $color){ - $result{$i} = chr(($color >> 24) & 0xff); + $result[$i] = chr(($color >> 24) & 0xff); } return $result; } diff --git a/src/pocketmine/level/generator/populator/GroundCover.php b/src/pocketmine/level/generator/populator/GroundCover.php index 7da08e0f1..5961a5487 100644 --- a/src/pocketmine/level/generator/populator/GroundCover.php +++ b/src/pocketmine/level/generator/populator/GroundCover.php @@ -48,7 +48,7 @@ class GroundCover extends Populator{ $column = $chunk->getBlockIdColumn($x, $z); for($y = 127; $y > 0; --$y){ - if($column{$y} !== "\x00" and !BlockFactory::get(ord($column{$y}))->isTransparent()){ + if($column[$y] !== "\x00" and !BlockFactory::get(ord($column[$y]))->isTransparent()){ break; } } @@ -56,10 +56,10 @@ class GroundCover extends Populator{ $endY = $startY - count($cover); for($y = $startY; $y > $endY and $y >= 0; --$y){ $b = $cover[$startY - $y]; - if($column{$y} === "\x00" and $b->isSolid()){ + if($column[$y] === "\x00" and $b->isSolid()){ break; } - if($b->canBeFlowedInto() and BlockFactory::get(ord($column{$y})) instanceof Liquid){ + if($b->canBeFlowedInto() and BlockFactory::get(ord($column[$y])) instanceof Liquid){ continue; } if($b->getDamage() === 0){ diff --git a/src/pocketmine/network/mcpe/VerifyLoginTask.php b/src/pocketmine/network/mcpe/VerifyLoginTask.php index f4cdaf5ea..b56f8efe8 100644 --- a/src/pocketmine/network/mcpe/VerifyLoginTask.php +++ b/src/pocketmine/network/mcpe/VerifyLoginTask.php @@ -120,12 +120,12 @@ class VerifyLoginTask extends AsyncTask{ [$rString, $sString] = str_split($plainSignature, 48); $rString = ltrim($rString, "\x00"); - if(ord($rString{0}) >= 128){ //Would be considered signed, pad it with an extra zero + if(ord($rString[0]) >= 128){ //Would be considered signed, pad it with an extra zero $rString = "\x00" . $rString; } $sString = ltrim($sString, "\x00"); - if(ord($sString{0}) >= 128){ //Would be considered signed, pad it with an extra zero + if(ord($sString[0]) >= 128){ //Would be considered signed, pad it with an extra zero $sString = "\x00" . $sString; } diff --git a/src/pocketmine/network/mcpe/protocol/UnknownPacket.php b/src/pocketmine/network/mcpe/protocol/UnknownPacket.php index 1b5b756de..e110c4043 100644 --- a/src/pocketmine/network/mcpe/protocol/UnknownPacket.php +++ b/src/pocketmine/network/mcpe/protocol/UnknownPacket.php @@ -37,7 +37,7 @@ class UnknownPacket extends DataPacket{ public function pid(){ if(strlen($this->payload ?? "") > 0){ - return ord($this->payload{0}); + return ord($this->payload[0]); } return self::NETWORK_ID; } diff --git a/src/pocketmine/network/query/QueryHandler.php b/src/pocketmine/network/query/QueryHandler.php index 73125866b..2c605b027 100644 --- a/src/pocketmine/network/query/QueryHandler.php +++ b/src/pocketmine/network/query/QueryHandler.php @@ -92,7 +92,7 @@ class QueryHandler{ public function handle(AdvancedSourceInterface $interface, string $address, int $port, string $packet){ $offset = 2; - $packetType = ord($packet{$offset++}); + $packetType = ord($packet[$offset++]); $sessionID = Binary::readInt(substr($packet, $offset, 4)); $offset += 4; $payload = substr($packet, $offset); diff --git a/src/pocketmine/permission/BanList.php b/src/pocketmine/permission/BanList.php index d6bc206cb..de2ca150d 100644 --- a/src/pocketmine/permission/BanList.php +++ b/src/pocketmine/permission/BanList.php @@ -154,7 +154,7 @@ class BanList{ $fp = @fopen($this->file, "r"); if(is_resource($fp)){ while(($line = fgets($fp)) !== false){ - if($line{0} !== "#"){ + if($line[0] !== "#"){ try{ $entry = BanEntry::fromString($line); if($entry instanceof BanEntry){ diff --git a/src/pocketmine/utils/Utils.php b/src/pocketmine/utils/Utils.php index ef2fb0d34..5f388c592 100644 --- a/src/pocketmine/utils/Utils.php +++ b/src/pocketmine/utils/Utils.php @@ -496,7 +496,7 @@ class Utils{ public static function javaStringHash(string $string) : int{ $hash = 0; for($i = 0, $len = strlen($string); $i < $len; $i++){ - $ord = ord($string{$i}); + $ord = ord($string[$i]); if($ord & 0x80){ $ord -= 0x100; } From 5a08a104480bcf80c85f178136293b0f944e0c1d Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 22 Jul 2019 17:15:18 +0100 Subject: [PATCH 3/6] update dependency requirements --- composer.json | 8 +++--- composer.lock | 49 +++++++++++++++++------------------ src/pocketmine/PocketMine.php | 4 +-- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/composer.json b/composer.json index aa33b9a97..cce152633 100644 --- a/composer.json +++ b/composer.json @@ -17,17 +17,17 @@ "ext-openssl": "*", "ext-pcre": "*", "ext-phar": "*", - "ext-pthreads": ">=3.1.7dev", + "ext-pthreads": "~3.2.0", "ext-reflection": "*", "ext-sockets": "*", "ext-spl": "*", "ext-yaml": ">=2.0.0", "ext-zip": "*", "ext-zlib": ">=1.2.11", - "pocketmine/raklib": "^0.12.0", + "pocketmine/raklib": "^0.12.5", "pocketmine/spl": "^0.3.0", - "pocketmine/binaryutils": "^0.1.0", - "pocketmine/nbt": "^0.2.6", + "pocketmine/binaryutils": "^0.1.9", + "pocketmine/nbt": "^0.2.10", "pocketmine/math": "^0.2.0", "pocketmine/snooze": "^0.1.0", "daverandom/callback-validator": "dev-master", diff --git a/composer.lock b/composer.lock index 166990518..1aa668766 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2f5313e4ebd7b62c785cf683b27464b4", + "content-hash": "377d9e0ab5f1a9a4ef9b664706d26f5b", "packages": [ { "name": "adhocore/json-comment", @@ -92,16 +92,16 @@ }, { "name": "pocketmine/binaryutils", - "version": "0.1.8", + "version": "0.1.9", "source": { "type": "git", "url": "https://github.com/pmmp/BinaryUtils.git", - "reference": "33f511715d22418c03368b49b45a6c25d6b33806" + "reference": "8b3b1160679398387cb896fd5d06018413437dfa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/33f511715d22418c03368b49b45a6c25d6b33806", - "reference": "33f511715d22418c03368b49b45a6c25d6b33806", + "url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/8b3b1160679398387cb896fd5d06018413437dfa", + "reference": "8b3b1160679398387cb896fd5d06018413437dfa", "shasum": "" }, "require": { @@ -119,10 +119,10 @@ ], "description": "Classes and methods for conveniently handling binary data", "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" }, - "time": "2019-01-16T17:31:44+00:00" + "time": "2019-07-22T13:15:53+00:00" }, { "name": "pocketmine/math", @@ -160,23 +160,23 @@ }, { "name": "pocketmine/nbt", - "version": "0.2.7", + "version": "0.2.10", "source": { "type": "git", "url": "https://github.com/pmmp/NBT.git", - "reference": "2f176c9f2fd9b31db8bc2ada2f38990157ec8f1a" + "reference": "2db27aebe7dc89772aaa8df53361eef801f60063" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/NBT/zipball/2f176c9f2fd9b31db8bc2ada2f38990157ec8f1a", - "reference": "2f176c9f2fd9b31db8bc2ada2f38990157ec8f1a", + "url": "https://api.github.com/repos/pmmp/NBT/zipball/2db27aebe7dc89772aaa8df53361eef801f60063", + "reference": "2db27aebe7dc89772aaa8df53361eef801f60063", "shasum": "" }, "require": { "ext-zlib": "*", "php": ">=7.2.0", "php-64bit": "*", - "pocketmine/binaryutils": "^0.1.0" + "pocketmine/binaryutils": "^0.1.9" }, "type": "library", "autoload": { @@ -194,33 +194,33 @@ ], "description": "PHP library for working with Named Binary Tags", "support": { - "source": "https://github.com/pmmp/NBT/tree/0.2.7", + "source": "https://github.com/pmmp/NBT/tree/0.2.10", "issues": "https://github.com/pmmp/NBT/issues" }, - "time": "2019-03-29T19:39:42+00:00" + "time": "2019-07-22T15:22:23+00:00" }, { "name": "pocketmine/raklib", - "version": "0.12.4", + "version": "0.12.5", "source": { "type": "git", "url": "https://github.com/pmmp/RakLib.git", - "reference": "fc1ccc8e61b9033e5372436b2e28a7a95388373f" + "reference": "874db2d3c24117db2221c1e4550380478aeea852" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/RakLib/zipball/fc1ccc8e61b9033e5372436b2e28a7a95388373f", - "reference": "fc1ccc8e61b9033e5372436b2e28a7a95388373f", + "url": "https://api.github.com/repos/pmmp/RakLib/zipball/874db2d3c24117db2221c1e4550380478aeea852", + "reference": "874db2d3c24117db2221c1e4550380478aeea852", "shasum": "" }, "require": { "ext-bcmath": "*", - "ext-pthreads": ">=3.1.7dev", + "ext-pthreads": "~3.2.0", "ext-sockets": "*", "php": ">=7.2.0", "php-64bit": "*", "php-ipv6": "*", - "pocketmine/binaryutils": "^0.1.0", + "pocketmine/binaryutils": "^0.1.9", "pocketmine/snooze": "^0.1.0", "pocketmine/spl": "^0.3.0" }, @@ -235,10 +235,10 @@ ], "description": "A RakNet server implementation written in PHP", "support": { - "source": "https://github.com/pmmp/RakLib/tree/0.12.4", + "source": "https://github.com/pmmp/RakLib/tree/0.12", "issues": "https://github.com/pmmp/RakLib/issues" }, - "time": "2019-05-02T14:53:51+00:00" + "time": "2019-07-22T14:38:20+00:00" }, { "name": "pocketmine/snooze", @@ -302,7 +302,7 @@ ], "description": "Standard library files required by PocketMine-MP and related projects", "support": { - "source": "https://github.com/pmmp/SPL/tree/0.3.2" + "source": "https://github.com/pmmp/SPL/tree/master" }, "time": "2018-08-12T15:17:39+00:00" } @@ -311,7 +311,6 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "ext-pthreads": 20, "daverandom/callback-validator": 20 }, "prefer-stable": false, @@ -329,7 +328,7 @@ "ext-openssl": "*", "ext-pcre": "*", "ext-phar": "*", - "ext-pthreads": ">=3.1.7dev", + "ext-pthreads": "~3.2.0", "ext-reflection": "*", "ext-sockets": "*", "ext-spl": "*", diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index 732026434..0e2b306de 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -102,8 +102,8 @@ namespace pocketmine { if(substr_count($pthreads_version, ".") < 2){ $pthreads_version = "0.$pthreads_version"; } - if(version_compare($pthreads_version, "3.1.7dev") < 0){ - $messages[] = "pthreads >= 3.1.7dev is required, while you have $pthreads_version."; + if(version_compare($pthreads_version, "3.2.0") < 0){ + $messages[] = "pthreads >= 3.2.0 is required, while you have $pthreads_version."; } } From e93d034a4e7242a11845a8eac592c257f88d15fe Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 22 Jul 2019 17:17:15 +0100 Subject: [PATCH 4/6] fix bucket empty sound position, close #3051 --- src/pocketmine/item/Bucket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/item/Bucket.php b/src/pocketmine/item/Bucket.php index 6660b7950..3c7834350 100644 --- a/src/pocketmine/item/Bucket.php +++ b/src/pocketmine/item/Bucket.php @@ -85,7 +85,7 @@ class Bucket extends Item implements Consumable{ $ev->call(); if(!$ev->isCancelled()){ $player->getLevel()->setBlock($blockReplace, $resultBlock->getFlowingForm(), true, true); - $player->getLevel()->broadcastLevelSoundEvent($blockClicked->add(0.5, 0.5, 0.5), $resultBlock->getBucketEmptySound()); + $player->getLevel()->broadcastLevelSoundEvent($blockReplace->add(0.5, 0.5, 0.5), $resultBlock->getBucketEmptySound()); if($player->isSurvival()){ $player->getInventory()->setItemInHand($ev->getItem()); From 7a747d6f9347273467b5ecc1963998c949ff6a7a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 22 Jul 2019 17:28:33 +0100 Subject: [PATCH 5/6] Release 3.9.2 --- changelogs/3.9.md | 8 ++++++++ src/pocketmine/VersionInfo.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/changelogs/3.9.md b/changelogs/3.9.md index 1f8f68545..2f35ab897 100644 --- a/changelogs/3.9.md +++ b/changelogs/3.9.md @@ -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. - Silenced a debug message which appeared every time a player right-clicked a block. - 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. diff --git a/src/pocketmine/VersionInfo.php b/src/pocketmine/VersionInfo.php index 97ccfb941..1f3d3e076 100644 --- a/src/pocketmine/VersionInfo.php +++ b/src/pocketmine/VersionInfo.php @@ -23,5 +23,5 @@ namespace pocketmine; const NAME = "PocketMine-MP"; const BASE_VERSION = "3.9.2"; -const IS_DEVELOPMENT_BUILD = true; +const IS_DEVELOPMENT_BUILD = false; const BUILD_NUMBER = 0; From 04c0cd142d33949294c1c7a46f803c7ee3b4aaf3 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 22 Jul 2019 17:28:33 +0100 Subject: [PATCH 6/6] 3.9.3 is next --- src/pocketmine/VersionInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/VersionInfo.php b/src/pocketmine/VersionInfo.php index 1f3d3e076..d7ae20990 100644 --- a/src/pocketmine/VersionInfo.php +++ b/src/pocketmine/VersionInfo.php @@ -22,6 +22,6 @@ namespace pocketmine; const NAME = "PocketMine-MP"; -const BASE_VERSION = "3.9.2"; -const IS_DEVELOPMENT_BUILD = false; +const BASE_VERSION = "3.9.3"; +const IS_DEVELOPMENT_BUILD = true; const BUILD_NUMBER = 0;