diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index 5b1d820a2..cca5cb1ad 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -263,8 +263,8 @@ namespace pocketmine { $errors = 0; - if(version_compare("5.5.0", PHP_VERSION) > 0){ - $logger->critical("Use PHP >= 5.5.0"); + if(version_compare("5.6.0", PHP_VERSION) > 0){ + $logger->critical("You must use PHP >= 5.6"); ++$errors; } diff --git a/src/pocketmine/level/format/anvil/ChunkRequestTask.php b/src/pocketmine/level/format/anvil/ChunkRequestTask.php index cd2661f7f..1d5c8007e 100644 --- a/src/pocketmine/level/format/anvil/ChunkRequestTask.php +++ b/src/pocketmine/level/format/anvil/ChunkRequestTask.php @@ -100,9 +100,7 @@ class ChunkRequestTask extends AsyncTask{ } } - $biomeColors = $this->biomeColors; - array_unshift($biomeColors, "N*"); - $biomeColors = call_user_func_array("pack", $biomeColors); + $biomeColors = pack("N*", ...$this->biomeColors); $ordered = zlib_encode(Binary::writeLInt($this->chunkX) . Binary::writeLInt($this->chunkZ) . $orderedIds . $orderedData . $orderedSkyLight . $orderedLight . $this->biomeIds . $biomeColors . $this->tiles, ZLIB_ENCODING_DEFLATE, $this->compressionLevel); diff --git a/src/pocketmine/level/format/mcregion/McRegion.php b/src/pocketmine/level/format/mcregion/McRegion.php index 5e6a4e19f..5cca7ba47 100644 --- a/src/pocketmine/level/format/mcregion/McRegion.php +++ b/src/pocketmine/level/format/mcregion/McRegion.php @@ -122,9 +122,7 @@ class McRegion extends BaseLevelProvider{ } } - $biomeColors = $chunk->getBiomeColorArray(); - array_unshift($biomeColors, "N*"); - $biomeColors = call_user_func_array("pack", $biomeColors); + $biomeColors = pack("N*", ...$chunk->getBiomeColorArray()); $ordered = zlib_encode( Binary::writeLInt($x) . Binary::writeLInt($z) . diff --git a/src/pocketmine/nbt/tag/IntArray.php b/src/pocketmine/nbt/tag/IntArray.php index b79b904fe..ad39c148b 100644 --- a/src/pocketmine/nbt/tag/IntArray.php +++ b/src/pocketmine/nbt/tag/IntArray.php @@ -37,8 +37,6 @@ class IntArray extends NamedTag{ public function write(NBT $nbt){ $nbt->putInt(count($this->value)); - $ints = $this->value; - array_unshift($ints, $nbt->endianness === NBT::LITTLE_ENDIAN ? "V*" : "N*"); - $nbt->put(call_user_func_array("pack", $ints)); + $nbt->put(pack($nbt->endianness === NBT::LITTLE_ENDIAN ? "V*" : "N*", ...$this->value)); } } \ No newline at end of file diff --git a/src/pocketmine/plugin/MethodEventExecutor.php b/src/pocketmine/plugin/MethodEventExecutor.php index 43137db8e..a47239572 100644 --- a/src/pocketmine/plugin/MethodEventExecutor.php +++ b/src/pocketmine/plugin/MethodEventExecutor.php @@ -33,7 +33,7 @@ class MethodEventExecutor implements EventExecutor{ } public function execute(Listener $listener, Event $event){ - call_user_func(array($listener, $this->method), $event); + $listener->{$this->getMethod()}($event); } public function getMethod(){