mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Initial PHP 5.6 features support
This commit is contained in:
parent
f4b92bcdfc
commit
759d7e2545
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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) .
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
@ -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(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user