Compare commits

..

No commits in common. "stable" and "5.27.0" have entirely different histories.

12 changed files with 48 additions and 68 deletions

View File

@ -8,7 +8,7 @@ on:
jobs: jobs:
build: build:
name: Update Docker Hub images name: Update Docker Hub images
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
steps: steps:
- name: Set up Docker Buildx - name: Set up Docker Buildx

View File

@ -24,7 +24,7 @@ permissions:
jobs: jobs:
check-intent: check-intent:
name: Check release trigger name: Check release trigger
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
outputs: outputs:
valid: ${{ steps.validate.outputs.DEV_BUILD == 'false' }} valid: ${{ steps.validate.outputs.DEV_BUILD == 'false' }}
@ -43,7 +43,7 @@ jobs:
#don't do these checks if this isn't a release - we don't want to generate unnecessary failed statuses #don't do these checks if this isn't a release - we don't want to generate unnecessary failed statuses
if: needs.check-intent.outputs.valid == 'true' if: needs.check-intent.outputs.valid == 'true'
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@ -23,7 +23,7 @@ env:
jobs: jobs:
skip: skip:
name: Check whether to ignore this tag name: Check whether to ignore this tag
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
outputs: outputs:
skip: ${{ steps.exists.outputs.exists == 'true' }} skip: ${{ steps.exists.outputs.exists == 'true' }}
@ -54,7 +54,7 @@ jobs:
needs: [check] needs: [check]
if: needs.check.outputs.valid == 'true' && github.ref_type != 'tag' #can't do post-commit for a tag if: needs.check.outputs.valid == 'true' && github.ref_type != 'tag' #can't do post-commit for a tag
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
steps: steps:
- name: Generate access token - name: Generate access token
@ -79,7 +79,7 @@ jobs:
needs: [check] needs: [check]
if: needs.check.outputs.valid == 'true' || github.ref_type == 'tag' #ignore validity check for tags if: needs.check.outputs.valid == 'true' || github.ref_type == 'tag' #ignore validity check for tags
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@ -15,7 +15,7 @@ on:
type: number type: number
image: image:
description: 'Runner image to use' description: 'Runner image to use'
default: 'ubuntu-22.04' default: 'ubuntu-20.04'
type: string type: string
jobs: jobs:

View File

@ -20,7 +20,7 @@ jobs:
codestyle: codestyle:
name: Code Style checks name: Code Style checks
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
strategy: strategy:
fail-fast: false fail-fast: false
@ -40,7 +40,7 @@ jobs:
shellcheck: shellcheck:
name: ShellCheck name: ShellCheck
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -16,9 +16,3 @@ If you're upgrading from 5.25.x directly to 5.27.0, please also read the followi
## General ## General
- Aded support for Minecraft: Bedrock Edition 1.21.70. - Aded support for Minecraft: Bedrock Edition 1.21.70.
- Removed support for earlier versions. - Removed support for earlier versions.
# 5.27.1
Released 6th April 2025.
## Fixes
- Updated RakLib to get ping timestamp handling fixes.

View File

@ -45,14 +45,14 @@
"pocketmine/log": "^0.4.0", "pocketmine/log": "^0.4.0",
"pocketmine/math": "~1.0.0", "pocketmine/math": "~1.0.0",
"pocketmine/nbt": "~1.1.0", "pocketmine/nbt": "~1.1.0",
"pocketmine/raklib": "~1.1.2", "pocketmine/raklib": "~1.1.0",
"pocketmine/raklib-ipc": "~1.0.0", "pocketmine/raklib-ipc": "~1.0.0",
"pocketmine/snooze": "^0.5.0", "pocketmine/snooze": "^0.5.0",
"ramsey/uuid": "~4.7.0", "ramsey/uuid": "~4.7.0",
"symfony/filesystem": "~6.4.0" "symfony/filesystem": "~6.4.0"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "2.1.11", "phpstan/phpstan": "2.1.8",
"phpstan/phpstan-phpunit": "^2.0.0", "phpstan/phpstan-phpunit": "^2.0.0",
"phpstan/phpstan-strict-rules": "^2.0.0", "phpstan/phpstan-strict-rules": "^2.0.0",
"phpunit/phpunit": "^10.5.24" "phpunit/phpunit": "^10.5.24"

66
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "818c679a25da8e6b466bc454ad48dec3", "content-hash": "28b4de9a23a293646dbad2707cdfd9e0",
"packages": [ "packages": [
{ {
"name": "adhocore/json-comment", "name": "adhocore/json-comment",
@ -471,16 +471,16 @@
}, },
{ {
"name": "pocketmine/locale-data", "name": "pocketmine/locale-data",
"version": "2.24.2", "version": "2.24.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pmmp/Language.git", "url": "https://github.com/pmmp/Language.git",
"reference": "2a00c44c52bce98e7a43aa31517df78cbb2ba23b" "reference": "8f48cbe1fb5835a8bb573bed00ef04c65c26c7e5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pmmp/Language/zipball/2a00c44c52bce98e7a43aa31517df78cbb2ba23b", "url": "https://api.github.com/repos/pmmp/Language/zipball/8f48cbe1fb5835a8bb573bed00ef04c65c26c7e5",
"reference": "2a00c44c52bce98e7a43aa31517df78cbb2ba23b", "reference": "8f48cbe1fb5835a8bb573bed00ef04c65c26c7e5",
"shasum": "" "shasum": ""
}, },
"type": "library", "type": "library",
@ -488,9 +488,9 @@
"description": "Language resources used by PocketMine-MP", "description": "Language resources used by PocketMine-MP",
"support": { "support": {
"issues": "https://github.com/pmmp/Language/issues", "issues": "https://github.com/pmmp/Language/issues",
"source": "https://github.com/pmmp/Language/tree/2.24.2" "source": "https://github.com/pmmp/Language/tree/2.24.1"
}, },
"time": "2025-04-03T01:23:27+00:00" "time": "2025-03-16T19:04:15+00:00"
}, },
{ {
"name": "pocketmine/log", "name": "pocketmine/log",
@ -618,16 +618,16 @@
}, },
{ {
"name": "pocketmine/raklib", "name": "pocketmine/raklib",
"version": "1.1.2", "version": "1.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pmmp/RakLib.git", "url": "https://github.com/pmmp/RakLib.git",
"reference": "4145a31cd812fe8931c3c9c691fcd2ded2f47e7f" "reference": "be2783be516bf6e2872ff5c81fb9048596617b97"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pmmp/RakLib/zipball/4145a31cd812fe8931c3c9c691fcd2ded2f47e7f", "url": "https://api.github.com/repos/pmmp/RakLib/zipball/be2783be516bf6e2872ff5c81fb9048596617b97",
"reference": "4145a31cd812fe8931c3c9c691fcd2ded2f47e7f", "reference": "be2783be516bf6e2872ff5c81fb9048596617b97",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -639,8 +639,8 @@
"pocketmine/log": "^0.3.0 || ^0.4.0" "pocketmine/log": "^0.3.0 || ^0.4.0"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "2.1.0", "phpstan/phpstan": "1.10.1",
"phpstan/phpstan-strict-rules": "^2.0" "phpstan/phpstan-strict-rules": "^1.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -655,9 +655,9 @@
"description": "A RakNet server implementation written in PHP", "description": "A RakNet server implementation written in PHP",
"support": { "support": {
"issues": "https://github.com/pmmp/RakLib/issues", "issues": "https://github.com/pmmp/RakLib/issues",
"source": "https://github.com/pmmp/RakLib/tree/1.1.2" "source": "https://github.com/pmmp/RakLib/tree/1.1.1"
}, },
"time": "2025-04-06T03:38:21+00:00" "time": "2024-03-04T14:02:14+00:00"
}, },
{ {
"name": "pocketmine/raklib-ipc", "name": "pocketmine/raklib-ipc",
@ -742,16 +742,16 @@
}, },
{ {
"name": "ramsey/collection", "name": "ramsey/collection",
"version": "2.1.1", "version": "2.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/ramsey/collection.git", "url": "https://github.com/ramsey/collection.git",
"reference": "344572933ad0181accbf4ba763e85a0306a8c5e2" "reference": "3c5990b8a5e0b79cd1cf11c2dc1229e58e93f109"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2", "url": "https://api.github.com/repos/ramsey/collection/zipball/3c5990b8a5e0b79cd1cf11c2dc1229e58e93f109",
"reference": "344572933ad0181accbf4ba763e85a0306a8c5e2", "reference": "3c5990b8a5e0b79cd1cf11c2dc1229e58e93f109",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -812,9 +812,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/ramsey/collection/issues", "issues": "https://github.com/ramsey/collection/issues",
"source": "https://github.com/ramsey/collection/tree/2.1.1" "source": "https://github.com/ramsey/collection/tree/2.1.0"
}, },
"time": "2025-03-22T05:38:12+00:00" "time": "2025-03-02T04:48:29+00:00"
}, },
{ {
"name": "ramsey/uuid", "name": "ramsey/uuid",
@ -1373,16 +1373,16 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "2.1.11", "version": "2.1.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "8ca5f79a8f63c49b2359065832a654e1ec70ac30" "reference": "f9adff3b87c03b12cc7e46a30a524648e497758f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/8ca5f79a8f63c49b2359065832a654e1ec70ac30", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/f9adff3b87c03b12cc7e46a30a524648e497758f",
"reference": "8ca5f79a8f63c49b2359065832a654e1ec70ac30", "reference": "f9adff3b87c03b12cc7e46a30a524648e497758f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1427,20 +1427,20 @@
"type": "github" "type": "github"
} }
], ],
"time": "2025-03-24T13:45:00+00:00" "time": "2025-03-09T09:30:48+00:00"
}, },
{ {
"name": "phpstan/phpstan-phpunit", "name": "phpstan/phpstan-phpunit",
"version": "2.0.6", "version": "2.0.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan-phpunit.git", "url": "https://github.com/phpstan/phpstan-phpunit.git",
"reference": "6b92469f8a7995e626da3aa487099617b8dfa260" "reference": "d09e152f403c843998d7a52b5d87040c937525dd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/6b92469f8a7995e626da3aa487099617b8dfa260", "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/d09e152f403c843998d7a52b5d87040c937525dd",
"reference": "6b92469f8a7995e626da3aa487099617b8dfa260", "reference": "d09e152f403c843998d7a52b5d87040c937525dd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1451,9 +1451,7 @@
"phpunit/phpunit": "<7.0" "phpunit/phpunit": "<7.0"
}, },
"require-dev": { "require-dev": {
"nikic/php-parser": "^5",
"php-parallel-lint/php-parallel-lint": "^1.2", "php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0", "phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^9.6" "phpunit/phpunit": "^9.6"
}, },
@ -1478,9 +1476,9 @@
"description": "PHPUnit extensions and rules for PHPStan", "description": "PHPUnit extensions and rules for PHPStan",
"support": { "support": {
"issues": "https://github.com/phpstan/phpstan-phpunit/issues", "issues": "https://github.com/phpstan/phpstan-phpunit/issues",
"source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.6" "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.4"
}, },
"time": "2025-03-26T12:47:06+00:00" "time": "2025-01-22T13:07:38+00:00"
}, },
{ {
"name": "phpstan/phpstan-strict-rules", "name": "phpstan/phpstan-strict-rules",

View File

@ -31,8 +31,8 @@ use function str_repeat;
final class VersionInfo{ final class VersionInfo{
public const NAME = "PocketMine-MP"; public const NAME = "PocketMine-MP";
public const BASE_VERSION = "5.27.2"; public const BASE_VERSION = "5.27.0";
public const IS_DEVELOPMENT_BUILD = true; public const IS_DEVELOPMENT_BUILD = false;
public const BUILD_CHANNEL = "stable"; public const BUILD_CHANNEL = "stable";
/** /**

View File

@ -60,7 +60,6 @@ use pocketmine\player\Player;
use pocketmine\Server; use pocketmine\Server;
use pocketmine\timings\Timings; use pocketmine\timings\Timings;
use pocketmine\timings\TimingsHandler; use pocketmine\timings\TimingsHandler;
use pocketmine\utils\Limits;
use pocketmine\utils\Utils; use pocketmine\utils\Utils;
use pocketmine\VersionInfo; use pocketmine\VersionInfo;
use pocketmine\world\format\Chunk; use pocketmine\world\format\Chunk;
@ -77,7 +76,6 @@ use function floatval;
use function floor; use function floor;
use function fmod; use function fmod;
use function get_class; use function get_class;
use function min;
use function sin; use function sin;
use function spl_object_id; use function spl_object_id;
use const M_PI_2; use const M_PI_2;
@ -702,16 +700,9 @@ abstract class Entity{
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
*/ */
public function setFireTicks(int $fireTicks) : void{ public function setFireTicks(int $fireTicks) : void{
if($fireTicks < 0){ if($fireTicks < 0 || $fireTicks > 0x7fff){
throw new \InvalidArgumentException("Fire ticks cannot be negative"); throw new \InvalidArgumentException("Fire ticks must be in range 0 ... " . 0x7fff . ", got $fireTicks");
} }
//Since the max value is not externally obvious or intuitive, many plugins use this without being aware that
//reasonably large values are not accepted. We even have such usages within PM itself. It doesn't make sense
//to force all those calls to be aware of this limitation, as it's not a functional limit but a limitation of
//the Mojang save format. Truncating this to the max acceptable value is the next best thing we can do.
$fireTicks = min($fireTicks, Limits::INT16_MAX);
if(!$this->isFireProof()){ if(!$this->isFireProof()){
$this->fireTicks = $fireTicks; $this->fireTicks = $fireTicks;
$this->networkPropertiesDirty = true; $this->networkPropertiesDirty = true;

View File

@ -28,7 +28,6 @@ use pocketmine\item\enchantment\ItemEnchantmentTags as Tags;
use pocketmine\item\enchantment\VanillaEnchantments as Enchantments; use pocketmine\item\enchantment\VanillaEnchantments as Enchantments;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\utils\SingletonTrait; use pocketmine\utils\SingletonTrait;
use pocketmine\utils\Utils;
use function array_filter; use function array_filter;
use function array_values; use function array_values;
use function count; use function count;
@ -130,7 +129,6 @@ final class AvailableEnchantmentRegistry{
if(!$this->isRegistered($enchantment)){ if(!$this->isRegistered($enchantment)){
throw new \LogicException("Cannot set primary item tags for non-registered enchantment"); throw new \LogicException("Cannot set primary item tags for non-registered enchantment");
} }
Utils::validateArrayValueType($tags, fn(string $v) => 1);
$this->primaryItemTags[spl_object_id($enchantment)] = array_values($tags); $this->primaryItemTags[spl_object_id($enchantment)] = array_values($tags);
} }
@ -154,7 +152,6 @@ final class AvailableEnchantmentRegistry{
if(!$this->isRegistered($enchantment)){ if(!$this->isRegistered($enchantment)){
throw new \LogicException("Cannot set secondary item tags for non-registered enchantment"); throw new \LogicException("Cannot set secondary item tags for non-registered enchantment");
} }
Utils::validateArrayValueType($tags, fn(string $v) => 1);
$this->secondaryItemTags[spl_object_id($enchantment)] = array_values($tags); $this->secondaryItemTags[spl_object_id($enchantment)] = array_values($tags);
} }

View File

@ -584,7 +584,7 @@ final class Utils{
/** /**
* @phpstan-template TMemberType * @phpstan-template TMemberType
* @phpstan-param array<mixed, TMemberType> $array * @phpstan-param array<mixed, TMemberType> $array
* @phpstan-param \Closure(TMemberType) : mixed $validator * @phpstan-param \Closure(TMemberType) : void $validator
*/ */
public static function validateArrayValueType(array $array, \Closure $validator) : void{ public static function validateArrayValueType(array $array, \Closure $validator) : void{
foreach(Utils::promoteKeys($array) as $k => $v){ foreach(Utils::promoteKeys($array) as $k => $v){