Merge branch 'minor-next' into feat/anvil

This commit is contained in:
ShockedPlot7560 2024-08-11 00:06:05 +02:00 committed by GitHub
commit b1a773ceb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 59 additions and 31 deletions

View File

@ -12,6 +12,22 @@ updates:
update-types: update-types:
- "version-update:semver-major" - "version-update:semver-major"
- "version-update:semver-minor" - "version-update:semver-minor"
groups:
production-patch-updates:
dependency-type: production
patterns:
- "*"
update-types:
- "patch"
development-patch-updates:
dependency-type: development
patterns:
- "*"
update-types:
- "patch"
phpstan:
patterns:
- "phpstan/*"
- package-ecosystem: gitsubmodule - package-ecosystem: gitsubmodule
directory: "/" directory: "/"

View File

@ -53,7 +53,7 @@ jobs:
run: echo NAME=$(echo "${GITHUB_REPOSITORY,,}") >> $GITHUB_OUTPUT run: echo NAME=$(echo "${GITHUB_REPOSITORY,,}") >> $GITHUB_OUTPUT
- name: Build image for tag - name: Build image for tag
uses: docker/build-push-action@v5.3.0 uses: docker/build-push-action@v6.5.0
with: with:
push: true push: true
context: ./pocketmine-mp context: ./pocketmine-mp
@ -66,7 +66,7 @@ jobs:
- name: Build image for major tag - name: Build image for major tag
if: steps.channel.outputs.CHANNEL == 'stable' if: steps.channel.outputs.CHANNEL == 'stable'
uses: docker/build-push-action@v5.3.0 uses: docker/build-push-action@v6.5.0
with: with:
push: true push: true
context: ./pocketmine-mp context: ./pocketmine-mp
@ -79,7 +79,7 @@ jobs:
- name: Build image for minor tag - name: Build image for minor tag
if: steps.channel.outputs.CHANNEL == 'stable' if: steps.channel.outputs.CHANNEL == 'stable'
uses: docker/build-push-action@v5.3.0 uses: docker/build-push-action@v6.5.0
with: with:
push: true push: true
context: ./pocketmine-mp context: ./pocketmine-mp
@ -92,7 +92,7 @@ jobs:
- name: Build image for latest tag - name: Build image for latest tag
if: steps.channel.outputs.CHANNEL == 'stable' if: steps.channel.outputs.CHANNEL == 'stable'
uses: docker/build-push-action@v5.3.0 uses: docker/build-push-action@v6.5.0
with: with:
push: true push: true
context: ./pocketmine-mp context: ./pocketmine-mp

View File

@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup PHP and tools - name: Setup PHP and tools
uses: shivammathur/setup-php@2.30.4 uses: shivammathur/setup-php@2.31.1
with: with:
php-version: 8.2 php-version: 8.2

View File

@ -20,7 +20,7 @@ jobs:
submodules: true submodules: true
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@2.30.4 uses: shivammathur/setup-php@2.31.1
with: with:
php-version: ${{ matrix.php-version }} php-version: ${{ matrix.php-version }}

View File

@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup PHP and tools - name: Setup PHP and tools
uses: shivammathur/setup-php@2.30.4 uses: shivammathur/setup-php@2.31.1
with: with:
php-version: 8.2 php-version: 8.2
tools: php-cs-fixer:3.49 tools: php-cs-fixer:3.49

View File

@ -52,7 +52,7 @@
"symfony/filesystem": "~6.4.0" "symfony/filesystem": "~6.4.0"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "1.11.2", "phpstan/phpstan": "1.11.9",
"phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-phpunit": "^1.1.0",
"phpstan/phpstan-strict-rules": "^1.2.0", "phpstan/phpstan-strict-rules": "^1.2.0",
"phpunit/phpunit": "^10.5.24" "phpunit/phpunit": "^10.5.24"

40
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": "d459605b85f247204988a879982aab50", "content-hash": "cddee8096f4b575629ff671000543d3f",
"packages": [ "packages": [
{ {
"name": "adhocore/json-comment", "name": "adhocore/json-comment",
@ -1389,16 +1389,16 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.11.2", "version": "1.11.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "0d5d4294a70deb7547db655c47685d680e39cfec" "reference": "e370bcddadaede0c1716338b262346f40d296f82"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d5d4294a70deb7547db655c47685d680e39cfec", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e370bcddadaede0c1716338b262346f40d296f82",
"reference": "0d5d4294a70deb7547db655c47685d680e39cfec", "reference": "e370bcddadaede0c1716338b262346f40d296f82",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1443,25 +1443,25 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-05-24T13:23:04+00:00" "time": "2024-08-01T16:25:18+00:00"
}, },
{ {
"name": "phpstan/phpstan-phpunit", "name": "phpstan/phpstan-phpunit",
"version": "1.3.16", "version": "1.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan-phpunit.git", "url": "https://github.com/phpstan/phpstan-phpunit.git",
"reference": "d5242a59d035e46774f2e634b374bc39ff62cb95" "reference": "f3ea021866f4263f07ca3636bf22c64be9610c11"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/d5242a59d035e46774f2e634b374bc39ff62cb95", "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/f3ea021866f4263f07ca3636bf22c64be9610c11",
"reference": "d5242a59d035e46774f2e634b374bc39ff62cb95", "reference": "f3ea021866f4263f07ca3636bf22c64be9610c11",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2 || ^8.0", "php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.10" "phpstan/phpstan": "^1.11"
}, },
"conflict": { "conflict": {
"phpunit/phpunit": "<7.0" "phpunit/phpunit": "<7.0"
@ -1493,27 +1493,27 @@
"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/1.3.16" "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.0"
}, },
"time": "2024-02-23T09:51:20+00:00" "time": "2024-04-20T06:39:00+00:00"
}, },
{ {
"name": "phpstan/phpstan-strict-rules", "name": "phpstan/phpstan-strict-rules",
"version": "1.5.5", "version": "1.6.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan-strict-rules.git", "url": "https://github.com/phpstan/phpstan-strict-rules.git",
"reference": "2e193a07651a6f4be3baa44ddb21d822681f5918" "reference": "363f921dd8441777d4fc137deb99beb486c77df1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/2e193a07651a6f4be3baa44ddb21d822681f5918", "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/363f921dd8441777d4fc137deb99beb486c77df1",
"reference": "2e193a07651a6f4be3baa44ddb21d822681f5918", "reference": "363f921dd8441777d4fc137deb99beb486c77df1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2 || ^8.0", "php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.10.60" "phpstan/phpstan": "^1.11"
}, },
"require-dev": { "require-dev": {
"nikic/php-parser": "^4.13.0", "nikic/php-parser": "^4.13.0",
@ -1542,9 +1542,9 @@
"description": "Extra strict and opinionated rules for PHPStan", "description": "Extra strict and opinionated rules for PHPStan",
"support": { "support": {
"issues": "https://github.com/phpstan/phpstan-strict-rules/issues", "issues": "https://github.com/phpstan/phpstan-strict-rules/issues",
"source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.5" "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.6.0"
}, },
"time": "2024-04-19T15:12:26+00:00" "time": "2024-04-20T06:37:51+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",

View File

@ -38,6 +38,9 @@ use function implode;
final class BlockStateData{ final class BlockStateData{
/** /**
* Bedrock version of the most recent backwards-incompatible change to blockstates. * Bedrock version of the most recent backwards-incompatible change to blockstates.
*
* This is *not* the same as current game version. It should match the numbers in the
* newest blockstate upgrade schema used in BedrockBlockUpgradeSchema.
*/ */
public const CURRENT_VERSION = public const CURRENT_VERSION =
(1 << 24) | //major (1 << 24) | //major

View File

@ -60,6 +60,8 @@ interface ResourcePack{
* @param int $start Offset to start reading the chunk from * @param int $start Offset to start reading the chunk from
* @param int $length Maximum length of data to return. * @param int $length Maximum length of data to return.
* *
* @phpstan-param positive-int $length
*
* @return string byte-array * @return string byte-array
* @throws \InvalidArgumentException if the chunk does not exist * @throws \InvalidArgumentException if the chunk does not exist
*/ */

View File

@ -154,6 +154,9 @@ class ZippedResourcePack implements ResourcePack{
} }
public function getPackChunk(int $start, int $length) : string{ public function getPackChunk(int $start, int $length) : string{
if($length < 1){
throw new \InvalidArgumentException("Pack length must be positive");
}
fseek($this->fileResource, $start); fseek($this->fileResource, $start);
if(feof($this->fileResource)){ if(feof($this->fileResource)){
throw new \InvalidArgumentException("Requested a resource pack chunk with invalid start offset"); throw new \InvalidArgumentException("Requested a resource pack chunk with invalid start offset");

View File

@ -51,12 +51,12 @@ use function time;
class BedrockWorldData extends BaseNbtWorldData{ class BedrockWorldData extends BaseNbtWorldData{
public const CURRENT_STORAGE_VERSION = 10; public const CURRENT_STORAGE_VERSION = 10;
public const CURRENT_STORAGE_NETWORK_VERSION = 685; public const CURRENT_STORAGE_NETWORK_VERSION = 686;
public const CURRENT_CLIENT_VERSION_TARGET = [ public const CURRENT_CLIENT_VERSION_TARGET = [
1, //major 1, //major
21, //minor 21, //minor
0, //patch 2, //patch
3, //revision 2, //revision
0 //is beta 0 //is beta
]; ];

View File

@ -27,6 +27,7 @@ use function range;
class RegionLocationTableEntry{ class RegionLocationTableEntry{
private int $firstSector; private int $firstSector;
/** @phpstan-var positive-int */
private int $sectorCount; private int $sectorCount;
private int $timestamp; private int $timestamp;
@ -61,6 +62,9 @@ class RegionLocationTableEntry{
return range($this->getFirstSector(), $this->getLastSector()); return range($this->getFirstSector(), $this->getLastSector());
} }
/**
* @phpstan-return positive-int
*/
public function getSectorCount() : int{ public function getSectorCount() : int{
return $this->sectorCount; return $this->sectorCount;
} }