mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-19 01:16:38 +00:00
Merge branch 'stable'
This commit is contained in:
commit
e1eb9186fe
@ -28,7 +28,6 @@ use function dirname;
|
|||||||
use function fgets;
|
use function fgets;
|
||||||
use function file_get_contents;
|
use function file_get_contents;
|
||||||
use function file_put_contents;
|
use function file_put_contents;
|
||||||
use function preg_quote;
|
|
||||||
use function preg_replace;
|
use function preg_replace;
|
||||||
use function sleep;
|
use function sleep;
|
||||||
use function sprintf;
|
use function sprintf;
|
||||||
@ -59,7 +58,7 @@ function replaceVersion(string $versionInfoPath, string $newVersion, bool $isDev
|
|||||||
);
|
);
|
||||||
$versionInfo = preg_replace(
|
$versionInfo = preg_replace(
|
||||||
'/^const IS_DEVELOPMENT_BUILD = (?:true|false);$/m',
|
'/^const IS_DEVELOPMENT_BUILD = (?:true|false);$/m',
|
||||||
'const IS_DEVELOPMENT_BUILD = ' . ($isDev ? 'true' : 'false'). ';',
|
'const IS_DEVELOPMENT_BUILD = ' . ($isDev ? 'true' : 'false') . ';',
|
||||||
$versionInfo
|
$versionInfo
|
||||||
);
|
);
|
||||||
file_put_contents($versionInfoPath, $versionInfo);
|
file_put_contents($versionInfoPath, $versionInfo);
|
||||||
|
@ -24,12 +24,28 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\build\server_phar;
|
namespace pocketmine\build\server_phar;
|
||||||
|
|
||||||
use pocketmine\utils\Git;
|
use pocketmine\utils\Git;
|
||||||
|
use function array_map;
|
||||||
|
use function count;
|
||||||
|
use function defined;
|
||||||
|
use function dirname;
|
||||||
|
use function file_exists;
|
||||||
|
use function getcwd;
|
||||||
|
use function getopt;
|
||||||
|
use function implode;
|
||||||
|
use function ini_get;
|
||||||
|
use function microtime;
|
||||||
|
use function preg_quote;
|
||||||
|
use function realpath;
|
||||||
|
use function round;
|
||||||
|
use function rtrim;
|
||||||
|
use function sprintf;
|
||||||
|
use function str_replace;
|
||||||
|
use function unlink;
|
||||||
|
|
||||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string[] $strings
|
* @param string[] $strings
|
||||||
* @param string|null $delim
|
|
||||||
*
|
*
|
||||||
* @return string[]
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
@ -38,13 +54,8 @@ function preg_quote_array(array $strings, string $delim = null) : array{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $pharPath
|
|
||||||
* @param string $basePath
|
|
||||||
* @param string[] $includedPaths
|
* @param string[] $includedPaths
|
||||||
* @param mixed[] $metadata
|
* @param mixed[] $metadata
|
||||||
* @param string $stub
|
|
||||||
* @param int $signatureAlgo
|
|
||||||
* @param int|null $compression
|
|
||||||
* @phpstan-param array<string, mixed> $metadata
|
* @phpstan-param array<string, mixed> $metadata
|
||||||
*
|
*
|
||||||
* @return \Generator|string[]
|
* @return \Generator|string[]
|
||||||
|
@ -53,3 +53,16 @@ Plugin developers should **only** update their required API to this version if y
|
|||||||
- Populate type information in lots of places where it was previously missing; this will improve the quality of static analysis for plugins.
|
- Populate type information in lots of places where it was previously missing; this will improve the quality of static analysis for plugins.
|
||||||
- `MainLogger::logException()` now logs previous exceptions recursively.
|
- `MainLogger::logException()` now logs previous exceptions recursively.
|
||||||
- `MainLogger::logException()` now always logs exceptions as `critical`.
|
- `MainLogger::logException()` now always logs exceptions as `critical`.
|
||||||
|
|
||||||
|
# 3.11.5
|
||||||
|
- PHPStan and PHPUnit are now managed as Composer dev dependencies.
|
||||||
|
- Core code is now analyzed using PHPStan level 6 (full, including iterable types checking).
|
||||||
|
- Improved type information available to PHPStan in many areas.
|
||||||
|
- Mass-removal of useless PHPDoc.
|
||||||
|
- Fixed incorrect documentation of `Internet::getURL()`, `Internet::postURL()` and `Internet::simpleCurl()`.
|
||||||
|
- Fixed crash on use of case-mismatched recursive command aliases.
|
||||||
|
- Basic build instructions are now provided in `BUILDING.md`.
|
||||||
|
- `build/server-phar.php` now uses GZIP compression on created phars, providing a 75% size reduction.
|
||||||
|
- `ClientboundMapItemDataPacket` now uses `MapDecoration` objects for decorations instead of associative arrays.
|
||||||
|
- Updated Composer dependencies to get bug fixes in `pocketmine/nbt` and other libraries.
|
||||||
|
- Packages `pocketmine/classloader` and `pocketmine/log` are now required; these provide classes previously part of `pocketmine/spl`. This change has no effect on API compatibility.
|
||||||
|
@ -96,7 +96,7 @@ class Chest extends Transparent{
|
|||||||
if($chest instanceof TileChest){
|
if($chest instanceof TileChest){
|
||||||
if(
|
if(
|
||||||
!$this->getSide(Facing::UP)->isTransparent() or
|
!$this->getSide(Facing::UP)->isTransparent() or
|
||||||
($chest->isPaired() and !$chest->getPair()->getBlock()->getSide(Facing::UP)->isTransparent()) or
|
(($pair = $chest->getPair()) !== null and !$pair->getBlock()->getSide(Facing::UP)->isTransparent()) or
|
||||||
!$chest->canOpenWith($item->getCustomName())
|
!$chest->canOpenWith($item->getCustomName())
|
||||||
){
|
){
|
||||||
return true;
|
return true;
|
||||||
|
@ -57,10 +57,7 @@ class PharPluginLoader implements PluginLoader{
|
|||||||
public function getPluginDescription(string $file) : ?PluginDescription{
|
public function getPluginDescription(string $file) : ?PluginDescription{
|
||||||
$phar = new \Phar($file);
|
$phar = new \Phar($file);
|
||||||
if(isset($phar["plugin.yml"])){
|
if(isset($phar["plugin.yml"])){
|
||||||
$pluginYml = $phar["plugin.yml"];
|
return new PluginDescription($phar["plugin.yml"]->getContent());
|
||||||
if($pluginYml instanceof \PharFileInfo){
|
|
||||||
return new PluginDescription($pluginYml->getContent());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
PHP_BINARY="php"
|
|
||||||
PM_WORKERS="auto"
|
PM_WORKERS="auto"
|
||||||
|
|
||||||
while getopts "p:t:" OPTION 2> /dev/null; do
|
while getopts "t:" OPTION 2> /dev/null; do
|
||||||
case ${OPTION} in
|
case ${OPTION} in
|
||||||
p)
|
|
||||||
PHP_BINARY="$OPTARG"
|
|
||||||
;;
|
|
||||||
t)
|
t)
|
||||||
PM_WORKERS="$OPTARG"
|
PM_WORKERS="$OPTARG"
|
||||||
;;
|
;;
|
||||||
@ -22,10 +18,10 @@ rm -rf "$DATA_DIR"
|
|||||||
rm PocketMine-MP.phar 2> /dev/null
|
rm PocketMine-MP.phar 2> /dev/null
|
||||||
|
|
||||||
cd tests/plugins/PocketMine-DevTools
|
cd tests/plugins/PocketMine-DevTools
|
||||||
"$PHP_BINARY" -dphar.readonly=0 ./src/DevTools/ConsoleScript.php --make ./ --relative ./ --out ../../../DevTools.phar
|
php -dphar.readonly=0 ./src/DevTools/ConsoleScript.php --make ./ --relative ./ --out ../../../DevTools.phar
|
||||||
cd ../../..
|
cd ../../..
|
||||||
|
|
||||||
"$PHP_BINARY" -dphar.readonly=0 ./build/server-phar.php ./PocketMine-MP.phar
|
php -dphar.readonly=0 ./build/server-phar.php ./PocketMine-MP.phar
|
||||||
if [ -f PocketMine-MP.phar ]; then
|
if [ -f PocketMine-MP.phar ]; then
|
||||||
echo Server phar created successfully.
|
echo Server phar created successfully.
|
||||||
else
|
else
|
||||||
@ -37,7 +33,7 @@ mkdir "$DATA_DIR"
|
|||||||
mkdir "$PLUGINS_DIR"
|
mkdir "$PLUGINS_DIR"
|
||||||
mv DevTools.phar "$PLUGINS_DIR"
|
mv DevTools.phar "$PLUGINS_DIR"
|
||||||
cp -r tests/plugins/TesterPlugin "$PLUGINS_DIR"
|
cp -r tests/plugins/TesterPlugin "$PLUGINS_DIR"
|
||||||
echo -e "stop\n" | "$PHP_BINARY" PocketMine-MP.phar --no-wizard --disable-ansi --disable-readline --debug.level=2 --data="$DATA_DIR" --plugins="$PLUGINS_DIR" --anonymous-statistics.enabled=0 --settings.async-workers="$PM_WORKERS" --settings.enable-dev-builds=1
|
echo -e "stop\n" | php PocketMine-MP.phar --no-wizard --disable-ansi --disable-readline --debug.level=2 --data="$DATA_DIR" --plugins="$PLUGINS_DIR" --anonymous-statistics.enabled=0 --settings.async-workers="$PM_WORKERS" --settings.enable-dev-builds=1
|
||||||
|
|
||||||
output=$(grep '\[TesterPlugin\]' "$DATA_DIR/server.log")
|
output=$(grep '\[TesterPlugin\]' "$DATA_DIR/server.log")
|
||||||
if [ "$output" == "" ]; then
|
if [ "$output" == "" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user