Compare commits

...

101 Commits

Author SHA1 Message Date
b54854529f Release 3.24.0 2021-10-09 20:20:37 +01:00
974d08efd6 Bump PHP minimum requirement to 8.0
PHPStan failed on 7.4 after updating to 0.12.99, and I figured it was less hassle to just do this than fix the build. In any case, we stopped shipping 7.4 months ago, and warned at 3.22 release that 7.4 support would soon be dropped.
2021-10-09 20:09:42 +01:00
289553fa46 CS again 2021-10-09 19:50:07 +01:00
e38866c4ba phpstan 0.12.99 2021-10-09 19:33:43 +01:00
58a95f8836 Updated transitive composer dependencies 2021-10-09 19:18:32 +01:00
e032b8fe20 Server: fixed stats reporting checking a nonexistent pocketmine.yml property
this was originally worked around by 47f7af6739. However, that commit was just duct tape, and I never bothered to investigate if the config was being checked somewhere else.
Here's to a years-old bug finally getting fixed.
2021-10-06 22:23:41 +01:00
a27c14c00c phpstan: exclude build/php from analysis
in case I built PHP in there, I don't want the install_data getting analysed and screwing up the analysis.
2021-10-05 00:14:44 +00:00
003c002208 Bump phpunit/phpunit from 9.5.9 to 9.5.10 (#4482)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.9 to 9.5.10.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.9...9.5.10)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-28 21:04:11 +01:00
d417b1e2f5 Projectile: fixed move() not using the given parameters (#4481)
it was using this->motion instead, which usually would be the same, but maybe not.
2021-09-28 21:03:03 +01:00
65e468e3c2 Updated build/php submodule to pmmp/php-build-scripts@6aac46e500 2021-09-28 21:00:13 +01:00
a11cf8c296 Update PHP versions used by GitHub Actions 2021-09-28 20:52:40 +01:00
d455188d03 3.23.2 is next 2021-09-22 01:00:50 +01:00
14fba36636 Release 3.23.1 2021-09-22 01:00:50 +01:00
43ac3fbf3e actions: use newer PHP versions 2021-09-22 00:51:06 +01:00
352162a6e6 Fixed PHP 7.4 build 2021-09-22 00:50:00 +01:00
b3601c9390 Regenerate PHPStan baselines 2021-09-22 00:45:07 +01:00
817fec9e3d EducationSettingsPacket: safeguard against purity issue reported by PHPStan
while annoying, PHPStan is right to complain about this, because putBool() is impure, meaning that these fields could have been mutated in the call.
We know they didn't, but PHPStan doesn't, and we can't mark the method as pure because .. well .. it isn't.
2021-09-22 00:44:52 +01:00
ceeef7c729 3.23.1 is next 2021-09-22 00:29:24 +01:00
7f1b2a0ee5 Release 3.23.0 2021-09-22 00:29:24 +01:00
27324a3aeb Protocol changes for 1.17.30 2021-09-22 00:26:39 +01:00
33b5da3749 3.22.6 is next 2021-09-10 17:09:51 +01:00
40e88f1686 Release 3.22.5 2021-09-10 17:09:50 +01:00
4c65a0cdaa LegacySkinAdapter: Use 64x64 for persona polyfilled skins
64x32 has some corruption issues and generally just looks really bad.
2021-09-09 16:04:43 +01:00
806f03bd37 consistency ... 2021-09-07 13:00:28 +01:00
39820be836 draft-release: preprocess only src of dependencies
p sure we had this problem already somewhere else? ...
2021-09-07 12:59:32 +01:00
c948aa94aa Fixed new files in build/ keeping getting missed 2021-09-07 12:39:54 +01:00
5d0d1aa4c5 Include build/generate-build-info-json.php in analysis 2021-09-07 12:36:42 +01:00
9b8be22015 Sort phpstan.neon 2021-09-07 12:32:19 +01:00
b0b28ec6ed 3.22.5 is next 2021-09-05 15:47:54 +01:00
2fb4704269 Release 3.22.4 2021-09-05 15:47:54 +01:00
0c0eb72b1b make-release: display the current and next version numbers 2021-09-05 15:46:40 +01:00
466107d3b8 actions: fix release build shitting the bed 2021-09-05 15:45:07 +01:00
4f59d3487a 3.22.4 is next 2021-09-05 15:42:39 +01:00
65220b4f7f Release 3.22.3 2021-09-05 15:42:38 +01:00
85eb6b30a5 Player: do not allow doFirstSpawn() to be executed before the constructor is called
this problem doesn't exist on PM4.
2021-09-05 15:38:14 +01:00
1c2eb35025 actions: fixed bad git hash on published releases 2021-09-05 15:32:31 +01:00
85ed7efcb4 PHPStan 0.12.98 2021-09-03 11:50:18 +01:00
183489e863 PHPUnit 9.5.9 2021-09-03 11:47:31 +01:00
ac060f2ec6 Update build/php submodule to pmmp/php-build-scripts@e55c60f176 2021-09-03 11:45:43 +01:00
6c85d4d254 CommandReader: fixed CS with php-cs-fixer 3.1.0 2021-08-29 23:35:07 +01:00
f506c922b5 phpstan.neon.dist: fix indentation inconsistency
fuck you, phpstorm!

it doesn't have an option to use tabs for indentation in YAML, and YAML is the closest thing to NEON, so ...
2021-08-29 23:19:35 +01:00
a5b08fc8f2 Rewrite CONTRIBUTING.md to be more developer-oriented 2021-08-27 15:05:57 +01:00
c3c4c80b70 SECURITY: drop supported versions table
this isn't actively maintained, so it's misleading.
[ci skip]
2021-08-27 13:53:01 +01:00
5695fa9086 CONTRIBUTING: fixed a broken link
[ci skip]
2021-08-27 13:51:16 +01:00
f78808bad0 Bump phpstan/phpstan-strict-rules from 0.12.10 to 0.12.11 (#4401)
Bumps [phpstan/phpstan-strict-rules](https://github.com/phpstan/phpstan-strict-rules) from 0.12.10 to 0.12.11.
- [Release notes](https://github.com/phpstan/phpstan-strict-rules/releases)
- [Commits](https://github.com/phpstan/phpstan-strict-rules/compare/0.12.10...0.12.11)

---
updated-dependencies:
- dependency-name: phpstan/phpstan-strict-rules
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-25 20:41:11 +01:00
dc0082162b Bump phpstan/phpstan from 0.12.95 to 0.12.96 (#4397)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.95 to 0.12.96.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.95...0.12.96)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-23 13:53:20 +01:00
ff4aa148ef phpstan 0.12.95 2021-08-20 22:47:29 +01:00
63e86fe806 Config: fixed incorrect fluent @return annotations 2021-08-20 14:44:59 +01:00
ab05bc7379 Replace some references to Pocket Edition with Bedrock Edition
closes #4387
2021-08-20 14:23:11 +01:00
1a395a51c9 Fixing function import inconsistencies since php-cs-fixer 3.0 migration 2021-08-19 15:26:45 +01:00
142c8f067b fix CS in php-cs-fixer config
unfortunately i can't seem to make it fix itself
2021-08-19 15:25:20 +01:00
cd3c96aad2 shivammathur/setup-php 2.12.0 2021-08-19 02:31:18 +01:00
19c47fa71f 3.22.3 is next 2021-08-18 14:14:58 +01:00
d670bc8bf8 Release 3.22.2 2021-08-18 14:14:54 +01:00
7bd8d09023 GitHub Actions: automatically build and upload release artifacts, and auto-update update.pmmp.io (#4376) 2021-08-18 14:02:52 +01:00
5a970541f9 actions: use newer pthreads version 2021-08-16 23:15:47 +01:00
e561fa6222 actions: update PHP versions 2021-08-16 23:14:17 +01:00
025dde19ce Bump phpstan/phpstan-phpunit from 0.12.21 to 0.12.22 (#4367)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 0.12.21 to 0.12.22.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/0.12.21...0.12.22)

---
updated-dependencies:
- dependency-name: phpstan/phpstan-phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-13 12:51:34 +01:00
28bfe9fbb4 emit_performance_warnings(): Log a warning when using a PHP debug build 2021-08-11 20:14:03 +01:00
cd53fa162b Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2021-08-03 20:22:41 +01:00
748e9705ba Updated build/php submodule to pmmp/php-build-scripts@49971716b0 2021-08-03 20:20:56 +01:00
219ed81389 Player: Fixed items on the crafting grid disappearing when the player disconnects (#4344) 2021-08-02 19:48:36 +01:00
6a7196530c Bump phpunit/phpunit from 9.5.7 to 9.5.8 (#4345)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.7 to 9.5.8.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.7...9.5.8)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-02 11:52:17 +01:00
01fe497c49 phpstan: use PHP 8.0 as primary version
I'm using 8.0 for local development now, so having the phpstan configs targeted at 7.4 by default makes things inconvenient.
2021-07-26 14:34:47 +01:00
3bbd088a09 Update build/php submodule to pmmp/php-build-scripts@280dd0524a 2021-07-24 22:40:28 +01:00
85effa5240 Remove junk from php8 baseline 2021-07-23 15:56:06 +01:00
81c5b83bd9 actions: test on 8.0 2021-07-23 15:55:01 +01:00
ef31a9fc66 Update bug_report.md 2021-07-23 13:32:18 +01:00
dc56a99473 3.22.2 is next 2021-07-23 13:03:27 +01:00
9477034a4a Release 3.22.1 2021-07-23 13:03:27 +01:00
5844b59b12 Fixed incorrect encoding of NpcDialoguePacket
this is in fact an ActorUniqueID, but for some reason written as a uint64 instead of a varint.
2021-07-23 12:53:30 +01:00
3af18917f0 Player: remove note about bans from getUniqueId()
while it's true that you might be able to skip the CPU waste from verifying a player's login just to find out that they are banned, this is generally a minority case anyway, so it doesn't make a lot of difference overall. This additional note is essentially a recommendation premature optimisation, which will likely lead to people making security mistakes.
2021-07-22 22:14:14 +01:00
61528393c2 Player: rewrite the confusing documentation of getUniqueId() 2021-07-22 21:14:31 +01:00
59b8453228 Player: added extra debug message for XUID mismatches 2021-07-22 21:04:40 +01:00
8cb48bfe1d Bump phpunit/phpunit from 9.5.6 to 9.5.7 (#4322)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.6 to 9.5.7.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.6...9.5.7)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-19 12:48:11 +01:00
8fb4d7b982 BUILDING.md: Changed pre-requisites PHP version to 7.4 or newer (#4319)
[ci skip]
2021-07-18 00:08:14 +01:00
13f114f30e bootstrap: report loaded php.ini in error, as well as php binary path
in some cases extension loading issues are caused by incorrect php.ini path, which should be easy to spot if the path is given.
2021-07-17 21:50:30 +01:00
eccd258aeb start.cmd: fixed incorrect php.ini scan dir when using a non-local binary 2021-07-17 21:49:11 +01:00
bd5f379c4c apparently opcache_get_status() may return false? 2021-07-17 21:11:12 +01:00
2588895ab0 bootstrap: add a giant yellow warning about JIT 2021-07-17 19:00:19 +01:00
432999a7d7 Bump phpstan/phpstan-phpunit from 0.12.20 to 0.12.21 (#4313)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 0.12.20 to 0.12.21.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/0.12.20...0.12.21)

---
updated-dependencies:
- dependency-name: phpstan/phpstan-phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-15 22:32:47 +01:00
68699dbff9 PlayerAuthInputFlags: Fixed a mistake in the documentation 2021-07-14 21:08:23 +01:00
bfbe3d83de 3.22.1 is next 2021-07-13 18:31:34 +01:00
c32c21464c Release 3.22.0 2021-07-13 18:31:28 +01:00
16faafa1ef Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2021-07-13 18:11:03 +01:00
4d6ac57a26 Fixed particle IDs 2021-07-13 17:54:40 +01:00
73ba1ba224 Bump phpstan/phpstan from 0.12.91 to 0.12.92 (#4309)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.91 to 0.12.92.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.91...0.12.92)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-12 12:35:35 +01:00
8b79253d3b Protocol changes for 1.17.10 2021-07-09 19:29:34 +01:00
1122131c8d 3.21.2 is next 2021-07-05 18:49:26 +01:00
a50ef2af6f Release 3.21.1 2021-07-05 18:49:26 +01:00
72e4660800 Updated build/php submodule to pmmp/php-build-scripts@4bf8ec1ad0 2021-07-05 18:42:35 +01:00
e6285a0312 Update composer transitive dependencies 2021-07-05 17:22:32 +01:00
5420e76a9a Bump phpstan/phpstan-strict-rules from 0.12.9 to 0.12.10 (#4295) 2021-07-05 13:20:03 +00:00
de46a81cf4 Bump phpstan/phpstan from 0.12.90 to 0.12.91 (#4296)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.90 to 0.12.91.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.90...0.12.91)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-05 14:07:49 +01:00
0cdc04f9b5 Player: Fixed so-called 'pot lag'
this occurred because of transactions arriving before MobEquipmentPacket updating the player's own held item slot. This was only a problem while rapidly changing hotbar slots and simultaneously using items, like projectiles.
closes #4168
2021-06-26 18:56:30 +01:00
8b1a84f2bf Bump phpunit/phpunit from 9.5.5 to 9.5.6 (#4282)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.5 to 9.5.6.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.5...9.5.6)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-26 16:49:19 +01:00
155e516f74 phpstan 0.12.90 2021-06-18 18:46:30 +01:00
ea0a47dff7 Updated transitive composer dependency junk 2021-06-18 18:42:08 +01:00
0a6ce18322 CrashDump: Sort plugins list 2021-06-17 20:56:49 +01:00
11d73e5bb8 Bump phpstan/phpstan-phpunit from 0.12.19 to 0.12.20 (#4273)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 0.12.19 to 0.12.20.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/0.12.19...0.12.20)

---
updated-dependencies:
- dependency-name: phpstan/phpstan-phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-17 15:30:01 +01:00
492ad6bb66 3.21.1 is next 2021-06-13 15:38:22 +01:00
73 changed files with 1809 additions and 472 deletions

View File

@ -20,8 +20,9 @@ assignees: ''
<!-- try the `version` command | LATEST IS NOT A VALID VERSION -->
* PocketMine-MP:
* PHP:
* Using JIT: yes/no (delete as appropriate) <!-- look for the giant yellow warning in the log that says you're using JIT -->
* Server OS:
* Game version: PE/Win10 (delete as appropriate)
* Game version: Android/iOS/Win10/Xbox/PS4/Switch (delete as appropriate)
### Plugins
<!--- use the `plugins` command and paste the output below -->

113
.github/workflows/draft-release.yml vendored Normal file
View File

@ -0,0 +1,113 @@
name: Draft release
on:
push:
tags: "*"
jobs:
draft:
name: Create GitHub draft release
if: "startsWith(github.event.head_commit.message, 'Release ')"
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup PHP
uses: shivammathur/setup-php@2.12.0
with:
php-version: 8.0
- name: Restore Composer package cache
uses: actions/cache@v2
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-${{ hashFiles('./composer.lock') }}"
restore-keys: |
composer-v2-cache-
- name: Install Composer dependencies
run: composer install --no-dev --prefer-dist --no-interaction --ignore-platform-reqs
- name: Patch VersionInfo
run: |
BUILD_NUMBER=2000+$GITHUB_RUN_NUMBER #to stay above jenkins
echo "Build number: $BUILD_NUMBER"
sed -i "s/const BUILD_NUMBER = 0/const BUILD_NUMBER = ${BUILD_NUMBER}/" src/pocketmine/VersionInfo.php
- name: Minify BedrockData JSON files
run: php src/pocketmine/resources/vanilla/.minify_json.php
- name: Run preprocessor
run: |
PM_PREPROCESSOR_PATH="$GITHUB_WORKSPACE/build/preprocessor"
php "$PM_PREPROCESSOR_PATH/PreProcessor.php" --path=src --multisize || (echo "Preprocessor exited with code $?" && exit 1)
#dump the diff of preprocessor replacements to a patch in case it has bugs
git diff > preprocessor_diff.patch
VENDOR_PM="$GITHUB_WORKSPACE/vendor"
VENDOR_PM_BACKUP="$GITHUB_WORKSPACE/vendor-before-preprocess"
cp -r "$VENDOR_PM" "$VENDOR_PM_BACKUP"
for f in $(ls $VENDOR_PM/pocketmine); do
echo "Processing directory \"$f\"..."
php "$PM_PREPROCESSOR_PATH/PreProcessor.php" --path="$VENDOR_PM/pocketmine/$f/src" --multisize || (echo "Preprocessor exited with code $?" && exit 1)
echo "Checking for changes in \"$f\"..."
DIFF=$(git diff --no-index "$VENDOR_PM_BACKUP/pocketmine/$f" "$VENDOR_PM/pocketmine/$f" || true)
if [ "$DIFF" != "" ]; then
PATCH="$GITHUB_WORKSPACE/preprocessor_diff_$f.patch"
echo "$DIFF" > "$PATCH"
echo "Generated patch file \"$PATCH\""
else
echo "No diff generated for \"$f\" (preprocessor made no changes)"
fi
done
- name: Build PocketMine-MP.phar
run: php -dphar.readonly=0 build/server-phar.php --git ${{ github.sha }}
- name: Get PocketMine-MP release version
id: get-pm-version
run: |
echo ::set-output name=PM_VERSION::$(php -r 'require "vendor/autoload.php"; echo \pocketmine\BASE_VERSION;')
echo ::set-output name=MCPE_VERSION::$(php -r 'require "vendor/autoload.php"; echo \pocketmine\network\mcpe\protocol\ProtocolInfo::MINECRAFT_VERSION_NETWORK;')
echo ::set-output name=PM_VERSION_SHORT::$(php -r 'require "vendor/autoload.php"; $v = explode(".", \pocketmine\BASE_VERSION); array_pop($v); echo implode(".", $v);')
echo ::set-output name=PM_VERSION_MD::$(php -r 'require "vendor/autoload.php"; echo str_replace(".", "", \pocketmine\BASE_VERSION);')
- name: Generate build info
run: php build/generate-build-info-json.php ${{ github.sha }} ${{ steps.get-pm-version.outputs.PM_VERSION }} ${{ github.repository }} > build_info.json
- name: Upload release artifacts
uses: actions/upload-artifact@v2
with:
name: release_artifacts
path: |
${{ github.workspace }}/PocketMine-MP.phar
${{ github.workspace }}/start.*
${{ github.workspace }}/build_info.json
- name: Create draft release
uses: ncipollo/release-action@v1.8.6
with:
artifacts: ${{ github.workspace }}/PocketMine-MP.phar,${{ github.workspace }}/start.*,${{ github.workspace }}/build_info.json
commit: ${{ github.sha }}
draft: true
name: PocketMine-MP ${{ steps.get-pm-version.outputs.PM_VERSION }}
tag: ${{ steps.get-pm-version.outputs.PM_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
body: |
**For Minecraft: Bedrock Edition ${{ steps.get-pm-version.outputs.MCPE_VERSION }}**
Please see the [changelogs](/changelogs/${{ steps.get-pm-version.outputs.PM_VERSION_SHORT }}.md#${{ steps.get-pm-version.outputs.PM_VERSION_MD }}) for details.
- name: Upload preprocessor diffs
uses: actions/upload-artifact@v2
if: always()
with:
name: preprocessor_diffs
path: ${{ github.workspace }}/preprocessor_diff*.patch

View File

@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
image: [ubuntu-20.04]
php: [7.4.20]
php: [8.0.11]
steps:
- uses: actions/checkout@v2 #needed for build.sh
@ -37,7 +37,7 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [7.4.20]
php: [8.0.11]
steps:
- uses: actions/checkout@v2
@ -87,7 +87,7 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [7.4.20]
php: [8.0.11]
steps:
- uses: actions/checkout@v2
@ -137,7 +137,7 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [7.4.20]
php: [8.0.11]
steps:
- uses: actions/checkout@v2
@ -189,7 +189,7 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [7.4.20]
php: [8.0.11]
steps:
- uses: actions/checkout@v2
@ -243,7 +243,7 @@ jobs:
cp -r "$VENDOR_PM" "$VENDOR_PM_BACKUP"
for f in $(ls $VENDOR_PM/pocketmine); do
echo "Processing directory \"$f\"..."
php "$PM_PREPROCESSOR_PATH/PreProcessor.php" --path="$VENDOR_PM/pocketmine/$f" --multisize || (echo "Preprocessor exited with code $?" && exit 1)
php "$PM_PREPROCESSOR_PATH/PreProcessor.php" --path="$VENDOR_PM/pocketmine/$f/src" --multisize || (echo "Preprocessor exited with code $?" && exit 1)
echo "Checking for changes in \"$f\"..."
DIFF=$(git diff --no-index "$VENDOR_PM_BACKUP/pocketmine/$f" "$VENDOR_PM/pocketmine/$f" || true)
if [ "$DIFF" != "" ]; then
@ -272,9 +272,9 @@ jobs:
- uses: actions/checkout@v2
- name: Setup PHP and tools
uses: shivammathur/setup-php@2.9.0
uses: shivammathur/setup-php@2.12.0
with:
php-version: 7.4
php-version: 8.0
tools: php-cs-fixer
- name: Run PHP-CS-Fixer

View File

@ -22,8 +22,6 @@
declare(strict_types=1);
const VERSIONS = [
"7.3",
"7.4",
"8.0"
];

View File

@ -0,0 +1,45 @@
name: Update update.pmmp.io API info
on:
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install jq
run: sudo apt update && sudo apt install jq -y
- uses: actions/checkout@v2
with:
repository: pmmp/update.pmmp.io
ssh-key: ${{ secrets.UPDATE_PMMP_IO_DEPLOY_KEY }}
- name: Get actual tag name
id: tag-name
run: echo ::set-output name=TAG_NAME::$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{')
- name: Download new release information
run: curl -f -L ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ steps.tag-name.outputs.TAG_NAME }}/build_info.json -o new_build_info.json
- name: Detect channel
id: channel
run: echo ::set-output name=CHANNEL::$(jq -r '.channel' new_build_info.json)
- name: Copy release information
run: |
cp new_build_info.json channels/${{ steps.channel.outputs.CHANNEL }}.json
rm new_build_info.json
- name: Commit changes
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git diff-index --quiet HEAD || git commit -m "New ${{ steps.channel.outputs.CHANNEL }} release: ${{ github.repository }} ${{ steps.tag-name.outputs.TAG_NAME }}"
- name: Push changes
run: git push

View File

@ -41,13 +41,14 @@ return (new PhpCsFixer\Config)
],
'indentation_type' => true,
'native_function_invocation' => [
'scope' => 'namespaced'
'scope' => 'namespaced',
'include' => ['@all'],
],
'no_closing_tag' => true,
'no_empty_phpdoc' => true,
'no_extra_blank_lines' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'allow_mixed' => true,
],
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,

View File

@ -2,13 +2,13 @@
## Pre-requisites
- A bash shell (git bash is sufficient for Windows)
- [`git`](https://git-scm.com) available in your shell
- PHP 7.3 or newer available in your shell
- PHP 8.0 or newer available in your shell
- [`composer`](https://getcomposer.org) available in your shell
## Custom PHP binaries
Because PocketMine-MP requires several non-standard PHP extensions and configuration, PMMP provides scripts to build custom binaries for running PocketMine-MP, as well as prebuilt binaries.
- [Prebuilt binaries](https://jenkins.pmmp.io/job/PHP-7.4-Aggregate)
- [Prebuilt binaries](https://jenkins.pmmp.io/job/PHP-8.0-Aggregate)
- [Compile scripts](https://github.com/pmmp/php-build-scripts) are provided as a submodule in the path `build/php`
If you use a custom binary, you'll need to replace `composer` usages in this guide with `path/to/your/php path/to/your/composer.phar`.
@ -38,7 +38,7 @@ There is a bug in PHP that might cause an error which looks like this:
```
Fatal error: Uncaught BadMethodCallException: unable to create temporary file in PocketMine-MP/build/server-phar.php:119
```
You can work around it by setting `ulimit -n` to some bigger number, e.g. `8192`, or by updating your PHP version to at least 7.4.16 or 8.0.3.
You can work around it by setting `ulimit -n` to some bigger number, e.g. `8192`, or by updating your PHP version to at least 8.0.3.
## Running PocketMine-MP from source code
Run `src/pocketmine/PocketMine.php` using your preferred PHP binary.

View File

@ -2,125 +2,102 @@
# PocketMine-MP Contribution Guidelines
PocketMine-MP is an open source project, and contributions from the community are welcomed, as long as they comply with our quality standards and licensing.
## Creating an Issue
- If you are reporting a bug:
- **make sure that you are using the latest supported version** before opening an issue.
- **test it on a clean test server, WITHOUT PLUGINS**, to see if the issue still occurs. If not then it may be a plugin issue. Please also indicate the result of such tests.
- **[Search the issue tracker](https://github.com/pmmp/PocketMine-MP/issues?utf8=%E2%9C%93&q=is%3Aissue)** to check if anyone has already reported it, to avoid needlessly creating duplicate issues. Make sure you also check closed issues, as an issue you think is valid may already have been resolved.
- **Do not report plugin issues here.** If your issue is related to a plugin, contact the plugin's original author instead.
- **Support requests are not bugs.** Issues such as "How do I do this" are not bugs and will be closed. If you need help, please see [here](README.md#discussion) and do not misuse our issue tracker.
- **No generic titles** such as "Question", "Help", "Crash Report" etc. A good issue report provides a quick summary in the title. If you just got a crash report but you don't understand it, please look for a line starting with `Message`. It summarizes the bug.
- **Provide information in the issue body, not in the title.** No tags like `[BUG]` are allowed in the title, including `[SOLVED]` for solved issues.
- **No generic issue reports.** For bugs, it is the issue author's responsibility to provide us an issue that is **trackable, debuggable, reproducible, reported professionally and is an actual bug**.
<br>Valid issue reports must include instructions how to reproduce the issue or a crashdump/backtrace (unless the cause of the issue is obvious).
<br>**If you do not provide us with a summary or instructions on how to reproduce the issue, it will be treated as spam and will therefore be closed.**
<br>In simple words, if the issue cannot be properly confirmed to be valid or lacks required information, the issue will be closed until further information is provided.
- To express appreciation, objection, confusion or other supported reactions on pull requests, issues or comments on them, use GitHub [reactions](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) rather than posting an individual comment with an emoji only. This helps keeping the issue/pull request conversation clean and readable.
- If your issue is related to the PocketMine-MP website, forums, etc., please [talk to a human directly](README.md#discussion).
Code contributions must be submitted using [GitHub Pull Requests](https://github.com/pmmp/PocketMine-MP/pulls), where they will be reviewed by maintainers.
Small contributions (e.g. minor bug fixes) can be submitted as pull requests directly.
Larger contributions like feature additions should be preceded by a [Change Proposal](#rfcs--change-proposals) to allow maintainers and other people to discuss and decide if it's a good idea or not.
## Contributing
To contribute to the repository, [fork it on GitHub](https://github.com/pmmp/PocketMine-MP/fork), create a branch on your fork, and make your changes on your fork. You can then make a [pull request](https://github.com/pmmp/PocketMine-MP/pull/new) to the project to compare your branch to ours and propose your changes to our repository. We use the Pull Request system to allow members of the team to review changes before they are merged.
## Useful documentation from github.com
- [About pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)
- [About forks](https://docs.github.com/en/github/collaborating-with-pull-requests/working-with-forks/about-forks)
- [Creating a pull request from a fork](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
### Licensing
By proposing a pull request to the project, you agree to your code being distributed within PocketMine-MP under the [LGPL license](LICENSE).
## Other things you'll need
- [git](https://git-scm.com/)
### Contribution standards
- **We enforce a very high standard for contributions**. This is because PocketMine-MP and its related projects are used very widely in production. While this might seem like we are being mean at times, **our priority is what is best for PocketMine-MP itself**.
We try to ensure that our project's codebase is as clean as possible and ensure that only top-quality material makes it through to PocketMine-MP itself.
- **If a contribution does not meet our standards, changes may be requested or the pull request may be closed.**
## Making a pull request
The basic procedure to create a pull request is:
1. [Fork the repository on GitHub](https://github.com/pmmp/PocketMine-MP/fork). This gives you your own copy of the repository to make changes to.
2. Create a branch on your fork for your changes.
3. Make the changes you want to make on this branch.
4. You can then make a [pull request](https://github.com/pmmp/PocketMine-MP/pull/new) to the project.
### Pull requests
- **Create a new branch for each pull request.** Do not create a pull request with commits that exist in another pull request.
## Pull request reviews
Pull requests will be reviewed by maintainers when they are available.
Note that there might be a long wait time before a reviewer looks at your PR.
Depending on the changes, maintainers might ask you to make changes to the PR to fix problems or to improve the code.
**Do not delete your fork** while your pull request remains open, otherwise you won't be able to make any requested changes and the PR will end up being declined.
### Requirements
The following are required as a minimum for pull requests. PRs that don't meet these requirements will be declined unless updated to meet them.
#### Licensing
PocketMine-MP is licensed under [LGPLv3 license](LICENSE).
By proposing a pull request, you agree to your code being distributed within PocketMine-MP under the same license.
If you take code from other projects, that code MUST be licensed under an LGPL-compatible license.
#### PRs should be about exactly ONE thing
If you want to make multiple changes, those changes should each be contributed as separate pull requests. **DO NOT** mix unrelated changes.
#### PRs must not include unnecessary/unrelated changes
Do not include changes which aren't strictly necessary. This makes it harder to review a PR, because the code diff becomes larger and harder to review.
This means:
- don't reformat or rearrange existing code
- don't change things that aren't related to the PR's objective
- don't rewrite existing code just to make it "look nicer"
- don't change PhpDocs to native types in code you didn't write
#### Tests must be provided
Where possible, PHPUnit tests should be written for new or changed code.
If that's not possible (e.g. for in-game functionality), the code must be tested manually and details of the tests done must be provided.
**Simply saying "Tested" is not acceptable** and will lead to your PR being declined.
#### Comments and documentation must be written in American English
English is the shared languages of all current maintainers.
#### Code must be in the PocketMine-MP style
It's your responsibility to ensure your code matches the formatting and styling of the rest of the code.
If you use PhpStorm, a `Project` code style is provided, which you can use to automatically format new code.
You can also use [`php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to format your code.
### Recommendations
- **Do not edit code directly on github.com.** We recommend learning how to use [`git`](https://git-scm.com). `git` allows you to "clone" a repository onto your computer, so that you can make changes using an IDE.
- **Use an IDE, not a text editor.** We recommend PhpStorm or VSCode.
- **Create a new branch on your fork for each pull request.** This allows you to use the same fork to make multiple pull requests at the same time.
- **Use descriptive commit titles.** You can see an example [here](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
- **Do not include multiple unrelated changes in one commit.** An atomic style for commits is preferred - this means that changes included in a commit should be part of a single distinct change set. See [this link](https://www.freshconsulting.com/atomic-commits/) for more information on atomic commits. See the [documentation on `git add`](https://git-scm.com/docs/git-add) for information on how to isolate local changes for committing.
- **Your pull request will be checked and discussed in due time.** Since the team is scattered all around the world, your PR may not receive any attention for some time.
- **It is inadvisable to create large pull requests with lots of changes** unless this has been discussed with the team beforehand. Large pull requests are difficult to review, and such pull requests may end up being closed. The only exception is when all features in the pull request are related to each other, and share the same core changes.
- **You may be asked to rebase your pull request** if the branch becomes outdated and/or if possibly conflicting changes are made to the target branch. To see how to do this, read [this page](https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request).
- **Details should be provided of tests done.** Simply saying "Tested" or equivalent is not acceptable.
### Code contributions
- **Avoid committing changes directly on GitHub. This includes use of the web editor, and also uploading files.** The web editor lacks most useful GIT features and **should only be used for very minor changes**. It is immediately clear if the web editor has been used, and if so the PR is more likely to be rejected. If you want to make serious contributions, **please learn how to use [GIT version control](https://git-scm.com/)**.
- **Do not copy-paste code**. There are potential license issues implicit with copy-pasting, and copy-paste usually indicates a lack of understanding of the actual code. Copy-pasted code is obvious a mile off and **any PR like this is likely to be closed**. If you want to use somebody else's code from a Git repository, **use [GIT's cherry-pick feature](https://git-scm.com/docs/git-cherry-pick)** to cherry-pick the commit. **Cherry-picking is the politer way to copy somebody's changes** and retains all the original accreditation, so there is no need for copy-pasted commits with descriptions like `Some code, thanks @exampleperson`.
- **Make sure you can explain your changes**. If you can't provide a good explanation of changes, your PR may be rejected.
- **Code should use the same style as in PocketMine-MP.** See [below](#code-syntax) for an example.
- **The code must be clear** and written in English, comments included.
- **Do not make large pull requests without an RFC.** Large changes should be discussed beforehand using the [RFC / Change Proposal](#rfcs--change-proposals) process. Large changes are much harder to review and are more likely to be declined if maintainers don't have a good idea what you're trying to do in advance.
- **Do not copy-paste code**. There are potential license issues implicit with copy-pasting, and copy-paste usually indicates a lack of understanding of the actual code. Copy-pasted code is obvious a mile off and **any PR like this is likely to be closed**. If you want to use somebody else's code from a Git repository, **use [GIT's cherry-pick feature](https://git-scm.com/docs/git-cherry-pick)** to cherry-pick the commit.
**Thanks for contributing to PocketMine-MP!**
## RFCs / Change Proposals
Change Proposals are issues or discussions which describe a new feature proposal or behavioural change.
They are used to get feedback from maintainers and the community about an idea for a change, to decide whether or not it's a good idea.
### Submitting an RFC
RFCs should be submitted using Issues or Discussions.
RFCs _can_ be submitted as pull requests if you've already written the code, but this is not recommended, since it's not guaranteed that an RFC will pass, in which case your effort would be wasted.
### Code Syntax
RFCs should include the following:
- A summary of what you want to change
- Why you want to change it (e.g. what problems it solves)
- Alternative methods you've considered to solve the problem. This should include any possible ways that what you want can be done without the change.
It is mainly [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) with a few exceptions.
### Voting on RFCs
Community members can vote on RFCs. This gives maintainers an idea of how popular the idea is.
Votes can be cast using :+1: and :-1: reactions.
- Opening braces MUST go on the same line, and MUST NOT have spaces before.
- `else if` MUST be written as `elseif`. _(It is in PSR-2, but using a SHOULD)_
- Control structure keywords or opening braces MUST NOT have one space before or after them.
- Code MUST use tabs for indenting.
- Long arrays MAY be split across multiple lines, where each subsequent line is indented once.
- Files MUST use only the `<?php` tag.
- Files MUST NOT have an ending `?>` tag.
- Code MUST use namespaces.
- Strings SHOULD use the double quote `"` except when the single quote is required.
- All code SHOULD have parameter and type declarations where possible.
- Strict types SHOULD be enabled on new files where it is sensible to do so.
- All constant declarations SHOULD be preceded by a visibility modifier.
**Please don't downvote without providing a reason why!**
```php
<?php
### Implementing RFCs
Anyone can write the code to implement an RFC, and submit a pull request for it. It doesn't have to be the RFC author.
declare(strict_types=1);
namespace pocketmine\example;
class ExampleClass{
public const EXAMPLE_CLASS_CONSTANT = 1;
public $examplePublicVariable = "defaultValue";
private $examplePrivateVariable;
/**
* Creates an instance of ExampleClass
*
* @param string $firstArgument the first argument
* @param string|null $secondArgument default null
*/
public function __construct(string $firstArgument, ?string &$secondArgument = null){
if($firstArgument === "exampleValue"){ //Remember to use === instead of == when possible
//do things
}elseif($firstArgument === "otherValue"){
$secondArgument = function(){
$this->examplePrivateVariable = [
0 => "value1",
1 => "value2",
2 => "value3",
3 => "value4",
4 => "value5",
5 => "value6",
];
};
}
}
public function doStuff(string $stuff) : string{
return $stuff;
}
}
```
<!-- TODO: RFC and voting on the forums instead -->
### RFC and Voting
* These are big Pull Requests or contributions that change important behavior.
* RFCs will be tagged with the *Type: Request For Comments* label
* A vote will be held once the RFC is ready. All users can vote commenting on the Pull Request
* Comments MUST use "Yes" or "No" on the FIRST sentence to signify the vote, except when they don't want it to be counted.
* If your comment is a voting comment, specify the reason of your vote or it won't be counted.
* After voting has been closed, no further votes will be counted.
* An RFC will be rejected if less than 50% + 1 (simple majority) has voted Yes.
* If the RFC is approved, Team Members have the final word on its implementation or rejection.
* RFCs with complex voting options will specify the vote percentage or other details.
Implementations should be submitted as pull requests. The pull request description must include a link to the RFC.

View File

@ -1,13 +1,5 @@
# Security Policy
## Supported Versions
The following release lines are currently receiving active security updates and bug fixes:
| Version | Supported |
| -------- | ------------------ |
| 3.15.x | :white_check_mark: |
| < 3.15.0 | :x: |
## Reporting a Vulnerability
**DO NOT report vulnerabilities on the GitHub issue tracker.**

View File

@ -0,0 +1,43 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
require dirname(__DIR__) . '/vendor/autoload.php';
if(count($argv) !== 4){
fwrite(STDERR, "required args: <git hash> <tag name> <github repo (owner/name)>");
exit(1);
}
echo json_encode([
"php_version" => sprintf("%d.%d", PHP_MAJOR_VERSION, PHP_MINOR_VERSION),
"base_version" => \pocketmine\BASE_VERSION,
"build" => \pocketmine\BUILD_NUMBER,
"is_dev" => \pocketmine\IS_DEVELOPMENT_BUILD,
"channel" => \pocketmine\BUILD_CHANNEL,
"git_commit" => $argv[1],
"mcpe_version" => \pocketmine\network\mcpe\protocol\ProtocolInfo::MINECRAFT_VERSION_NETWORK,
"date" => time(), //TODO: maybe we should embed this in VersionInfo?
"details_url" => "https://github.com/$argv[3]/releases/tag/$argv[2]",
"download_url" => "https://github.com/$argv[3]/releases/download/$argv[2]/PocketMine-MP.phar",
"source_url" => "https://github.com/$argv[3]/tree/$argv[2]",
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";

View File

@ -24,20 +24,23 @@ declare(strict_types=1);
namespace pocketmine\build\make_release;
use pocketmine\utils\VersionString;
use function count;
use function dirname;
use function fgets;
use function file_get_contents;
use function file_put_contents;
use function fwrite;
use function preg_replace;
use function sleep;
use function sprintf;
use function system;
use const pocketmine\BASE_VERSION;
use const STDERR;
use const STDIN;
require_once dirname(__DIR__) . '/vendor/autoload.php';
function replaceVersion(string $versionInfoPath, string $newVersion, bool $isDev) : void{
function replaceVersion(string $versionInfoPath, string $newVersion, bool $isDev, string $channel) : void{
$versionInfo = file_get_contents($versionInfoPath);
$versionInfo = preg_replace(
$pattern = '/^const BASE_VERSION = "(\d+)\.(\d+)\.(\d+)(?:-(.*))?";$/m',
@ -49,6 +52,11 @@ function replaceVersion(string $versionInfoPath, string $newVersion, bool $isDev
'const IS_DEVELOPMENT_BUILD = ' . ($isDev ? 'true' : 'false') . ';',
$versionInfo
);
$versionInfo = preg_replace(
'/^const BUILD_CHANNEL = ".*";$/m',
'const BUILD_CHANNEL = "' . $channel . '";',
$versionInfo
);
file_put_contents($versionInfoPath, $versionInfo);
}
@ -57,8 +65,12 @@ function replaceVersion(string $versionInfoPath, string $newVersion, bool $isDev
* @phpstan-param list<string> $argv
*/
function main(array $argv) : void{
if(isset($argv[1])){
$currentVer = new VersionString($argv[1]);
if(count($argv) < 2){
fwrite(STDERR, "Arguments: <channel> [release version]\n");
exit(1);
}
if(isset($argv[2])){
$currentVer = new VersionString($argv[2]);
}else{
$currentVer = new VersionString(BASE_VERSION);
}
@ -69,6 +81,7 @@ function main(array $argv) : void{
$currentVer->getPatch() + 1
));
echo "About to tag version $currentVer. Next version will be $nextVer.\n";
echo "please add appropriate notes to the changelog and press enter...";
fgets(STDIN);
system('git add "' . dirname(__DIR__) . '/changelogs"');
@ -78,10 +91,10 @@ function main(array $argv) : void{
exit(1);
}
$versionInfoPath = dirname(__DIR__) . '/src/pocketmine/VersionInfo.php';
replaceVersion($versionInfoPath, $currentVer->getBaseVersion(), false);
replaceVersion($versionInfoPath, $currentVer->getBaseVersion(), false, $argv[1]);
system('git commit -m "Release ' . $currentVer->getBaseVersion() . '" --include "' . $versionInfoPath . '"');
system('git tag ' . $currentVer->getBaseVersion());
replaceVersion($versionInfoPath, $nextVer->getBaseVersion(), true);
replaceVersion($versionInfoPath, $nextVer->getBaseVersion(), true, "");
system('git add "' . $versionInfoPath . '"');
system('git commit -m "' . $nextVer->getBaseVersion() . ' is next" --include "' . $versionInfoPath . '"');
echo "pushing changes in 5 seconds\n";

View File

@ -9,3 +9,7 @@ Plugin developers should **only** update their required API to this version if y
# 3.21.0
- PHP 7.4 is now required as a minimum.
- A workaround for player movement added in 1.14.30 has been removed.
# 3.21.1
- Fixed so-called 'pot lag' - a bug that could occur when using items while rapidly switching hotbar slots.
- Plugins in crashdumps are now ordered alphabetically for easier reading.

36
changelogs/3.22.md Normal file
View File

@ -0,0 +1,36 @@
**For Minecraft: Bedrock Edition 1.17.10**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 3.x.y version will also run on these releases and do not need API bumps.
Plugin developers should **only** update their required API to this version if you need the changes in this build.
**WARNING: If your plugin uses the protocol, you're not shielded by API change constraints.** You should consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you do.
# 3.22.0
- Added support for Minecraft: Bedrock Edition 1.17.10.
- Removed compatibility with earlier versions.
# 3.22.1
- Added a giant yellow startup warning if using OPcache JIT on PHP 8.0. JIT is currently considered highly unstable and not recommended for production use.
- When using a bad PHP binary, the bootstrap will now report the used `php.ini` path. This can be useful for debugging issues with extension loading when the wrong `php.ini` file is loaded for some reason.
- Fixed `start.cmd` causing the wrong `php.ini` to be loaded on Windows when a global PHP installation is used.
- A debug message is now logged containing expected vs. actual XUID of players when an XUID mismatch is detected.
- Improved the documentation for `Player->getUniqueId()`.
- Fixed a mistake in the documentation of `PlayerAuthInputFlags`.
- Fixed incorrect encoding of `NpcDialoguePacket`.
# 3.22.2
- PHP 8.0 is now the primary supported version. PHP 7.4 is still supported for now, but it will be dropped in the coming weeks. It's recommended to start testing your servers on 8.0 now so you're ready.
- Fixed items in the crafting grid getting deleted on server-side disconnect or session timeout.
- A warning is now logged on startup if a debug build of PHP is used to run the server (because it has a significant performance impact).
- GitHub Actions is now used to build new releases, instead of Jenkins. You can see build logs [here](https://github.com/pmmp/PocketMine-MP/actions/workflows/draft-release.yml).
# 3.22.3
- Fixed a bug in the release build of 3.22.2 which caused the crash archive to reject all crashdumps.
- Fixed possible server crash during player spawning.
# 3.22.4
- Fixed a bug which broke the build of 3.22.3.
# 3.22.5
- Added a workaround for polyfilled solid-colour Persona skin replacements turning into a corrupted mess (caused by https://bugs.mojang.com/browse/MCPE-130275).

14
changelogs/3.23.md Normal file
View File

@ -0,0 +1,14 @@
**For Minecraft: Bedrock Edition 1.17.30**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 3.x.y version will also run on these releases and do not need API bumps.
Plugin developers should **only** update their required API to this version if you need the changes in this build.
**WARNING: If your plugin uses the protocol, you're not shielded by API change constraints.** You should consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you do.
# 3.23.0
- Added support for Minecraft: Bedrock Edition 1.17.30.
- Removed compatibility with earlier versions.
# 3.23.1
- Fixed broken build of 3.23.0.

12
changelogs/3.24.md Normal file
View File

@ -0,0 +1,12 @@
**For Minecraft: Bedrock Edition 1.17.30**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 3.x.y version will also run on these releases and do not need API bumps.
Plugin developers should **only** update their required API to this version if you need the changes in this build.
**WARNING: If your plugin uses the protocol, you're not shielded by API change constraints.** You should consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you do.
# 3.24.0
- PHP 8.0 is now required as a minimum.
- Fixed stats reporting checking the wrong `pocketmine.yml` property.
- Fixed `Projectile->move()` not respecting the given `dx`/`dy`/`dz` and using its own motion instead.

View File

@ -1,11 +1,11 @@
{
"name": "pocketmine/pocketmine-mp",
"description": "A server software for Minecraft: Pocket Edition written in PHP",
"description": "A server software for Minecraft: Bedrock Edition written in PHP",
"type": "project",
"homepage": "https://pmmp.io",
"license": "LGPL-3.0",
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.0",
"php-64bit": "*",
"ext-ctype": "*",
"ext-curl": "*",
@ -38,7 +38,7 @@
"pocketmine/spl": "^0.4.0"
},
"require-dev": {
"phpstan/phpstan": "0.12.89",
"phpstan/phpstan": "0.12.99",
"phpstan/phpstan-phpunit": "^0.12.6",
"phpstan/phpstan-strict-rules": "^0.12.2",
"phpunit/phpunit": "^9.2"
@ -60,14 +60,14 @@
},
"config": {
"platform": {
"php": "7.4.0"
"php": "8.0.0"
},
"sort-packages": true
},
"scripts": {
"make-devtools": "@php -dphar.readonly=0 tests/plugins/DevTools/src/DevTools/ConsoleScript.php --make tests/plugins/DevTools --out plugins/DevTools.phar",
"make-server": [
"@composer install --no-dev --classmap-authoritative",
"@composer install --no-dev --classmap-authoritative --ignore-platform-reqs",
"@php -dphar.readonly=0 build/server-phar.php"
]
}

165
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "29c660b8c4fd0708d270c63993de9526",
"content-hash": "cfba71d2ad0dd961ed00520b5d52e4d7",
"packages": [
{
"name": "adhocore/json-comment",
@ -617,16 +617,16 @@
},
{
"name": "nikic/php-parser",
"version": "v4.10.5",
"version": "v4.13.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "4432ba399e47c66624bc73c8c0f811e5c109576f"
"reference": "50953a2691a922aa1769461637869a0a2faa3f53"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4432ba399e47c66624bc73c8c0f811e5c109576f",
"reference": "4432ba399e47c66624bc73c8c0f811e5c109576f",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53",
"reference": "50953a2691a922aa1769461637869a0a2faa3f53",
"shasum": ""
},
"require": {
@ -667,22 +667,22 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v4.10.5"
"source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0"
},
"time": "2021-05-03T19:11:20+00:00"
"time": "2021-09-20T12:20:58+00:00"
},
{
"name": "phar-io/manifest",
"version": "2.0.1",
"version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/phar-io/manifest.git",
"reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133"
"reference": "97803eca37d319dfa7826cc2437fc020857acb53"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133",
"reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133",
"url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53",
"reference": "97803eca37d319dfa7826cc2437fc020857acb53",
"shasum": ""
},
"require": {
@ -727,9 +727,9 @@
"description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
"support": {
"issues": "https://github.com/phar-io/manifest/issues",
"source": "https://github.com/phar-io/manifest/tree/master"
"source": "https://github.com/phar-io/manifest/tree/2.0.3"
},
"time": "2020-06-27T14:33:11+00:00"
"time": "2021-07-20T11:28:43+00:00"
},
{
"name": "phar-io/version",
@ -893,16 +893,16 @@
},
{
"name": "phpdocumentor/type-resolver",
"version": "1.4.0",
"version": "1.5.1",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
"reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae",
"reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae",
"shasum": ""
},
"require": {
@ -910,7 +910,8 @@
"phpdocumentor/reflection-common": "^2.0"
},
"require-dev": {
"ext-tokenizer": "*"
"ext-tokenizer": "*",
"psalm/phar": "^4.8"
},
"type": "library",
"extra": {
@ -936,39 +937,39 @@
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0"
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1"
},
"time": "2020-09-17T18:55:26+00:00"
"time": "2021-10-02T14:08:47+00:00"
},
{
"name": "phpspec/prophecy",
"version": "1.13.0",
"version": "1.14.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "be1996ed8adc35c3fd795488a653f4b518be70ea"
"reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea",
"reference": "be1996ed8adc35c3fd795488a653f4b518be70ea",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
"reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.2",
"php": "^7.2 || ~8.0, <8.1",
"php": "^7.2 || ~8.0, <8.2",
"phpdocumentor/reflection-docblock": "^5.2",
"sebastian/comparator": "^3.0 || ^4.0",
"sebastian/recursion-context": "^3.0 || ^4.0"
},
"require-dev": {
"phpspec/phpspec": "^6.0",
"phpspec/phpspec": "^6.0 || ^7.0",
"phpunit/phpunit": "^8.0 || ^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.11.x-dev"
"dev-master": "1.x-dev"
}
},
"autoload": {
@ -1003,22 +1004,22 @@
],
"support": {
"issues": "https://github.com/phpspec/prophecy/issues",
"source": "https://github.com/phpspec/prophecy/tree/1.13.0"
"source": "https://github.com/phpspec/prophecy/tree/1.14.0"
},
"time": "2021-03-17T13:42:18+00:00"
"time": "2021-09-10T09:02:12+00:00"
},
{
"name": "phpstan/phpstan",
"version": "0.12.89",
"version": "0.12.99",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "54c0f5a6c30511b77128d58b6369f718df250542"
"reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/54c0f5a6c30511b77128d58b6369f718df250542",
"reference": "54c0f5a6c30511b77128d58b6369f718df250542",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/b4d40f1d759942f523be267a1bab6884f46ca3f7",
"reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7",
"shasum": ""
},
"require": {
@ -1049,7 +1050,7 @@
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/0.12.89"
"source": "https://github.com/phpstan/phpstan/tree/0.12.99"
},
"funding": [
{
@ -1069,34 +1070,33 @@
"type": "tidelift"
}
],
"time": "2021-06-09T20:23:49+00:00"
"time": "2021-09-12T20:09:55+00:00"
},
{
"name": "phpstan/phpstan-phpunit",
"version": "0.12.19",
"version": "0.12.22",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-phpunit.git",
"reference": "52f7072ddc5f81492f9d2de65a24813a48c90b18"
"reference": "7c01ef93bf128b4ac8bdad38c54b2a4fd6b0b3cc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/52f7072ddc5f81492f9d2de65a24813a48c90b18",
"reference": "52f7072ddc5f81492f9d2de65a24813a48c90b18",
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/7c01ef93bf128b4ac8bdad38c54b2a4fd6b0b3cc",
"reference": "7c01ef93bf128b4ac8bdad38c54b2a4fd6b0b3cc",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0",
"phpstan/phpstan": "^0.12.86"
"phpstan/phpstan": "^0.12.92"
},
"conflict": {
"phpunit/phpunit": "<7.0"
},
"require-dev": {
"phing/phing": "^2.16.3",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan-strict-rules": "^0.12.6",
"phpunit/phpunit": "^7.5.20"
"phpunit/phpunit": "^9.5"
},
"type": "phpstan-extension",
"extra": {
@ -1122,33 +1122,32 @@
"description": "PHPUnit extensions and rules for PHPStan",
"support": {
"issues": "https://github.com/phpstan/phpstan-phpunit/issues",
"source": "https://github.com/phpstan/phpstan-phpunit/tree/0.12.19"
"source": "https://github.com/phpstan/phpstan-phpunit/tree/0.12.22"
},
"time": "2021-04-30T11:10:37+00:00"
"time": "2021-08-12T10:53:43+00:00"
},
{
"name": "phpstan/phpstan-strict-rules",
"version": "0.12.9",
"version": "0.12.11",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-strict-rules.git",
"reference": "0705fefc7c9168529fd130e341428f5f10f4f01d"
"reference": "2b72e8e17d2034145f239126e876e5fb659675e2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/0705fefc7c9168529fd130e341428f5f10f4f01d",
"reference": "0705fefc7c9168529fd130e341428f5f10f4f01d",
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/2b72e8e17d2034145f239126e876e5fb659675e2",
"reference": "2b72e8e17d2034145f239126e876e5fb659675e2",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0",
"phpstan/phpstan": "^0.12.66"
"phpstan/phpstan": "^0.12.96"
},
"require-dev": {
"phing/phing": "^2.16.3",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan-phpunit": "^0.12.16",
"phpunit/phpunit": "^7.5.20"
"phpunit/phpunit": "^9.5"
},
"type": "phpstan-extension",
"extra": {
@ -1173,29 +1172,29 @@
"description": "Extra strict and opinionated rules for PHPStan",
"support": {
"issues": "https://github.com/phpstan/phpstan-strict-rules/issues",
"source": "https://github.com/phpstan/phpstan-strict-rules/tree/0.12.9"
"source": "https://github.com/phpstan/phpstan-strict-rules/tree/0.12.11"
},
"time": "2021-01-13T08:50:28+00:00"
"time": "2021-08-21T11:36:27+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "9.2.6",
"version": "9.2.7",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "f6293e1b30a2354e8428e004689671b83871edde"
"reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde",
"reference": "f6293e1b30a2354e8428e004689671b83871edde",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218",
"reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
"nikic/php-parser": "^4.10.2",
"nikic/php-parser": "^4.12.0",
"php": ">=7.3",
"phpunit/php-file-iterator": "^3.0.3",
"phpunit/php-text-template": "^2.0.2",
@ -1244,7 +1243,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7"
},
"funding": [
{
@ -1252,7 +1251,7 @@
"type": "github"
}
],
"time": "2021-03-28T07:26:59+00:00"
"time": "2021-09-17T05:39:03+00:00"
},
{
"name": "phpunit/php-file-iterator",
@ -1497,16 +1496,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.5.5",
"version": "9.5.10",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "89ff45ea9d70e35522fb6654a2ebc221158de276"
"reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/89ff45ea9d70e35522fb6654a2ebc221158de276",
"reference": "89ff45ea9d70e35522fb6654a2ebc221158de276",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a",
"reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a",
"shasum": ""
},
"require": {
@ -1518,11 +1517,11 @@
"ext-xml": "*",
"ext-xmlwriter": "*",
"myclabs/deep-copy": "^1.10.1",
"phar-io/manifest": "^2.0.1",
"phar-io/manifest": "^2.0.3",
"phar-io/version": "^3.0.2",
"php": ">=7.3",
"phpspec/prophecy": "^1.12.1",
"phpunit/php-code-coverage": "^9.2.3",
"phpunit/php-code-coverage": "^9.2.7",
"phpunit/php-file-iterator": "^3.0.5",
"phpunit/php-invoker": "^3.1.1",
"phpunit/php-text-template": "^2.0.3",
@ -1536,7 +1535,7 @@
"sebastian/global-state": "^5.0.1",
"sebastian/object-enumerator": "^4.0.3",
"sebastian/resource-operations": "^3.0.3",
"sebastian/type": "^2.3.2",
"sebastian/type": "^2.3.4",
"sebastian/version": "^3.0.2"
},
"require-dev": {
@ -1584,7 +1583,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.5"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10"
},
"funding": [
{
@ -1596,7 +1595,7 @@
"type": "github"
}
],
"time": "2021-06-05T04:49:07+00:00"
"time": "2021-09-25T07:38:51+00:00"
},
{
"name": "sebastian/cli-parser",
@ -2455,16 +2454,16 @@
},
{
"name": "sebastian/type",
"version": "2.3.2",
"version": "2.3.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
"reference": "0d1c587401514d17e8f9258a27e23527cb1b06c1"
"reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0d1c587401514d17e8f9258a27e23527cb1b06c1",
"reference": "0d1c587401514d17e8f9258a27e23527cb1b06c1",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914",
"reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914",
"shasum": ""
},
"require": {
@ -2499,7 +2498,7 @@
"homepage": "https://github.com/sebastianbergmann/type",
"support": {
"issues": "https://github.com/sebastianbergmann/type/issues",
"source": "https://github.com/sebastianbergmann/type/tree/2.3.2"
"source": "https://github.com/sebastianbergmann/type/tree/2.3.4"
},
"funding": [
{
@ -2507,7 +2506,7 @@
"type": "github"
}
],
"time": "2021-06-04T13:02:07+00:00"
"time": "2021-06-15T12:49:02+00:00"
},
{
"name": "sebastian/version",
@ -2643,16 +2642,16 @@
},
{
"name": "theseer/tokenizer",
"version": "1.2.0",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/theseer/tokenizer.git",
"reference": "75a63c33a8577608444246075ea0af0d052e452a"
"reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a",
"reference": "75a63c33a8577608444246075ea0af0d052e452a",
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
"reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
"shasum": ""
},
"require": {
@ -2681,7 +2680,7 @@
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"support": {
"issues": "https://github.com/theseer/tokenizer/issues",
"source": "https://github.com/theseer/tokenizer/tree/master"
"source": "https://github.com/theseer/tokenizer/tree/1.2.1"
},
"funding": [
{
@ -2689,7 +2688,7 @@
"type": "github"
}
],
"time": "2020-07-12T23:59:07+00:00"
"time": "2021-07-28T10:34:58+00:00"
},
{
"name": "webmozart/assert",
@ -2756,7 +2755,7 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "^7.4 || ^8.0",
"php": "^8.0",
"php-64bit": "*",
"ext-ctype": "*",
"ext-curl": "*",
@ -2779,7 +2778,7 @@
},
"platform-dev": [],
"platform-overrides": {
"php": "7.4.0"
"php": "8.0.0"
},
"plugin-api-version": "2.1.0"
}

View File

@ -9,6 +9,7 @@ includes:
- tests/phpstan/configs/phpunit-wiring-tests.neon
- tests/phpstan/configs/pthreads-bugs.neon
- tests/phpstan/configs/runtime-type-checks.neon
- tests/phpstan/configs/spl-fixed-array-sucks.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
@ -20,30 +21,32 @@ parameters:
bootstrapFiles:
- tests/phpstan/bootstrap.php
scanDirectories:
- tests/plugins/TesterPlugin
- build
- tests/plugins/TesterPlugin
scanFiles:
- src/pocketmine/PocketMine.php
- build/make-release.php
- build/server-phar.php
paths:
- build
- src
- build/make-release.php
- build/server-phar.php
- tests/phpunit
- tests/plugins/TesterPlugin
excludePaths:
analyseAndScan:
- build/php
- build/preprocessor
dynamicConstantNames:
- pocketmine\IS_DEVELOPMENT_BUILD
- pocketmine\DEBUG
- pocketmine\IS_DEVELOPMENT_BUILD
stubFiles:
- tests/phpstan/stubs/pthreads.stub
- tests/phpstan/stubs/chunkutils.stub
- tests/phpstan/stubs/leveldb.stub
- tests/phpstan/stubs/pthreads.stub
reportUnmatchedIgnoredErrors: false #no other way to silence platform-specific non-warnings
staticReflectionClassNamePatterns:
- "#^COM$#"
typeAliases:
#variadics don't work for this - mixed probably shouldn't work either, but for now it does
#what we actually need is something that accepts an infinite number of parameters, but in the absence of that,
#we'll just fill it with 10 - it's very unlikely to encounter a callable with 10 parameters anyway.
anyCallable: 'callable(mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed) : mixed'
anyClosure: '\Closure(mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed) : mixed'
#variadics don't work for this - mixed probably shouldn't work either, but for now it does
#what we actually need is something that accepts an infinite number of parameters, but in the absence of that,
#we'll just fill it with 10 - it's very unlikely to encounter a callable with 10 parameters anyway.
anyCallable: 'callable(never, never, never, never, never, never, never, never, never, never) : mixed'
anyClosure: '\Closure(never, never, never, never, never, never, never, never, never, never) : mixed'

View File

@ -46,6 +46,7 @@ use function is_dir;
use function is_resource;
use function json_encode;
use function json_last_error_msg;
use function ksort;
use function max;
use function microtime;
use function mkdir;
@ -81,6 +82,7 @@ use const FILE_IGNORE_NEW_LINES;
use const JSON_UNESCAPED_SLASHES;
use const PHP_EOL;
use const PHP_OS;
use const SORT_STRING;
class CrashDump{
@ -182,7 +184,9 @@ class CrashDump{
$this->addLine();
$this->addLine("Loaded plugins:");
$this->data["plugins"] = [];
foreach($this->server->getPluginManager()->getPlugins() as $p){
$plugins = $this->server->getPluginManager()->getPlugins();
ksort($plugins, SORT_STRING);
foreach($plugins as $p){
$d = $p->getDescription();
$this->data["plugins"][$d->getName()] = [
"name" => $d->getName(),

View File

@ -483,19 +483,14 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
}
/**
* Returns the player's UUID. This should be preferred over their Xbox user ID (XUID) because UUID is a standard
* format which will never change, and all players will have one regardless of whether they are logged into Xbox
* Live.
* Returns the player's UUID. This should be the preferred method to identify a player.
* It does not change if the player changes their username.
*
* The UUID is comprised of:
* - when logged into XBL: a hash of their XUID (and as such will not change for the lifetime of the XBL account)
* - when NOT logged into XBL: a hash of their name + clientID + secret device ID.
* All players will have a UUID, regardless of whether they are logged into Xbox Live or not. However, note that
* non-XBL players can fake their UUIDs.
*
* WARNING: UUIDs of players **not logged into Xbox Live** CAN BE FAKED and SHOULD NOT be trusted!
*
* (In the olden days this method used to return a fake UUID computed by the server, which was used by plugins such
* as SimpleAuth for authentication. This is NOT SAFE anymore as this UUID is now what was given by the client, NOT
* a server-computed UUID.)
* WARNING: DO NOT trust this before PlayerLoginEvent. Before PlayerLoginEvent, the player hasn't yet been
* authenticated, and any of their data might be faked.
*/
public function getUniqueId() : ?UUID{
return parent::getUniqueId();
@ -1078,7 +1073,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
* @return void
*/
public function doFirstSpawn(){
if($this->spawned){
if($this->spawned || !$this->constructed){
return; //avoid player spawning twice (this can only happen on 3.x with a custom malicious client)
}
$this->spawned = true;
@ -1981,17 +1976,19 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
base64_decode($packet->clientData["CapeData"] ?? "", true)
),
base64_decode($packet->clientData["SkinGeometryData"] ?? "", true),
base64_decode($packet->clientData["SkinGeometryDataEngineVersion"], true),
base64_decode($packet->clientData["SkinAnimationData"] ?? "", true),
$packet->clientData["PremiumSkin"] ?? false,
$packet->clientData["PersonaSkin"] ?? false,
$packet->clientData["CapeOnClassicSkin"] ?? false,
$packet->clientData["CapeId"] ?? "",
null,
$packet->clientData["ArmSize"] ?? SkinData::ARM_SIZE_WIDE,
$packet->clientData["SkinColor"] ?? "",
$personaPieces,
$pieceTintColors,
true
true,
$packet->clientData["PremiumSkin"] ?? false,
$packet->clientData["PersonaSkin"] ?? false,
$packet->clientData["CapeOnClassicSkin"] ?? false,
true, //assume this is true? there's no field for it ...
);
try{
@ -2087,6 +2084,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$checkXUID = (bool) $this->server->getProperty("player.verify-xuid", true);
$kickForXUIDMismatch = function(string $xuid) use ($checkXUID) : bool{
if($checkXUID && $this->xuid !== $xuid){
$this->server->getLogger()->debug($this->getName() . " XUID mismatch: expected '$xuid', but got '$this->xuid'");
if($this->kick("XUID does not match (possible impersonation attempt)", false)){
//TODO: Longer term, we should be identifying playerdata using something more reliable, like XUID or UUID.
//However, that would be a very disruptive change, so this will serve as a stopgap for now.
@ -2529,6 +2527,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$blockVector = $packet->trData->getBlockPos();
$face = $packet->trData->getFace();
if($this->inventory->getHeldItemIndex() !== $packet->trData->getHotbarSlot()){
$this->inventory->equipItem($packet->trData->getHotbarSlot());
}
switch($packet->trData->getActionType()){
case UseItemTransactionData::ACTION_CLICK_BLOCK:
//TODO: start hack for client spam bug
@ -2687,6 +2689,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
return false;
}
if($this->inventory->getHeldItemIndex() !== $packet->trData->getHotbarSlot()){
$this->inventory->equipItem($packet->trData->getHotbarSlot());
}
switch($packet->trData->getActionType()){
case UseItemOnEntityTransactionData::ACTION_INTERACT:
break; //TODO
@ -2778,6 +2784,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->inventory->sendContents($this);
return false;
}elseif($packet->trData instanceof ReleaseItemTransactionData){
if($this->inventory->getHeldItemIndex() !== $packet->trData->getHotbarSlot()){
$this->inventory->equipItem($packet->trData->getHotbarSlot());
}
try{
switch($packet->trData->getActionType()){
case ReleaseItemTransactionData::ACTION_RELEASE:
@ -3697,6 +3707,8 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->stopSleep();
if($this->spawned){
$this->doCloseInventory();
$ev = new PlayerQuitEvent($this, $message, $reason);
$ev->call();
if($ev->getQuitMessage() != ""){

View File

@ -36,7 +36,7 @@ namespace pocketmine {
require_once __DIR__ . '/VersionInfo.php';
const MIN_PHP_VERSION = "7.4.0";
const MIN_PHP_VERSION = "8.0.0";
/**
* @param string $message
@ -127,6 +127,9 @@ namespace pocketmine {
* @return void
*/
function emit_performance_warnings(\Logger $logger){
if(PHP_DEBUG !== 0){
$logger->warning("This PHP binary was compiled in debug mode. This has a major impact on performance.");
}
if(extension_loaded("xdebug")){
$logger->warning("Xdebug extension is enabled. This has a major impact on performance.");
}
@ -139,6 +142,24 @@ namespace pocketmine {
if(\Phar::running(true) === ""){
$logger->warning("Non-packaged installation detected. This will degrade autoloading speed and make startup times longer.");
}
if(function_exists('opcache_get_status') && ($opcacheStatus = opcache_get_status(false)) !== false){
$jitEnabled = $opcacheStatus["jit"]["on"] ?? false;
if($jitEnabled !== false){
$logger->warning(<<<'JIT_WARNING'
--------------------------------------- ! WARNING ! ---------------------------------------
You're using PHP 8.0 with JIT enabled. This provides significant performance improvements.
HOWEVER, it is EXPERIMENTAL, and has already been seen to cause weird and unexpected bugs.
Proceed with caution.
If you want to report any bugs, make sure to mention that you are using PHP 8.0 with JIT.
To turn off JIT, change `opcache.jit` to `0` in your php.ini file.
-------------------------------------------------------------------------------------------
JIT_WARNING
);
}
}
}
/**
@ -159,10 +180,12 @@ namespace pocketmine {
if(count($messages = check_platform_dependencies()) > 0){
echo PHP_EOL;
$binary = version_compare(PHP_VERSION, "5.4") >= 0 ? PHP_BINARY : "unknown";
critical_error("Selected PHP binary ($binary) does not satisfy some requirements.");
critical_error("Selected PHP binary does not satisfy some requirements.");
foreach($messages as $m){
echo " - $m" . PHP_EOL;
}
critical_error("PHP binary used: " . $binary);
critical_error("Loaded php.ini: " . (($file = php_ini_loaded_file()) !== false ? $file : "none"));
critical_error("Please recompile PHP with the needed configuration, or refer to the installation instructions at http://pmmp.rtfd.io/en/rtfd/installation.html.");
echo PHP_EOL;
exit(1);

View File

@ -1961,7 +1961,7 @@ class Server{
$this->network->blockAddress($entry->getName(), -1);
}
if((bool) $this->getProperty("settings.send-usage", true)){
if((bool) $this->getProperty("anonymous-statistics.enabled", true)){
$this->sendUsageTicker = 6000;
$this->sendUsage(SendUsageTask::TYPE_OPEN);
}

View File

@ -33,6 +33,7 @@ if(defined('pocketmine\_VERSION_INFO_INCLUDED')){
const _VERSION_INFO_INCLUDED = true;
const NAME = "PocketMine-MP";
const BASE_VERSION = "3.21.0";
const BASE_VERSION = "3.24.0";
const IS_DEVELOPMENT_BUILD = false;
const BUILD_NUMBER = 0;
const BUILD_CHANNEL = "stable";

View File

@ -32,7 +32,6 @@ use function fstat;
use function is_resource;
use function microtime;
use function preg_replace;
use function readline;
use function stream_isatty;
use function stream_select;
use function trim;

View File

@ -180,7 +180,7 @@ abstract class Projectile extends Entity{
Timings::$entityMoveTimer->startTiming();
$start = $this->asVector3();
$end = $start->add($this->motion);
$end = $start->add($dx, $dy, $dz);
$blockHit = null;
$entityHit = null;

View File

@ -36,78 +36,79 @@ abstract class Particle extends Vector3{
public const TYPE_EXPLODE = 6;
public const TYPE_EVAPORATION = 7;
public const TYPE_FLAME = 8;
public const TYPE_LAVA = 9;
public const TYPE_LARGE_SMOKE = 10;
public const TYPE_REDSTONE = 11;
public const TYPE_RISING_RED_DUST = 12;
public const TYPE_ITEM_BREAK = 13;
public const TYPE_SNOWBALL_POOF = 14;
public const TYPE_HUGE_EXPLODE = 15;
public const TYPE_HUGE_EXPLODE_SEED = 16;
public const TYPE_MOB_FLAME = 17;
public const TYPE_HEART = 18;
public const TYPE_TERRAIN = 19;
public const TYPE_SUSPENDED_TOWN = 20, TYPE_TOWN_AURA = 20;
public const TYPE_PORTAL = 21;
//22 same as 21
public const TYPE_SPLASH = 23, TYPE_WATER_SPLASH = 23;
public const TYPE_WATER_SPLASH_MANUAL = 24;
public const TYPE_WATER_WAKE = 25;
public const TYPE_DRIP_WATER = 26;
public const TYPE_DRIP_LAVA = 27;
public const TYPE_DRIP_HONEY = 28;
public const TYPE_STALACTITE_DRIP_WATER = 29;
public const TYPE_STALACTITE_DRIP_LAVA = 30;
public const TYPE_FALLING_DUST = 31, TYPE_DUST = 31;
public const TYPE_MOB_SPELL = 32;
public const TYPE_MOB_SPELL_AMBIENT = 33;
public const TYPE_MOB_SPELL_INSTANTANEOUS = 34;
public const TYPE_INK = 35;
public const TYPE_SLIME = 36;
public const TYPE_RAIN_SPLASH = 37;
public const TYPE_VILLAGER_ANGRY = 38;
public const TYPE_VILLAGER_HAPPY = 39;
public const TYPE_ENCHANTMENT_TABLE = 40;
public const TYPE_TRACKING_EMITTER = 41;
public const TYPE_NOTE = 42;
public const TYPE_WITCH_SPELL = 43;
public const TYPE_CARROT = 44;
public const TYPE_MOB_APPEARANCE = 45;
public const TYPE_END_ROD = 46;
public const TYPE_DRAGONS_BREATH = 47;
public const TYPE_SPIT = 48;
public const TYPE_TOTEM = 49;
public const TYPE_FOOD = 50;
public const TYPE_FIREWORKS_STARTER = 51;
public const TYPE_FIREWORKS_SPARK = 52;
public const TYPE_FIREWORKS_OVERLAY = 53;
public const TYPE_BALLOON_GAS = 54;
public const TYPE_COLORED_FLAME = 55;
public const TYPE_SPARKLER = 56;
public const TYPE_CONDUIT = 57;
public const TYPE_BUBBLE_COLUMN_UP = 58;
public const TYPE_BUBBLE_COLUMN_DOWN = 59;
public const TYPE_SNEEZE = 60;
public const TYPE_SHULKER_BULLET = 61;
public const TYPE_BLEACH = 62;
public const TYPE_DRAGON_DESTROY_BLOCK = 63;
public const TYPE_MYCELIUM_DUST = 64;
public const TYPE_FALLING_RED_DUST = 65;
public const TYPE_CAMPFIRE_SMOKE = 66;
public const TYPE_TALL_CAMPFIRE_SMOKE = 67;
public const TYPE_DRAGON_BREATH_FIRE = 68;
public const TYPE_DRAGON_BREATH_TRAIL = 69;
public const TYPE_BLUE_FLAME = 70;
public const TYPE_SOUL = 71;
public const TYPE_OBSIDIAN_TEAR = 72;
public const TYPE_PORTAL_REVERSE = 73;
public const TYPE_SNOWFLAKE = 74;
public const TYPE_VIBRATION_SIGNAL = 75;
public const TYPE_SCULK_SENSOR_REDSTONE = 76;
public const TYPE_SPORE_BLOSSOM_SHOWER = 77;
public const TYPE_SPORE_BLOSSOM_AMBIENT = 78;
public const TYPE_WAX = 79;
public const TYPE_ELECTRIC_SPARK = 80;
public const TYPE_CANDLE_FLAME = 9;
public const TYPE_LAVA = 10;
public const TYPE_LARGE_SMOKE = 11;
public const TYPE_REDSTONE = 12;
public const TYPE_RISING_RED_DUST = 13;
public const TYPE_ITEM_BREAK = 14;
public const TYPE_SNOWBALL_POOF = 15;
public const TYPE_HUGE_EXPLODE = 16;
public const TYPE_HUGE_EXPLODE_SEED = 17;
public const TYPE_MOB_FLAME = 18;
public const TYPE_HEART = 19;
public const TYPE_TERRAIN = 20;
public const TYPE_SUSPENDED_TOWN = 21, TYPE_TOWN_AURA = 21;
public const TYPE_PORTAL = 22;
//23 same as 22
public const TYPE_SPLASH = 24, TYPE_WATER_SPLASH = 24;
public const TYPE_WATER_SPLASH_MANUAL = 25;
public const TYPE_WATER_WAKE = 26;
public const TYPE_DRIP_WATER = 27;
public const TYPE_DRIP_LAVA = 28;
public const TYPE_DRIP_HONEY = 29;
public const TYPE_STALACTITE_DRIP_WATER = 30;
public const TYPE_STALACTITE_DRIP_LAVA = 31;
public const TYPE_FALLING_DUST = 32, TYPE_DUST = 32;
public const TYPE_MOB_SPELL = 33;
public const TYPE_MOB_SPELL_AMBIENT = 34;
public const TYPE_MOB_SPELL_INSTANTANEOUS = 35;
public const TYPE_INK = 36;
public const TYPE_SLIME = 37;
public const TYPE_RAIN_SPLASH = 38;
public const TYPE_VILLAGER_ANGRY = 39;
public const TYPE_VILLAGER_HAPPY = 40;
public const TYPE_ENCHANTMENT_TABLE = 41;
public const TYPE_TRACKING_EMITTER = 42;
public const TYPE_NOTE = 43;
public const TYPE_WITCH_SPELL = 44;
public const TYPE_CARROT = 45;
public const TYPE_MOB_APPEARANCE = 46;
public const TYPE_END_ROD = 47;
public const TYPE_DRAGONS_BREATH = 48;
public const TYPE_SPIT = 49;
public const TYPE_TOTEM = 50;
public const TYPE_FOOD = 51;
public const TYPE_FIREWORKS_STARTER = 52;
public const TYPE_FIREWORKS_SPARK = 53;
public const TYPE_FIREWORKS_OVERLAY = 54;
public const TYPE_BALLOON_GAS = 55;
public const TYPE_COLORED_FLAME = 56;
public const TYPE_SPARKLER = 57;
public const TYPE_CONDUIT = 58;
public const TYPE_BUBBLE_COLUMN_UP = 59;
public const TYPE_BUBBLE_COLUMN_DOWN = 60;
public const TYPE_SNEEZE = 61;
public const TYPE_SHULKER_BULLET = 62;
public const TYPE_BLEACH = 63;
public const TYPE_DRAGON_DESTROY_BLOCK = 64;
public const TYPE_MYCELIUM_DUST = 65;
public const TYPE_FALLING_RED_DUST = 66;
public const TYPE_CAMPFIRE_SMOKE = 67;
public const TYPE_TALL_CAMPFIRE_SMOKE = 68;
public const TYPE_DRAGON_BREATH_FIRE = 69;
public const TYPE_DRAGON_BREATH_TRAIL = 70;
public const TYPE_BLUE_FLAME = 71;
public const TYPE_SOUL = 72;
public const TYPE_OBSIDIAN_TEAR = 73;
public const TYPE_PORTAL_REVERSE = 74;
public const TYPE_SNOWFLAKE = 75;
public const TYPE_VIBRATION_SIGNAL = 76;
public const TYPE_SCULK_SENSOR_REDSTONE = 77;
public const TYPE_SPORE_BLOSSOM_SHOWER = 78;
public const TYPE_SPORE_BLOSSOM_AMBIENT = 79;
public const TYPE_WAX = 80;
public const TYPE_ELECTRIC_SPARK = 81;
/**
* @return DataPacket|DataPacket[]

View File

@ -105,10 +105,8 @@ class NetworkBinaryStream extends BinaryStream{
}
$capeData = $this->getSkinImage();
$geometryData = $this->getString();
$geometryDataVersion = $this->getString();
$animationData = $this->getString();
$premium = $this->getBool();
$persona = $this->getBool();
$capeOnClassic = $this->getBool();
$capeId = $this->getString();
$fullSkinId = $this->getString();
$armSize = $this->getString();
@ -137,8 +135,12 @@ class NetworkBinaryStream extends BinaryStream{
$colors
);
}
$premium = $this->getBool();
$persona = $this->getBool();
$capeOnClassic = $this->getBool();
$isPrimaryUser = $this->getBool();
return new SkinData($skinId, $skinPlayFabId, $skinResourcePatch, $skinData, $animations, $capeData, $geometryData, $animationData, $premium, $persona, $capeOnClassic, $capeId, $fullSkinId, $armSize, $skinColor, $personaPieces, $pieceTintColors);
return new SkinData($skinId, $skinPlayFabId, $skinResourcePatch, $skinData, $animations, $capeData, $geometryData, $geometryDataVersion, $animationData, $capeId, $fullSkinId, $armSize, $skinColor, $personaPieces, $pieceTintColors, true, $premium, $persona, $capeOnClassic, $isPrimaryUser);
}
/**
@ -158,10 +160,8 @@ class NetworkBinaryStream extends BinaryStream{
}
$this->putSkinImage($skin->getCapeImage());
$this->putString($skin->getGeometryData());
$this->putString($skin->getGeometryDataEngineVersion());
$this->putString($skin->getAnimationData());
$this->putBool($skin->isPremium());
$this->putBool($skin->isPersona());
$this->putBool($skin->isPersonaCapeOnClassic());
$this->putString($skin->getCapeId());
$this->putString($skin->getFullSkinId());
$this->putString($skin->getArmSize());
@ -182,6 +182,10 @@ class NetworkBinaryStream extends BinaryStream{
$this->putString($color);
}
}
$this->putBool($skin->isPremium());
$this->putBool($skin->isPersona());
$this->putBool($skin->isPersonaCapeOnClassic());
$this->putBool($skin->isPrimaryUser());
}
private function getSkinImage() : SkinImage{

View File

@ -66,11 +66,13 @@ use pocketmine\network\mcpe\protocol\ContainerSetDataPacket;
use pocketmine\network\mcpe\protocol\CorrectPlayerMovePredictionPacket;
use pocketmine\network\mcpe\protocol\CraftingDataPacket;
use pocketmine\network\mcpe\protocol\CraftingEventPacket;
use pocketmine\network\mcpe\protocol\CreatePhotoPacket;
use pocketmine\network\mcpe\protocol\CreativeContentPacket;
use pocketmine\network\mcpe\protocol\DataPacket;
use pocketmine\network\mcpe\protocol\DebugInfoPacket;
use pocketmine\network\mcpe\protocol\DisconnectPacket;
use pocketmine\network\mcpe\protocol\EducationSettingsPacket;
use pocketmine\network\mcpe\protocol\EduUriResourcePacket;
use pocketmine\network\mcpe\protocol\EmoteListPacket;
use pocketmine\network\mcpe\protocol\EmotePacket;
use pocketmine\network\mcpe\protocol\EventPacket;
@ -110,9 +112,11 @@ use pocketmine\network\mcpe\protocol\MultiplayerSettingsPacket;
use pocketmine\network\mcpe\protocol\NetworkChunkPublisherUpdatePacket;
use pocketmine\network\mcpe\protocol\NetworkSettingsPacket;
use pocketmine\network\mcpe\protocol\NetworkStackLatencyPacket;
use pocketmine\network\mcpe\protocol\NpcDialoguePacket;
use pocketmine\network\mcpe\protocol\NpcRequestPacket;
use pocketmine\network\mcpe\protocol\OnScreenTextureAnimationPacket;
use pocketmine\network\mcpe\protocol\PacketViolationWarningPacket;
use pocketmine\network\mcpe\protocol\PhotoInfoRequestPacket;
use pocketmine\network\mcpe\protocol\PhotoTransferPacket;
use pocketmine\network\mcpe\protocol\PlayerActionPacket;
use pocketmine\network\mcpe\protocol\PlayerArmorDamagePacket;
@ -166,6 +170,7 @@ use pocketmine\network\mcpe\protocol\ShowCreditsPacket;
use pocketmine\network\mcpe\protocol\ShowProfilePacket;
use pocketmine\network\mcpe\protocol\ShowStoreOfferPacket;
use pocketmine\network\mcpe\protocol\SimpleEventPacket;
use pocketmine\network\mcpe\protocol\SimulationTypePacket;
use pocketmine\network\mcpe\protocol\SpawnExperienceOrbPacket;
use pocketmine\network\mcpe\protocol\SpawnParticleEffectPacket;
use pocketmine\network\mcpe\protocol\StartGamePacket;
@ -185,6 +190,7 @@ use pocketmine\network\mcpe\protocol\UpdateBlockSyncedPacket;
use pocketmine\network\mcpe\protocol\UpdateEquipPacket;
use pocketmine\network\mcpe\protocol\UpdatePlayerGameTypePacket;
use pocketmine\network\mcpe\protocol\UpdateSoftEnumPacket;
use pocketmine\network\mcpe\protocol\UpdateSubChunkBlocksPacket;
use pocketmine\network\mcpe\protocol\UpdateTradePacket;
abstract class NetworkSession{
@ -841,4 +847,28 @@ abstract class NetworkSession{
public function handleRemoveVolumeEntity(RemoveVolumeEntityPacket $packet) : bool{
return false;
}
public function handleSimulationType(SimulationTypePacket $packet) : bool{
return false;
}
public function handleNpcDialogue(NpcDialoguePacket $packet) : bool{
return false;
}
public function handleEduUriResource(EduUriResourcePacket $packet) : bool{
return false;
}
public function handleCreatePhoto(CreatePhotoPacket $packet) : bool{
return false;
}
public function handleUpdateSubChunkBlocks(UpdateSubChunkBlocksPacket $packet) : bool{
return false;
}
public function handlePhotoInfoRequest(PhotoInfoRequestPacket $packet) : bool{
return false;
}
}

View File

@ -34,15 +34,19 @@ class ActorPickRequestPacket extends DataPacket{
public $entityUniqueId;
/** @var int */
public $hotbarSlot;
/** @var bool */
public $addUserData;
protected function decodePayload(){
$this->entityUniqueId = $this->getLLong();
$this->hotbarSlot = $this->getByte();
$this->addUserData = $this->getBool();
}
protected function encodePayload(){
$this->putLLong($this->entityUniqueId);
$this->putByte($this->hotbarSlot);
$this->putBool($this->addUserData);
}
public function handle(NetworkSession $session) : bool{

View File

@ -36,11 +36,14 @@ class AddVolumeEntityPacket extends DataPacket{
private $entityNetId;
/** @var CompoundTag */
private $data;
/** @var string */
private $engineVersion;
public static function create(int $entityNetId, CompoundTag $data) : self{
public static function create(int $entityNetId, CompoundTag $data, string $engineVersion) : self{
$result = new self;
$result->entityNetId = $entityNetId;
$result->data = $data;
$result->engineVersion = $engineVersion;
return $result;
}
@ -48,14 +51,18 @@ class AddVolumeEntityPacket extends DataPacket{
public function getData() : CompoundTag{ return $this->data; }
public function getEngineVersion() : string{ return $this->engineVersion; }
protected function decodePayload() : void{
$this->entityNetId = $this->getUnsignedVarInt();
$this->data = $this->getNbtCompoundRoot();
$this->engineVersion = $this->getString();
}
protected function encodePayload() : void{
$this->putUnsignedVarInt($this->entityNetId);
$this->put((new NetworkLittleEndianNBTStream())->write($this->data));
$this->putString($this->engineVersion);
}
public function handle(NetworkSession $handler) : bool{

View File

@ -37,6 +37,8 @@ class AnimateEntityPacket extends DataPacket/* implements ClientboundPacket*/{
private $nextState;
/** @var string */
private $stopExpression;
/** @var int */
private $stopExpressionVersion;
/** @var string */
private $controller;
/** @var float */
@ -51,11 +53,12 @@ class AnimateEntityPacket extends DataPacket/* implements ClientboundPacket*/{
* @param int[] $actorRuntimeIds
* @phpstan-param list<int> $actorRuntimeIds
*/
public static function create(string $animation, string $nextState, string $stopExpression, string $controller, float $blendOutTime, array $actorRuntimeIds) : self{
public static function create(string $animation, string $nextState, string $stopExpression, int $stopExpressionVersion, string $controller, float $blendOutTime, array $actorRuntimeIds) : self{
$result = new self;
$result->animation = $animation;
$result->nextState = $nextState;
$result->stopExpression = $stopExpression;
$result->stopExpressionVersion = $stopExpressionVersion;
$result->controller = $controller;
$result->blendOutTime = $blendOutTime;
$result->actorRuntimeIds = $actorRuntimeIds;
@ -68,6 +71,8 @@ class AnimateEntityPacket extends DataPacket/* implements ClientboundPacket*/{
public function getStopExpression() : string{ return $this->stopExpression; }
public function getStopExpressionVersion() : int{ return $this->stopExpressionVersion; }
public function getController() : string{ return $this->controller; }
public function getBlendOutTime() : float{ return $this->blendOutTime; }
@ -82,6 +87,7 @@ class AnimateEntityPacket extends DataPacket/* implements ClientboundPacket*/{
$this->animation = $this->getString();
$this->nextState = $this->getString();
$this->stopExpression = $this->getString();
$this->stopExpressionVersion = $this->getLInt();
$this->controller = $this->getString();
$this->blendOutTime = $this->getLFloat();
$this->actorRuntimeIds = [];
@ -94,6 +100,7 @@ class AnimateEntityPacket extends DataPacket/* implements ClientboundPacket*/{
$this->putString($this->animation);
$this->putString($this->nextState);
$this->putString($this->stopExpression);
$this->putLInt($this->stopExpressionVersion);
$this->putString($this->controller);
$this->putLFloat($this->blendOutTime);
$this->putUnsignedVarInt(count($this->actorRuntimeIds));

View File

@ -281,7 +281,7 @@ class AvailableCommandsPacket extends DataPacket{
$retval = new CommandData();
$retval->commandName = $this->getString();
$retval->commandDescription = $this->getString();
$retval->flags = $this->getByte();
$retval->flags = $this->getLShort();
$retval->permission = $this->getByte();
$retval->aliases = $enums[$this->getLInt()] ?? null;
@ -324,7 +324,7 @@ class AvailableCommandsPacket extends DataPacket{
protected function putCommandData(CommandData $data, array $enumIndexes, array $postfixIndexes) : void{
$this->putString($data->commandName);
$this->putString($data->commandDescription);
$this->putByte($data->flags);
$this->putLShort($data->flags);
$this->putByte($data->permission);
if($data->aliases !== null){

View File

@ -32,6 +32,8 @@ use pocketmine\item\ItemFactory;
use pocketmine\network\mcpe\convert\ItemTranslator;
use pocketmine\network\mcpe\NetworkBinaryStream;
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\protocol\types\MaterialReducerRecipe;
use pocketmine\network\mcpe\protocol\types\MaterialReducerRecipeOutput;
use pocketmine\network\mcpe\protocol\types\PotionContainerChangeRecipe;
use pocketmine\network\mcpe\protocol\types\PotionTypeRecipe;
#ifndef COMPILE
@ -58,6 +60,8 @@ class CraftingDataPacket extends DataPacket{
public $potionTypeRecipes = [];
/** @var PotionContainerChangeRecipe[] */
public $potionContainerRecipes = [];
/** @var MaterialReducerRecipe[] */
public $materialReducerRecipes = [];
/** @var bool */
public $cleanRecipes = false;
@ -169,6 +173,17 @@ class CraftingDataPacket extends DataPacket{
[$output, ] = ItemTranslator::getInstance()->fromNetworkId($outputIdNet, 0);
$this->potionContainerRecipes[] = new PotionContainerChangeRecipe($input, $ingredient, $output);
}
for($i = 0, $count = $this->getUnsignedVarInt(); $i < $count; ++$i){
$inputIdAndData = $this->getVarInt();
[$inputId, $inputMeta] = [$inputIdAndData >> 16, $inputIdAndData & 0x7fff];
$outputs = [];
for($j = 0, $outputCount = $this->getUnsignedVarInt(); $j < $outputCount; ++$j){
$outputItemId = $this->getVarInt();
$outputItemCount = $this->getVarInt();
$outputs[] = new MaterialReducerRecipeOutput($outputItemId, $outputItemCount);
}
$this->materialReducerRecipes[] = new MaterialReducerRecipe($inputId, $inputMeta, $outputs);
}
$this->cleanRecipes = $this->getBool();
}
@ -301,6 +316,15 @@ class CraftingDataPacket extends DataPacket{
$this->putVarInt($recipe->getIngredientItemId());
$this->putVarInt($recipe->getOutputItemId());
}
$this->putUnsignedVarInt(count($this->materialReducerRecipes));
foreach($this->materialReducerRecipes as $recipe){
$this->putVarInt(($recipe->getInputItemId() << 16) | $recipe->getInputItemMeta());
$this->putUnsignedVarInt(count($recipe->getOutputs()));
foreach($recipe->getOutputs() as $output){
$this->putVarInt($output->getItemId());
$this->putVarInt($output->getCount());
}
}
$this->putBool($this->cleanRecipes);
}

View File

@ -0,0 +1,69 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
class CreatePhotoPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::CREATE_PHOTO_PACKET;
private int $entityUniqueId;
private string $photoName;
private string $photoItemName;
public static function create(int $actorUniqueId, string $photoName, string $photoItemName) : self{
$result = new self;
$result->entityUniqueId = $actorUniqueId;
$result->photoName = $photoName;
$result->photoItemName = $photoItemName;
return $result;
}
/**
* TODO: rename this to getEntityUniqueId() on PM4 (shit architecture, thanks shoghi)
*/
public function getEntityUniqueIdField() : int{ return $this->entityUniqueId; }
public function getPhotoName() : string{ return $this->photoName; }
public function getPhotoItemName() : string{ return $this->photoItemName; }
protected function decodePayload() : void{
$this->entityUniqueId = $this->getLLong(); //why be consistent mojang ?????
$this->photoName = $this->getString();
$this->photoItemName = $this->getString();
}
protected function encodePayload() : void{
$this->putLLong($this->entityUniqueId);
$this->putString($this->photoName);
$this->putString($this->photoItemName);
}
public function handle(NetworkSession $handler) : bool{
return $handler->handleCreatePhoto($this);
}
}

View File

@ -0,0 +1,55 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\protocol\types\EducationUriResource;
class EduUriResourcePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::EDU_URI_RESOURCE_PACKET;
private EducationUriResource $resource;
public static function create(EducationUriResource $resource) : self{
$result = new self;
$result->resource = $resource;
return $result;
}
public function getResource() : EducationUriResource{ return $this->resource; }
protected function decodePayload() : void{
$this->resource = EducationUriResource::read($this);
}
protected function encodePayload() : void{
$this->resource->write($this);
}
public function handle(NetworkSession $handler) : bool{
return $handler->handleEduUriResource($this);
}
}

View File

@ -26,6 +26,8 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\protocol\types\EducationSettingsAgentCapabilities;
use pocketmine\network\mcpe\protocol\types\EducationSettingsExternalLinkSettings;
class EducationSettingsPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::EDUCATION_SETTINGS_PACKET;
@ -36,18 +38,44 @@ class EducationSettingsPacket extends DataPacket{
private $codeBuilderTitle;
/** @var bool */
private $canResizeCodeBuilder;
/** @var bool */
private $disableLegacyTitleBar;
/** @var string */
private $postProcessFilter;
/** @var string */
private $screenshotBorderResourcePath;
/** @var EducationSettingsAgentCapabilities|null */
private $agentCapabilities;
/** @var string|null */
private $codeBuilderOverrideUri;
/** @var bool */
private $hasQuiz;
/** @var EducationSettingsExternalLinkSettings|null */
private $linkSettings;
public static function create(string $codeBuilderDefaultUri, string $codeBuilderTitle, bool $canResizeCodeBuilder, ?string $codeBuilderOverrideUri, bool $hasQuiz) : self{
public static function create(
string $codeBuilderDefaultUri,
string $codeBuilderTitle,
bool $canResizeCodeBuilder,
bool $disableLegacyTitleBar,
string $postProcessFilter,
string $screenshotBorderResourcePath,
?EducationSettingsAgentCapabilities $agentCapabilities,
?string $codeBuilderOverrideUri,
bool $hasQuiz,
?EducationSettingsExternalLinkSettings $linkSettings
) : self{
$result = new self;
$result->codeBuilderDefaultUri = $codeBuilderDefaultUri;
$result->codeBuilderTitle = $codeBuilderTitle;
$result->canResizeCodeBuilder = $canResizeCodeBuilder;
$result->disableLegacyTitleBar = $disableLegacyTitleBar;
$result->postProcessFilter = $postProcessFilter;
$result->screenshotBorderResourcePath = $screenshotBorderResourcePath;
$result->agentCapabilities = $agentCapabilities;
$result->codeBuilderOverrideUri = $codeBuilderOverrideUri;
$result->hasQuiz = $hasQuiz;
$result->linkSettings = $linkSettings;
return $result;
}
@ -63,6 +91,14 @@ class EducationSettingsPacket extends DataPacket{
return $this->canResizeCodeBuilder;
}
public function disableLegacyTitleBar() : bool{ return $this->disableLegacyTitleBar; }
public function getPostProcessFilter() : string{ return $this->postProcessFilter; }
public function getScreenshotBorderResourcePath() : string{ return $this->screenshotBorderResourcePath; }
public function getAgentCapabilities() : ?EducationSettingsAgentCapabilities{ return $this->agentCapabilities; }
public function getCodeBuilderOverrideUri() : ?string{
return $this->codeBuilderOverrideUri;
}
@ -71,27 +107,51 @@ class EducationSettingsPacket extends DataPacket{
return $this->hasQuiz;
}
public function getLinkSettings() : ?EducationSettingsExternalLinkSettings{ return $this->linkSettings; }
protected function decodePayload() : void{
$this->codeBuilderDefaultUri = $this->getString();
$this->codeBuilderTitle = $this->getString();
$this->canResizeCodeBuilder = $this->getBool();
$this->disableLegacyTitleBar = $this->getBool();
$this->postProcessFilter = $this->getString();
$this->screenshotBorderResourcePath = $this->getString();
$this->agentCapabilities = $this->getBool() ? EducationSettingsAgentCapabilities::read($this) : null;
if($this->getBool()){
$this->codeBuilderOverrideUri = $this->getString();
}else{
$this->codeBuilderOverrideUri = null;
}
$this->hasQuiz = $this->getBool();
$this->linkSettings = $this->getBool() ? EducationSettingsExternalLinkSettings::read($this) : null;
}
protected function encodePayload() : void{
$this->putString($this->codeBuilderDefaultUri);
$this->putString($this->codeBuilderTitle);
$this->putBool($this->canResizeCodeBuilder);
$this->putBool($this->disableLegacyTitleBar);
$this->putString($this->postProcessFilter);
$this->putString($this->screenshotBorderResourcePath);
$agentCapabilities = $this->agentCapabilities;
if($agentCapabilities !== null){
$this->putBool(true);
$agentCapabilities->write($this);
}else{
$this->putBool(false);
}
$this->putBool($this->codeBuilderOverrideUri !== null);
if($this->codeBuilderOverrideUri !== null){
$this->putString($this->codeBuilderOverrideUri);
}
$this->putBool($this->hasQuiz);
$linkSettings = $this->linkSettings;
if($linkSettings !== null){
$this->putBool(true);
$linkSettings->write($this);
}else{
$this->putBool(false);
}
}
public function handle(NetworkSession $handler) : bool{

View File

@ -34,15 +34,19 @@ class HurtArmorPacket extends DataPacket{
public $cause;
/** @var int */
public $health;
/** @var int */
public $armorSlotFlags;
protected function decodePayload(){
$this->cause = $this->getVarInt();
$this->health = $this->getVarInt();
$this->armorSlotFlags = $this->getUnsignedVarLong();
}
protected function encodePayload(){
$this->putVarInt($this->cause);
$this->putVarInt($this->health);
$this->putUnsignedVarLong($this->armorSlotFlags);
}
public function handle(NetworkSession $session) : bool{

View File

@ -0,0 +1,87 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
class NpcDialoguePacket extends DataPacket/* implements ClientboundPacket*/{
public const NETWORK_ID = ProtocolInfo::NPC_DIALOGUE_PACKET;
public const ACTION_OPEN = 0;
public const ACTION_CLOSE = 1;
private int $npcActorUniqueId;
private int $actionType;
private string $dialogue;
private string $sceneName;
private string $npcName;
private string $actionJson;
public static function create(int $npcActorUniqueId, int $actionType, string $dialogue, string $sceneName, string $npcName, string $actionJson) : self{
$result = new self;
$result->npcActorUniqueId = $npcActorUniqueId;
$result->actionType = $actionType;
$result->dialogue = $dialogue;
$result->sceneName = $sceneName;
$result->npcName = $npcName;
$result->actionJson = $actionJson;
return $result;
}
public function getNpcActorUniqueId() : int{ return $this->npcActorUniqueId; }
public function getActionType() : int{ return $this->actionType; }
public function getDialogue() : string{ return $this->dialogue; }
public function getSceneName() : string{ return $this->sceneName; }
public function getNpcName() : string{ return $this->npcName; }
public function getActionJson() : string{ return $this->actionJson; }
protected function decodePayload() : void{
$this->npcActorUniqueId = $this->getLLong(); //WHY NOT USING STANDARD METHODS, MOJANG
$this->actionType = $this->getVarInt();
$this->dialogue = $this->getString();
$this->sceneName = $this->getString();
$this->npcName = $this->getString();
$this->actionJson = $this->getString();
}
protected function encodePayload() : void{
$this->putLLong($this->npcActorUniqueId);
$this->putVarInt($this->actionType);
$this->putString($this->dialogue);
$this->putString($this->sceneName);
$this->putString($this->npcName);
$this->putString($this->actionJson);
}
public function handle(NetworkSession $handler) : bool{
return $handler->handleNpcDialogue($this);
}
}

View File

@ -36,6 +36,7 @@ class NpcRequestPacket extends DataPacket{
public const REQUEST_SET_NAME = 3;
public const REQUEST_SET_SKIN = 4;
public const REQUEST_SET_INTERACTION_TEXT = 5;
public const REQUEST_EXECUTE_OPENING_COMMANDS = 6;
/** @var int */
public $entityRuntimeId;
@ -45,12 +46,14 @@ class NpcRequestPacket extends DataPacket{
public $commandString;
/** @var int */
public $actionType;
public string $sceneName;
protected function decodePayload(){
$this->entityRuntimeId = $this->getEntityRuntimeId();
$this->requestType = $this->getByte();
$this->commandString = $this->getString();
$this->actionType = $this->getByte();
$this->sceneName = $this->getString();
}
protected function encodePayload(){
@ -58,6 +61,7 @@ class NpcRequestPacket extends DataPacket{
$this->putByte($this->requestType);
$this->putString($this->commandString);
$this->putByte($this->actionType);
$this->putString($this->sceneName);
}
public function handle(NetworkSession $session) : bool{

View File

@ -198,6 +198,12 @@ class PacketPool{
static::registerPacket(new SyncActorPropertyPacket());
static::registerPacket(new AddVolumeEntityPacket());
static::registerPacket(new RemoveVolumeEntityPacket());
static::registerPacket(new SimulationTypePacket());
static::registerPacket(new NpcDialoguePacket());
static::registerPacket(new EduUriResourcePacket());
static::registerPacket(new CreatePhotoPacket());
static::registerPacket(new UpdateSubChunkBlocksPacket());
static::registerPacket(new PhotoInfoRequestPacket());
}
/**

View File

@ -0,0 +1,52 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
class PhotoInfoRequestPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::PHOTO_INFO_REQUEST_PACKET;
private int $photoId;
public static function create(int $photoId) : self{
$result = new self;
$result->photoId = $photoId;
return $result;
}
protected function decodePayload() : void{
$this->photoId = $this->getEntityUniqueId();
}
protected function encodePayload() : void{
$this->putEntityUniqueId($this->photoId);
}
public function handle(NetworkSession $handler) : bool{
return $handler->handlePhotoInfoRequest($this);
}
}

View File

@ -36,17 +36,33 @@ class PhotoTransferPacket extends DataPacket{
public $photoData;
/** @var string */
public $bookId; //photos are stored in a sibling directory to the games folder (screenshots/(some UUID)/bookID/example.png)
/** @var int */
public $type;
/** @var int */
public $sourceType;
/** @var int */
public $ownerEntityUniqueId;
/** @var string */
public $newPhotoName; //???
protected function decodePayload(){
$this->photoName = $this->getString();
$this->photoData = $this->getString();
$this->bookId = $this->getString();
$this->type = $this->getByte();
$this->sourceType = $this->getByte();
$this->ownerEntityUniqueId = $this->getLLong(); //...............
$this->newPhotoName = $this->getString();
}
protected function encodePayload(){
$this->putString($this->photoName);
$this->putString($this->photoData);
$this->putString($this->bookId);
$this->putByte($this->type);
$this->putByte($this->sourceType);
$this->putLLong($this->ownerEntityUniqueId);
$this->putString($this->newPhotoName);
}
public function handle(NetworkSession $session) : bool{

View File

@ -37,11 +37,11 @@ interface ProtocolInfo{
*/
/** Actual Minecraft: PE protocol version */
public const CURRENT_PROTOCOL = 440;
public const CURRENT_PROTOCOL = 465;
/** Current Minecraft PE version reported by the server. This is usually the earliest currently supported version. */
public const MINECRAFT_VERSION = 'v1.17.0';
public const MINECRAFT_VERSION = 'v1.17.30';
/** Version number sent to clients in ping responses. */
public const MINECRAFT_VERSION_NETWORK = '1.17.0';
public const MINECRAFT_VERSION_NETWORK = '1.17.30';
public const LOGIN_PACKET = 0x01;
public const PLAY_STATUS_PACKET = 0x02;
@ -210,5 +210,11 @@ interface ProtocolInfo{
public const SYNC_ACTOR_PROPERTY_PACKET = 0xa5;
public const ADD_VOLUME_ENTITY_PACKET = 0xa6;
public const REMOVE_VOLUME_ENTITY_PACKET = 0xa7;
public const SIMULATION_TYPE_PACKET = 0xa8;
public const NPC_DIALOGUE_PACKET = 0xa9;
public const EDU_URI_RESOURCE_PACKET = 0xaa;
public const CREATE_PHOTO_PACKET = 0xab;
public const UPDATE_SUB_CHUNK_BLOCKS_PACKET = 0xac;
public const PHOTO_INFO_REQUEST_PACKET = 0xad;
}

View File

@ -33,9 +33,11 @@ class ResourcePacksInfoPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::RESOURCE_PACKS_INFO_PACKET;
/** @var bool */
public $mustAccept = false; //if true, forces client to use selected resource packs
public $mustAccept = false; //if true, forces client to choose between accepting packs or being disconnected
/** @var bool */
public $hasScripts = false; //if true, causes disconnect for any platform that doesn't support scripts yet
public bool $forceServerPacks = false;
/** @var ResourcePack[] */
public $behaviorPackEntries = [];
/** @var ResourcePack[] */
@ -44,6 +46,7 @@ class ResourcePacksInfoPacket extends DataPacket{
protected function decodePayload(){
$this->mustAccept = $this->getBool();
$this->hasScripts = $this->getBool();
$this->forceServerPacks = $this->getBool();
$behaviorPackCount = $this->getLShort();
while($behaviorPackCount-- > 0){
$this->getString();
@ -71,6 +74,7 @@ class ResourcePacksInfoPacket extends DataPacket{
protected function encodePayload(){
$this->putBool($this->mustAccept);
$this->putBool($this->hasScripts);
$this->putBool($this->forceServerPacks);
$this->putLShort(count($this->behaviorPackEntries));
foreach($this->behaviorPackEntries as $entry){
$this->putString($entry->getPackId());

View File

@ -50,6 +50,8 @@ class SetTitlePacket extends DataPacket{
public $stayTime = 0;
/** @var int */
public $fadeOutTime = 0;
public string $xuid = "";
public string $platformOnlineId = "";
protected function decodePayload(){
$this->type = $this->getVarInt();
@ -57,6 +59,8 @@ class SetTitlePacket extends DataPacket{
$this->fadeInTime = $this->getVarInt();
$this->stayTime = $this->getVarInt();
$this->fadeOutTime = $this->getVarInt();
$this->xuid = $this->getString();
$this->platformOnlineId = $this->getString();
}
protected function encodePayload(){
@ -65,6 +69,8 @@ class SetTitlePacket extends DataPacket{
$this->putVarInt($this->fadeInTime);
$this->putVarInt($this->stayTime);
$this->putVarInt($this->fadeOutTime);
$this->putString($this->xuid);
$this->putString($this->platformOnlineId);
}
public function handle(NetworkSession $session) : bool{

View File

@ -0,0 +1,58 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
class SimulationTypePacket extends DataPacket/* implements ClientboundPacket*/{
public const NETWORK_ID = ProtocolInfo::SIMULATION_TYPE_PACKET;
public const GAME = 0;
public const EDITOR = 1;
public const TEST = 2;
private int $type;
public static function create(int $type) : self{
$result = new self;
$result->type = $type;
return $result;
}
public function getType() : int{ return $this->type; }
protected function decodePayload() : void{
$this->type = $this->getByte();
}
protected function encodePayload() : void{
$this->putByte($this->type);
}
public function handle(NetworkSession $handler) : bool{
return $handler->handleSimulationType($this);
}
}

View File

@ -30,6 +30,7 @@ use pocketmine\nbt\NetworkLittleEndianNBTStream;
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\protocol\types\BlockPaletteEntry;
use pocketmine\network\mcpe\protocol\types\EducationEditionOffer;
use pocketmine\network\mcpe\protocol\types\EducationUriResource;
use pocketmine\network\mcpe\protocol\types\Experiments;
use pocketmine\network\mcpe\protocol\types\GameRuleType;
use pocketmine\network\mcpe\protocol\types\GeneratorType;
@ -143,6 +144,8 @@ class StartGamePacket extends DataPacket{
public $limitedWorldLength = 0;
/** @var bool */
public $isNewNether = true;
/** @var EducationUriResource|null */
public $eduSharedUriResource = null;
/** @var bool|null */
public $experimentalGameplayOverride = null;
@ -227,6 +230,7 @@ class StartGamePacket extends DataPacket{
$this->limitedWorldWidth = $this->getLInt();
$this->limitedWorldLength = $this->getLInt();
$this->isNewNether = $this->getBool();
$this->eduSharedUriResource = EducationUriResource::read($this);
if($this->getBool()){
$this->experimentalGameplayOverride = $this->getBool();
}else{
@ -311,6 +315,7 @@ class StartGamePacket extends DataPacket{
$this->putLInt($this->limitedWorldWidth);
$this->putLInt($this->limitedWorldLength);
$this->putBool($this->isNewNether);
($this->eduSharedUriResource ?? new EducationUriResource("", ""))->write($this);
$this->putBool($this->experimentalGameplayOverride !== null);
if($this->experimentalGameplayOverride !== null){
$this->putBool($this->experimentalGameplayOverride);

View File

@ -0,0 +1,97 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\protocol\types\UpdateSubChunkBlocksPacketEntry;
use function count;
class UpdateSubChunkBlocksPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::UPDATE_SUB_CHUNK_BLOCKS_PACKET;
private int $subChunkX;
private int $subChunkY;
private int $subChunkZ;
/** @var UpdateSubChunkBlocksPacketEntry[] */
private array $layer0Updates;
/** @var UpdateSubChunkBlocksPacketEntry[] */
private array $layer1Updates;
/**
* @param UpdateSubChunkBlocksPacketEntry[] $layer0
* @param UpdateSubChunkBlocksPacketEntry[] $layer1
*/
public static function create(int $subChunkX, int $subChunkY, int $subChunkZ, array $layer0, array $layer1) : self{
$result = new self;
$result->subChunkX = $subChunkX;
$result->subChunkY = $subChunkY;
$result->subChunkZ = $subChunkZ;
$result->layer0Updates = $layer0;
$result->layer1Updates = $layer1;
return $result;
}
public function getSubChunkX() : int{ return $this->subChunkX; }
public function getSubChunkY() : int{ return $this->subChunkY; }
public function getSubChunkZ() : int{ return $this->subChunkZ; }
/** @return UpdateSubChunkBlocksPacketEntry[] */
public function getLayer0Updates() : array{ return $this->layer0Updates; }
/** @return UpdateSubChunkBlocksPacketEntry[] */
public function getLayer1Updates() : array{ return $this->layer1Updates; }
protected function decodePayload() : void{
$this->subChunkX = $this->subChunkY = $this->subChunkZ = 0;
$this->getBlockPosition($this->subChunkX, $this->subChunkY, $this->subChunkZ);
$this->layer0Updates = [];
for($i = 0, $count = $this->getUnsignedVarInt(); $i < $count; ++$i){
$this->layer0Updates[] = UpdateSubChunkBlocksPacketEntry::read($this);
}
for($i = 0, $count = $this->getUnsignedVarInt(); $i < $count; ++$i){
$this->layer1Updates[] = UpdateSubChunkBlocksPacketEntry::read($this);
}
}
protected function encodePayload() : void{
$this->putBlockPosition($this->subChunkX, $this->subChunkY, $this->subChunkZ);
$this->putUnsignedVarInt(count($this->layer0Updates));
foreach($this->layer0Updates as $update){
$update->write($this);
}
$this->putUnsignedVarInt(count($this->layer1Updates));
foreach($this->layer1Updates as $update){
$update->write($this);
}
}
public function handle(NetworkSession $handler) : bool{
return $handler->handleUpdateSubChunkBlocks($this);
}
}

View File

@ -0,0 +1,51 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types;
use pocketmine\network\mcpe\NetworkBinaryStream;
final class EducationSettingsAgentCapabilities{
private ?bool $canModifyBlocks;
public function __construct(?bool $canModifyBlocks){
$this->canModifyBlocks = $canModifyBlocks;
}
public function getCanModifyBlocks() : ?bool{ return $this->canModifyBlocks; }
public static function read(NetworkBinaryStream $in) : self{
$canModifyBlocks = $in->getBool() ? $in->getBool() : null;
return new self($canModifyBlocks);
}
public function write(NetworkBinaryStream $out) : void{
if($this->canModifyBlocks !== null){
$out->putBool(true);
$out->putBool($this->canModifyBlocks);
}else{
$out->putBool(false);
}
}
}

View File

@ -0,0 +1,52 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types;
use pocketmine\network\mcpe\NetworkBinaryStream;
final class EducationSettingsExternalLinkSettings{
private string $displayName;
private string $url;
public function __construct(string $url, string $displayName){
$this->displayName = $displayName;
$this->url = $url;
}
public function getUrl() : string{ return $this->url; }
public function getDisplayName() : string{ return $this->displayName; }
public static function read(NetworkBinaryStream $in) : self{
$url = $in->getString();
$displayName = $in->getString();
return new self($displayName, $url);
}
public function write(NetworkBinaryStream $out) : void{
$out->putString($this->url);
$out->putString($this->displayName);
}
}

View File

@ -0,0 +1,51 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types;
use pocketmine\network\mcpe\NetworkBinaryStream;
final class EducationUriResource{
private string $buttonName;
private string $linkUri;
public function __construct(string $buttonName, string $linkUri){
$this->buttonName = $buttonName;
$this->linkUri = $linkUri;
}
public function getButtonName() : string{ return $this->buttonName; }
public function getLinkUri() : string{ return $this->linkUri; }
public static function read(NetworkBinaryStream $in) : self{
$buttonName = $in->getString();
$linkUri = $in->getString();
return new self($buttonName, $linkUri);
}
public function write(NetworkBinaryStream $out) : void{
$out->putString($this->buttonName);
$out->putString($this->linkUri);
}
}

View File

@ -54,7 +54,7 @@ class LegacySkinAdapter implements SkinAdapter{
public function fromSkinData(SkinData $data) : Skin{
if($data->isPersona()){
return new Skin("Standard_Custom", str_repeat(random_bytes(3) . "\xff", 2048));
return new Skin("Standard_Custom", str_repeat(random_bytes(3) . "\xff", 4096));
}
$capeData = $data->isPersonaCapeOnClassic() ? "" : $data->getCapeImage()->getData();

View File

@ -0,0 +1,52 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types;
final class MaterialReducerRecipe{
private int $inputItemId;
private int $inputItemMeta;
/**
* @var MaterialReducerRecipeOutput[]
* @phpstan-var list<MaterialReducerRecipeOutput>
*/
private array $outputs;
/**
* @param MaterialReducerRecipeOutput[] $outputs
* @phpstan-param list<MaterialReducerRecipeOutput> $outputs
*/
public function __construct(int $inputItemId, int $inputItemMeta, array $outputs){
$this->inputItemId = $inputItemId;
$this->inputItemMeta = $inputItemMeta;
$this->outputs = $outputs;
}
public function getInputItemId() : int{ return $this->inputItemId; }
public function getInputItemMeta() : int{ return $this->inputItemMeta; }
/** @return MaterialReducerRecipeOutput[] */
public function getOutputs() : array{ return $this->outputs; }
}

View File

@ -0,0 +1,39 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types;
final class MaterialReducerRecipeOutput{
private int $itemId;
private int $count;
public function __construct(int $itemId, int $count){
$this->itemId = $itemId;
$this->count = $count;
}
public function getItemId() : int{ return $this->itemId; }
public function getCount() : int{ return $this->count; }
}

View File

@ -30,7 +30,7 @@ use pocketmine\network\mcpe\protocol\PlayerAuthInputPacket;
* The flags should be written as
* `flags |= (1 << flag)`
* and read as
* `(flags & (1 & flag)) !== 0`
* `(flags & (1 << flag)) !== 0`
*
* @see PlayerAuthInputPacket
*/
@ -56,8 +56,8 @@ final class PlayerAuthInputFlags{
public const WANT_DOWN_SLOW = 18;
public const WANT_UP_SLOW = 19;
public const SPRINTING = 20;
public const ASCEND_SCAFFOLDING = 21;
public const DESCEND_SCAFFOLDING = 22;
public const ASCEND_BLOCK = 21;
public const DESCEND_BLOCK = 22;
public const SNEAK_TOGGLE_DOWN = 23;
public const PERSIST_SNEAK = 24;
public const START_SPRINTING = 25;

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types;
use pocketmine\network\mcpe\protocol\ProtocolInfo;
use pocketmine\utils\UUID;
class SkinData{
@ -44,14 +45,9 @@ class SkinData{
private $capeImage;
/** @var string */
private $geometryData;
private string $geometryDataEngineVersion;
/** @var string */
private $animationData;
/** @var bool */
private $persona;
/** @var bool */
private $premium;
/** @var bool */
private $personaCapeOnClassic;
/** @var string */
private $capeId;
/** @var string */
@ -66,13 +62,21 @@ class SkinData{
private $pieceTintColors;
/** @var bool */
private $isVerified;
/** @var bool */
private $persona;
/** @var bool */
private $premium;
/** @var bool */
private $personaCapeOnClassic;
/** @var bool */
private $isPrimaryUser;
/**
* @param SkinAnimation[] $animations
* @param PersonaSkinPiece[] $personaPieces
* @param PersonaPieceTintColor[] $pieceTintColors
*/
public function __construct(string $skinId, string $playFabId, string $resourcePatch, SkinImage $skinImage, array $animations = [], SkinImage $capeImage = null, string $geometryData = "", string $animationData = "", bool $premium = false, bool $persona = false, bool $personaCapeOnClassic = false, string $capeId = "", ?string $fullSkinId = null, string $armSize = self::ARM_SIZE_WIDE, string $skinColor = "", array $personaPieces = [], array $pieceTintColors = [], bool $isVerified = true){
public function __construct(string $skinId, string $playFabId, string $resourcePatch, SkinImage $skinImage, array $animations = [], SkinImage $capeImage = null, string $geometryData = "", string $geometryDataEngineVersion = ProtocolInfo::MINECRAFT_VERSION_NETWORK, string $animationData = "", string $capeId = "", ?string $fullSkinId = null, string $armSize = self::ARM_SIZE_WIDE, string $skinColor = "", array $personaPieces = [], array $pieceTintColors = [], bool $isVerified = true, bool $premium = false, bool $persona = false, bool $personaCapeOnClassic = false, bool $isPrimaryUser = true){
$this->skinId = $skinId;
$this->playFabId = $playFabId;
$this->resourcePatch = $resourcePatch;
@ -80,10 +84,8 @@ class SkinData{
$this->animations = $animations;
$this->capeImage = $capeImage ?? new SkinImage(0, 0, "");
$this->geometryData = $geometryData;
$this->geometryDataEngineVersion = $geometryDataEngineVersion;
$this->animationData = $animationData;
$this->premium = $premium;
$this->persona = $persona;
$this->personaCapeOnClassic = $personaCapeOnClassic;
$this->capeId = $capeId;
//this has to be unique or the client will do stupid things
$this->fullSkinId = $fullSkinId ?? UUID::fromRandom()->toString();
@ -92,6 +94,10 @@ class SkinData{
$this->personaPieces = $personaPieces;
$this->pieceTintColors = $pieceTintColors;
$this->isVerified = $isVerified;
$this->premium = $premium;
$this->persona = $persona;
$this->personaCapeOnClassic = $personaCapeOnClassic;
$this->isPrimaryUser = $isPrimaryUser;
}
public function getSkinId() : string{
@ -123,22 +129,12 @@ class SkinData{
return $this->geometryData;
}
public function getGeometryDataEngineVersion() : string{ return $this->geometryDataEngineVersion; }
public function getAnimationData() : string{
return $this->animationData;
}
public function isPersona() : bool{
return $this->persona;
}
public function isPremium() : bool{
return $this->premium;
}
public function isPersonaCapeOnClassic() : bool{
return $this->personaCapeOnClassic;
}
public function getCapeId() : string{
return $this->capeId;
}
@ -169,6 +165,20 @@ class SkinData{
return $this->pieceTintColors;
}
public function isPersona() : bool{
return $this->persona;
}
public function isPremium() : bool{
return $this->premium;
}
public function isPersonaCapeOnClassic() : bool{
return $this->personaCapeOnClassic;
}
public function isPrimaryUser() : bool{ return $this->isPrimaryUser; }
public function isVerified() : bool{
return $this->isVerified;
}

View File

@ -0,0 +1,88 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types;
use pocketmine\network\mcpe\NetworkBinaryStream;
use pocketmine\network\mcpe\protocol\UpdateBlockPacket;
final class UpdateSubChunkBlocksPacketEntry{
private int $x;
private int $y;
private int $z;
private int $blockRuntimeId;
private int $flags;
//These two fields are useless 99.9% of the time; they are here to allow this packet to provide UpdateBlockSyncedPacket functionality.
private int $syncedUpdateEntityUniqueId;
private int $syncedUpdateType;
public function __construct(int $x, int $y, int $z, int $blockRuntimeId, int $flags, int $syncedUpdateEntityUniqueId, int $syncedUpdateType){
$this->x = $x;
$this->y = $y;
$this->z = $z;
$this->blockRuntimeId = $blockRuntimeId;
$this->flags = $flags;
$this->syncedUpdateEntityUniqueId = $syncedUpdateEntityUniqueId;
$this->syncedUpdateType = $syncedUpdateType;
}
public static function simple(int $x, int $y, int $z, int $blockRuntimeId) : self{
return new self($x, $y, $z, $blockRuntimeId, UpdateBlockPacket::FLAG_NETWORK, 0, 0);
}
public function getX() : int{ return $this->x; }
public function getY() : int{ return $this->y; }
public function getZ() : int{ return $this->z; }
public function getBlockRuntimeId() : int{ return $this->blockRuntimeId; }
public function getFlags() : int{ return $this->flags; }
public function getSyncedUpdateEntityUniqueId() : int{ return $this->syncedUpdateEntityUniqueId; }
public function getSyncedUpdateType() : int{ return $this->syncedUpdateType; }
public static function read(NetworkBinaryStream $in) : self{
$x = $y = $z = 0;
$in->getBlockPosition($x, $y, $z);
$blockRuntimeId = $in->getUnsignedVarInt();
$updateFlags = $in->getUnsignedVarInt();
$syncedUpdateEntityUniqueId = $in->getUnsignedVarLong(); //this can't use the standard method because it's unsigned as opposed to the usual signed... !!!!!!
$syncedUpdateType = $in->getUnsignedVarInt(); //this isn't even consistent with UpdateBlockSyncedPacket?!
return new self($x, $y, $z, $blockRuntimeId, $updateFlags, $syncedUpdateEntityUniqueId, $syncedUpdateType);
}
public function write(NetworkBinaryStream $out) : void{
$out->putBlockPosition($this->x, $this->y, $this->z);
$out->putUnsignedVarInt($this->blockRuntimeId);
$out->putUnsignedVarInt($this->flags);
$out->putUnsignedVarLong($this->syncedUpdateEntityUniqueId);
$out->putUnsignedVarInt($this->syncedUpdateType);
}
}

View File

@ -57,15 +57,15 @@ use const SOL_TCP;
class RCON{
/** @var Server */
private $server;
/** @var resource */
/** @var \Socket */
private $socket;
/** @var RCONInstance */
private $instance;
/** @var resource */
/** @var \Socket */
private $ipcMainSocket;
/** @var resource */
/** @var \Socket */
private $ipcThreadSocket;
public function __construct(Server $server, string $password, int $port = 19132, string $interface = "0.0.0.0", int $maxClients = 50){

View File

@ -60,7 +60,7 @@ class RCONInstance extends Thread{
/** @var bool */
private $stop;
/** @var resource */
/** @var \Socket */
private $socket;
/** @var string */
private $password;
@ -68,16 +68,12 @@ class RCONInstance extends Thread{
private $maxClients;
/** @var \ThreadedLogger */
private $logger;
/** @var resource */
/** @var \Socket */
private $ipcSocket;
/** @var SleeperNotifier|null */
private $notifier;
/**
* @param resource $socket
* @param resource $ipcSocket
*/
public function __construct($socket, string $password, int $maxClients, \ThreadedLogger $logger, $ipcSocket, ?SleeperNotifier $notifier){
public function __construct(\Socket $socket, string $password, int $maxClients, \ThreadedLogger $logger, \Socket $ipcSocket, ?SleeperNotifier $notifier){
$this->stop = false;
$this->cmd = "";
$this->response = "";
@ -92,11 +88,9 @@ class RCONInstance extends Thread{
}
/**
* @param resource $client
*
* @return int|false
*/
private function writePacket($client, int $requestID, int $packetType, string $payload){
private function writePacket(\Socket $client, int $requestID, int $packetType, string $payload){
$pk = Binary::writeLInt($requestID)
. Binary::writeLInt($packetType)
. $payload
@ -105,14 +99,13 @@ class RCONInstance extends Thread{
}
/**
* @param resource $client
* @param int $requestID reference parameter
* @param int $packetType reference parameter
* @param string $payload reference parameter
*
* @return bool
*/
private function readPacket($client, ?int &$requestID, ?int &$packetType, ?string &$payload){
private function readPacket(\Socket $client, ?int &$requestID, ?int &$packetType, ?string &$payload){
$d = @socket_read($client, 4);
socket_getpeername($client, $ip, $port);
@ -165,7 +158,10 @@ class RCONInstance extends Thread{
public function run(){
$this->registerClassLoader();
/** @var resource[] $clients */
/**
* @var \Socket[] $clients
* @phpstan-var array<int, \Socket> $clients
*/
$clients = [];
/** @var bool[] $authenticated */
$authenticated = [];
@ -264,10 +260,7 @@ class RCONInstance extends Thread{
}
}
/**
* @param resource $client
*/
private function disconnectClient($client) : void{
private function disconnectClient(\Socket $client) : void{
socket_getpeername($client, $ip, $port);
@socket_set_option($client, SOL_SOCKET, SO_LINGER, ["l_onoff" => 1, "l_linger" => 1]);
@socket_shutdown($client, 2);

View File

@ -258,7 +258,7 @@ class Config{
/**
* Sets the options for the JSON encoding when saving
*
* @return Config $this
* @return $this
* @throws \RuntimeException if the Config is not in JSON
* @see json_encode
*/
@ -275,7 +275,7 @@ class Config{
/**
* Enables the given option in addition to the currently set JSON options
*
* @return Config $this
* @return $this
* @throws \RuntimeException if the Config is not in JSON
* @see json_encode
*/
@ -292,7 +292,7 @@ class Config{
/**
* Disables the given option for the JSON encoding when saving
*
* @return Config $this
* @return $this
* @throws \RuntimeException if the Config is not in JSON
* @see json_encode
*/

View File

@ -31,6 +31,7 @@ use function curl_getinfo;
use function curl_init;
use function curl_setopt_array;
use function explode;
use function is_int;
use function is_string;
use function preg_match;
use function socket_close;
@ -196,7 +197,7 @@ class Internet{
* @param callable|null $onSuccess function to be called if there is no error. Accepts a resource argument as the cURL handle.
* @phpstan-param array<int, mixed> $extraOpts
* @phpstan-param list<string> $extraHeaders
* @phpstan-param (callable(resource) : void)|null $onSuccess
* @phpstan-param (callable(\CurlHandle) : void)|null $onSuccess
*
* @return array a plain array of three [result body : string, headers : string[][], HTTP response code : int]. Headers are grouped by requests with strtolower(header name) as keys and header value as values
* @phpstan-return array{string, list<array<string, string>>, int}
@ -233,6 +234,7 @@ class Internet{
}
if(!is_string($raw)) throw new AssumptionFailedError("curl_exec() should return string|false when CURLOPT_RETURNTRANSFER is set");
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if(!is_int($httpCode)) throw new AssumptionFailedError("curl_getinfo(CURLINFO_HTTP_CODE) always returns int");
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$rawHeaders = substr($raw, 0, $headerSize);
$body = substr($raw, $headerSize);

View File

@ -201,9 +201,6 @@ abstract class Timezone{
}
$parsed = date_parse($offset);
if($parsed === false){
return false;
}
$offset = $parsed['hour'] * 3600 + $parsed['minute'] * 60 + $parsed['second'];
//After date_parse is done, put the sign back

View File

@ -454,7 +454,7 @@ class Utils{
* @param callable|null $onSuccess function to be called if there is no error. Accepts a resource argument as the cURL handle.
* @phpstan-param array<int, mixed> $extraOpts
* @phpstan-param list<string> $extraHeaders
* @phpstan-param (callable(resource) : void)|null $onSuccess
* @phpstan-param (callable(\CurlHandle) : void)|null $onSuccess
*
* @return array a plain array of three [result body : string, headers : string[][], HTTP response code : int]. Headers are grouped by requests with strtolower(header name) as keys and header value as values
* @phpstan-return array{string, list<array<string, string>>, int}
@ -642,7 +642,6 @@ class Utils{
preg_match_all('/(*ANYCRLF)^[\t ]*(?:\* )?@([a-zA-Z]+)(?:[\t ]+(.+?))?[\t ]*$/m', $rawDocComment, $matches);
$result = array_combine($matches[1], $matches[2]);
if($result === false) throw new AssumptionFailedError("array_combine() doesn't return false with two equal-sized arrays");
return $result;
}

View File

@ -1,5 +1,5 @@
@echo off
TITLE PocketMine-MP server software for Minecraft: Pocket Edition
TITLE PocketMine-MP server software for Minecraft: Bedrock Edition
cd /d %~dp0
if exist bin\php\php.exe (
@ -22,5 +22,5 @@ if exist bin\mintty.exe (
start "" bin\mintty.exe -o Columns=88 -o Rows=32 -o AllowBlinking=0 -o FontQuality=3 -o Font="Consolas" -o FontHeight=10 -o CursorType=0 -o CursorBlinks=1 -h error -t "PocketMine-MP" -i bin/pocketmine.ico -w max %PHP_BINARY% %POCKETMINE_FILE% --enable-ansi %*
) else (
REM pause on exitcode != 0 so the user can see what went wrong
%PHP_BINARY% -c bin\php %POCKETMINE_FILE% %* || pause
%PHP_BINARY% %POCKETMINE_FILE% %* || pause
)

View File

@ -17,9 +17,9 @@ INSTALL_DIR="$(pwd)/bin/php7"
export CFLAGS="$CFLAGS -march=x86-64"
export CXXFLAGS="$CXXFLAGS -march=x86-64"
git clone https://github.com/php-build/php-build.git
git clone https://github.com/pmmp/php-build.git
cd php-build
./install-dependencies.sh
echo '"pthreads",,"https://github.com/pmmp/pthreads.git",,,"extension",' >> share/php-build/extension/definition
PHP_BUILD_INSTALL_EXTENSION='pthreads=@acc6e52b2144c61c434b62a3cb680d537e06828e yaml=2.2.1' PHP_BUILD_ZTS_ENABLE=on ./bin/php-build "$VERSION" "$INSTALL_DIR" || exit 1
PHP_BUILD_INSTALL_EXTENSION='pthreads=@a6afc0434f91c1e9541444aef6ac7a1f16c595be yaml=2.2.1' PHP_BUILD_ZTS_ENABLE=on ./bin/php-build "$VERSION" "$INSTALL_DIR" || exit 1
rm "$INSTALL_DIR/etc/conf.d/xdebug.ini" || true

View File

@ -1,7 +1,7 @@
parameters:
ignoreErrors:
-
message: "#^Cannot access offset float\\|int on mixed\\.$#"
message: "#^Cannot access offset \\(float\\|int\\) on mixed\\.$#"
count: 1
path: ../../../src/pocketmine/CrashDump.php
@ -41,8 +41,8 @@ parameters:
path: ../../../src/pocketmine/Player.php
-
message: "#^Parameter \\#1 \\$str of function base64_decode expects string, mixed given\\.$#"
count: 5
message: "#^Parameter \\#1 \\$string of function base64_decode expects string, mixed given\\.$#"
count: 6
path: ../../../src/pocketmine/Player.php
-
@ -51,27 +51,32 @@ parameters:
path: ../../../src/pocketmine/Player.php
-
message: "#^Parameter \\#10 \\$persona of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#"
message: "#^Parameter \\#10 \\$capeId of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/Player.php
-
message: "#^Parameter \\#11 \\$personaCapeOnClassic of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#"
message: "#^Parameter \\#12 \\$armSize of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/Player.php
-
message: "#^Parameter \\#12 \\$capeId of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, mixed given\\.$#"
message: "#^Parameter \\#13 \\$skinColor of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/Player.php
-
message: "#^Parameter \\#14 \\$armSize of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, mixed given\\.$#"
message: "#^Parameter \\#17 \\$premium of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/Player.php
-
message: "#^Parameter \\#15 \\$skinColor of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, mixed given\\.$#"
message: "#^Parameter \\#18 \\$persona of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/Player.php
-
message: "#^Parameter \\#19 \\$personaCapeOnClassic of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/Player.php
@ -85,11 +90,6 @@ parameters:
count: 2
path: ../../../src/pocketmine/Player.php
-
message: "#^Parameter \\#9 \\$premium of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/Player.php
-
message: "#^Cannot access offset 'git' on mixed\\.$#"
count: 2
@ -121,7 +121,7 @@ parameters:
path: ../../../src/pocketmine/Server.php
-
message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#"
message: "#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/Server.php
@ -151,7 +151,7 @@ parameters:
path: ../../../src/pocketmine/command/CommandReader.php
-
message: "#^Parameter \\#1 \\$number of function round expects float, mixed given\\.$#"
message: "#^Parameter \\#1 \\$num of function round expects float\\|int, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/command/defaults/StatusCommand.php
@ -231,7 +231,7 @@ parameters:
path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#"
message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php
@ -466,7 +466,7 @@ parameters:
path: ../../../src/pocketmine/plugin/PluginDescription.php
-
message: "#^Parameter \\#1 \\$str of function mb_strtoupper expects string, mixed given\\.$#"
message: "#^Parameter \\#1 \\$string of function mb_strtoupper expects string, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/plugin/PluginDescription.php
@ -516,7 +516,7 @@ parameters:
path: ../../../src/pocketmine/resourcepacks/ZippedResourcePack.php
-
message: "#^Parameter \\#1 \\$variable_representation of function unserialize expects string, mixed given\\.$#"
message: "#^Parameter \\#1 \\$data of function unserialize expects string, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/scheduler/AsyncTask.php
@ -531,7 +531,7 @@ parameters:
path: ../../../src/pocketmine/updater/AutoUpdater.php
-
message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#"
message: "#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/updater/AutoUpdater.php
@ -541,7 +541,7 @@ parameters:
path: ../../../src/pocketmine/updater/AutoUpdater.php
-
message: "#^Parameter \\#2 \\$timestamp of function date expects int, mixed given\\.$#"
message: "#^Parameter \\#2 \\$timestamp of function date expects int\\|null, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/updater/AutoUpdater.php
@ -551,12 +551,12 @@ parameters:
path: ../../../src/pocketmine/updater/AutoUpdater.php
-
message: "#^Parameter \\#2 \\$start of function substr expects int, mixed given\\.$#"
message: "#^Parameter \\#2 \\$offset of function substr expects int, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/utils/Internet.php
-
message: "#^Parameter \\#3 \\$length of function substr expects int, mixed given\\.$#"
message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/utils/Internet.php
@ -576,7 +576,7 @@ parameters:
path: ../../../src/pocketmine/utils/Utils.php
-
message: "#^Parameter \\#2 \\$input1 of function array_map expects array, mixed given\\.$#"
message: "#^Parameter \\#2 \\$array of function array_map expects array, mixed given\\.$#"
count: 1
path: ../../../src/pocketmine/utils/Utils.php

View File

@ -16,12 +16,12 @@ parameters:
path: ../../../build/server-phar.php
-
message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#"
message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/MemoryManager.php
-
message: "#^Parameter \\#1 \\$fp of function fwrite expects resource, resource\\|false given\\.$#"
message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/MemoryManager.php
@ -41,7 +41,12 @@ parameters:
path: ../../../src/pocketmine/Player.php
-
message: "#^Parameter \\#8 \\$animationData of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, string\\|false given\\.$#"
message: "#^Parameter \\#8 \\$geometryDataEngineVersion of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, string\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/Player.php
-
message: "#^Parameter \\#9 \\$animationData of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, string\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/Player.php
@ -70,11 +75,6 @@ parameters:
count: 2
path: ../../../src/pocketmine/PocketMine.php
-
message: "#^Cannot cast array\\<int, mixed\\>\\|string\\|false to int\\.$#"
count: 1
path: ../../../src/pocketmine/Server.php
-
message: "#^Cannot cast array\\<int, mixed\\>\\|string\\|false to string\\.$#"
count: 1
@ -86,12 +86,12 @@ parameters:
path: ../../../src/pocketmine/Server.php
-
message: "#^Parameter \\#1 \\$buffer of method pocketmine\\\\nbt\\\\NBTStream\\:\\:readCompressed\\(\\) expects string, string\\|false given\\.$#"
message: "#^Parameter \\#1 \\$array of function array_filter expects array, array\\<int, string\\>\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/Server.php
-
message: "#^Parameter \\#1 \\$input of function array_filter expects array, array\\<int, string\\>\\|false given\\.$#"
message: "#^Parameter \\#1 \\$buffer of method pocketmine\\\\nbt\\\\NBTStream\\:\\:readCompressed\\(\\) expects string, string\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/Server.php
@ -220,23 +220,23 @@ parameters:
count: 1
path: ../../../src/pocketmine/command/defaults/PardonIpCommand.php
-
message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#"
count: 2
path: ../../../src/pocketmine/command/defaults/TimingsCommand.php
-
message: "#^Parameter \\#1 \\$fp of function fseek expects resource, resource\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/command/defaults/TimingsCommand.php
-
message: "#^Parameter \\#1 \\$fp of static method pocketmine\\\\timings\\\\TimingsHandler\\:\\:printTimings\\(\\) expects resource, resource\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/command/defaults/TimingsCommand.php
-
message: "#^Parameter \\#1 \\$source of function stream_get_contents expects resource, resource\\|false given\\.$#"
message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#"
count: 2
path: ../../../src/pocketmine/command/defaults/TimingsCommand.php
-
message: "#^Parameter \\#1 \\$stream of function fseek expects resource, resource\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/command/defaults/TimingsCommand.php
-
message: "#^Parameter \\#1 \\$stream of function stream_get_contents expects resource, resource\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/command/defaults/TimingsCommand.php
@ -276,7 +276,7 @@ parameters:
path: ../../../src/pocketmine/entity/projectile/Projectile.php
-
message: "#^Parameter \\#1 \\$argument of class ReflectionClass constructor expects class\\-string\\<T of object\\>\\|T of object, string given\\.$#"
message: "#^Parameter \\#1 \\$objectOrClass of class ReflectionClass constructor expects class\\-string\\<T of object\\>\\|T of object, string given\\.$#"
count: 1
path: ../../../src/pocketmine/event/HandlerList.php
@ -301,7 +301,7 @@ parameters:
path: ../../../src/pocketmine/item/Item.php
-
message: "#^Parameter \\#2 \\$input1 of function array_map expects array, array\\|false given\\.$#"
message: "#^Parameter \\#2 \\$array of function array_map expects array, array\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/lang/BaseLang.php
@ -546,7 +546,7 @@ parameters:
path: ../../../src/pocketmine/level/format/io/region/McRegion.php
-
message: "#^Parameter \\#1 \\$input of function array_filter expects array, array\\<int, string\\>\\|false given\\.$#"
message: "#^Parameter \\#1 \\$array of function array_filter expects array, array\\<int, string\\>\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/io/region/McRegion.php
@ -616,7 +616,7 @@ parameters:
path: ../../../src/pocketmine/network/mcpe/VerifyLoginTask.php
-
message: "#^Parameter \\#1 \\$str of function str_split expects string, string\\|false given\\.$#"
message: "#^Parameter \\#1 \\$string of function str_split expects string, string\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/network/mcpe/VerifyLoginTask.php
@ -795,3 +795,8 @@ parameters:
count: 3
path: ../../../src/pocketmine/tile/Tile.php
-
message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|false given\\.$#"
count: 1
path: ../../../src/pocketmine/utils/Timezone.php

View File

@ -2,7 +2,7 @@ parameters:
ignoreErrors:
-
message: "#^Parameter \\#3 \\$subject of function preg_replace expects array\\|string, string\\|null given\\.$#"
count: 1
count: 2
path: ../../../build/make-release.php
-
@ -260,11 +260,6 @@ parameters:
count: 1
path: ../../../src/pocketmine/block/BaseRail.php
-
message: "#^Parameter \\#1 \\$constraint of method pocketmine\\\\block\\\\BaseRail\\:\\:getPossibleConnectionDirectionsOneConstraint\\(\\) expects int, int\\|null given\\.$#"
count: 1
path: ../../../src/pocketmine/block/BaseRail.php
-
message: "#^Only numeric types are allowed in \\-, int\\|null given on the left side\\.$#"
count: 1

View File

@ -1,10 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^Method ReflectionMethod\\:\\:getClosure\\(\\) invoked with 0 parameters, 1 required\\.$#"
count: 1
path: ../../phpunit/network/mcpe/StupidJsonDecodeTest.php
-
message: "#^Property pocketmine\\\\network\\\\mcpe\\\\StupidJsonDecodeTest\\:\\:\\$stupidJsonDecodeFunc \\(Closure\\(string, bool\\)\\: mixed\\) does not accept Closure\\|null\\.$#"
count: 1

View File

@ -1,37 +1,77 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(mixed, mixed\\)\\: bool\\)\\|null, Closure\\(pocketmine\\\\Player\\)\\: bool given\\.$#"
count: 1
path: ../../../src/pocketmine/Server.php
-
message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(mixed, mixed\\)\\: bool\\)\\|null, Closure\\(string\\)\\: bool given\\.$#"
count: 1
path: ../../../src/pocketmine/Server.php
-
message: "#^Call to function is_resource\\(\\) with resource will always evaluate to true\\.$#"
count: 3
path: ../../../src/pocketmine/command/CommandReader.php
-
message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(mixed, mixed\\)\\: bool\\)\\|null, Closure\\(pocketmine\\\\Player\\)\\: bool given\\.$#"
count: 1
path: ../../../src/pocketmine/command/defaults/ListCommand.php
-
message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(mixed, mixed\\)\\: bool\\)\\|null, Closure\\(pocketmine\\\\entity\\\\Attribute\\)\\: bool given\\.$#"
count: 1
path: ../../../src/pocketmine/entity/AttributeMap.php
-
message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(mixed, mixed\\)\\: bool\\)\\|null, Closure\\(pocketmine\\\\item\\\\Item\\)\\: bool given\\.$#"
count: 1
path: ../../../src/pocketmine/entity/Human.php
-
message: "#^Call to function assert\\(\\) with false and 'unknown hit type' will always evaluate to false\\.$#"
count: 1
path: ../../../src/pocketmine/entity/projectile/Projectile.php
-
message: "#^Parameter \\#2 \\$callback of function usort expects callable\\(mixed, mixed\\)\\: int, array\\('pocketmine\\\\\\\\inventory\\\\\\\\CraftingManager', 'sort'\\) given\\.$#"
count: 1
path: ../../../src/pocketmine/inventory/CraftingManager.php
-
message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(mixed, mixed\\)\\: bool\\)\\|null, Closure\\(string\\)\\: bool given\\.$#"
count: 1
path: ../../../src/pocketmine/lang/BaseLang.php
-
message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(mixed, mixed\\)\\: bool\\)\\|null, Closure\\(pocketmine\\\\entity\\\\Entity\\)\\: bool given\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/Chunk.php
-
message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(mixed, mixed\\)\\: bool\\)\\|null, Closure\\(string\\)\\: bool given\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/io/region/McRegion.php
-
message: "#^Call to function is_resource\\(\\) with resource will always evaluate to true\\.$#"
count: 2
path: ../../../src/pocketmine/level/format/io/region/RegionLoader.php
-
message: "#^Parameter \\#2 \\$count of function array_fill expects int\\<0, max\\>, int given\\.$#"
count: 2
path: ../../../src/pocketmine/level/generator/noise/Noise.php
-
message: "#^Call to function method_exists\\(\\) with pocketmine\\\\network\\\\mcpe\\\\CachedEncapsulatedPacket and '__toString' will always evaluate to true\\.$#"
count: 1
path: ../../../src/pocketmine/network/mcpe/protocol/DataPacket.php
-
message: "#^Parameter \\#1 \\$ of closure expects TMemberType, TMemberType given\\.$#"
count: 1
path: ../../../src/pocketmine/utils/Utils.php
-
message: "#^Strict comparison using \\=\\=\\= between string and false will always evaluate to false\\.$#"
count: 1
path: ../../../src/pocketmine/utils/Utils.php
-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertNotNull\\(\\) with int and string will always evaluate to true\\.$#"
count: 1
path: ../../phpunit/block/BlockTest.php

View File

@ -0,0 +1,72 @@
parameters:
ignoreErrors:
-
message: "#^Cannot call method getBlockData\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/Level.php
-
message: "#^Cannot call method getBlockId\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/Level.php
-
message: "#^Cannot call method getBlockDataArray\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/Chunk.php
-
message: "#^Cannot call method getBlockDataColumn\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/Chunk.php
-
message: "#^Cannot call method getBlockIdArray\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/Chunk.php
-
message: "#^Cannot call method getBlockIdColumn\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/Chunk.php
-
message: "#^Cannot call method getBlockLightArray\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/Chunk.php
-
message: "#^Cannot call method getBlockLightColumn\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/Chunk.php
-
message: "#^Cannot call method getBlockSkyLightArray\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/Chunk.php
-
message: "#^Cannot call method getBlockSkyLightColumn\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/Chunk.php
-
message: "#^Method pocketmine\\\\level\\\\format\\\\Chunk\\:\\:getHeightMapArray\\(\\) should return array\\<int\\> but returns array\\<int, int\\|null\\>\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/Chunk.php
-
message: "#^Cannot call method getBlockDataArray\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Cannot call method getBlockIdArray\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Cannot call method isEmpty\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php