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/composer.json b/composer.json index a1ad3c122..a70304af5 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "ext-openssl": "*", "ext-pcre": "*", "ext-phar": "*", - "ext-pthreads": ">=3.1.7dev", + "ext-pthreads": "~3.2.0", "ext-reflection": "*", "ext-sockets": "*", "ext-spl": "*", @@ -32,7 +32,7 @@ "mdanter/ecc": "^0.5.0", "pocketmine/raklib": "dev-master", "pocketmine/spl": "dev-master", - "pocketmine/binaryutils": "^0.1.7", + "pocketmine/binaryutils": "^0.1.9", "pocketmine/nbt": "dev-master", "pocketmine/math": "dev-master", "pocketmine/snooze": "^0.1.0", diff --git a/composer.lock b/composer.lock index 606cd6003..c4713cfb7 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": "7d9bec9f6226ca3ec19b06f6ed406718", + "content-hash": "3f4e9e3e4dfdd48390caf564839e8b46", "packages": [ { "name": "adhocore/json-comment", @@ -277,7 +277,7 @@ { "name": "Berry Langerak", "email": "berry@berryllium.nl", - "role": "developer" + "role": "Developer" }, { "name": "Rick van der Staaij", @@ -295,16 +295,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": { @@ -322,10 +322,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", @@ -372,19 +372,19 @@ "source": { "type": "git", "url": "https://github.com/pmmp/NBT.git", - "reference": "ddbc9909228c6fcedc13809a650ced2a0c432cf0" + "reference": "0976fcea814978c4ca7e53f5c19e459ae8e341e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/NBT/zipball/ddbc9909228c6fcedc13809a650ced2a0c432cf0", - "reference": "ddbc9909228c6fcedc13809a650ced2a0c432cf0", + "url": "https://api.github.com/repos/pmmp/NBT/zipball/0976fcea814978c4ca7e53f5c19e459ae8e341e5", + "reference": "0976fcea814978c4ca7e53f5c19e459ae8e341e5", "shasum": "" }, "require": { "ext-zlib": "*", "php": ">=7.2.0", "php-64bit": "*", - "pocketmine/binaryutils": "^0.1.7" + "pocketmine/binaryutils": "^0.1.9" }, "type": "library", "autoload": { @@ -405,7 +405,7 @@ "source": "https://github.com/pmmp/NBT/tree/master", "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", @@ -413,22 +413,22 @@ "source": { "type": "git", "url": "https://github.com/pmmp/RakLib.git", - "reference": "b4799d6ecc0914b6d47ead8c70b50e53b043d828" + "reference": "df98f7e1a67629ee743939318810d3d2bafc5ba3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/RakLib/zipball/b4799d6ecc0914b6d47ead8c70b50e53b043d828", - "reference": "b4799d6ecc0914b6d47ead8c70b50e53b043d828", + "url": "https://api.github.com/repos/pmmp/RakLib/zipball/df98f7e1a67629ee743939318810d3d2bafc5ba3", + "reference": "df98f7e1a67629ee743939318810d3d2bafc5ba3", "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": "dev-master" }, @@ -446,7 +446,7 @@ "source": "https://github.com/pmmp/RakLib/tree/master", "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", @@ -488,12 +488,12 @@ "source": { "type": "git", "url": "https://github.com/pmmp/SPL.git", - "reference": "7b80cbebd90a320b109154a7ff594688c1e0efcf" + "reference": "49a4b0187f2aa9daa1a9457aefa1f4cbcc5ead92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/SPL/zipball/7b80cbebd90a320b109154a7ff594688c1e0efcf", - "reference": "7b80cbebd90a320b109154a7ff594688c1e0efcf", + "url": "https://api.github.com/repos/pmmp/SPL/zipball/49a4b0187f2aa9daa1a9457aefa1f4cbcc5ead92", + "reference": "49a4b0187f2aa9daa1a9457aefa1f4cbcc5ead92", "shasum": "" }, "type": "library", @@ -509,14 +509,13 @@ "support": { "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": [], "aliases": [], "minimum-stability": "stable", "stability-flags": { - "ext-pthreads": 20, "pocketmine/raklib": 20, "pocketmine/spl": 20, "pocketmine/nbt": 20, @@ -543,7 +542,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 e138e7bf6..ebdf6d941 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -108,8 +108,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."; } } 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/crafting/ShapedRecipe.php b/src/pocketmine/crafting/ShapedRecipe.php index a4802f11d..278f725f8 100644 --- a/src/pocketmine/crafting/ShapedRecipe.php +++ b/src/pocketmine/crafting/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/item/LiquidBucket.php b/src/pocketmine/item/LiquidBucket.php index 8c466f157..0186c45b6 100644 --- a/src/pocketmine/item/LiquidBucket.php +++ b/src/pocketmine/item/LiquidBucket.php @@ -64,7 +64,7 @@ class LiquidBucket extends Item{ $ev->call(); if(!$ev->isCancelled()){ $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()){ $player->getInventory()->setItemInHand($ev->getItem()); diff --git a/src/pocketmine/lang/Language.php b/src/pocketmine/lang/Language.php index 270b7183a..aa01b21b1 100644 --- a/src/pocketmine/lang/Language.php +++ b/src/pocketmine/lang/Language.php @@ -186,7 +186,7 @@ class Language{ $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/network/mcpe/protocol/UnknownPacket.php b/src/pocketmine/network/mcpe/protocol/UnknownPacket.php index 129a29f84..490471dfe 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() : int{ if(strlen($this->payload ?? "") > 0){ - return ord($this->payload{0}); + return ord($this->payload[0]); } return self::NETWORK_ID; } diff --git a/src/pocketmine/permission/BanList.php b/src/pocketmine/permission/BanList.php index 40837ef05..f3e4ee63b 100644 --- a/src/pocketmine/permission/BanList.php +++ b/src/pocketmine/permission/BanList.php @@ -151,7 +151,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 !== null){ diff --git a/src/pocketmine/utils/Utils.php b/src/pocketmine/utils/Utils.php index 14a94dd30..c9eef9d8c 100644 --- a/src/pocketmine/utils/Utils.php +++ b/src/pocketmine/utils/Utils.php @@ -351,7 +351,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; } diff --git a/src/pocketmine/world/format/Chunk.php b/src/pocketmine/world/format/Chunk.php index 4973e9866..4d3df4e0a 100644 --- a/src/pocketmine/world/format/Chunk.php +++ b/src/pocketmine/world/format/Chunk.php @@ -385,7 +385,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]); } /** @@ -397,7 +397,7 @@ class Chunk{ */ public function setBiomeId(int $x, int $z, int $biomeId) : void{ $this->hasChanged = true; - $this->biomeIds{($z << 4) | $x} = chr($biomeId & 0xff); + $this->biomeIds[($z << 4) | $x] = chr($biomeId & 0xff); } /** diff --git a/src/pocketmine/world/format/LightArray.php b/src/pocketmine/world/format/LightArray.php index dd3f1d7a0..1b10eb489 100644 --- a/src/pocketmine/world/format/LightArray.php +++ b/src/pocketmine/world/format/LightArray.php @@ -65,15 +65,15 @@ final class LightArray{ } 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{ $i = ($x << 7) | ($z << 3) | ($y >> 1); $shift = ($y & 1) << 2; - $byte = ord($this->data{$i}); - $this->data{$i} = chr(($byte & ~(0xf << $shift)) | (($level & 0xf) << $shift)); + $byte = ord($this->data[$i]); + $this->data[$i] = chr(($byte & ~(0xf << $shift)) | (($level & 0xf) << $shift)); } public function collectGarbage() : void{ diff --git a/src/pocketmine/world/format/io/ChunkUtils.php b/src/pocketmine/world/format/io/ChunkUtils.php index 27cd2b75e..b97dc2e73 100644 --- a/src/pocketmine/world/format/io/ChunkUtils.php +++ b/src/pocketmine/world/format/io/ChunkUtils.php @@ -38,7 +38,7 @@ class 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; }