Compare commits

...

3768 Commits

Author SHA1 Message Date
929cd63135 Release 5.17.1 2024-08-13 10:55:29 -05:00
585dc835e7 Fixed anvil placing rotation. (#6375)
Co-authored-by: IvanCraft623 <57236932+IvanCraft623@users.noreply.github.com>
2024-08-13 16:19:07 +01:00
d077bda30c Bump docker/build-push-action from 6.5.0 to 6.6.1 (#6419) 2024-08-13 14:35:01 +00:00
25c66e4c8b Bump phpstan/phpstan in the development-patch-updates group (#6420) 2024-08-13 13:36:14 +00:00
5a926a79cb Bump phpstan/phpstan in the development-patch-updates group (#6412) 2024-08-06 14:21:20 +00:00
54e7749c0b Bump docker/build-push-action from 6.3.0 to 6.5.0 (#6409) 2024-07-30 06:52:28 +00:00
237677c028 Bump phpstan/phpstan from 1.11.2 to 1.11.8 in the development-patch-updates group (#6410) 2024-07-30 06:47:56 +00:00
df4ada81e5 BedrockWorldData: Update version constants to 1.21.2 (#6399)
Co-authored-by: Dylan T <14214667+dktapps@users.noreply.github.com>
2024-07-16 00:51:06 -05:00
a96f1a5083 Bump docker/build-push-action from 5.3.0 to 6.3.0 (#6387) 2024-07-14 18:17:41 +00:00
1f510caf88 Bump the phpstan group with 2 updates (#6401) 2024-07-12 13:16:44 +00:00
32be474840 dependabot: group PHPStan dependency updates always
these typically need to be updated together anyway
2024-07-12 14:12:47 +01:00
f750b01d8b dependabot: group patch updates into a single PR 2024-07-12 14:10:14 +01:00
31484ee5c1 Merge pull request #6400 from pmmp/dependabot/github_actions/shivammathur/setup-php-2.31.1 2024-07-12 12:46:19 +00:00
786d84a9e1 Bump shivammathur/setup-php from 2.30.4 to 2.31.1
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.30.4 to 2.31.1.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.30.4...2.31.1)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-12 12:43:18 +00:00
85606925a1 BlockStateData: add a note about CURRENT_VERSION
this is not the same as current game version, as the revision is determined by some Mojang internal factors.
2024-07-12 11:26:51 +01:00
616f96a703 Release 5.17.0 (1.21.2 support) 2024-07-10 09:31:25 -05:00
824e270041 5.17.1 is next 2024-07-09 21:16:13 -05:00
37bf4bc0b0 Release 5.17.0 2024-07-09 21:15:18 -05:00
5d60ba36b7 Support for 1.21.2 2024-07-09 21:07:47 -05:00
68d2e2915e Bells always drops themselves (#4802) 2024-07-07 15:20:45 -05:00
20f5741ed7 Bowl: Add fuel return value (#6384) 2024-07-05 17:41:22 -05:00
23b2b75acf Merge pull request #6380 from pmmp/dependabot/composer/phpunit/phpunit-10.5.24 2024-07-04 21:16:19 +00:00
25ea9b2218 Bump phpunit/phpunit from 10.3.5 to 10.5.24
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.3.5 to 10.5.24.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.5.24/ChangeLog-10.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.3.5...10.5.24)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 10:53:54 +00:00
77db7a8941 Merge pull request #6381 from pmmp/dependabot/composer/symfony/filesystem-6.4.9 2024-07-01 10:53:02 +00:00
af4294295b Bump symfony/filesystem from 6.4.7 to 6.4.9
Bumps [symfony/filesystem](https://github.com/symfony/filesystem) from 6.4.7 to 6.4.9.
- [Release notes](https://github.com/symfony/filesystem/releases)
- [Changelog](https://github.com/symfony/filesystem/blob/7.1/CHANGELOG.md)
- [Commits](https://github.com/symfony/filesystem/compare/v6.4.7...v6.4.9)

---
updated-dependencies:
- dependency-name: symfony/filesystem
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 10:19:24 +00:00
585aee9386 Fixed an oopsie from 5ef247620a
I added it to the wrong set of artifacts :(
2024-06-13 18:58:32 +01:00
433bd6a8aa 5.16.1 is next 2024-06-13 18:55:21 +01:00
22a1549998 Release 5.16.0 2024-06-13 18:55:18 +01:00
0ec8465fcf shut! 2024-06-13 18:43:10 +01:00
f121654452 Assemble 1.21.0 2024-06-13 18:41:41 +01:00
08c6e63aac Bump phpstan/phpstan from 1.10.67 to 1.11.2 (#6352)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.67 to 1.11.2.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.67...1.11.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-31 17:01:51 +01:00
4c418b4318 Remove unnecessary return statement (#6350) 2024-05-31 16:54:50 +01:00
fb9a74e879 gitignore files generated by install-local-protocol.sh 2024-05-13 11:52:31 +01:00
554775841e Added script for linking local versions of Bedrock* deps for testing 2024-05-13 11:48:23 +01:00
373dd9938c Update composer dependencies 2024-05-13 11:37:32 +01:00
f772bb7384 WoodenStairs can be a fuel (#6345) 2024-05-13 09:34:18 +01:00
5ef247620a Attach permission doc to every release 2024-05-07 12:46:31 +01:00
1b082f99e9 DefaultPermissions: fixed typo 2024-05-07 12:34:42 +01:00
9b6a0c9945 Bump phpstan/phpstan-strict-rules from 1.5.3 to 1.5.5 (#6335)
Bumps [phpstan/phpstan-strict-rules](https://github.com/phpstan/phpstan-strict-rules) from 1.5.3 to 1.5.5.
- [Release notes](https://github.com/phpstan/phpstan-strict-rules/releases)
- [Commits](https://github.com/phpstan/phpstan-strict-rules/compare/1.5.3...1.5.5)

---
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>
2024-05-06 15:41:59 +01:00
ab3be50b49 Bump phpstan/phpstan from 1.10.66 to 1.10.67 (#6337)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.66 to 1.10.67.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.66...1.10.67)

---
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>
2024-05-06 15:41:50 +01:00
27dc43f131 Bump shivammathur/setup-php from 2.30.2 to 2.30.4 (#6339)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.30.2 to 2.30.4.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.30.2...2.30.4)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  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>
2024-05-06 15:41:40 +01:00
d67f5a5c6f Bump symfony/filesystem from 6.4.6 to 6.4.7 (#6342)
Bumps [symfony/filesystem](https://github.com/symfony/filesystem) from 6.4.6 to 6.4.7.
- [Release notes](https://github.com/symfony/filesystem/releases)
- [Changelog](https://github.com/symfony/filesystem/blob/7.0/CHANGELOG.md)
- [Commits](https://github.com/symfony/filesystem/compare/v6.4.6...v6.4.7)

---
updated-dependencies:
- dependency-name: symfony/filesystem
  dependency-type: direct:production
  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>
2024-05-06 15:41:28 +01:00
ed158f8a1b Server: include uptime in crash restart throttle message
this makes it clearer why the wait duration is chosen instead of it looking random.
2024-04-29 16:36:14 +01:00
d70a7d34a7 Living: don't knockback or do hurt FX when attacked during cooldown
players were switching from a weaker tool to a stronger one to get double knockback in PvP.
while it's intended that we don't cancel the second attack during hit cooldown if the damage is
higher (the first damage is subtracted to prevent doubling up), we don't want them to get double
knockback.
this behaviour now matches vanilla to the best of my observations.

Come at me PvP community... I know some people are going to hate this change
2024-04-29 15:51:43 +01:00
be6754494f 5.15.1 is next 2024-04-25 11:52:31 +01:00
d273ccf87c Release 5.15.0 2024-04-25 11:52:30 +01:00
737f5066a0 Fully cover codegen in CI 2024-04-25 11:48:22 +01:00
10238d7934 Removed beta change 2024-04-25 11:39:09 +01:00
6077748caa Changes for 1.20.80 2024-04-25 11:31:41 +01:00
50e2c469a5 Bump phpstan/phpstan-strict-rules from 1.5.2 to 1.5.3 (#6326)
Bumps [phpstan/phpstan-strict-rules](https://github.com/phpstan/phpstan-strict-rules) from 1.5.2 to 1.5.3.
- [Release notes](https://github.com/phpstan/phpstan-strict-rules/releases)
- [Commits](https://github.com/phpstan/phpstan-strict-rules/compare/1.5.2...1.5.3)

---
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>
2024-04-08 14:24:59 +01:00
fa87602661 Bump build/php from f9601e5 to 084822a (#6323)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `f9601e5` to `084822a`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](f9601e5313...084822aa9e)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 14:24:48 +01:00
d3c9c137ad Bump symfony/filesystem from 6.4.3 to 6.4.6 (#6327)
Bumps [symfony/filesystem](https://github.com/symfony/filesystem) from 6.4.3 to 6.4.6.
- [Release notes](https://github.com/symfony/filesystem/releases)
- [Changelog](https://github.com/symfony/filesystem/blob/7.0/CHANGELOG.md)
- [Commits](https://github.com/symfony/filesystem/compare/v6.4.3...v6.4.6)

---
updated-dependencies:
- dependency-name: symfony/filesystem
  dependency-type: direct:production
  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>
2024-04-08 14:24:11 +01:00
37322e0d50 Armor: only make sound when the item was equipped by player action
this ensures the greatest amount of consistency with vanilla.

in order to prevent the sounds being broadcasted on armor damage with the old method, we'd also have to sacrifice the sound when replacing one leather helmet with another, for example.
this approach minimizes the gameplay impact at the possible expense of plugins.

closes #6325
2024-04-08 14:05:47 +01:00
55cf24aa02 5.14.2 is next 2024-04-05 18:41:27 +01:00
3590d84d03 Release 5.14.1 2024-04-05 18:41:27 +01:00
68f8fa8caf Update pmmpthread required version 2024-04-05 18:40:43 +01:00
1ad190024a 5.14.1 is next 2024-04-05 18:16:22 +01:00
769a149057 Release 5.14.0 2024-04-05 18:16:19 +01:00
ea339355bb Merge branch 'minor-next' into stable 2024-04-05 17:30:59 +01:00
b9288c238b Update BedrockBlockUpgradeSchema 2024-04-05 17:29:16 +01:00
16f29c775e tools/generate-blockstate-upgrade-schema: added support for generating newFlattenedName with value transforms
as seen in pmmp/BedrockBlockUpgradeSchema@ebd768e5b2, this enables use of newFlattenedName in more places (by allowing the flattened values to be transformed before building the new ID), as well as reducing the number of remappedStates in general by compacting stuff which was partially transformed like color silver -> light_gray.
2024-04-05 17:13:38 +01:00
e30e27dd57 Fix CS 2024-04-03 15:43:43 +01:00
cd6634d34b Bump shivammathur/setup-php from 2.30.0 to 2.30.2 (#6315)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.30.0 to 2.30.2.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.30.0...2.30.2)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  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>
2024-04-03 15:37:13 +01:00
f013079ff6 Fixed MainLogger BC break 2024-04-03 15:31:37 +01:00
c4abac4606 Bump build/php from 6f619bf to f9601e5 (#6321)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `6f619bf` to `f9601e5`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](6f619bf7a0...f9601e5313)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 14:03:46 +01:00
11fbc8db6f Make use of pmmpthread 6.1.0 for Thread::getRunningCount()
ThreadManager doesn't count these correctly anymore since pmmpthread since thread-safe statics aren't copied anymore.
2024-04-02 19:40:44 +01:00
022362a01a Update pocketmine/errorhandler to 0.7.0 2024-04-02 19:37:07 +01:00
98380e46bf Ignore non-fatal error types in crash handlers
ErrorToExceptionHandler currently prevents these from appearing by turning them into exceptions, but this won't always be the case.
For example, in the future we may not want to turn ALL types of E_* errors into exceptions (e.g. E_DEPRECATED).
2024-04-02 19:22:40 +01:00
dad9a7e6cd Merge branch 'stable' into minor-next 2024-04-02 16:35:31 +01:00
de6a91dabc Rework consistency check to tolerate dynamic type IDs
we don't actually care about the specific values, only whether all the blocks and their states have been correctly registered.
I'd prefer to track all of the state data permutations, but the APIs for that are private, so tracking the number of permutations will have to suffice (this should be good enough to detect bugs anyway, and also takes way less space).
2024-04-01 18:44:01 +01:00
0615afa766 Bump phpstan/phpstan from 1.10.65 to 1.10.66 (#6317)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.65 to 1.10.66.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.65...1.10.66)

---
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>
2024-04-01 16:12:31 +01:00
d5919dc094 ... 2024-03-25 17:24:52 +00:00
09904dc519 workaround for callback-validator not understanding arrow functions 2024-03-25 14:58:21 +00:00
f799cfaba6 Implemented sound when equipping armor (#6303) 2024-03-25 14:15:54 +00:00
11f119551d Bump phpstan/phpstan from 1.10.62 to 1.10.65 (#6308)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.62 to 1.10.65.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.62...1.10.65)

---
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>
2024-03-25 10:55:22 +00:00
2584314202 NetherRoots: fix placement on soul soil (#6299) 2024-03-25 10:53:16 +00:00
337e462c8f Added new banner patterns (#6298) 2024-03-25 10:52:21 +00:00
b680a1693c Added sound when picking sweet berries (#6287) 2024-03-19 10:18:30 +00:00
0e5395c59b PocketMine-MP.phar self-extraction to decompressed cache (#6217)
Because ext-phar sucks, tmp gets spammed by cache files for every thread when loading files from the phar on the fly.

Instead, we convert the `.phar` into a decompressed `.tar` in the tmp directory and require files from inside it. Surprisingly, this works because `ext-phar` supports `tar` and `zip` natively. No stream wrapper is required, as the `PocketMine.php` bootstrap loads files relative to its location, so the cache is automatically used for everything.

To be honest I would rather get rid of phars entirely, but they are still the easiest way to have PhpStorm load PocketMine-MP API information for now, and the alternatives are more complicated and inconvenient.

### Caveats
Everywhere that previously used `new Phar(Phar::running(false))` in the core code needs to be updated to use `PharData` for this to work correctly. Plugins don't need to do anything.

### Why not just use `Phar::decompressFiles()`?
This requires setting `phar.readonly` to `0`, which is a security issue. Technically, we could have used a subprocess to do this, but it just didn't seem right.

### WTF? `phar://` can be used on `tar` files???
Yup. I was just as surprised to find out that `require` works in such contexts.

### Relevant issues
- Closes #6214 

## Changes
### API changes
None.

### Behavioural changes
Server startup will be slightly slower, as the phar has to decompress and convert itself into a `.tar`. However, testing showed that this generally takes less than 200 ms, so it should be barely noticeable.

## Backwards compatibility
No BC issues.

## Tests
Locally tested and the CI will also verify
2024-03-18 16:48:17 +00:00
94e0bf954b Bump docker/build-push-action from 5.2.0 to 5.3.0 (#6288)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5.2.0...v5.3.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 15:08:13 +00:00
556b00d11f Bump phpstan/phpstan from 1.10.60 to 1.10.62 (#6289)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.60 to 1.10.62.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.60...1.10.62)

---
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>
2024-03-18 15:06:50 +00:00
981f49ff56 CS 2024-03-15 18:03:44 +00:00
f527a4c8fe Added --no-log-file command line option
while this would be more user-friendly as a config option, configs are a pain because they aren't initialized until after the server log has already been set up.
In any case, I foresee that people will likely want to bake this into Dockerfiles directly anyway.
2024-03-15 17:53:50 +00:00
7148c7a222 Log rotate (#4032)
`server.log` is not rotated by default and grows unmanageably large, to the point where it's so huge that it's not possible to read it with any standard text editor anymore.

This PR implements automatic log rotation. 
- When the `server.log` reaches 32MB in size, it's moved to the `log_archive/` folder of the server's data folder.
- The archive's file name will look something like this: `server.2024-03-15T15.26.24.0.log`
- The file's name contains the date and time when the file was archived. This may be useful if you're trying to find logs from a particular time frame.

This has several benefits:
- Much more easily find logs from a particular time frame without scrolling through GBs of logs
- Free up space without stopping the server - Archived log files in `log_archive/` can be safely deleted and/or modified while the server is running

If you want to automatically compress or clean up the log files, I suggest an external cron job or disk watcher.

Closes #4029.
2024-03-15 16:44:37 +00:00
e31fd122d9 BlockStateReader: micro optimize unread properties check
this has a pretty much insignificant performance impact, but reduces the cost of this check to basically 0.
2024-03-14 17:54:26 +00:00
a835069564 Merge remote-tracking branch 'origin/stable' into minor-next 2024-03-14 12:47:04 +00:00
b77193b987 ZlibCompressor: Increase max decompression size to accommodate larger skins
again, very annoying that we have to account for this (it makes it easier for attackers to waste CPU time and memory), but we don't really have much of a choice.
2024-03-14 12:34:30 +00:00
11ca208d93 RakLib: Allow larger number of split packet parts
some persona skins are insanely bloated and get split into hundreds of parts.
it's quite annoying that we have to accommodate this, but we can't keep allowing players to experience login timeouts without an obvious indication what's wrong.
2024-03-14 12:32:26 +00:00
8d7f1a8557 BlockStateUpgraderTest: fixed tests for 7ff0ae19d6 2024-03-13 18:35:07 +00:00
7ff0ae19d6 BlockStateUpgrader: a simple yet hard-to-explain optimization
Prior to this commit, upgrade schemas would be applied to blockstates with the same version, as there wasn't any way to know if they should be applied or not given Mojang's tendency to forget to bump the version.
However, it occurred to me that we only need to do this if there are multiple schemas present for the same version ID, which is rarely the case.
This allows skipping costly logic for blockstates on the newest version (the common case), reducing the time taken to process the blockstate for upgrading by over 30%.
Overall, this translates into less than 10% real performance improvement for chunk loading, but it's still a worthwhile improvement.
2024-03-13 18:19:51 +00:00
1de66cb0de RegistryTrait: added fast path optimization
this reduces VanillaBlocks access time from 360 ns to 230 ns on my machine - an improvement of about 35%.
2024-03-13 17:11:06 +00:00
9f3533d870 Improved logging for block decode errors
this is still noisy, but less so than before.
this also adds logging to places where it was previously missing.
2024-03-13 16:42:23 +00:00
2d24fac067 5.13.1 is next 2024-03-13 14:59:21 +00:00
f193a990b0 Release 5.13.0 2024-03-13 14:59:21 +00:00
c11c0679e3 Fix CS 2024-03-13 14:55:54 +00:00
ba48f258f3 Support for 1.20.70 2024-03-13 14:53:27 +00:00
e105c9bd76 5.12.2 is next 2024-03-13 13:48:59 +00:00
23f4632409 Release 5.12.1 2024-03-13 13:48:56 +00:00
264ce06cbf Updated composer dependencies 2024-03-12 16:51:12 +00:00
a6202d0442 BlockStateUpgrader: calculate output version ID in a less stupid way
this improves the performance by a conservative 10%.
2024-03-12 11:48:48 +00:00
8ec304e66e BlockStateUpgradeSchema: avoid unnecessary property access and calculation
this was costing a surprisingly large 5-10% of the processing time for blockstate data.
2024-03-12 11:45:08 +00:00
cbffbd23f9 Bump docker/build-push-action from 5.1.0 to 5.2.0 (#6281)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5.1.0...v5.2.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-12 09:30:29 +00:00
9d7aec5891 Bump phpstan/phpstan from 1.10.59 to 1.10.60 (#6282)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.59 to 1.10.60.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.59...1.10.60)

---
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>
2024-03-12 09:30:03 +00:00
ac8dbf8640 BlockStateUpgrader: extract state remap to its own function 2024-03-06 12:56:49 +00:00
dbc7105e5b Merge branch 'resource-pack-ack-receipts' into minor-next 2024-03-04 15:46:31 +00:00
3b97d067a3 Merge remote-tracking branch 'origin/stable' into minor-next 2024-03-04 15:40:10 +00:00
b0390a39fd Update composer dependencies 2024-03-04 15:17:48 +00:00
5cb69e00d0 NetworkSession: remove hardcoded limit
this is already covered by the dynamic Game Packets rate limit, which is much more effective at dealing with this anyway.
2024-03-04 14:36:40 +00:00
781e3643dd Clean up 2024-03-04 14:25:47 +00:00
2ca50ecd36 Bump shivammathur/setup-php from 2.29.0 to 2.30.0 (#6273)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.29.0 to 2.30.0.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.29.0...2.30.0)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 11:54:53 +00:00
5ad63f27bb Update RakLib (again) 2024-03-02 01:02:57 +00:00
f13eaaab05 Update RakLib 2024-03-02 00:08:49 +00:00
72f3c0b4b9 NetworkSession: fixed timings not being stopped when handling uncompressed packets 2024-03-01 17:36:40 +00:00
b9a1ef1357 Throttle resource pack sending using ack receipts
this isn't the best solution, as it limits the download speed somewhat, but it's relatively simple and works quite well.
closes #3127
2024-03-01 17:07:19 +00:00
4abc36275c Remove newline 2024-03-01 17:02:44 +00:00
4b5ac53276 Fixes 2024-03-01 17:01:32 +00:00
90409b50d1 Allow offering different resource packs to different players (#6249)
closes #6248
2024-03-01 14:53:59 +00:00
bc2abf4b15 First shot at packet ack receipt support
this will be useful for preventing resource pack sending from overloading the network.
it's not the best solution for that (since it means the RTT will limit the pack download speed), but it's easier than implementing congestion control and will work fine in most cases.
2024-03-01 14:41:53 +00:00
b2c97cf2f1 5.12.1 is next 2024-02-28 18:14:41 +00:00
a35c3406a8 Release 5.12.0 2024-02-28 18:14:37 +00:00
54ea404d80 Merge branch 'minor-next' into stable 2024-02-28 17:39:25 +00:00
98042f844f Merge remote-tracking branch 'origin/stable' into minor-next 2024-02-28 17:36:21 +00:00
a0cca53f52 Fixed mismatched predictions due to NBT key order differences
this is a pain :(
It appears the client always sorts the keys in alphabetical order due to use of std::map. However I'm not sure of the exact ordering behaviour, so it needs to be investigated.
2024-02-27 16:07:43 +00:00
6872118355 Update BedrockProtocol to release version 2024-02-27 14:15:31 +00:00
efd113bdc8 Integrate pmmp/BedrockProtocol@65b3d0b341 2024-02-26 17:09:09 +00:00
34a5f91aa9 5.11.3 is next 2024-02-26 14:45:48 +00:00
aee3656415 Release 5.11.2 2024-02-26 14:45:47 +00:00
c58e599eb2 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2024-02-26 14:35:40 +00:00
47f0119660 InGamePacketHandler: added an extra check 2024-02-26 14:35:21 +00:00
561ffd3da3 Bump pmmp/setup-php-action from 3.0.0 to 3.1.0 (#6267)
Bumps [pmmp/setup-php-action](https://github.com/pmmp/setup-php-action) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/pmmp/setup-php-action/releases)
- [Commits](https://github.com/pmmp/setup-php-action/compare/3.0.0...3.1.0)

---
updated-dependencies:
- dependency-name: pmmp/setup-php-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 14:27:56 +00:00
b744e09352 5.11.2 is next 2024-02-23 14:19:02 +00:00
7b89dda420 Release 5.11.1 2024-02-23 14:19:01 +00:00
db665fefdb Harden JsonMapper defaults in general 2024-02-23 14:10:24 +00:00
6872661fd0 Harden JsonMapper on login JSON handling 2024-02-23 14:10:02 +00:00
920341668f Implemented working Name tag (#5209) 2024-02-19 18:46:48 +00:00
4fab518384 PluginManager: do not accept generator functions as event handlers
closes #4912

I didn't merge the original PR because this needs to be checked for explicitly registered handlers as well as auto-detected ones from listeners.
2024-02-19 16:53:53 +00:00
e06b042cd0 Bump pmmp/setup-php-action from 2.0.0 to 3.0.0 (#6259)
Bumps [pmmp/setup-php-action](https://github.com/pmmp/setup-php-action) from 2.0.0 to 3.0.0.
- [Release notes](https://github.com/pmmp/setup-php-action/releases)
- [Commits](https://github.com/pmmp/setup-php-action/compare/2.0.0...3.0.0)

---
updated-dependencies:
- dependency-name: pmmp/setup-php-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 16:16:28 +00:00
44ce9ca610 Bump phpstan/phpstan from 1.10.57 to 1.10.58 (#6260)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.57 to 1.10.58.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.57...1.10.58)

---
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>
2024-02-19 16:16:16 +00:00
2616d8c5ad New biome IDs, courtesy of build/generate-biome-ids 2024-02-19 16:10:46 +00:00
61d0181bfd Added script to generate biome IDs
this has been sitting in my local workspace for a very long time
2024-02-19 16:10:22 +00:00
db894e3a4a Fixed Utils::cloneObjectArray() template signature (#6255) 2024-02-16 16:52:10 +00:00
53cbc44d70 Update PULL_REQUEST_TEMPLATE.md
[ci skip]
2024-02-15 14:51:34 +00:00
be102dc95f Bump ncipollo/release-action from 1.13.0 to 1.14.0 (#6250)
Bumps [ncipollo/release-action](https://github.com/ncipollo/release-action) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/ncipollo/release-action/releases)
- [Commits](https://github.com/ncipollo/release-action/compare/v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: ncipollo/release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-12 11:51:31 +00:00
d211392b67 Merge remote-tracking branch 'origin/stable' into minor-next 2024-02-12 11:46:48 +00:00
eaab1a8784 ChunkSerializer: fixed count calculation for non-overworld chunks
plugins that implement dimensions can't change the number of subchunks used by Chunk, they can only choose to use a subset of them.
2024-02-07 18:58:41 +00:00
169d3e0de8 5.11.1 is next 2024-02-07 13:01:30 +00:00
ce8fecc6ec Release 5.11.0 2024-02-07 13:01:30 +00:00
4fcb644c51 Added missing imports 2024-02-07 12:51:39 +00:00
826cbea0bc Use newer php-cs-fixer on Actions 2024-02-07 12:51:27 +00:00
fe06bfcda0 Import alias cleanup courtesy of newest php-cs-fixer 2024-02-07 12:50:37 +00:00
f54ed8362d tools/convert-world: add a namespace
not sure why this was left in the global namespace to its own devices
2024-02-07 12:49:05 +00:00
8c7a4d720a Fixed inconsistent global namespace reference 2024-02-07 12:46:11 +00:00
6492e7f4a2 1.20.60 support 2024-02-07 12:33:44 +00:00
6bb84bc46c Add Promise::all (#6152) 2024-02-06 12:42:24 +00:00
20837c9894 Merge remote-tracking branch 'origin/stable' into minor-next 2024-02-05 12:43:39 +00:00
f207d1bbf2 Make CocoaBlock Flowable (#6218) 2024-02-05 12:36:09 +00:00
5709d727a2 Bump phpstan/phpstan from 1.10.55 to 1.10.57 (#6235)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.55 to 1.10.57.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.55...1.10.57)

---
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>
2024-02-05 12:30:19 +00:00
234199d241 Bump actions/cache from 3 to 4 (#6229)
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-05 12:29:49 +00:00
e28d20a68e Bump shivammathur/setup-php from 2.28.0 to 2.29.0 (#6228)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.28.0 to 2.29.0.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.28.0...2.29.0)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-05 12:29:34 +00:00
81d5b9ba06 tools/generate-bedrock-data-from-packets: add more exception detail for unexpected block runtimeIDs 2024-01-22 18:49:06 +00:00
d97c8e2fd2 tools/generate-item-upgrade-schema: filter old IDs that were already renamed by previous schemas
this caused weird outputs if an item was renamed multiple times.
2024-01-22 18:48:32 +00:00
c7c20d4d79 tools/generate-block-palette-spec: fixed sorting 2024-01-09 16:43:11 +00:00
c6a09e5ed8 Merge branch 'stable' into minor-next 2024-01-09 16:17:55 +00:00
e77cd39316 ItemBlock: add a workaround for air items with a stack size bigger than 0
In the future we should look into making empty slots be represented by null or a different, special item type, instead of breaking the air block for this purpose.

closes #6185
closes #6016
2024-01-09 15:55:41 +00:00
a459e3c1a9 Block: improve some documentation 2024-01-09 13:35:36 +00:00
288bd4018b Block: deprecate isSolid()
As discussed many years ago in #2551, no one actually knows what this property actually means. It definitely isn't the conventionally expected definition of 'solid' found in the real world, as signs are solid but flower pots are not.
2024-01-09 13:35:10 +00:00
9b03b082ab Added --version option 2024-01-09 13:04:14 +00:00
db3bb55a2b Change PHP_DEBUG constant usage to ZEND_DEBUG_BUILD
In PHP 8.4, the type of `PHP_DEBUG` changes from `int` to `bool`.
See [PHP.Watch: PHP 8.4: `PHP_ZTS` and `PHP_DEBUG` constant value type changed from `int` to `bool`](https://php.watch/versions/8.4/PHP_ZTS-PHP_DEBUG-const-type-change).

This changes the constants to `ZEND_DEBUG_BUILD`, which contains the same value but as a `bool` across all PHP versions.

closes #6222
2024-01-09 12:30:24 +00:00
8372c9efc2 Merge branch 'stable' into minor-next 2024-01-09 12:27:25 +00:00
4db38ee452 Updated PHPStan 2024-01-08 16:20:42 +00:00
ee977c8001 Updated composer dependencies 2024-01-08 16:18:13 +00:00
5b5c73f660 Matrixify jobs that run on all PHP versions
this allows us to specify PHP versions in just one place instead of 4,
and also makes the display of jobs in the UI nicer.
2024-01-08 16:13:09 +00:00
f83280ece6 Bump tests/plugins/DevTools from 411fd5b to c6dca35 (#6216)
Bumps [tests/plugins/DevTools](https://github.com/pmmp/DevTools) from `411fd5b` to `c6dca35`.
- [Release notes](https://github.com/pmmp/DevTools/releases)
- [Commits](411fd5bdc0...c6dca357c7)

---
updated-dependencies:
- dependency-name: tests/plugins/DevTools
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-08 16:11:18 +00:00
19556634e3 Bump build/php from 73e5950 to 6f619bf (#6220)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `73e5950` to `6f619bf`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](73e5950eb9...6f619bf7a0)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-08 16:08:54 +00:00
5718a1a20e Reduce frequency of annoying Dependabot updates
phpstan is releasing sometimes 4-5 times a week at this point, generating lots of noise.
2024-01-08 11:38:29 +00:00
5386e86079 ProcessLoginTask: remove old root key (#6211) 2024-01-03 12:50:05 +00:00
1b0ef468f3 CommonThreadPartsTrait: remove outdated documentation
This is now automatically called by the final run(), and the user now only needs to implement onRun(), so they have no business calling this function.
2023-12-21 13:09:05 +00:00
b69843a8bd CommonThreadPartsTrait: add common implementation of quit()
there's no need for the worker specialization here (isShutdown and shutdown are aliased to isJoined and join respectively), and the unstacking is not really desirable either as we previously learned with AsyncPool.
2023-12-21 12:56:51 +00:00
03619ebca9 Thread/Worker: Remove duplicated code
Despite the comments, there doesn't seem to be an obvious reason for these to be copy-pasted. Perhaps there was some legacy reason for this with legacy pthreads.
In fact, it looks likely that quit() will probably be able to be traitified too.
2023-12-21 12:44:03 +00:00
fd1bc1b845 AsyncWorker: deprecate ThreadStore methods
these are inconvenient and don't make any sense. It's far easier and more static-analysis-friendly to just use static properties.
2023-12-21 12:39:55 +00:00
c05116849a AsyncWorker: clean up nonsensical sleeper notifier handling code 2023-12-21 12:39:12 +00:00
7a55a6e6b6 ServerKiller: harden against spurious wakeups
If awakened by spurious wakeup, the thread would immediately exit without doing anything, rendering it useless.
Not sure how it took so long for this to be found...
2023-12-20 17:22:11 +00:00
bf99917f2a ThreadSafeClassLoader: add native property types 2023-12-20 17:01:20 +00:00
57f3a04bc5 data: Use statically analyzable ways of ensuring all cases are registered
PHPStan will verify that these matches cover all cases, which guarantees that all cases will be covered.
In addition, if PHPStan is not used, the constructors will immediately bail out when they hit a case that isn't covered.
The only downside is the extra indentation :(
2023-12-20 16:07:05 +00:00
c51b1b2812 Create LightableTrait and remove repetitive code (#6111) 2023-12-20 15:21:11 +00:00
80125f9b19 Modernize single-use phpstan-template tags 2023-12-20 15:20:28 +00:00
8dc28b7ea8 RuntimeDataDescriber: remove useless template parameter 2023-12-20 15:15:43 +00:00
58ce746ae1 Remove dead PHPStan ignored error 2023-12-20 14:44:24 +00:00
74cb0be868 Noise: give PHPStan some help understanding SplFixedArray 2023-12-20 14:43:36 +00:00
4d9b97d2bb Merge branch 'stable' into minor-next 2023-12-20 14:30:38 +00:00
90af8cfd69 Update composer dependencies 2023-12-20 14:29:02 +00:00
c8da9dea95 WorldManager: Remove unused if in unloadWorld() (#6203) 2023-12-20 10:38:00 +00:00
e1f4fd3048 ProcessLoginTask: remove dead comments
This is no longer an issue since b2df405cc0.
2023-12-15 16:01:43 +00:00
d3d7f24015 Noise: make calls with many parameters less nauseating to read 2023-12-15 15:32:54 +00:00
944dd7d3e4 BaseBanner: remove unnecessary array_filter() usage 2023-12-15 15:19:44 +00:00
a03013d582 Bump phpstan/phpstan from 1.10.47 to 1.10.50 (#6198)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.47 to 1.10.50.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.47...1.10.50)

---
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>
2023-12-15 14:49:32 +00:00
053abfbb6f Bump actions/upload-artifact from 3 to 4 (#6199)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-15 12:23:49 +00:00
00a8ea267c 5.10.1 is next 2023-12-14 16:54:42 +00:00
daeba95101 Release 5.10.0 2023-12-14 16:54:38 +00:00
a750af72db Updated build/php submodule to pmmp/PHP-Binaries@73e5950eb9 2023-12-14 16:05:38 +00:00
61decaa2f8 Merge branch 'minor-next' into stable 2023-12-14 16:04:51 +00:00
06b2e61d3c Merge remote-tracking branch 'origin/stable' into minor-next 2023-12-14 14:02:15 +00:00
b4838f5b4e 5.9.1 is next 2023-12-06 15:02:57 +00:00
46307973e3 Release 5.9.0 2023-12-06 15:02:57 +00:00
2f1d6115a0 Merge branch 'legacy/pm4' into stable 2023-12-06 14:55:18 +00:00
ba89ae5bf2 4.26.1 is next 2023-12-06 14:53:00 +00:00
30433bba10 Release 4.26.0 2023-12-06 14:52:59 +00:00
ed3fe2b727 Update dependencies for 1.20.50 2023-12-06 14:47:44 +00:00
927f129c6e Fixed borked world loading 2023-12-06 14:41:19 +00:00
2a136c7804 Update composer dependencies 2023-12-06 14:37:27 +00:00
25cca1b63f Changes for 1.20.50 2023-12-06 14:29:23 +00:00
15574ec99a Update composer dependencies 2023-12-06 14:28:30 +00:00
2420dee8be AsyncTask: Fix retrieval of null data from the thread-local storage (#6176) 2023-12-06 13:40:09 +00:00
bd65948453 Bump phpstan/phpstan from 1.10.46 to 1.10.47 (#6189)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.46 to 1.10.47.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.46...1.10.47)

---
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>
2023-12-06 13:29:40 +00:00
0984aa670d Bump phpstan/phpstan from 1.10.44 to 1.10.46 (#6182)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.44 to 1.10.46.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.44...1.10.46)

---
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>
2023-11-29 16:33:04 +00:00
239f9ed83a Bump shivammathur/setup-php from 2.27.1 to 2.28.0 (#6179)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.27.1 to 2.28.0.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.27.1...2.28.0)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-29 16:32:42 +00:00
b2df405cc0 NetworkSession: Send less information to clients on error disconnects
in particular, the information from VerifyLoginTask shouldn't be sent to clients, as it could contain sensitive information.
This change only affects disconnection screens. The server log shows the same amount of information as before (though formatted differently in some cases).
2023-11-29 16:31:59 +00:00
ace
d596dc571d Fix pitcher pod wrongly registered as a block (#6162) 2023-11-27 14:46:20 +00:00
bc11894f0a Bump build/php from 6b4c9c7 to b0ffbdb (#6178)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `6b4c9c7` to `b0ffbdb`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](6b4c9c76bd...b0ffbdbe33)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-27 11:01:36 +00:00
d51475dc72 Bump docker/build-push-action from 5.0.0 to 5.1.0 (#6169)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5.0.0...v5.1.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-24 16:31:34 +00:00
233c8b746d Bump phpstan/phpstan from 1.10.41 to 1.10.44 (#6172)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.41 to 1.10.44.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.41...1.10.44)

---
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>
2023-11-24 16:31:18 +00:00
c1f0f13d5a Add PHP 8.3 to test matrix 2023-11-24 16:29:27 +00:00
06e2d36294 Bump build/php from 19f2ee6 to 6b4c9c7 (#6171)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `19f2ee6` to `6b4c9c7`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](19f2ee6d33...6b4c9c76bd)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-22 11:06:32 +00:00
a1748a92ca Avoid unnecessary TypeConverter::getInstance() calls
we already have it available within these contexts
2023-11-17 14:00:25 +00:00
fbcf4649eb Avoid unnecessary Entity::getWorld() calls in loops 2023-11-17 13:58:41 +00:00
0f620fad94 ChunkCache: inline unnecessary function 2023-11-17 13:30:44 +00:00
67ad2bad17 World: fixed edge case that could lead to crash during block update sending 2023-11-17 13:24:06 +00:00
bc07778434 Avoid unnecessary CompressBatchPromise allocations for sync-prepared batches
Sync-prepared batches account for the vast majority of outbound packets. Avoiding these useless objects further reduces the overhead of zero-compressed packets, as the creation of these objects is a significant part of the overhead for these cases.

closes #6157
2023-11-17 12:35:42 +00:00
519784460f Merge branch 'stable' into minor-next 2023-11-17 12:04:10 +00:00
a25597ca30 Server: updated documentation for prepareBatch() 2023-11-17 12:01:19 +00:00
ace
89fbb3fd0d Fix loading of Item Frame item rotation (#6123) 2023-11-16 10:16:29 +00:00
e9c5846a06 World: simplify condition 2023-11-16 10:06:43 +00:00
886ed60e6a Bump build/php from 3c3c483 to 19f2ee6 (#6163)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `3c3c483` to `19f2ee6`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](3c3c483baa...19f2ee6d33)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-16 09:39:26 +00:00
8f107e785b Bump dessant/support-requests from 3 to 4 (#6160)
Bumps [dessant/support-requests](https://github.com/dessant/support-requests) from 3 to 4.
- [Release notes](https://github.com/dessant/support-requests/releases)
- [Changelog](https://github.com/dessant/support-requests/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dessant/support-requests/compare/v3...v4)

---
updated-dependencies:
- dependency-name: dessant/support-requests
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-15 17:06:23 +00:00
69f197dbec PluginBase: fixed erroneous replacement 2023-11-14 13:04:14 +00:00
13f34a500c PluginBase: clean up inconsistent getter vs property access usages 2023-11-14 12:59:38 +00:00
e5c96faa4b Server: clean up inconsistent getter vs property access usages 2023-11-14 12:59:05 +00:00
dd98e4aaed block: clean up unnecessary getter usages
with the assistance of a custom phpstan rule
this inconsistent mess has been bothering me for a long time
2023-11-14 12:47:33 +00:00
e525699dd4 TimeTrackingSleeperHandler: record time spent in each Snooze handler 2023-11-13 11:35:39 +00:00
0ad6429fee Fix RegistryTrait documentation (#6153) 2023-11-13 11:15:07 +00:00
923c922960 Merge branch 'stable' into minor-next 2023-11-13 11:13:12 +00:00
77590fb63a Server: fixed prepareBatch() not being marked as internal 2023-11-13 11:12:12 +00:00
bd43ff6579 Update README.md
[ci skip]
2023-11-10 16:27:57 +00:00
c2189bc2df Update README.md
[ci skip]
2023-11-10 16:16:49 +00:00
58ea94bab8 ... 2023-11-10 15:41:17 +00:00
22b10e4cb0 Timings: Stop using BREAKDOWN group
with tree timings, the breakdown is actually pretty annoying, since it makes it hard to find a timer in the aggregate lists.
2023-11-10 15:36:35 +00:00
c44758f36c StringToItemParser: added pitcher_plant and pitcher_pod
it seems a bit weird to map pitcher_pod to PITCHER_CROP(). Perhaps this wasn't implemented correctly.
2023-11-10 15:26:02 +00:00
7a4cf8ef68 Prepare for PHP 8.2 as primary version 2023-11-09 19:04:53 +00:00
269b3d89a2 Update build/php submodule to pmmp/PHP-Binaries@39885cf248 2023-11-09 19:03:12 +00:00
b3766834c6 Merge branch 'stable' into minor-next 2023-11-09 19:02:08 +00:00
93699024da 5.8.3 is next 2023-11-09 18:51:20 +00:00
c3c81b09e8 Release 5.8.2 2023-11-09 18:51:17 +00:00
08f9873c32 Update build/php submodule to pmmp/PHP-Binaries@3c3c483baa 2023-11-09 18:30:03 +00:00
50592dc269 Merge branch 'stable' into minor-next 2023-11-09 18:05:38 +00:00
e3700cab50 ZlibCompressor: use libdeflate for level 0 compression
this is supported since libdeflate 1.15 and ext-libdeflate 0.2.0.
Everyone should be using these versions by now anyway, and if they aren't, they should update.

libdeflate's level 0 compression is over 20 times faster than zlib, so this is a nice performance improvement.
2023-11-09 18:05:07 +00:00
4103631bc1 Added Smithing Template items (#6132) 2023-11-09 14:25:49 +00:00
ace
c1ed182112 Fix loading of sign text from vanilla world (#6122) 2023-11-09 14:22:37 +00:00
5f3a2a5096 BlockStateUpgrader: fixed undefined array key when flattening a block whose new ID is the same as the old
this came up during 1.20.50 testing, where minecraft:stone[stone_type=stone] continues to have an ID minecraft:stone without the stone_type property.
This could have appeared in other ways, such as with an invalid legacy blockstate.
2023-11-08 18:52:22 +00:00
8ccaf907d1 tools/generate-blockstate-upgrade-schema: do not optimize state remaps with unchanged IDs
processRemappedStates() needs to know about the full set of states to generate reliable mappings.
Without it, it may generate flattening rules or state matching criteria that unintentionally match states that it's not aware of.
Sadly, this does make some schemas bigger, but it's for the best.
2023-11-08 15:19:02 +00:00
6b5c405939 Bump shivammathur/setup-php from 2.26.0 to 2.27.1 (#6142)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.26.0 to 2.27.1.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.26.0...2.27.1)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-08 12:06:43 +00:00
d09af2e30d World: don't assume that random Vector3 are int vectors
we can safely assume this for blocks (though the type info doesn't reflect it) but this is not safe to assume for random APIs that might be used by plugins.
2023-11-06 17:15:17 +00:00
bbe66e8e09 Block: Improve performance of encodeFullState()
if there's no state data to encode, we can avoid useless calls and object allocations.
For the best cases (blocks which don't use state data at all) this improves the performance of getStateId() by more than 10x.
Blocks which use one or the other benefit by a smaller but still significant margin.
2023-11-06 17:04:39 +00:00
457660235e Crops must have access to a light level of at least 9 2023-11-06 16:02:57 +00:00
9fc9609694 Fix ancient debris not being fireproof (#6138) 2023-11-06 15:01:43 +00:00
1055b7580a Bump phpstan/phpstan from 1.10.40 to 1.10.41 (#6139)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.40 to 1.10.41.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.40...1.10.41)

---
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>
2023-11-06 15:00:06 +00:00
3385087c56 Fix Iron & Gold ores not affected by fortune (#6134) 2023-11-04 10:57:53 +00:00
d3b7861d1a Constify bootstrap options 2023-11-02 16:15:57 +00:00
a6b36d6c3c CropGrowthHelper: avoid unnecessary checks 2023-11-02 15:32:22 +00:00
109673382d Implemented modifiers for crop growth speed
closes #6070

there are some unresolved questions about the growth speed of beetroots, pitcher plants and torchflower crops, but that's a topic for another commit.
this change also doesn't account for the light levels.
2023-11-02 15:16:11 +00:00
1e4a1565bb Stem: fixed not attaching to grown pumpkin/melon
no idea how this got missed ...
2023-11-02 14:48:45 +00:00
8aaa6dd176 Stem: do not disable ticking when the stem is not attached to a pumpkin
fixes #6131
2023-11-02 14:47:55 +00:00
07dff9c9e8 5.8.2 is next 2023-11-01 17:55:23 +00:00
75a39491be Release 5.8.1 2023-11-01 17:55:22 +00:00
a10e4b6481 Merge branch 'minor-next' into stable 2023-11-01 17:51:52 +00:00
68c6b87678 5.8.1 is next 2023-11-01 17:49:56 +00:00
e20c031aa1 Release 5.8.0 2023-11-01 17:49:53 +00:00
9832fe899f Merge branch 'stable' into minor-next 2023-11-01 16:39:44 +00:00
55f3477ed9 5.7.2 is next 2023-11-01 16:37:46 +00:00
2c17f82eb8 Release 5.7.1 2023-11-01 16:37:46 +00:00
e6e2c54ec9 Fixed various reentrant-unsafe 2D array element unsets (similar to previous commit)
this pattern was used in various places
2023-11-01 16:28:59 +00:00
abce512860 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-11-01 16:13:44 +00:00
0093732d49 PermissionManager: fixed non-reentrant-safe permission unsubscribing
during unset(), the destructors for other objects with cyclic references can get triggered, resulting in the functions being reentered before the count() call. This leads to a crash because the offset no longer exists.
Instead, we check if only the given PermissibleInternal is present, and clean everything up with a single unset instead of two.
This could also have been solved by adding extra isset() checks before checking the counts, but this way seemed more elegant.

This is similar to an issue with AsyncTask thread-local storage a few months ago, which was also caused by GC reentrancy.

closes #6119
2023-11-01 16:13:28 +00:00
9eb2a46942 World: remove useless isChunkLoaded checks
getChunkEntities() will return an empty array if the chunk isn't loaded anyway, so this is just wasting CPU cycles.
2023-11-01 15:53:37 +00:00
1402571055 Bump phpstan/phpstan from 1.10.39 to 1.10.40 (#6126)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.39 to 1.10.40.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.39...1.10.40)

---
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>
2023-11-01 15:26:46 +00:00
34bb86d2bf Bump phpstan/phpstan-strict-rules from 1.5.1 to 1.5.2 (#6125)
Bumps [phpstan/phpstan-strict-rules](https://github.com/phpstan/phpstan-strict-rules) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/phpstan/phpstan-strict-rules/releases)
- [Commits](https://github.com/phpstan/phpstan-strict-rules/compare/1.5.1...1.5.2)

---
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>
2023-11-01 15:26:30 +00:00
b41960dfec Merge branch 'stable' into minor-next 2023-10-26 12:55:47 +01:00
0b2fc84827 5.7.1 is next 2023-10-26 12:51:45 +01:00
22b9e70372 Release 5.7.0 2023-10-26 12:51:45 +01:00
a222636476 Merge branch 'legacy/pm4' into stable 2023-10-26 12:47:19 +01:00
fb586cc562 4.25.1 is next 2023-10-26 12:43:16 +01:00
f3f22ba48b Release 4.25.0 2023-10-26 12:43:16 +01:00
a2e6e2e5b9 Update PHPStan 2023-10-26 12:39:45 +01:00
1aaaadb909 1.20.40 changes (PM4) 2023-10-26 12:36:12 +01:00
53a740433f Changes for 1.20.40 2023-10-26 12:32:59 +01:00
8491d3c6c0 Merge branch 'stable' into minor-next 2023-10-24 11:56:51 +01:00
d637370b83 Wipe internal block AABB cache only for specific blocks that need it
the vast majority of blocks don't need this cache erasing, so it's costing performance for no good reason.
2023-10-23 17:38:04 +01:00
f655eda3b3 Player: bypass slow function call
for some reason the isSpectator() call here can take upwards of 2 microseconds, for no obvious reason. Subsequent calls are much faster, so I think there's some weird cache thing going on here.
2023-10-23 16:05:13 +01:00
af432c1a7f Give neighbour block updates its own timer
this way we aren't conflating them with scheduled updates, which are usually caused by e.g. water
2023-10-23 12:33:36 +01:00
9fcc9f4338 StringToItemParser: added missing blocks
closes #6108
2023-10-23 12:24:02 +01:00
41c5f63565 World: remove dead code 2023-10-23 12:17:41 +01:00
73b1fba53c Fixed Promise<null> calling rejection handler given after being successfully resolved
closes #6110

this is a weird use case, but it should work nonetheless.
2023-10-23 11:46:08 +01:00
8e17aed4f4 Fix build 2023-10-20 17:43:04 +01:00
1f461977d4 Block: Avoid useless Vector3 allocations in getHorizontalSides and getAllSides 2023-10-20 17:28:19 +01:00
e4888d7102 ÂCONTRIBUTING.md: restructure, reword and reorganize
[ci skip]
2023-10-20 12:12:14 +01:00
450ad42202 Added some new recommendations to CONTRIBUTING.md 2023-10-20 11:37:58 +01:00
eb935ca80f ÂLeaves: use a constant for max distance from wood 2023-10-20 11:20:30 +01:00
1c5d3b43be 5.6.2 is next 2023-10-20 10:30:50 +01:00
decc188302 Release 5.6.1 2023-10-20 10:30:50 +01:00
8fa5c7cdab World: do not apply fake state properties from tile if the block doesn't expect this tile type
This was causing a variety of crashes due to incorrect tiles, presumably from PM3 worlds.
2023-10-20 10:28:46 +01:00
7dd3a70d2e Revert "World: discard tiles on load if they aren't the correct type or no tile is expected"
This reverts commit 8f804f6f34.

This change is too disruptive, since popular plugins like
ExtendedBlocks and ExtendedBlocksConverter relied on custom tiles.
Deleting them at this stage would prevent these plugins from working,
making it impossible to upgrade old data.

An alternative solution to this problem will need to be developed.
2023-10-20 10:16:49 +01:00
dbb5a32a96 Liquid: eliminate unnecessary Position allocations and getSide() calls 2023-10-19 17:09:13 +01:00
9474324f75 Liquid: simplify code 2023-10-19 17:02:40 +01:00
ada37899aa Liquid: improve code legibility and fix a bunch of PHPStan errors 2023-10-19 17:02:22 +01:00
f1440324a7 Update PHPStan baselines 2023-10-19 16:56:15 +01:00
73659318f6 World: Avoid unnecessary Vector3 usages in neighbour block update scheduling
The old code was allocating 6 Vector3s which were all immediately discarded. In addition, we didn't need to take the performance hit of reading Vector3 properties when we could have just passed integers directly.
The real performance difference of this is likely to be close to zero, but it's still worth doing.
2023-10-19 16:46:52 +01:00
f868c1d8c6 Liquid: Update legacy code with Facing::OFFSET 2023-10-19 16:38:34 +01:00
114f444ec3 Update PHPStan baseline 2023-10-19 13:28:40 +01:00
19a1792184 Fixed behavioural change on invalid Facing introduced by previous commit
while this shouldn't be given invalid facings anyway, Vector3::getSide() accepts them and just returns itself.
2023-10-19 13:27:44 +01:00
6a3ec70c72 ÂBlock: use Facing::OFFSET in getSide()
instead of the comically inefficient getBlock() + throwaway Position->getSide()
This improved the function's performance by 2.3x.
2023-10-19 13:25:32 +01:00
ccd2cdd324 World: improve performance of calculating non-cached AABBs for a cell
Avoiding getSide() improved the performance by 2x ...
2023-10-19 13:13:46 +01:00
c7a358a56f World: extract getBlockCollisionBoxes() from getCollisionBoxes()
closes #6104

This function has been a footgun for anyone using it, since it also returns entity AABBs by default.
In all core use cases, this functionality was disabled, and we were paying a needless (admittedly micro) performance penalty for passing the extra useless argument and useless condition check.
2023-10-19 12:52:24 +01:00
b3390458b4 Bump phpstan/phpstan from 1.10.38 to 1.10.39 (#6103)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.38 to 1.10.39.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.38...1.10.39)

---
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>
2023-10-19 11:58:27 +01:00
b4d55e4384 Fixed dirt and grass block interactions when clicking on sides other than the top (#6071) 2023-10-18 10:40:01 +01:00
932116fa52 Server: re-added @see reference that somehow got deleted
this is useful when clicking through references in the call stack.
2023-10-18 10:23:02 +01:00
7b5c30bc2c WoodenDoor can be a fuel (#6101) 2023-10-17 22:10:08 +01:00
c14eb63f9b Wooden Button can be a fuel (#6099) 2023-10-17 16:30:35 +01:00
48dcf0e32c Farmland: Remember relative location of nearby water in blockstate data (#6090)
Farmland can end up scanning up to 162 blocks looking for water in the worst case. This is obviously not great for huge farms where there are thousands of blocks of the stuff.

In most farms, the water won't be moved, and nor will the farmland. This means that we can avoid this costly search on random updates.

This PR implements a cache using blockstate data (only possible in PM5) which stores an index mapping to a coordinate offset where water was previously found by this farmland block. This allows the farmland to avoid water searching entirely in most cases.

This is a colossal improvement as compared to scanning the whole 9x2x9 area every time, which, on average, scans about 40 blocks to find water if the water is at the same Y coordinate. In real terms this translates into about a 8x performance improvement for farmland (see timings below).
2023-10-17 16:25:13 +01:00
7f3de835e4 Block: private internal function 2023-10-17 15:23:39 +01:00
63fcf9879a Block: Use xxhash'd XOR mask to improve state data lower bits distribution
xxhash is generally well known for its hash key properties, so this is a suitable use case.
We XOR the state data with a partial hash of xxh3(typeID), which provides sufficient hash distribution regardless of the size of state data.
The previous method started to break down as the number of bits exceeded the number of significant bits of type ID (about 10 currently).

As well as being better for hash distribution regardless of state data size, this also reduces the load factor of RuntimeBlockRegistry to 1.08 (previously around 1.24), which is a nice bonus.
2023-10-17 15:21:22 +01:00
224a69b11a Sign can be a fuel (#6095) 2023-10-17 12:22:20 +01:00
d0d16cdeb7 RuntimeDataDescriber: Introduce boundedIntAuto, replacing boundedInt
closes #6096
boundedIntAuto automatically calculates the correct number of bits to use based on the given bounds. The bounds must be constant, of course.
2023-10-17 12:03:43 +01:00
18b711aca8 Apparently this function is no longer needed 2023-10-17 11:34:02 +01:00
b0936a50c1 Block: split generateStatePermutations into type and state parts
this makes it marginally faster, since we can skip all permutations containing invalid type data.
I measured a performance improvement of about 20% across all blocks.
In addition, this makes it easier to locate where a problem is coming from if invalid inputs are accepted.
2023-10-17 11:28:58 +01:00
ace
82d6fc3890 Fix loading of Chiseled Bookshelf tile from vanilla world (#6084)
Co-authored-by: Dylan T <dktapps@pmmp.io>
2023-10-17 11:10:36 +01:00
3c614b505d Merge branch 'stable' into minor-next 2023-10-16 21:28:59 +01:00
15ba642258 Merge branch 'legacy/pm4' into stable 2023-10-16 21:28:48 +01:00
edea793a98 Downgrade PHPUnit to 10.3 until sebastianbergmann/phpunit#5539 is fixed 2023-10-16 21:25:53 +01:00
1da7e3586b Updated composer dependencies 2023-10-16 20:45:44 +01:00
538b698a00 Revert "World: specialize nearby entity updating for block updates"
This reverts commit 128eb500eb.

This breaks when entities in neighbouring chunks overlap into the
current chunk without actually being tracked by it.
Perhaps it might be worth having entities tracked by all chunks their
AABB touches in the future, so that we don't have to check padding
chunks and waste CPU time.
2023-10-14 19:43:46 +01:00
128eb500eb World: specialize nearby entity updating for block updates
this slashes the cost of checking this with no entities by 50%, which should be the common case for farms and such.
once factoring in other things, this translates into a real-world performance gain of about 15% for block updates.
2023-10-13 17:35:47 +01:00
7d200247f8 Cactus: do not update if only age changed
I'd prefer a smarter solution for this that automatically disables updates depending on which type of property was changed, but for now, this will significantly improve the performance of cactus farms.
The newly placed cactus block at the top cannot have updates disabled, though, since it needs to check its surroundings in case it grew into a space with a solid block next to it.

Thanks @KingOfTurkey38 for bringing this to light.
2023-10-13 12:45:11 +01:00
ace
8b52a5cd9e Fix book placed in wrong slot in Chiseled Bookshelf (#6085) 2023-10-10 12:35:50 +01:00
ace
c9163a1505 ChiseledBookshelf: Fix duplication bug (#6086)
Also fixes being able to put more than 1 book in the slot
2023-10-10 10:59:39 +01:00
2d697c5f04 A random change that Composer 2.6 wanted to make 2023-10-09 18:27:20 +01:00
364f408eb1 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-10-09 18:22:54 +01:00
660e2b8173 Update build/php to pmmp/php-build-scripts@a34e48e7da 2023-10-09 18:22:28 +01:00
9facb98327 Bump phpunit/phpunit from 10.3.5 to 10.4.1 (#6082)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.3.5 to 10.4.1.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.4.1/ChangeLog-10.4.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.3.5...10.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-09 17:16:15 +01:00
7e42a03db3 Bump phpstan/phpstan from 1.10.37 to 1.10.38 (#6081)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.37 to 1.10.38.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.37...1.10.38)

---
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>
2023-10-09 17:15:50 +01:00
ee26d6d570 LightUpdate: avoid trying to propagate light into nodes with higher light levels
Track which direction the current node's light came from, and don't
check it again when we check the current node's adjacent blocks.

e.g. if this node was the eastern neighbour of a light source, we don't
need to check this node's western neighbour, as we already know it has
a higher light level than our own.

This improves performance of basic light spread in a void by about 6%,
which isn't a huge amount, but it's something.

I've yet to explore whether light removal could also benefit from this
change.
2023-10-09 17:06:02 +01:00
94a17f59d2 fix(Entity): broadcastSound() not firing WorldSoundEvent (#6069) 2023-10-08 19:25:19 +01:00
ed4088755f Bump phpstan/phpstan from 1.10.35 to 1.10.37 (#6073)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.35 to 1.10.37.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.35...1.10.37)

---
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>
2023-10-05 22:23:13 +01:00
006f78c0a7 Updated block consistency check 2023-09-29 12:57:39 +01:00
55cc5a6651 NetherVines: optimize condition order 2023-09-29 12:45:55 +01:00
390cc3060a Disable random ticking for some blocks depending on their states
we don't need to waste CPU time attempting to tick fully grown crops.
2023-09-29 12:45:37 +01:00
ca69f08da0 ChorusFlower: move ticksRandomly() to a more appropriate place 2023-09-29 12:44:27 +01:00
eac0564792 Fix CS 2023-09-29 12:31:11 +01:00
628d77f8d7 Implemented pitcher plants, crops and pods 2023-09-29 12:30:52 +01:00
fe543a4789 AgeableTrait: fixed incorrect number of bits
the original method breaks if MAX_AGE is 0 or any power of 2.
2023-09-29 12:05:39 +01:00
31cd096b4b Implement torchflower, its seeds and its crop 2023-09-28 17:13:33 +01:00
78cc5ba635 CS again 2023-09-28 16:06:38 +01:00
4b9d170954 RuntimeDataDescriber: added dynamic method for reading and writing enum sets
this was previously only needed for brewing stands, but it's now become needed for chiselled bookshelves too.
2023-09-28 16:06:17 +01:00
d94391af57 Implement Chiseled Bookshelf (#5827) 2023-09-28 15:56:46 +01:00
ff89d4d055 Updated composer dependencies 2023-09-28 14:55:55 +01:00
a6b030f2b3 Fix CSÂ 2023-09-27 17:07:02 +01:00
56d7039086 Implemented budding amethyst and amethyst clusters 2023-09-27 17:02:37 +01:00
8f804f6f34 World: discard tiles on load if they aren't the correct type or no tile is expected
in many instances, remnants of improperly removed blocks from PM3 have been causing problems, such as flower pot tiles where there are no flower pots.

this change might break some plugins which are using tiles for custom purposes, but this is a misuse that was never supported properly in the first place.
2023-09-27 14:57:06 +01:00
4f13e446a1 StringToItemParser: clean up hardcoded potion aliases
these were needed in PM4, but the type is dynamic in PM5.
2023-09-27 13:18:02 +01:00
6ec340359b Implemented crimson and warped roots 2023-09-27 13:07:46 +01:00
c3bca9e172 tools/generate-bedrock-data-from-packets: fixed interpreting item metadata as blockstates when the item ID could be interpreted as a block ID
this broke crafting recipes which accepted skulls as inputs, as well as nether wart and bed recipes.
2023-09-27 12:37:26 +01:00
c028bb9055 Bump docker/setup-buildx-action from 2 to 3 (#6049)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-21 14:50:57 +01:00
f151047b5e Bump docker/login-action from 2 to 3 (#6050)
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-21 14:50:40 +01:00
77566db766 Bump docker/build-push-action from 4.1.1 to 5.0.0 (#6051)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.1 to 5.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.1.1...v5.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-21 14:50:17 +01:00
dd2e6ea33f Bump shivammathur/setup-php from 2.25.5 to 2.26.0 (#6055)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.25.5 to 2.26.0.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.25.5...2.26.0)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-21 14:49:38 +01:00
ee6d551729 Include TitleID in PlayerInfo extraData (#6054) 2023-09-21 14:48:50 +01:00
04b815a87a Merge branch 'stable' into minor-next 2023-09-21 13:27:11 +01:00
d138a15a32 Merge branch 'legacy/pm4' into stable 2023-09-21 13:27:04 +01:00
7a2cfa92b6 Update composer dependencies 2023-09-21 13:23:09 +01:00
912fd3f5c6 PHPStan 1.10.35, plus workarounds 2023-09-21 13:22:14 +01:00
3906600d44 Fix CS 2023-09-20 19:44:53 +01:00
3f7abf29a8 Added PHPStan rule to flag usages of legacy enum accessors provided by LegacyEnumShimTrait
closes #6061
2023-09-20 19:42:21 +01:00
fe3e2cc90a Merge branch 'stable' into minor-next 2023-09-20 19:14:34 +01:00
5eca90d478 5.6.1 is next 2023-09-20 19:00:51 +01:00
338bb3fe6d Release 5.6.0 2023-09-20 19:00:51 +01:00
f485f7fb46 Updated composer dependencies 2023-09-20 18:57:36 +01:00
63eba3eb53 Merge branch 'legacy/pm4' into stable 2023-09-20 18:40:58 +01:00
914eb62e94 4.24.1 is next 2023-09-20 18:40:07 +01:00
a85814d0c9 Release 4.24.0 2023-09-20 18:40:07 +01:00
eb2e472b01 Merge branch 'legacy/pm4' into stable 2023-09-20 18:36:41 +01:00
6553852d99 Updated for 1.20.30 release 2023-09-20 18:34:12 +01:00
540476365f Updated for 1.20.30 release 2023-09-20 18:14:59 +01:00
e9169cfa67 ChorusPlant: change stupid code 2023-09-08 17:34:47 +01:00
537e194161 ChorusPlant: make use of StaticSupportTrait 2023-09-08 17:33:32 +01:00
f7f5af607c Merge branch 'stable' into minor-next 2023-09-08 17:20:45 +01:00
b293d7bf1f Static support trait (#6044)
Added StaticSupportTrait for blocks which require unconditional support

dynamic support requirements, such as those presented by item frames and torches, are not included.

in addition, double blocks, such as tallgrass, small dripleaf and doors, do not cooperate well with this, so they are also not included.

some blocks which could be migrated (such as chorus plant) were skipped due to unresolved problems.
2023-09-08 17:19:06 +01:00
efafc2c6ca DeadBush: updated support requirements
since 1.20 they can now be placed on grass and mud.
2023-09-08 16:41:06 +01:00
2a528b4afb SetupWizard: stop depending on Java gamemode IDs for option selection 2023-09-08 16:15:07 +01:00
999eab0c84 SetupWizard: use Server constants directly 2023-09-08 15:43:36 +01:00
33a0fb9061 SetupWizard: clean up crusty code that loads server.properties 3 times 2023-09-08 15:14:51 +01:00
904b0acfff SetupWizard: replace hardcoded config keys 2023-09-08 15:11:59 +01:00
093b1e1b18 Merge branch 'stable' into minor-next 2023-09-08 12:48:40 +01:00
d7f69c5e24 CaveVines: fixed incorrect support condition 2023-09-08 12:47:46 +01:00
d60fca0a1c Age blocks logic moved into dedicated trait (#5962) 2023-09-08 12:25:26 +01:00
0e87ee1e0e ÂHangingRoots: fixed incorrect support face 2023-09-08 12:22:00 +01:00
03ecc98a24 HangingRoots: fixed support conditions 2023-09-08 12:16:45 +01:00
a5aeabd836 RegistryTrait: fixed mishandling of self::$members
Since PHPStan doesn't warn about potential nulls on untyped properties, this flew under the radar.
2023-09-08 12:16:16 +01:00
d3ab516ba4 CS 2023-09-08 11:26:58 +01:00
aa916b2c49 WoodLikeBlockIdHelper: reduce obnoxious code 2023-09-08 11:17:47 +01:00
7ce33d9375 Migrate final remaining EnumTrait users to native enums 2023-09-08 10:34:12 +01:00
14f2368454 ToolTier: remove legacy EnumTrait annotations and doc comment info 2023-09-08 10:02:50 +01:00
07194e3884 CS again 2023-09-07 20:33:30 +01:00
58278f22f3 Remove deprecated API usages from tests 2023-09-07 20:30:45 +01:00
7dcd2592d4 RuntimeDataDescriber: Support dynamically describing arbitrary enums (#6039)
Previously, we were using codegen to support describing a fixed set of enums.

Instead, we implement an enum() function, allowing any native PHP enum to be described.
All enums used in runtime data have been migrated to native PHP 8.1 enums in minor-next to facilitate this.

This implementation:

- is faster (in extreme cases by 40x, such as with PotionType)
- requires way less code
- does not require a build step
- is way more flexible

This fixes #5877, increasing the range of stuff that plugins are now able to do.

EnumTrait enums are not supported, as it's easier and cleaner to just support native enums. Most core EnumTrait enums have been migrated to native enums by now to facilitate this.
2023-09-07 20:07:14 +01:00
6887fcd590 RuntimeEnum(De)SerializerTrait no longer uses legacy accessors for enum members 2023-09-07 19:40:14 +01:00
c168818311 missed one 2023-09-07 19:39:13 +01:00
b50efbc15a Fix CS 2023-09-07 19:38:29 +01:00
94d98fb5c4 Migrate all but two remaining legacy enums to native PHP 8.1 enums 2023-09-07 19:32:45 +01:00
ae564e445d Start migrating EnumTrait enums to PHP 8.1 native enums 2023-09-07 17:20:52 +01:00
fe94379a93 Fixed connection requirements for fences, glass, bars and walls
these connect to the back faces of stairs and to glass, for example.
2023-09-06 12:56:47 +01:00
79acc4fed4 5.5.1 is next 2023-09-06 12:13:26 +01:00
c8d357f4eb Release 5.5.0 2023-09-06 12:13:26 +01:00
ec1cd5967d Added private constructors for new internal classes 2023-09-06 12:12:11 +01:00
5a010e8213 Merge branch 'minor-next' into stable 2023-09-06 12:06:15 +01:00
73a44d50ee 5.4.5 is next 2023-09-06 11:53:04 +01:00
6aab07debd Release 5.4.4 2023-09-06 11:53:01 +01:00
b160b87e24 Server: stop discriminating against crashes caused by folder plugins
these are the de facto standard, which means that a lot of crashes aren't getting reported from servers with folder plugins.
2023-09-06 11:34:03 +01:00
690ee4c574 CrashDump: fixed empty elements in lastError trace
as shown by #6010
2023-09-06 11:24:08 +01:00
a0c7587b68 Update composer dependencies 2023-09-06 11:09:28 +01:00
be4e091d40 Update draft release notice 2023-09-06 11:03:15 +01:00
857c2edc2c Server: update obsoletion notice with new announcement and cutoff date 2023-09-06 10:58:41 +01:00
b1ab69ac6c Updated build/php submodule to pmmp/PHP-Binaries@3331f8c0d5 2023-09-06 10:51:22 +01:00
e95a920fb8 Update composer dependencies 2023-09-06 10:49:54 +01:00
67f399b238 Bump phpstan/phpstan-phpunit from 1.3.13 to 1.3.14 (#6021)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.3.13 to 1.3.14.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.3.13...1.3.14)

---
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>
2023-09-06 10:24:41 +01:00
a7c806d549 Bump phpunit/phpunit from 10.3.2 to 10.3.3 (#6033)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.3.2 to 10.3.3.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.3.3/ChangeLog-10.3.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.3.2...10.3.3)

---
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>
2023-09-06 10:24:23 +01:00
0920c76a35 Bump build/php from 8884039 to 3331f8c (#6031)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `8884039` to `3331f8c`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](8884039bee...3331f8c0d5)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 08:37:05 +01:00
a91ca999fe Bump actions/checkout from 3 to 4 (#6032)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 08:32:33 +01:00
ce04478395 Fix SmithingTableInventory size (#6035)
Since 1.20 SmithingTable has a new Template slot, size is now 3

Fix debug error from InventoryManager
2023-09-06 08:15:27 +01:00
28ce7ac5fd Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-09-04 18:10:41 +01:00
540f088eda tools/generate-bedrock-data-from-packets: make duplicate reporting less spammy 2023-09-01 20:51:45 +01:00
19e3d339f6 InGamePacketHandler: subtract from raw position before rounding it (#6022)
This allows better compensation for floating point errors introduced by the subtraction of the 1.62 height offset.

For example, if the player is at y=7 exactly, their Y coordinate will be reported as 8.62, which, because of floating point errors, will be something like `8.619999999`. Subtracting `1.62` from this (really something like `1.62000000000005...`) leads to the calculated Y coordinate being slightly below 7.

Rounding after subtracting this offset allows this to be rounded to 7 sharp. Similar errors appear in various other coordinates.
2023-08-29 11:43:21 +01:00
9fdb6ba5aa Mark some new things as internal 2023-08-25 14:02:49 +01:00
4a0a538278 CS 2023-08-25 13:27:40 +01:00
2912e7ca29 ... 2023-08-25 13:27:11 +01:00
31d8cc1cb5 Generate and use constants for pocketmine.yml constant names
a couple of usages of properties that no longer exist couldn't be migrated.
in addition, this revealed a couple of dead properties in the default file.

this is not an ideal solution (I'd much rather model the configs using classes and map them) but in the absence of a good and reliable library to do that, this is the next best thing.
2023-08-25 13:23:38 +01:00
506d8d1064 CS 2023-08-25 12:49:56 +01:00
d1a7c1d453 Constify server.properties references 2023-08-25 12:49:39 +01:00
b56f1b679e Deduplicate a bunch of repeated type ID map code 2023-08-25 12:30:54 +01:00
1a18e32011 Bump ncipollo/release-action from 1.12.0 to 1.13.0 (#6019)
Bumps [ncipollo/release-action](https://github.com/ncipollo/release-action) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/ncipollo/release-action/releases)
- [Commits](https://github.com/ncipollo/release-action/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: ncipollo/release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-25 09:43:31 +01:00
09c9dfb576 Bump build/php from d75f83e to 8884039 (#6018)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `d75f83e` to `8884039`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](d75f83e7ef...8884039bee)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-25 09:43:05 +01:00
f2b710c083 Bump build/php from a053f65 to d75f83e (#6017)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `a053f65` to `d75f83e`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](a053f65e18...d75f83e7ef)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-24 08:31:31 +01:00
c7a311c17a COPILOT 2023-08-23 17:14:56 +01:00
ce53a221a5 5.5.0-BETA2 is next 2023-08-23 17:09:34 +01:00
c8100480ac Release 5.5.0-BETA1 2023-08-23 17:09:34 +01:00
8814d06dfd Fix CS 2023-08-23 17:00:18 +01:00
923f7561fb Enchantment: added @see tags to @deprecated methods 2023-08-23 16:53:09 +01:00
f4e1c31dcf Change some weird constant names 2023-08-23 16:52:47 +01:00
998fcf20db Remove useless Cancellable from PressurePlateUpdateEvent 2023-08-23 16:52:22 +01:00
1504fdca24 Use 'enchanting' terminology
'enchant' just didn't feel right, being a verb.
All these things pertain to the act of enchanting.

This is now also consistent with CraftingTransaction etc. The ship already sailed on EnchantInventory, which will have to be renamed at a later datte. However, that was already inconsistent with 'enchanting table', so that's the odd one out here.
2023-08-23 16:14:17 +01:00
bf668c0f6c Rename EnchantHelper related stuff
Perhaps this and EnchantOption should be called EnchantingHelper and EnchantingOption respectively. The terminology used is rather inconsistent, but 'enchantment' definitely isn't the right word here.
2023-08-23 16:07:02 +01:00
d942748203 Move enchanting seed generation to EnchantmentHelper 2023-08-23 15:52:49 +01:00
29fdc8b08d Private constructor for EnchantmentHelper 2023-08-23 15:49:31 +01:00
20a41b00ba StringToTParser: added registerAlias() 2023-08-23 15:24:29 +01:00
df96e023dc Require pocketmine/nbt 1.0.0 2023-08-23 14:42:50 +01:00
f4d5605de1 Use hasHandlers() on more warm-hot events 2023-08-23 14:35:53 +01:00
d03e4d17ec Use hasHandlers() for events in player movement processing pathway
this should offer a minor performance improvement.
2023-08-23 14:26:17 +01:00
4cc858829f 5.4.4 is next 2023-08-21 18:31:45 +01:00
e852a43821 Release 5.4.3 2023-08-21 18:31:45 +01:00
05f40b1315 Merge branch 'legacy/pm4' into stable 2023-08-21 18:27:18 +01:00
7aaef8cb89 4.23.7 is next 2023-08-21 18:26:50 +01:00
9d4c37fc3a Release 4.23.6 2023-08-21 18:26:47 +01:00
cd6abbe0bb BaseSign: remove redundant condition 2023-08-21 16:30:16 +01:00
22778583cf Sign: implement waxing using honeycomb 2023-08-21 16:28:17 +01:00
d44e0e87d0 BaseSign: implement sign editing
this was originally submitted by #6000, but considering the overcomplicated PR and the triviality of the feature, I figured it would be quicker to do it myself instead of having a bunch of back-and-forth bikeshedding over it.
2023-08-21 16:14:43 +01:00
47b448965d Merge branch 'stable' into minor-next 2023-08-21 16:08:27 +01:00
cfa2df82eb Merge branch 'legacy/pm4' into stable 2023-08-21 16:07:56 +01:00
7f78ec0a32 Include PHP binary URLs in GitHub releases and build info 2023-08-21 16:05:59 +01:00
8572311bf4 Remove dead PHPStan stub
closes #6003
2023-08-21 14:57:26 +01:00
18ca3a37d9 CrashDump: fixed crashdump generation failure on fatal error
closes #6007
2023-08-21 14:51:54 +01:00
b2414b4c29 EnchantTransaction: cleanup XP cost checking logic 2023-08-18 12:33:07 +01:00
b3c740081e Merge branch 'stable' into minor-next 2023-08-18 12:28:45 +01:00
4b41fca991 Merge branch 'legacy/pm4' into stable 2023-08-18 12:28:29 +01:00
9f09acc079 Workaround for slot IDs not changing client side when old item == new item
this is a really dumb bug and seems similar to the armor bug I fixed a while ago.

fixes #5987

it's unlikely that #5727 will be solved by this, but one can hope...
2023-08-18 12:27:27 +01:00
beaca8bb6d EnchantTransaction: fixed XP level costs when minimum level is less than the XP cost
this can happen and happens in vanilla too. In these cases, as much of the XP cost as possible is deducted.
2023-08-16 14:51:47 +01:00
e323c5dd76 Implement pressure plate activation logic and events (#5991)
closes #5936

This implements all of the basic activation logic for pressure plates.
It also introduces a PressurePlateUpdateEvent, which is called in pulses when entities are standing on top of the plate and when it deactivates. Deactivation can be detected by checking if the list of activating entities is empty.

---------

Co-authored-by: Javier León <58715544+JavierLeon9966@users.noreply.github.com>
2023-08-16 13:00:23 +01:00
b65b7a7f74 Bump tests/plugins/DevTools from 83f0db3 to 411fd5b (#5998)
Bumps [tests/plugins/DevTools](https://github.com/pmmp/DevTools) from `83f0db3` to `411fd5b`.
- [Release notes](https://github.com/pmmp/DevTools/releases)
- [Commits](83f0db3f9e...411fd5bdc0)

---
updated-dependencies:
- dependency-name: tests/plugins/DevTools
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-16 09:38:16 +01:00
f516c3c502 EnchantCommand: ensure that books are turned into enchanted book items 2023-08-15 19:10:48 +01:00
5afbb9d807 Allow enchanted books to be enchanted
if an enchanted book is obtained via /give without enchantments, it should be able to receive enchantments in an enchanting table, exactly the same as regular books.
2023-08-15 19:10:03 +01:00
b330cbe8e2 Merge remote-tracking branch 'origin/stable' into minor-next 2023-08-15 17:41:41 +01:00
39867b97c5 Implement enchanting using enchanting tables (#5953)
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2023-08-15 17:28:26 +01:00
4c25d38b44 Bump phpunit/phpunit from 10.3.1 to 10.3.2 (#5995)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.3.1 to 10.3.2.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.3.2/ChangeLog-10.3.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.3.1...10.3.2)

---
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>
2023-08-15 12:05:23 +01:00
983aa79a0b Bump build/php from ed0bc4d to a053f65 (#5993)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `ed0bc4d` to `a053f65`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](ed0bc4d2af...a053f65e18)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-15 09:30:51 +01:00
af9ae445fc Fix cake drops (#5985)
closes #5984
2023-08-10 17:42:32 +01:00
91d5a3ddfe PotionCauldron: fixed setPotionItem() not validating the given item
we should probably remove this API and have enums for potion container and type tbh... this API was a mistake
2023-08-10 16:06:41 +01:00
e48b5b2ec0 GeneratorManager: allow aliasing existing generators 2023-08-10 13:07:03 +01:00
f03e708f64 Fix chorus not working if the destination would be below y=0 (#5979) 2023-08-10 09:42:58 +01:00
37f2dafae1 PluginBase: make saveResource() use copy() instead of overengineered streams garbage 2023-08-09 16:16:11 +01:00
7826e0a11e Merge branch 'stable' into minor-next 2023-08-09 16:14:05 +01:00
97700636c6 PluginBase: added getResourceFolder() and getResourcePath(), deprecate getResource() (#5961)
This is a step towards #5958.

While it's not actually necessary to add these functions (since people could just use getFile() . "/resources/whatever.yml" instead), this helps preserve the convention of using the `resources` folder, which might be helpful for external tools.

As an example:
stream_get_contents($this->getResource("lang/eng.ini"));
(which is actually incorrect, since it leaks a resource)
can now be replaced by
file_get_contents($this->getResourcePath("lang/eng.ini"));
quite trivially.

getResourceFolder() can be used with scandir() to enumerate resources instead of using getResources(), although getResources() still provides utility in the relativized resource paths.
2023-08-09 16:09:16 +01:00
447f061566 Use Event::hasHandlers() for a few more hot events 2023-08-09 15:46:20 +01:00
b86b389fc5 changelog: fix link
[ci skip]
this is not technically wrong, but it's inconsistent with other changelogs
2023-08-09 15:33:02 +01:00
e27121a437 5.4.3 is next 2023-08-09 14:04:57 +01:00
2d5c9e64ce Release 5.4.2 2023-08-09 14:04:57 +01:00
78f5fbddf3 Merge branch 'legacy/pm4' into stable 2023-08-09 13:58:14 +01:00
aa3f4f2545 4.23.6 is next 2023-08-09 13:56:19 +01:00
f7279b6672 Release 4.23.5 2023-08-09 13:56:19 +01:00
2711ab4f00 Update composer dependencies 2023-08-09 13:49:19 +01:00
b4c5f5d58d PluginBase: fixed resource leak
all this time we've been harping at plugin devs to fix their own leaks, and here's one right under our noses that no one spotted for 10 years ...

this leak is rather common, since it will occur whenever a plugin attempts to save a resource which already exists in the data folder.

This bug was introduced in 2014 by commit 6328834681.
2023-08-09 13:28:05 +01:00
a5d8ef7a6c Add FarmlandHydrationChangeEvent (#5916) 2023-08-09 12:33:25 +01:00
59c88fe7f7 Added WorldDifficultyChangeEvent 2023-08-09 12:22:03 +01:00
735d9a5bf4 CandleTrait: allow candle to be lit by fire charges 2023-08-09 12:04:02 +01:00
f4a06605b1 Cake: only accept candle when no slices have been taken
otherwise, cake slices can be regenerated using candle
2023-08-09 11:42:08 +01:00
77dfbc4e23 Implemented pink petals (#5940) 2023-08-09 11:33:33 +01:00
662f2495e9 5.4.2 is next 2023-08-08 18:41:09 +01:00
b8a4ca45e4 Release 5.4.1 2023-08-08 18:41:06 +01:00
ebcd6a0bb2 CraftItemEvent: fixed inputs and outputs not being cloned 2023-08-08 18:29:49 +01:00
baefbce863 Merge branch 'stable' into minor-next 2023-08-08 18:27:50 +01:00
b45b4b5edf Update translations 2023-08-08 18:27:07 +01:00
9f14901820 Merge branch 'stable' into minor-next 2023-08-08 17:48:12 +01:00
dd79d4c463 Updated build/php submodule to pmmp/PHP-Binaries@ed0bc4d2af 2023-08-08 17:44:13 +01:00
9c1ab943bc Bump ext-pmmpthread min version to 6.0.7 2023-08-08 17:43:31 +01:00
2c74124e2e Update composer dependencies 2023-08-08 17:43:01 +01:00
514fc1ebb5 Bump phpunit/phpunit from 10.2.7 to 10.3.1 (#5965)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.2.7 to 10.3.1.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.3.1/ChangeLog-10.3.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.2.7...10.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-08 17:33:16 +01:00
c1638ffaab Ban foreach by-reference at the PHPStan level 2023-08-08 17:08:13 +01:00
710177ceb5 CS
this mistake actually hasn't happened for a while
2023-08-08 15:10:31 +01:00
2559d1719f All pocketmine\thread\Thread now log uncaught exceptions and fatal errors by default 2023-08-08 14:56:54 +01:00
2e58387a43 Fixed thread error capture fail in shutdown function
the shutdown handler currently isn't called until join(), which sets isKilled to true and stops the error information from being recorded.
2023-08-08 14:55:53 +01:00
515f8eae4c ÂResourcePackManager: allow setting force_resources from a plugin 2023-08-07 17:05:45 +01:00
35a28300f6 Podzol should be affected by silk touch (#5969) 2023-08-07 11:47:29 +01:00
1cf508abdb World: use Facing::OFFSET in getHighestAdjacentLight() 2023-08-03 16:51:09 +01:00
6ac45526f9 Use new features in pocketmine/math 1.0.0 2023-08-03 16:46:16 +01:00
c91c8c2f9e Improving performance of small moving entities (e.g. dropped items) (#5954)
* World: cache block AABBs directly in the world
this removes some indirection when fetching the AABBs, and also allows the AABB cache to live longer than the block cache.

In local testing this showed a 10-20% performance improvement, but it was difficult to properly measure.

* World: eliminate padding block checks in getCollisionBoxes()
this substantially improves the function's performance for small entities.

The padding of 1 block in each direction was previously necessary to account for blocks like fences, which might have an AABB larger than the cell containing them. However, by tracking this information in the collisionBoxCache directly, we can avoid the need to check this at the expense of slightly more complex code. This reduces the number of blocks checked for a moving item entity from 27-64 all the way down to 1-8, which is a major improvement.

Locally, this change allowed me to simulate 2100 item entities without lag, compared with 1500 on the previous commit.
2023-08-03 14:51:51 +01:00
81941ae9e5 Bump phpunit/phpunit from 10.2.6 to 10.2.7 (#5957)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.2.6 to 10.2.7.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.2.7/ChangeLog-10.2.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.2.6...10.2.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>
2023-08-02 18:05:30 +01:00
1a2c10e844 World: Fixed getSafeSpawn() not accepting seed positions below y=1 (#5955)
this should have been changed during the introduction of y=-64 minimum world height, but it got missed.
2023-08-02 18:05:16 +01:00
d88c3d8ced Fixed coral block killing itself when calling getDropsForCompatibleTool()
this might be called by plugins without actually breaking the block, in which case the block will glitch.
2023-08-02 13:43:36 +01:00
82f87cc2da Reduce repeated block-change-event related code
the new helper code reveals even more repetition, but this is at least consistent now.
2023-08-02 13:40:12 +01:00
bb0e648276 Fixed BlockDeathEvent usages showing an oldState which is already dead 2023-08-02 13:36:54 +01:00
6000bcccdd Merge pull request #5707 from pmmp/hot-events-optimisation
Avoid unnecessary event-related work in hot paths when the events have no registered handlers
2023-08-01 18:19:10 +01:00
0b86fafafb Hot path optimisation for DataPacketSendEvent 2023-08-01 17:41:53 +01:00
2608637210 HandlerListManager: track RegisteredListenerCache directly
This change improves the performance of calling an event with 0 handlers by about 10% with no other changes.

Since we have to access the list eventually anyway, we can cut out some unnecessary work by returning the handlers from the cache directly, instead of fetching the HandlerList for no reason.

This also improves the performance of Event::hasHandlers() by about 40%, which is pretty significant (120 ns -> 80 ns).
2023-08-01 17:37:49 +01:00
442d65143d Merge branch 'minor-next' into hot-events-optimisation 2023-08-01 17:01:52 +01:00
53de55dcde 5.4.1 is next 2023-08-01 12:46:56 +01:00
01664d2e81 Release 5.4.0 2023-08-01 12:46:53 +01:00
0a90a5928a Added TallGrassTrait, remove weirdly specific logic from FortuneDropHelper
this needs to be dealt with before release otherwise we'll be stuck with FortuneDropHelper::grass()
this is the obvious solution and should have been done some time ago - stuff like flammability was already a problem for double tall grass anyway
2023-08-01 12:33:36 +01:00
46f24b165a Rename PlayerMissedSwingEvent -> PlayerMissSwingEvent
all the other events are present tense, so it doesn't make sense for this one to be past tense.
2023-08-01 12:21:39 +01:00
6f09286fed Merge branch 'minor-next' into stable 2023-08-01 11:57:02 +01:00
774eb3e72b 5.3.5 is next 2023-08-01 11:16:51 +01:00
cd8219d9fd Release 5.3.4 2023-08-01 11:16:50 +01:00
52ce3444d8 Merge branch 'legacy/pm4' into stable 2023-08-01 11:13:31 +01:00
e9e5923639 4.23.5 is next 2023-08-01 11:12:52 +01:00
49a9da147b Release 4.23.4 2023-08-01 11:12:41 +01:00
4c0df5ee4e Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-07-31 11:30:18 +01:00
4c737b2ee3 Merge branch 'legacy/pm4' into stable 2023-07-31 11:29:58 +01:00
eb53b795d5 ItemEntity: fixed O(n^2) performance issue when many of the same unstackable item are in the same place
this produced a 40% performance improvement in a simulation with 800 item entities.

If the items were all different, then this would still be a problem. However, many of the same unstackable items occupying the same space is a problem for SkyBlock farms, so this should improve performance for SkyBlock quite a bit.
2023-07-31 11:29:12 +01:00
befd3637f6 Bump shivammathur/setup-php from 2.25.4 to 2.25.5 (#5951)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.25.4 to 2.25.5.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.25.4...2.25.5)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  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>
2023-07-31 11:13:51 +01:00
9b2a7b43c2 ItemEntity: fixed O(n^2) performance issue when many of the same unstackable item are in the same place
this produced a 40% performance improvement in a simulation with 800 item entities.

If the items were all different, then this would still be a problem. However, many of the same unstackable items occupying the same space is a problem for SkyBlock farms, so this should improve performance for SkyBlock quite a bit.
2023-07-28 16:06:29 +01:00
5ec3f4655f EntityDamageByEntityEvent: added APIs to get and set vertical knockback limits
this was requested and PR'd as far back as 2020 (see #3782).
Since no issue was filed about this, it became forgotten until #5946.
However, #5946 overcomplicates the solution to the problem, and breaks BC without an obvious reason.
2023-07-28 12:52:15 +01:00
c972e65741 EntityDamageByEntityEvent: document methods 2023-07-28 12:41:27 +01:00
a45763328b Added constants for default knockback force and vertical limit 2023-07-28 12:36:46 +01:00
82a5ea9ed3 Allow thread errors and their traces to be properly recorded in crashdumps (#5910)
until now, any thread crash would show as a generic crash since we aren't able to get the trace from the crashed thread directly. This uses some dirty tricks to export a partially serialized stack trace to the main thread, where it can be written into a crashdump.
This enables us to see proper crash information for async tasks in the crash archive (finally!!!) as well as being able to capture RakLib errors properly.
2023-07-26 16:26:03 +01:00
bbdcab7277 Player: Added animation to missSwing() (#5942) 2023-07-26 10:04:36 +01:00
6086ef667c Added handling for attack-air action (#5912) 2023-07-25 14:50:28 +01:00
486d4099df 5.3.4 is next 2023-07-24 17:29:59 +01:00
a1f34a460b Release 5.3.3 2023-07-24 17:29:56 +01:00
5ff03c81f8 Merge branch 'legacy/pm4' into stable 2023-07-24 17:00:13 +01:00
1c611a03e6 4.23.4 is next 2023-07-24 16:59:48 +01:00
948875b025 Release 4.23.3 2023-07-24 16:59:45 +01:00
fb43f59458 Merge branch 'stable' into minor-next 2023-07-24 16:45:49 +01:00
16dfd27935 Merge branch 'legacy/pm4' into stable 2023-07-24 16:45:24 +01:00
2a4909d328 Fixed missing handling for some ContainerUIIds
SMITHING_TABLE_TEMPLATE is new in 1.20
HORSE_EQUIP was always present, but somehow got overlooked when building up that big ugly switch table
2023-07-24 16:44:01 +01:00
b078e01b65 JwtUtils: handle DER <-> raw signature conversion in-house, drop fgrosse/phpasn1 dependency
normally I would hesitate to reinvent the wheel, but we only need a tiny subset of the ASN.1 spec which is trivial to implement by itself.
I'd rather this than depend on another library that could introduce security vulnerabilities (I'm looking at you, jsonmapper).

closes #5935
2023-07-24 13:36:12 +01:00
4eb9dacd3c Remove unnecessary HorizontalFacingTrait (#5930)
FacingOppositePlacingPlayerTrait already includes HorizontalFacingTrait, so we don't need to include it twice.
2023-07-24 12:16:56 +01:00
43770313ba Update symfony/filesystem to 6.3.x 2023-07-24 12:07:32 +01:00
3afe3b7f44 Merge branch 'stable' into minor-next 2023-07-24 12:02:24 +01:00
fd23281183 Merge branch 'legacy/pm4' into stable 2023-07-24 12:00:29 +01:00
70dd8732e2 Update build/php to pmmp/PHP-Binaries@46604f2f6a 2023-07-24 11:59:11 +01:00
cdf72563f4 Update composer dependencies 2023-07-24 11:58:50 +01:00
2779f92828 Bell: clean up code 2023-07-21 15:29:33 +01:00
5899f2fc1d Block: introduce new methods to reduce support type boilerplate checks
this switches from a 'can be supported by' concept to a 'can stay at this position' paradigm, which requires way less boilerplate code.

there may be further improvements we can make from here, such as adding traits, but this is a good first step.
2023-07-21 15:02:25 +01:00
9ef835c82d Merge remote-tracking branch 'origin/legacy/pm4' into stable 2023-07-21 11:07:32 +01:00
d65d8c3356 Fix typo in documentation of ChunkSelector:selectChunks() (#5924) 2023-07-21 10:34:34 +01:00
9b43ddecbd Drop usages of Process:kill() with subprocesses parameter
we don't need this any more with console reader improvements, and this was not working correctly anyway.

closes #5234
2023-07-20 17:10:39 +01:00
4bdd6410db Fire: fixed support requirements
closes #5599
2023-07-20 17:00:32 +01:00
6ea7fd7d6b ShulkerBox: do not offer support for other blocks 2023-07-20 16:36:25 +01:00
5e7f18cbcf StandardEntityEventBroadcaster: suppress client-side emote messages
if users want these, they can broadcast them themselves using Server::broadcastMessage(), which will also record the message in the server log like chat

closes #5669
2023-07-20 16:20:34 +01:00
4517948297 FrostedIce: Remove non-Bedrock melting behaviour (#5486) 2023-07-19 17:12:05 +01:00
777a901932 Bump shivammathur/setup-php from 2.25.2 to 2.25.4 (#5829)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.25.2 to 2.25.4.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.25.2...2.25.4)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  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>
2023-07-19 16:37:33 +01:00
24d979bd08 Fixed /kill not properly killing the player under certain conditions, closes #4680 (#5919)
This occurs if the player had very high levels of Health Boost or other weird modifications.

It doesn't really make sense to apply damage modifiers to suicide anyway.

Really I'm doubtful that suicide should even be considered a damage type (perhaps we should add an EntitySuicideEvent), but that's a discussion for another time.
2023-07-19 16:33:16 +01:00
86810c5e1c LevelDB: clearer error message 2023-07-19 16:31:10 +01:00
b33a9690e9 LevelDB: simplify condition 2023-07-19 16:30:13 +01:00
1b9c282194 LevelDB: tolerate incorrect number of biome palettes, as long as there are enough for each real subchunk
modern versions save 24 exactly, but previous versions saved more. We don't use the excess, so it's not a problem if they are missing, but this is nonetheless non-compliant with vanilla.
2023-07-19 16:29:14 +01:00
82b75e0ccb LevelDB: Remove happy debug message 2023-07-19 15:21:47 +01:00
6c59912ed5 LevelDB: workaround 0 bpb palettes with a length prefix
this was caused by a plugin overriding the world provider.

related:
-  https://github.com/pmmp/PocketMine-MP/issues/5911
-  https://github.com/Refaltor77/CustomItemAPI/issues/68

fixes #5911
2023-07-19 15:19:33 +01:00
3c34841dfc CS 2023-07-19 14:00:35 +01:00
914dd90b3d Use first-class closures in more places 2023-07-19 13:56:48 +01:00
537721fe7d Replace Closure::fromCallable() usages with first-class callables
PHP 8.1 <3
2023-07-19 13:34:42 +01:00
fba51e3bf9 Merge branch 'stable' into minor-next 2023-07-19 13:22:07 +01:00
763241b11f Fixed burning animations for fireproof entities
creative players are not technically fireproof; they just don't take any damage from fire
2023-07-19 12:32:00 +01:00
8414c78969 Fixed netherite items burning in lava 2023-07-19 11:49:52 +01:00
4637aae621 Living: do not apply noDamageTicks to suicide damage
suicide damage is a voluntary damage source, which noDamageTicks is intended to prevent getting damaged while the player gets their bearings after (re)spawning.
2023-07-19 11:43:09 +01:00
6fbc133e5d Merge branch 'stable' into minor-next 2023-07-18 22:22:37 +01:00
f38aee1fc5 5.3.3 is next 2023-07-18 22:18:39 +01:00
69abd5eb53 Release 5.3.2 2023-07-18 22:18:39 +01:00
f6ee7ddc9e Merge branch 'legacy/pm4' into stable 2023-07-18 22:15:23 +01:00
cff4a8d2bc 4.23.3 is next 2023-07-18 22:14:24 +01:00
20b7e8d702 Release 4.23.2 2023-07-18 22:14:23 +01:00
c6110be051 Update BedrockProtocol dependency 2023-07-18 22:12:33 +01:00
c053742f5d Living: avoid updates of non-armor slots and armor slots which took no damage
this was also updating empty slots ...
2023-07-18 13:04:11 +01:00
0051b34797 Living: fixed turtle helmet being non-removable and spamming inventory updates
closes #5786
2023-07-18 12:58:07 +01:00
a74ab756bd AsyncTask: strip out task cancellation functionality
closes #5854

Cancelling task runs doesn't make any sense.

- It breaks sequential task execution - later tasks might depend on state from earlier tasks
- It doesn't actually cancel the task - at best, it prevents it from running, but cannot interrupt it (though interrupting a task does not make sense either)

We don't use this "feature" in the core anymore since 22b5e5db5e, as this was causing unexpected behaviour for plugins anyway, along with the occasional shutdown crash due to inconsistent worker states.
2023-07-18 12:45:30 +01:00
90520c8962 Merge branch 'minor-next' of github.com:pmmp/PocketMine-MP into minor-next 2023-07-18 12:39:52 +01:00
2e9a4f2be2 Merge branch 'trees' into minor-next 2023-07-18 12:39:41 +01:00
e23806d417 Stem: fixed supporting block check issue (#5907)
This bug was introduced in dca752c72f
2023-07-18 12:31:20 +01:00
30db658d70 Bump phpunit/phpunit from 10.2.5 to 10.2.6 (#5909)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.2.5 to 10.2.6.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.2.6/ChangeLog-10.2.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.2.5...10.2.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>
2023-07-18 11:34:13 +01:00
83d11c7429 Implemented Big & Small dripleaf (#5835) 2023-07-17 16:30:52 +01:00
4c6b82f30a Merge remote-tracking branch 'origin/stable' into minor-next 2023-07-17 16:13:16 +01:00
fb6a7d279f Implement fortune enchantment (#5757) 2023-07-17 11:13:45 +01:00
0c1bfb058a Bump phpunit/phpunit from 10.2.3 to 10.2.5 (#5898)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.2.3 to 10.2.5.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.2.5/ChangeLog-10.2.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.2.3...10.2.5)

---
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>
2023-07-14 17:45:36 +01:00
45d1ce9bb8 Don't mention enchantments in generic StringToTParser doc-comment (#5894) 2023-07-14 17:42:19 +01:00
8c8794ec71 Allow use ConsumingItemAnimation with Living entities (#5897) 2023-07-14 17:41:46 +01:00
b399eda21e Merge branch 'stable' into minor-next 2023-07-14 13:27:50 +01:00
f7c08dedee 5.3.2 is next 2023-07-14 13:08:58 +01:00
250d18e41b Release 5.3.1 2023-07-14 13:08:57 +01:00
86bd6777a3 4.23.2 is next 2023-07-14 13:06:26 +01:00
935df62006 Release 4.23.1 2023-07-14 13:06:26 +01:00
489a7ba365 Merge branch 'legacy/pm4' into stable 2023-07-14 13:03:14 +01:00
2709dd359c ProcessLoginTask: fixed backport errors 2023-07-14 12:37:50 +01:00
4e646d19a4 Harden login EC key validation 2023-07-14 11:55:47 +01:00
2a11762e61 Update JsonMapper dependency 2023-07-14 11:54:05 +01:00
dca752c72f Stem: implement facing property
fixes #5858

technically speaking, the sideways states for non-fully-grown stems shouldn't exist, but they do in Bedrock, and changing this code to split non-fully-grown stems from fully grown ones would likely require BC breaks.
This was the minimum necessary to achieve the desired functionality.
2023-07-13 14:50:26 +01:00
259cc305df Implement 1.20.10 short sneaking (#5892) 2023-07-13 13:36:53 +01:00
ace
7132ac0ad3 Implemented strong slowness potion (#5888) 2023-07-13 13:22:01 +01:00
0d8a06732a Merge branch 'stable' into minor-next 2023-07-13 12:59:53 +01:00
d2f4ba74c6 Updated build/php submodule to pmmp/PHP-Binaries@e0c918d137 2023-07-13 12:59:43 +01:00
d4716ef457 5.3.1 is next 2023-07-12 14:08:08 +01:00
d630b3af7b Release 5.3.0 2023-07-12 14:07:58 +01:00
c2bb51cb37 Merge branch 'legacy/pm4' into stable 2023-07-12 13:45:37 +01:00
7e0b5cf73d 4.23.1 is next 2023-07-12 13:44:16 +01:00
e903da8998 Release 4.23.0 2023-07-12 13:44:16 +01:00
b7210755a7 1.20.10 2023-07-12 13:39:39 +01:00
f2193d1ba7 1.20.10 2023-07-12 13:23:47 +01:00
4daacb2ab7 Merge branch 'legacy/pm4' into stable 2023-07-12 12:11:36 +01:00
f7977c9668 Update build/php submodule to pmmp/PHP-Binaries@16378ffcc3 2023-07-12 12:10:09 +01:00
93d3f439bf 5.2.2 is next 2023-07-11 16:04:43 +01:00
200e5f940c Release 5.2.1 2023-07-11 16:04:42 +01:00
9365ffa7fa Merge branch 'legacy/pm4' into stable 2023-07-11 16:02:06 +01:00
cfd9950b02 4.22.4 is next 2023-07-11 16:01:42 +01:00
8ebcdb452d Release 4.22.3 2023-07-11 16:01:38 +01:00
ef85fbffe1 Merge branch 'legacy/pm4' into stable 2023-07-11 15:10:55 +01:00
aacc00a911 update-updater-api: do not allow multiple jobs to run simultaneously
this would result in git conflicts if multiple releases are made at the same time

closes #5814
2023-07-11 15:10:35 +01:00
0c250a2ef0 InGamePacketHandler: fixed inconsistent handling of invalid data in BlockActorDataPacket 2023-07-11 12:53:29 +01:00
c01d2dc718 CreativeInventory per Player (#5694) 2023-07-06 11:08:13 +01:00
8f217ca6e0 Fixed borked changelog links 2023-07-04 16:12:01 +01:00
f0d5647aa2 5.2.1 is next 2023-07-04 15:58:09 +01:00
e6de9a70a2 Release 5.2.0 2023-07-04 15:58:09 +01:00
a34514c6a1 RuntimeDataDescriber: document that this is a sealed interface 2023-07-04 15:56:03 +01:00
6a80b210d4 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-07-04 14:44:00 +01:00
02ffb04b92 Merge branch 'minor-next' into stable 2023-07-04 14:43:23 +01:00
6cbb03bf9b README: change title of discussion section
[ci skip]

I've always hated the way the / looks here
2023-07-03 18:18:30 +01:00
3abd592b1f Update to pmmp/BedrockBlockUpgradeSchema@3.0.0 2023-07-03 18:07:51 +01:00
644b417d2c BlockStateData: added auxiliary toVanillaNbt() helper method
toNbt() adds PM version metadata, which might not always be desired.
2023-07-03 14:05:17 +01:00
588a754f1c Merge branch 'legacy/pm4' into stable 2023-07-01 13:33:59 +01:00
70dd9c7371 AsyncTask: fixed reentrancy bug tested by f8e6f036af 2023-07-01 13:27:32 +01:00
f8e6f036af AsyncPoolTest: added failing test case for AsyncTask::__destruct() reentrancy bug 2023-07-01 13:24:50 +01:00
5d51ffdfe3 Merge branch 'minor-next' into trees 2023-07-01 12:25:44 +01:00
a2a7006878 Merge branch 'stable' into minor-next 2023-07-01 12:25:11 +01:00
b78c18ad2d changelog: fix header size :(
[ci skip]
2023-07-01 12:23:19 +01:00
41281db6a5 5.1.4 is next 2023-07-01 12:18:13 +01:00
2278275505 Release 5.1.3 2023-07-01 12:18:10 +01:00
53a6d8451b Merge branch 'legacy/pm4' into stable 2023-07-01 12:05:42 +01:00
bbabccfc89 4.22.3 is next 2023-07-01 12:04:59 +01:00
1698eac6dc Release 4.22.2 2023-07-01 12:04:59 +01:00
83378d9403 Merge branch 'legacy/pm4' into stable 2023-07-01 11:57:59 +01:00
321972b87b Composer: do not allow automatic minor dependency updates
manual intervention should always be used here, since we need to present a consistent API to plugins.
2023-07-01 11:57:13 +01:00
24b74a96eb Merge branch 'legacy/pm4' into stable 2023-07-01 11:52:42 +01:00
e61796b146 Composer: do not allow automatic minor dependency updates
manual intervention should always be used here, since we need to present a consistent API to plugins.
2023-07-01 11:49:44 +01:00
c86c9b3ead Update Composer dependencies 2023-07-01 11:43:36 +01:00
249ef9c534 ProcessLoginTask: remove old key expiry
since we don't have a hard date for this, and I've already made one wrong educated guess, I'd rather not have another massive outage.
A security update will have to be made to remove the old key as soon as the new one is rolled. This is not ideal, but it's the least disruptive option.
2023-07-01 11:41:04 +01:00
17842703a1 Merge branch 'legacy/pm4' into stable 2023-07-01 10:29:23 +01:00
f4dab17a1b Added deprecation notices 2023-07-01 10:29:14 +01:00
eed423505e Merge branch 'legacy/pm4' into stable 2023-07-01 10:28:34 +01:00
c165670e0a Added support for using and generating blockstate upgrade schemas using newFlattenedName rules
see pmmp/BedrockBlockUpgradeSchema@f426fccbee
2023-06-26 16:20:01 +01:00
882d50b14e Reapply 470a3e1a3: tools/generate-blockstate-upgrade-schema: reduce dependencies for generating blockstate mappings 2023-06-26 16:09:51 +01:00
0b0b72f596 Reapply b8788c55c: tools/generate-blockstate-upgrade-schema: improve property remapping checks
this is now able to determine which properties were renamed and/or changed when multiple renames occurred in a single version.
This also fixes unrelated properties being considered mapped to each other when there was only one property in the old and new state (e.g. mapped_type and deprecated for hay_bale in 1.10). Now, these are properly considered as unrelated.
2023-06-26 16:09:09 +01:00
2654fb294b Merge branch 'stable' into minor-next 2023-06-26 16:08:22 +01:00
2b40c1a5be Revert "tools/generate-blockstate-upgrade-schema: improve property remapping checks"
This reverts commit b8788c55c5.

This changes behaviour, so it needs to target minor-next.
2023-06-26 16:07:52 +01:00
74d219dcb6 Revert "tools/generate-blockstate-upgrade-schema: reduce dependencies for generating blockstate mappings"
This reverts commit 470a3e1a3a.

This changes behaviour, so it needs to target minor-next.
2023-06-26 16:07:23 +01:00
470a3e1a3a tools/generate-blockstate-upgrade-schema: reduce dependencies for generating blockstate mappings 2023-06-26 12:40:17 +01:00
ad67fb7291 BlockStateUpgradeSchemaModelBlockRemap: added missing @required tag 2023-06-24 16:22:29 +01:00
3eed0a4620 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-06-24 16:14:37 +01:00
b8788c55c5 tools/generate-blockstate-upgrade-schema: improve property remapping checks
this is now able to determine which properties were renamed and/or changed when multiple renames occurred in a single version.
This also fixes unrelated properties being considered mapped to each other when there was only one property in the old and new state (e.g. mapped_type and deprecated for hay_bale in 1.10). Now, these are properly considered as unrelated.
2023-06-24 16:14:28 +01:00
c06763c59b Fixed crash in CakeWithCandle when block-picking 2023-06-23 12:55:47 +01:00
881451c40c Bump build/php from 8cb2a2b to 2a21c57 (#5856)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `8cb2a2b` to `2a21c57`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](8cb2a2b218...2a21c57900)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-23 11:00:59 +01:00
36f52f1ade AsyncTask: remove ArrayObject hack
this is no longer a concern with pmmpthread + PHP 8.1 and up. The behaviour that caused statics to be inherited was caused by bugs in PHP 8.0 and below, which have now been fixed.
2023-06-22 13:58:48 +01:00
0240d35c05 AsyncTask and AsyncPool no longer tolerate uncaught errors in tasks
Since task execution depends on tasks executing sequentially on a particular worker in some cases (e.g. PopulationTask must be preceded by GeneratorRegisterTask), it doesn't make sense to continue task execution if an error occurs.
Moreover, a task crashing may render the whole server unstable, as it leaves the server in an undefined state. This is the same kind of problem we fixed with scheduled tasks in PM3.

In versions past, pthreads was unreliable enough that random tasks would crash without an obvious reason, forcing us to accommodate this. I still don't know the origin or frequency of said issues, but I think it's time to rip the band-aid off and solve these problems for real.
2023-06-22 13:29:36 +01:00
8dedbb7471 World: clamp clickVector components from 0-1
this ensures that #5827 won't randomly start crashing if clients give bad values.
2023-06-21 16:59:14 +01:00
6f82942c64 Block: document onInteract() clickVector 2023-06-21 16:57:39 +01:00
9d0d60afd1 BlockPlaceEvent: ensure that getPosition() is always correct
since BlockTransaction was designed to be World-agnostic, it can't position() any blocks, since Position requires a World.

This workaround is the best we can do for now; however, it would probably be wise to deprecate getTransaction() in favour of a dedicated getBlocks() method which takes care of this, as BlockPlaceEvent is currently quite obnoxious to use.
2023-06-21 15:36:48 +01:00
391732f00c Fix Player->setGamemode() doc comment (#5848)
this has been outdated likely since the 1.3 alpha days.
2023-06-21 09:29:48 +01:00
ad3f854701 Register aliases for new cherry wood blocks 2023-06-20 12:59:16 +01:00
64e09525f3 Added timings for AsyncTask completion handlers, progress updates and error handlers (#5798)
closes #5749
2023-06-20 12:38:45 +01:00
774f92435a StringToItemParser: added underwater_tnt alias 2023-06-20 12:34:16 +01:00
be8cca1d55 Bump docker/build-push-action from 4.1.0 to 4.1.1 (#5834)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  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>
2023-06-19 15:25:26 +01:00
eb9f804781 ÂBedrockWorldData: throw less confusing errors on missing version tags 2023-06-19 12:22:50 +01:00
ace
bccda4fe44 Implement Piglin Head (#5839) 2023-06-19 12:07:49 +01:00
8f48f8a596 Added missing cherry door item, closes #5817 2023-06-13 18:18:13 +01:00
288ebfa08a Fixed a bunch of item IDs being missing
these items were all pretending to be blockitems when I dumped data, and I wasn't aware that they'd been omitted.
2023-06-13 18:15:47 +01:00
a3046eb6fa Merge branch 'stable' into minor-next 2023-06-13 18:06:06 +01:00
ff0199cdf8 Fixed blue candle being missing from the creative inventory
this coincidentally fixes mangrove doors being tagged with unwanted blockstate runtime IDs. Their items client-side are not actually blockitems, so the client doesn't expect them to have blockstate IDs attached.
This reduces the chaos in the creative inventory slightly (for some reason the client responds to this stuff by putting random creative items in the wrong places), but the mess is still substantial and I don't know what caused the rest of it.

closes #5818

technically we shouldn't be breaking BC of internals signatures in a patch release, but it's internals, and that's an unwritten rule anyway. In any case, no one is likely to be affected.
2023-06-13 18:03:10 +01:00
39a6a9ee70 Bump phpunit/phpunit from 10.2.1 to 10.2.2 (#5824)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.2.1 to 10.2.2.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.2.2/ChangeLog-10.2.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.2.1...10.2.2)

---
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>
2023-06-12 13:40:48 +01:00
0939301938 Bump docker/build-push-action from 4.0.0 to 4.1.0 (#5823)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 13:40:30 +01:00
202be92c06 RGB PMMP Logo (#5825) 2023-06-12 13:30:44 +01:00
df4a8d4788 AsyncTask: lazy-init progressUpdates (#5806)
this is only possible since pthreads 5.1 and pmmpthread

the performance cost of this one ThreadSafeArray allocation is 30% of the total cost of allocating an AsyncTask object on Windows, which is enormous.

In past versions we couldn't lazily initialize it, because the object might get destroyed before the main thread had a chance to dereference it, leading to a crash when collecting completed tasks. This is no longer an issue thanks to object rescue behaviour implemented in pthreads 5.1.
I think this is probably OK in terms of thread-safety, as only one thread writes the property.
2023-06-11 14:45:44 +01:00
1d25e15ec8 Bump build/php from fcbc15f to 8cb2a2b (#5820)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `fcbc15f` to `8cb2a2b`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](fcbc15f23e...8cb2a2b218)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-11 14:45:01 +01:00
1b35c352cc StandardEntityEventBroadcaster: Accepting PacketBroadcaster interface instead of StandardPacketBroadcaster (#5813) 2023-06-11 13:48:58 +01:00
ab75838c89 First shot at implementing acacia trees
this is mostly working, but due to some issue with leaf decay, the edges of the larger canopy will decay within minutes.

I don't know why this is yet, but it's likely some incorrect implementation of Leaves causing the problem.

In addition, the secondary branch of acacia may generate next to the base block of the trunk, which I've never observed to happen in vanilla. This has a 2% chance of occurring, so I haven't been able to rule it out yet, but it probably shouldn't happen.
2023-06-10 18:35:42 +01:00
1533dc4e56 Added cherry leaves 2023-06-10 13:21:21 +01:00
3800c0480f Group leaves (de)serializers together 2023-06-09 19:19:29 +01:00
0f8e61eda4 Implemented new cherry-wood blocks 2023-06-09 18:04:52 +01:00
0eb5f9b684 Fixed missing ItemTypeNames (forgot to regenerate from 1.20) 2023-06-09 17:59:11 +01:00
0f9283fda1 Reduce chaos in blockstate (de)serializers wrt. wooden blocks
these started to get flattened in 1.19, and rather than dump them in random places in the main function I made a new method, creating placement inconsistencies.
2023-06-09 17:47:06 +01:00
ab8386ed5a Tests: verify that ItemTypeIds/BlockTypeIds constants match their corresponding VanillaItems/VanillaBlocks registrations 2023-06-09 15:49:10 +01:00
64c1776910 Merge branch 'stable' into minor-next 2023-06-09 13:57:47 +01:00
e85605af7f changelog: fixed typo
[ci skip]
2023-06-09 01:44:45 +01:00
92bd88c77c 5.1.3 is next 2023-06-09 01:37:46 +01:00
7cd317bf39 Release 5.1.2 2023-06-09 01:37:45 +01:00
35fc9abacf Merge branch 'legacy/pm4' into stable 2023-06-09 01:34:33 +01:00
dfd70615ad 4.22.2 is next 2023-06-09 01:33:35 +01:00
ee903cad1f Release 4.22.1 2023-06-09 01:33:35 +01:00
9a04481bec Entity: broadcast teleports as regular movements
fixes #5810

probably fixes #4986

#5810 was caused by the workaround for #4394, which broke in 1.20 for reasons I'm still unclear on.

As FLAG_TELEPORT does not work at all for non-player entities, and causes bugs with player entities, sending the teleport movement without the flag is the least buggy way to solve all of these issues. Having the client interpolate teleport movements is not ideal, but there doesn't seem to be a way to reliably prevent it without causing even more bugs, so this will have to do.
2023-06-09 01:24:57 +01:00
833f9401f9 Merge branch 'stable' into minor-next 2023-06-07 22:03:34 +01:00
a46dfaf677 5.1.2 is next 2023-06-07 21:59:28 +01:00
4a3b175468 Release 5.1.1 2023-06-07 21:59:28 +01:00
73ee94b62c Fixed BlockStateData::CURRENT_VERSION 2023-06-07 21:58:21 +01:00
ab83210aa0 5.1.1 is next 2023-06-07 21:35:11 +01:00
3f2d51c58a Release 5.1.0 2023-06-07 21:35:10 +01:00
13dee2a615 Merge branch 'legacy/pm4' into stable 2023-06-07 21:33:12 +01:00
5d514a274f Merge branch 'legacy/pm4' of github.com:pmmp/PocketMine-MP into legacy/pm4 2023-06-07 21:24:13 +01:00
2220dc557e 4.22.1 is next 2023-06-07 21:23:57 +01:00
b5fc31a781 Release 4.22.0 2023-06-07 21:23:54 +01:00
9a67e3d660 PM5-specific changes for 1.20.0.23 beta 2023-06-07 21:08:41 +01:00
132330e16f Merge branch 'legacy/pm4' into stable 2023-06-07 21:08:09 +01:00
179eec9754 PHP-CS-Fixer 3.17 2023-06-07 21:04:11 +01:00
441f1f534f Random change PHP-CS-Fixer wanted to make 2023-06-07 20:59:32 +01:00
e747478afd and one more 2023-06-07 20:58:15 +01:00
92c45dd7e1 Fixed PHPUnit deprecation warnings 2023-06-07 20:57:43 +01:00
2538880408 1.20.0 2023-06-07 20:56:59 +01:00
4af981d726 PHPStan 1.10.16
closes #5802
2023-06-05 17:07:19 +01:00
ab3ebc1aa8 Bump phpunit/phpunit from 10.2.0 to 10.2.1 (#5803)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.2.0 to 10.2.1.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.2.1/ChangeLog-10.2.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.2.0...10.2.1)

---
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>
2023-06-05 15:01:41 +01:00
57cbc25080 Merge remote-tracking branch 'origin/stable' into minor-next 2023-06-04 16:10:07 +01:00
b9bdfe580b Bump version to 5.2.0+dev
next feature release go brrrr
2023-06-04 16:07:10 +01:00
6d7f44d8fe Implement glow lichen (#5401) 2023-06-04 16:04:08 +01:00
f9818efff4 Fixed PHPUnit deprecation warnings 2023-06-04 14:00:26 +01:00
7fef8f0ab6 5.0.2 is next 2023-06-03 21:56:30 +01:00
2f43ccea6f Release 5.0.1 2023-06-03 21:56:26 +01:00
af1f7e098b Require pmmpthread 6.0.1 2023-06-03 21:42:43 +01:00
1706fb43eb Updated build/php submodule to pmmp/PHP-Binaries@fcbc15f23e 2023-06-03 21:27:54 +01:00
8d7f8ff3f5 Merge branch 'legacy/pm4' into stable 2023-06-03 21:23:00 +01:00
c715efb18e Jukebox: fix music not stopping when destroyed by explosion
closes #5794
2023-06-03 21:22:26 +01:00
40be564689 BlockSpreadEvent: document poorly-named constructor parameters 2023-06-03 17:08:02 +01:00
4e031e7b3e Always drop spore blossom item when it is broken (#5796) 2023-06-03 16:07:44 +01:00
4340c26029 RuntimeDataSizeCalculator: Tidy up junk comments 2023-06-02 16:37:08 +01:00
9c6d4093ae Fixed crash when getting an item from a block which came from an item which came from a block
had a stroke yet?
2023-06-02 16:16:54 +01:00
007ef833d4 Merge branch 'legacy/pm4' into stable 2023-06-02 13:34:29 +01:00
6678360c00 Make changelogs less infuriating in PhpStorm 2023-06-02 13:34:16 +01:00
102fd4d63a CONTRIBUTING: pmmp/ClassLoader is no longer used by PM5 2023-06-02 13:12:50 +01:00
2c0715ac6e Bump phpunit/phpunit from 10.1.3 to 10.2.0 (#5790)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.1.3 to 10.2.0.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.2.0/ChangeLog-10.2.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.1.3...10.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-02 13:04:27 +01:00
f75bb061ce Bump tests/plugins/DevTools from 46d2479 to 83f0db3 (#5787)
Bumps [tests/plugins/DevTools](https://github.com/pmmp/DevTools) from `46d2479` to `83f0db3`.
- [Release notes](https://github.com/pmmp/DevTools/releases)
- [Commits](46d2479b73...83f0db3f9e)

---
updated-dependencies:
- dependency-name: tests/plugins/DevTools
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-02 13:03:26 +01:00
73e7201acb 5.0.1 is next 2023-06-01 16:09:52 +01:00
b16cc69974 Release 5.0.0 2023-06-01 16:09:49 +01:00
5de4215169 Merge branch 'major-next' into stable 2023-06-01 15:44:56 +01:00
e128a4e1e7 Merge branch 'minor-next' into major-next 2023-06-01 14:54:03 +01:00
c95c600100 Merge branch 'stable' into minor-next 2023-06-01 14:52:28 +01:00
3db45b6a68 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-06-01 14:51:14 +01:00
3e87ad281f Use tagged fork of netresearch/jsonmapper
we need this for it to not be a huge pain in the ass to install PM as a composer dependency, which plugin CIs may do.
2023-06-01 14:51:04 +01:00
b72da777eb Bump tests/plugins/DevTools from a67f9af to a2f36e8 (#5785)
Bumps [tests/plugins/DevTools](https://github.com/pmmp/DevTools) from `a67f9af` to `a2f36e8`.
- [Release notes](https://github.com/pmmp/DevTools/releases)
- [Commits](a67f9af8d6...a2f36e8dbf)

---
updated-dependencies:
- dependency-name: tests/plugins/DevTools
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-01 13:45:20 +01:00
de49910e84 Fix CS 2023-05-31 22:18:25 +01:00
d2fe537159 Merge branch 'minor-next' into major-next 2023-05-31 22:12:39 +01:00
bb31df051d Merge branch 'stable' into minor-next 2023-05-31 22:10:18 +01:00
1101f35c17 Update setup-php-action to 2.0.0
this version vastly improves build time by using optimized prebuilts
instead of building the binaries on the runner.
2023-05-31 22:09:33 +01:00
07225df936 Block: fixed tile-stored properties sticking to the item in asItem()
this was enabling duplication of items, since the dropped item object would contain a Block which still referenced the framed Item.
2023-05-31 21:48:06 +01:00
3948dc4f75 Remove calls to ReflectionProperty::setAccessible() (#5783)
This is a no-op in PHP 8.1 and up.
2023-05-31 14:03:14 +01:00
4f4dca7fc0 Mark WoodLikeBlockIdHelper as internal 2023-05-30 21:41:25 +01:00
0ed5e94a72 Merge branch 'minor-next' into major-next 2023-05-30 16:15:56 +01:00
3a4e958e84 Merge branch 'stable' into minor-next 2023-05-30 16:08:03 +01:00
20942b37eb Update composer dependencies 2023-05-30 16:07:01 +01:00
d343db8750 4.21.2 is next 2023-05-30 14:42:59 +01:00
f2df702c67 Release 4.21.1 2023-05-30 14:42:59 +01:00
481270e6aa Merge tag '4.20.5' into stable 2023-05-30 14:42:11 +01:00
e7bdaa8579 Release 4.20.5 2023-05-30 14:35:17 +01:00
76749cbaa7 Use fork of JsonMapper to solve cweiske/jsonmapper#210 2023-05-30 14:30:28 +01:00
a897bdfaa0 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-05-30 14:17:21 +01:00
09668a37d6 Use fork of JsonMapper to solve cweiske/JsonMapper#210 2023-05-30 14:17:09 +01:00
ea92a23d0d Bump build/php from b1d5c0d to f2ece7b (#5765)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `b1d5c0d` to `f2ece7b`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](b1d5c0d737...f2ece7b30d)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-29 21:37:18 +01:00
691e67018d Bump phpstan/phpstan-phpunit from 1.3.11 to 1.3.13 (#5772)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.3.11 to 1.3.13.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.3.11...1.3.13)

---
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>
2023-05-29 21:36:58 +01:00
fe2140a716 Bump shivammathur/setup-php from 2.25.1 to 2.25.2 (#5766)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.25.1 to 2.25.2.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.25.1...2.25.2)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  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>
2023-05-29 21:36:46 +01:00
8744032ab6 Fixed empty block handling after blockstate ID XOR change 2023-05-29 18:26:23 +01:00
5a9cdef40c Chunk: added DIRTY_FLAGS_ALL and DIRTY_FLAGS_NONE 2023-05-29 17:45:19 +01:00
a49842278a WorldProvider subsystem no longer depends on Chunk
Instead, it provides the data needed to construct the chunk, which doesn't require the provider to be aware of anywhere near as much logic.
2023-05-29 17:44:00 +01:00
d57954dff0 PopulationTask: ensure that unmodified chunks don't get sent back to the main thread for no reason 2023-05-29 17:30:04 +01:00
ce5e663a73 Assume chunks are dirty by default
having them be clean by default makes no sense. It only makes sense for them to be clean if they were loaded directly from disk without any alterations.

Default clean is a footgun.
2023-05-29 17:22:39 +01:00
c10be0f346 WorldProvider: allow loadChunk() to return additional information about the loaded chunk data
this will be needed for dealing with #5733. I don't plan to fix that before 5.0, but we need to make the appropriate BC breaks now, before release.
2023-05-29 17:03:39 +01:00
f5a1a0c9cb ÂInsert PM data version into blockstates, chunks, entities, tiles and level.dat
this information will allow us to correct for any bugs introduced by past versions.

however, we still need to propagate this information to permit actually using it when loading data.
2023-05-29 16:32:24 +01:00
7f1550ef04 Revert "Stop using insecure UUIDs from non-XBL players"
This reverts commit 9baf59702b.

I forgot this is also needed for the player list, and for skin updates
to work ... this will need to be revisited
2023-05-27 18:10:55 +01:00
9baf59702b Stop using insecure UUIDs from non-XBL players
closes #4076

I opted for the minimal approach of replacing only UUIDs for non-XBL players, since most servers are using XBL anyway (as they should).
2023-05-27 18:00:54 +01:00
473c062b40 Improve documentation for BlockTypeIds and ItemTypeIds 2023-05-27 17:28:36 +01:00
b8ba2d03ba Added new note instruments up to 1.19
1.20 adds extra ones for each type of mob head, but we're not supporting 1.20 yet.
2023-05-26 16:58:06 +01:00
06b0fa4d67 Fix PHPStan 2023-05-26 15:47:35 +01:00
fddab29e87 Move mob head and note instrument save IDs into pocketmine\data\bedrock
to be consistent, these shouldn't be exposed in the API like this...
I'm not very happy with the whole 'type ID map' paradigm (particularly its lack of static analysis guarantees), but the most important thing right now is to get this stuff out of the API so that plugin devs don't try and abuse it. We're not going to change the whole system days before PM5 release.
2023-05-26 15:47:12 +01:00
bdb0ed0701 Consistently use 'mob head' terminology in the API
previously, we were sometimes using 'mob head' and other times 'skull', sometimes even within the same file.
2023-05-26 15:08:00 +01:00
edafe9d21f Entity: Rename and document isImmobile() and friends
while I could implement server-side ability to disable entity movement, I don't think that's particularly useful. However, the intended function of this (disabling client sided AI) is useful, so it makes more sense to rename it to match its functionality, rather than changing its functionality to match the name.

closes #3130
2023-05-26 14:01:21 +01:00
cc77f18ff0 ÂBlock: added a TODO for getStateId() 2023-05-25 17:38:39 +01:00
24e897f813 Updated blockstate registry consistency check 2023-05-25 16:48:34 +01:00
ffe3556be1 Block: XOR state data with type ID, improve hash distribution
since most blocks have no state data, their lower 8 bits of state data were all zero.
This makes state IDs a bit more distributed for minimal cost.

I considered flipping these around and using type ID in the lower bits directly, but this worsened distribution for walls.

In the worst case, largest number of collisions drops from 11 to 5 with this change, and the number of states with unique hash keys increased from 3518 to 4461 (out of 7638). This is still a long way from perfect, but it's a decent improvement, improving the overall load factor from 1.6 to 1.3.

related to #5604
2023-05-25 16:35:45 +01:00
57330a7186 Bump build/php from f860ade to b1d5c0d (#5760)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `f860ade` to `b1d5c0d`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](f860ade30a...b1d5c0d737)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 12:27:12 +01:00
2ebf8757c1 5.0.0-BETA5 is next 2023-05-23 01:53:00 +01:00
1c69116717 Release 5.0.0-BETA4 2023-05-23 01:52:57 +01:00
9d9c628acd Mark AsyncPoolWorkerEntry as @internal 2023-05-23 01:32:44 +01:00
cbda24d77e Consolidate worker data under AsyncPoolWorkerEntry
instead of having a bunch of arrays... this improves the system integrity and makes it less obnoxious to look at
2023-05-23 01:31:25 +01:00
ed64eac76f ... 2023-05-23 01:21:30 +01:00
a7aebed0a0 Update DevTools submodule to pmmp/DevTools@aa1586db05 2023-05-23 01:19:03 +01:00
c66a3a8b3e Update to Snooze 0.5.0 2023-05-23 01:09:22 +01:00
4aba9d9725 Absorb pocketmine/classloader into the core code
the only use for this class is to facilitate random runtime plugin loading, and it's not complete even for that purpose.

Since nothing but PM uses pocketmine/classloader anyway, it doesn't make sense to have it outside the core. As with LogPthreads, it's just adding more maintenance work.
2023-05-22 22:52:48 +01:00
d2c34615f5 Update build/php to pmmp/PHP-Binaries@b1d5c0d737 2023-05-22 22:35:39 +01:00
815b4e2bab Fix PHPStan 2023-05-21 16:48:07 +01:00
69273f3ff7 AsyncTask::setResult(): permit returning ThreadSafe objects to the main thread
this is now supported thanks to the object rescue feature implemented in pthreads 5.1, making returning of thread-safe values from async tasks possible.
This needs to be explicitly supported, since otherwise it will attempt to serialize them, which isn't supported anymore.
2023-05-21 16:37:41 +01:00
9ddac21de0 Bump shivammathur/setup-php from 2.24.0 to 2.25.1 (#5711)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.24.0 to 2.25.1.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.24.0...2.25.1)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-21 00:13:22 +01:00
fdb724c646 ItemSerializer: change exception type 2023-05-20 18:58:59 +01:00
3109a179db ... 2023-05-20 18:56:28 +01:00
5afeeb8f89 Remove nonsensical code from block and item serializers
At the time when I wrote this code, I was still in the head space of the kind of ID hijacking that PM4 plugins do to override built-in blocks.

However, this kind of internal ID reuse makes no sense in PM5, since said IDs are only used in the core itself at runtime to identify types and states.

Even if we were to allow overriding block deserializers, overriding serializers makes no sense whatsoever, since the original block would continue to exist and be accessible.
There is a case to be made to allow overriding the deserializer, but not for the serializer.
2023-05-20 18:55:36 +01:00
1cb7846f7c Remove LogPthreads from CONTRIBUTING.md 2023-05-20 18:24:10 +01:00
097feba4d5 Absorb pocketmine/log-pthreads into PM core
this was previously part of the abandoned package pocketmine/spl. It had to be separated in the PM3 days, because RakLib depended on it.

Since RakLib 0.13, RakLib stopped being dependent on or aware of pthreads, so it no longer depends on any thread-related packages.
It's also possible to absorb pocketmine/snooze and pocketmine/classloader back into the core with this in mind.
2023-05-20 16:57:24 +01:00
9509d7e04d Scrub PHPStan baselines 2023-05-20 01:51:21 +01:00
3116fb8187 ... 2023-05-20 01:47:50 +01:00
e0630fbb25 pmmpthread support 2023-05-20 01:29:26 +01:00
8245cfab0e PlayerDeathEvent: add ability to set message displayed on the death screen (#5726) 2023-05-19 16:18:18 +01:00
8454076235 WaterCauldron: remove more repeated code 2023-05-19 15:45:12 +01:00
4a3843a881 WaterCauldron: reduce code repetition 2023-05-19 15:40:04 +01:00
bd6af68f91 Update symfony/filesystem to 6.2.10 2023-05-19 15:13:34 +01:00
b27d3a5fce Merge branch 'stable' into minor-next 2023-05-19 15:11:20 +01:00
c91aa24daa Bump phpunit/phpunit from 9.6.8 to 10.1.3 (#5753)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.6.8 to 10.1.3.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.1.3/ChangeLog-10.1.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.6.8...10.1.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-19 15:09:24 +01:00
b8a1b32461 Fixed late property initializing in UnknownBlock (#5755) 2023-05-18 19:53:37 +01:00
9c82507168 Merge remote-tracking branch 'origin/stable' into minor-next 2023-05-18 14:20:22 +01:00
db95bf8b9b Caching creative inventory entries (#5703)
Due to the high cost of Item::serializeCompoundTag(), it's very costly to rebuild this every time we need it. This is sent during the pre-spawn step, where we need to minimize costs as much as possible.
2023-05-18 14:11:28 +01:00
edcf0f8405 5.0.0-BETA4 is next 2023-05-17 19:47:42 +01:00
b8abe34904 Release 5.0.0-BETA3 2023-05-17 19:47:42 +01:00
7ac74180c9 Merge branch 'stable' into major-next 2023-05-17 19:46:50 +01:00
6186fc0bfe 4.21.1 is next 2023-05-17 16:45:35 +01:00
ef40934d24 Release 4.21.0 2023-05-17 16:45:32 +01:00
69b668355f Merge branch 'minor-next' into stable 2023-05-17 16:12:24 +01:00
ee9ce8a4f4 Merge branch 'minor-next' into major-next 2023-05-17 15:45:03 +01:00
59ca7b75e1 Fixed PHPStan error 2023-05-17 15:32:38 +01:00
9621836e36 Clean up confusing mess around block and item overriding
right now, I don't see an obvious reason to do this. If it turns out I was wrong later on, we can add functionality back, but we can't remove functionality after release.
2023-05-17 15:21:49 +01:00
0547383296 Update build/php submodule to pmmp/PHP-Binaries@f860ade30a 2023-05-17 15:08:05 +01:00
c7dff9ea40 bootstrap: remove ext-parallel bootstrapping code
I have no intention of using parallel, so this code is not necessary.
2023-05-17 14:11:43 +01:00
043350753b Drop PHP 8.0, 8.1 is now minimum version 2023-05-17 13:53:57 +01:00
5ad8016b99 Merge branch 'stable' into minor-next 2023-05-17 13:44:45 +01:00
2e5b2eed6e Update composer dependencies 2023-05-17 13:43:28 +01:00
5a0cde49cc AsyncPool: do not double-check progress updates on finished tasks
checkProgressUpdates is called directly before onCompletion, so we only need to call it again if the task isn't finished yet.
2023-05-16 23:37:58 +01:00
008a022ec1 Players now have finite resources in spectator mode
this seems like the logical solution for the block picking issues.
2023-05-16 23:02:33 +01:00
5c85a7c306 Merge remote-tracking branch 'origin/stable' into minor-next 2023-05-16 22:54:53 +01:00
599c4284f5 Introduce 10 KB threshold for async compression
due to the extremely large performance cost of instantiating AsyncTasks, it's usually not worth bothering with async compression except for very large packets.
While this large overhead can be significantly reduced by using specialized threads, it's early days in the testing stages for such improvements, and for now, we still have this to deal with.

Since async compression is always used prior to player spawn, this change may slightly improve the performance of the pre-join stage of the game.
2023-05-16 22:54:06 +01:00
9499e2e595 always the CS... 2023-05-16 14:22:03 +01:00
a4fea1444a Remove validateCallableSignature() calls from network hot paths
we rely on phpstan for validation of this internally, and plugins shouldn't be calling these methods anyway.
this significantly reduces the overhead of CompressBatchPromise.
2023-05-16 14:21:32 +01:00
c9bb4335a1 Item: added getStateId(), removed state data from public API
state data was only used for indexing stuff along with state ID anyway, so it makes more sense to lock it away in here instead.
2023-05-16 14:14:18 +01:00
015c668885 Change confusing 'type data' and 'state data' terminology for blocks and items
For blocks, we now use 'block-item state' and 'block-only state', which should be much clearer for people implementing custom stuff.
'block-item state', as the name suggests, sticks to the item when the block is acquired as an item.
'block-only state' applies only to the block and is discarded when the block is acquired as an item.

'type data' for items was also renamed, since 'type' is too ambiguous to be anything but super confusing.
2023-05-16 14:07:29 +01:00
ccb22ceb3f Fix flower pots being marked as pottable (#5747) 2023-05-16 12:31:30 +01:00
1ba47802a8 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-05-15 14:59:02 +01:00
9d111e13f1 CONTRIBUTING: added table of in-house dependencies and which classes, functions or namespaces they contain 2023-05-15 14:58:31 +01:00
44bc4d8c7c Bump phpstan/phpstan from 1.10.14 to 1.10.15 (#5741)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.14 to 1.10.15.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.14...1.10.15)

---
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>
2023-05-10 15:02:59 +01:00
30f1d3e016 Fix code style (#5740) 2023-05-10 13:41:25 +01:00
7b1a1e5a18 BlockStateToObjectDeserializer: remove redundant helper 2023-05-08 22:16:55 +01:00
1b452f3a88 BlockStateToObjectDeserializer: make flat colour block handling less repetetive 2023-05-08 21:38:58 +01:00
fa719f37d5 Implement Cave Vines & Glow Berries (#5424) 2023-05-08 19:24:23 +01:00
d834266635 BlockGrowEvent: add player information for bonemeal usage (#5596)
this is in line with StructureGrowEvent, which also has a similar API.
2023-05-08 17:38:07 +01:00
d317347a9b WorldTimings: remove TODO
I tried this, and it didn't really provide any information that the tree table didn't already show.
2023-05-08 16:35:30 +01:00
077fac84bf Added aggregate timers for all world timings
this allows timings list view to display totals for these sections. It does make the tree view a bit more annoying in some cases though.
2023-05-08 16:27:46 +01:00
6f0eb019d2 ItemIdMetaUpgrader: added some auxiliary methods 2023-05-07 19:28:07 +01:00
fdb3a5b121 Fixed incorrect implementation of peak timings 2023-05-07 18:29:37 +01:00
8e6c1762d7 Merge branch 'minor-next' into major-next 2023-05-06 18:27:06 +01:00
e3bc36ab5b Merge branch 'stable' into minor-next 2023-05-06 18:26:47 +01:00
283ff28aa9 4.20.5 is next 2023-05-06 18:20:19 +01:00
c3ceeeace7 Release 4.20.4 2023-05-06 18:20:18 +01:00
aac4f6c0e1 Fixed all game modes allowing flight
moral of the story: do not trust that mojang things do what they say they do - the spectator ability layer always applies, regardless of whether the player is actually in spectator mode or not ...
2023-05-06 18:18:05 +01:00
926f68d8c5 Move SkinAdapter under TypeConverter, remove SkinAdapterSingleton
this is legacy cruft from PM3, which didn't have TypeConverter or SingletonTrait.
2023-05-06 17:53:24 +01:00
ed11fd5a83 CS again... 2023-05-06 17:51:00 +01:00
e0a6ec0c24 Start deglobalizing TypeConverter
there's a bunch of places we can't reach with this right now:

- particles
- sounds
- tile NBT
- entity metadata
- crafting data cache
- chunk encoding
- world block update encoding

this is a work in progress, but ultimately we want to get rid of these singletons entirely.
2023-05-06 17:47:09 +01:00
7cdf6b0946 Fixed merge error 2023-05-06 17:29:59 +01:00
5c7f4570b4 Merge branch 'minor-next' into major-next 2023-05-06 17:20:37 +01:00
bb60a9057f Merge branch 'stable' into minor-next 2023-05-06 17:08:29 +01:00
3b893961e4 4.20.4 is next 2023-05-06 17:01:49 +01:00
325ffec1be Release 4.20.3 2023-05-06 17:01:49 +01:00
fa715a074a Fixed TimingsHandler depth not getting reset when timings is disabled
When timings was disabled, internalStopTiming is not called, and timer depth is not decremented.
If timings is later reenabled, the next call to internalStartTiming will think the timer is already running, and won't generate any new records for the timer.
This has led to broken timings reports with missing Full Server Tick entries, amongst other things.
2023-05-06 16:56:39 +01:00
4caa2c7690 NetworkSession: send FLYING flag on spectator ability layer
fixes #5722

I'm not very clear why this works. PM doesn't use real spectator mode yet (we're still using the faux spectator mode PM has had for years, because I haven't yet assessed how real spectator mode will affect stuff like block interactions), so this ability layer shouldn't have any effect.

thank you @Alemiz112
2023-05-06 15:54:23 +01:00
d04da9b1d8 Reuse timings handlers for event handlers of the same events
due to direct repeated usage of registerEvent() with closures, we've seen some libraries like muqsit/SimplePacketHandler generate very large timings reports, because a new timings handler gets created every time a plugin registers or unregisters a new packet handler callback.

This change fixes the problem by ensuring that any handlers derived from the same function, handling the same event class, will share the same timer.
2023-05-06 15:42:52 +01:00
8a374df801 BlockTranslator: remove useless call to generateDataFromStateId()
BlockStateDictionary doesn't retain BlockStateData anymore, so this optimisation is just wasting CPU cycles.
2023-05-05 17:02:50 +01:00
02cf5ed388 RuntimeBlockMapping: lazy-load NBT blockstates
this saves a considerable amount of memory.

we don't actually need this state array in PM4 anyway, since we don't support the client-side chunk cache yet.
when the time comes to support it, it'll be much more practical to cache binary states and copy bytes anyway, instead of doing it the current way, which is both slow and memory-intensive.

Measured footprint change: 9 MB -> 400 KB.
2023-05-05 16:18:03 +01:00
6cad559dbe Merge branch 'stable' into minor-next 2023-05-05 16:08:30 +01:00
84a943bcec BaseInventory: slap a TODO on isSlotEmpty() 2023-05-05 16:06:37 +01:00
f2c6a75145 BlockStateDictionary: reduce memory footprint of id/meta -> state ID lookup by >60%
the aim of the game here is to avoid allocating lots of tiny arrays, which have a terrible overhead:useful-data ratio.
This reduces the footprint of the mapping from 1.6 MB to 600 KB.
2023-05-05 15:26:54 +01:00
09e823e304 BlockStateDictionary: remove useless indirection 2023-05-05 14:52:21 +01:00
289ede669d BlockTranslator: use less ambiguous function names 2023-05-05 14:47:23 +01:00
4f32f5e0b7 BlockStateDictionaryEntry: encode property names as well as values
sadly we need these to reconstruct the state upon deserialization
2023-05-05 13:41:06 +01:00
633e77a34c RuntimeBlockMapping: share states CompoundTags if they are the same
this allows saving about 4 MB of memory, because there are many blocks which have identical states, although they have different IDs.

this relies on a potentially risky assumption that the tags in knownStates won't be modified. If they are modified, the changes will influence all blockstates which share the tag.
However, I don't expect this to happen, and the 4 MB memory saving is substantial enough to be worth the risk.
2023-05-04 23:21:54 +01:00
092d130c96 RuntimeBlockMapping: borrow a hack from PM5 to reduce memory footprint
we can't change the internals of this on a patch release, but this hack provides a 12 MB memory usage reduction, which is very significant.
2023-05-04 23:01:10 +01:00
c09390d20f 4.20.3 is next 2023-05-04 21:06:30 +01:00
22f8623e17 Release 4.20.2 2023-05-04 21:06:27 +01:00
d8e77c1920 Tidy up crafting block registration
according to data dumps from bds-mod-mapping, fletching tables have a blast resistance of 12.5, just like the others.
2023-05-04 18:47:06 +01:00
85372633eb Tidy up BlockLegacyIdHelper stuff
I don't plan to make wood-like blocks have a dynamic wood/leaves/sapling type, as it's entirely possible their type properties will continue to diverge in future versions.
2023-05-04 17:05:22 +01:00
2c81446e5b Move TreeType to generator package, added dedicated SaplingType enum
TreeType includes a bunch of stuff that don't have regular saplings associated with them, such as mangrove and azalea trees.
Mangrove has a dedicated propagule block with different behaviour than the others, and azalea trees are grown from azalea blocks, which are solid and have different behaviour to saplings.

We may also want to account for crimson and warped 'trees' in TreeType too, although I'm not sure if those belong there or not.
2023-05-04 16:54:10 +01:00
299ff5d912 Register mangrove boat item 2023-05-04 16:39:23 +01:00
896dd2ec9d Boat: use BoatType enum instead of TreeType
TreeType really belongs in the generator package. Not all types of tree may have their own boat type (e.g. azalea).
We can't use WoodType for this either, because some types of wood also don't have associated boat types (crimson, warped).
2023-05-04 16:35:31 +01:00
f1417e8dc9 BlockStateDictionaryEntry: deduplicate encoded states
this saves about 500 KB of memory at no cost.
2023-05-04 16:14:41 +01:00
897ba9f2d9 BlockStateLookupCache: combine arrays for stateless and stateful blocks
this reduces memory usage by another 20 KB or so.
2023-05-04 15:29:27 +01:00
d2c37d8bcf BlockStateLookupCache: avoid allocating useless arrays for blocks with only 1 permutation
this saves about 120 KB of memory.
2023-05-04 15:16:18 +01:00
43fe819862 BlockStateDictionary: added a smelly hack that saves another 40 KB
this is really diminishing returns at this point...
2023-05-03 23:18:06 +01:00
f9d9cbd0f6 BlockStateDictionary: slash another 14% off memory usage by deduplicating block type names
perhaps we could construct a dictionary from BlockTypeNames reflection??
2023-05-03 23:14:53 +01:00
ed021d193d BlockTranslator: cut memory usage in half
this was achieved by storing binary representations of the blockstates, rather than the original BlockStateData.

Due to the insane object:data ratio of Tag objects (40:1 for ByteTag for example), modestly sized NBT can explode in memory footprint. This has been previously seen with the absurd 25 MB footprint on file load.
Previously, I attempted to mitigate this by deduplicating tag objects, but this was mitigating a symptom rather than addressing the cause.

We don't actually need to keep the NBT around in memory, since we don't actually use it for anything other than matching blockstates. In this case, we can allow the code to be possibly a little slower, since the lookup is anyway slow and the result will be cached.
In fact, using encoded ordered states as hash keys significantly improves the speed of lookups for stuff like walls, which have many thousands of states.

We keep around generateStateData(), since it's still possible we may need the BlockStateData associated, and it can be easily reconstructed from the binary-encoded representation in BlockStateDictionaryEntry.
2023-05-03 23:11:00 +01:00
32e6fdd95a Rename RuntimeBlockMapping -> BlockTranslator 2023-05-03 22:18:27 +01:00
01f340985a Centralize all conversion-related stuff under TypeConverter
instead of having singletons for everything, which are a nightmare to manage for multi version
2023-05-03 16:33:17 +01:00
5e462db0f8 Move MOTD game mode stringifying to RakLibInterface
since this is contextless (there's no way to know the version of the client requesting the MOTD), we can safely assume that this is not going to vary between protocol versions.
2023-05-03 13:36:24 +01:00
6beb80b8fe Fixed usages of BlockDataUpgrader which weren't accounting for thrown exceptions 2023-05-02 17:13:31 +01:00
4d0cecbac2 RegionWorldProvider: use provider logger instead of global logger 2023-05-02 16:47:25 +01:00
5fcf5e0c40 LevelDB: log more stuff, stop bailing on recoverable errors 2023-05-02 16:46:45 +01:00
f29e2f7110 WorldProviders now accept Loggers 2023-05-02 15:41:11 +01:00
d0d263191d Fix build 2023-05-02 14:21:33 +01:00
3366e1084b LightUpdate: squeeze 10-15% more performance out of propagation
we can use SubChunkExplorerStatus to decide whether or not to update the local light array reference.

We also dereference some properties into local variables, because dereferencing properties is slow. Indirect property dereferences add an extra performance penalty for every layer.
2023-05-02 14:05:55 +01:00
d0b9234841 SkyLightUpdate: deal with effective light during initial node discovery
this allows the propagation stage to ignore effective light, which allows for further optimisations.
2023-05-01 22:29:31 +01:00
d80f65ae7c BedrockWorldData: do not load worlds with a newer NetworkVersion than we support
often, protocol updates are done without consideration for the current world format version. We don't want to require the world support to be updated at the same time, since this might delay updates.
2023-05-01 17:53:08 +01:00
096daef0d0 World: added setDisplayName()
this is an obvious use case, and I'm not really sure why it wasn't supported sooner.
2023-05-01 16:29:07 +01:00
29694c19af BlockStateUpgradeSchemaUtils: Use independent suffixes for each property mapping list 2023-05-01 14:46:30 +01:00
b3e94ef1dc Chunk: update documentation 2023-05-01 14:46:30 +01:00
f04151dbe6 README: next-major branch was renamed (#5731)
[ci skip]
2023-05-01 14:08:20 +01:00
5dcd8bf289 Bump symfony/filesystem from 5.4.21 to 5.4.23 (#5730)
Bumps [symfony/filesystem](https://github.com/symfony/filesystem) from 5.4.21 to 5.4.23.
- [Release notes](https://github.com/symfony/filesystem/releases)
- [Changelog](https://github.com/symfony/filesystem/blob/6.2/CHANGELOG.md)
- [Commits](https://github.com/symfony/filesystem/compare/v5.4.21...v5.4.23)

---
updated-dependencies:
- dependency-name: symfony/filesystem
  dependency-type: direct:production
  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>
2023-05-01 13:30:02 +01:00
17fe894229 TypeConverter: fixed crash on unknown blockitems (#5729)
morton2d_encode is 64-bit function when NBT int tag is 32-bit only, resulting in crash
2023-04-30 12:11:07 +01:00
728e0bc869 tools/generate-blockstate-upgrade-schema: allow multi-ID remaps to be processed as regular states if their ID didn't change
this allows remappedStates to only deal with stuff that has a different ID, which reduced the size of the 1.12 -> 1.13 schema quite nicely.
2023-04-28 20:58:18 +01:00
a1d44de487 Added support for compressing blockstate remaps using copiedState
this significantly reduces the size of schemas when state remaps are used (see pmmp/BedrockBlockUpgradeSchema@85b83b360e).

in addition, this will likely offer a substantial performance and memory saving when walls get flattened, which will eventually happen.
2023-04-28 20:35:37 +01:00
263e1e9950 Fixed bogus test expectations 2023-04-28 20:05:51 +01:00
2121152b76 Fix CS 2023-04-28 20:03:53 +01:00
a1cd1d7433 ... 2023-04-28 19:35:03 +01:00
04aabaee5e Fix CS 2023-04-28 19:31:08 +01:00
75410a5412 BlockStateUpgradeSchemaUtils: sort data before emitting JSON
this makes it easier to see what's changing, as well as making the order stable across multiple regenerations.
2023-04-28 19:31:00 +01:00
e2108557ab BlockStateUpgrader: make sure the returned state always has an updated version ID
PM itself doesn't require this, but it's useful for tools to know whether to upgrade the schema again (e.g. in testing scenarios).
2023-04-28 17:26:19 +01:00
ff8301b86c BlockStateData: fixed outdated version ID 2023-04-28 17:23:32 +01:00
869c836e2d BlockStateUpgradeSchemaUtils: ensure that remapped values are generated in a consistent order
this uses lexical order, which isn't ideal for numeric values (1, 10, 2, etc), but it's good enough to ensure that the order is stable.
2023-04-28 17:12:52 +01:00
b70ff32548 ItemTranslator: Fixed log items not displaying correctly on the client
closes #5724

this uses a (potentially bogus) assumption that the lowest mapped meta value associated with an ID is valid. I don't want to break this during a patch release, and this works for now.

In the future it would probably make more sense to bypass ItemTranslator entirely, and rely solely on the blockstate returned by RuntimeBlockMapping to fetch the correct ID. This is similar to how we serialize items for saving on disk in PM5.
2023-04-28 13:54:40 +01:00
73bf5d4b29 DoubleChestInventory: specialize isSlotEmpty() and getMatchingItemCount() 2023-04-27 21:17:55 +01:00
eb136e60c8 BaseInventory: added getMatchingItemCount() helper
this eliminates the performance issues described by #5719.
closes #5719

we may want to consider exposing a public API for this in the future, since it might be useful for plugins.
2023-04-27 21:08:35 +01:00
4228880509 BaseInventory: change dumb variable names in internalAddItem() 2023-04-27 20:29:02 +01:00
709d874204 BaseInventory: clean up max stack size handling
we can safely assume that:
- the inventory's max stack size won't change during the operation
- two items which stack together have the same max stack size
- the item's max stack size won't change during the operation
2023-04-27 20:27:05 +01:00
07dc10d6e6 World: improve performance of tickChunks() selection process (#5721)
Since light population is required to make a chunk tickable, a chunk may not be tickable for some time if the async workers get backlogged.
The previous version of this system only cached the eligibility result if the result was a "yes", but we can also track it when it's a "no", rather than rechecking it every tick.

This change should improve performance in factions and similar gamemodes, which involve large maps with sparsely distributed players, where each player likely has an independent, non-overlapping ticking chunk circle.

We also ditch TickingChunkEntry in favour of multiple arrays to track the eligibility states. This allows us to avoid rechecking the (even cached) readiness of potentially thousands of chunks. If there are no ticking chunks to recheck, this reduces the cost of the selection process to zero.
2023-04-27 16:59:29 +01:00
7f6269c432 Introduce and use optimised versions of Inventory->isSlotEmpty()
this avoids useless cloning, improving the performance of several functions.
2023-04-27 16:52:52 +01:00
194714b448 Merge branch 'stable' into minor-next 2023-04-27 15:37:54 +01:00
023460db2c BaseInventory: fixed internalAddItem() doing useless canStackWith() checks on null items
if the item is null, it's never going to stack with anything given to this function, because addItem() already discards null items.
2023-04-27 14:53:54 +01:00
2910ffebf4 4.20.2 is next 2023-04-27 13:31:02 +01:00
fea820a99e Release 4.20.1 2023-04-27 13:31:02 +01:00
7c19f14cf5 Fixed up offhand handling for ItemStackRequest, fixes #5723 2023-04-27 13:25:08 +01:00
5a54d09869 InventoryManager: verify slot existence in locateWindowAndSlot()
previously, this would happily return invalid slot IDs, potentially leading to a crash.
2023-04-27 13:18:28 +01:00
a8dec1adb1 PM5-specific changes for 1.19.80 2023-04-26 23:30:56 +01:00
0dca85af44 Merge branch 'minor-next' into major-next 2023-04-26 23:28:27 +01:00
4def4d52d9 Merge branch 'stable' into minor-next 2023-04-26 23:22:00 +01:00
1d10107024 4.20.1 is next 2023-04-26 23:15:38 +01:00
54ae4d0ea2 Release 4.20.0 2023-04-26 23:15:34 +01:00
0d21e591d1 Support sign editing UI in 1.19.80, with APIs to allow plugins to use it
this doesn't support editing the rear side of a sign, since the 1.12 format doesn't allow us to represent the rear text, and it would necessitate API breaks to support anyway.

However, we can quite trivially support APIs for the sign GUI, which plugins can use to enable editing signs. PocketMine-MP doesn't currently permit this, since it's currently an experimental feature in 1.20, but plugins can simply use Player->openSignEditor() to mimic it.

This is, however, a byproduct of the fact that APIs needed to be added in order to facilitate the use of OpenSignPacket in 1.19.80.
2023-04-26 22:55:05 +01:00
408616723c Changes for 1.19.80 2023-04-26 22:52:02 +01:00
9bfcd39f2a World: improve type info for getTickingChunks() 2023-04-26 17:06:52 +01:00
8102616ff4 Added ticking chunk count to /status
closes #5716
2023-04-26 17:05:31 +01:00
b162d688a3 CI: use php-cs-fixer 3.16 2023-04-26 16:05:06 +01:00
eb130f2906 Move primary version to PHP 8.1
8.0 is still supported for now, but won't be updated any longer.
2023-04-26 16:03:33 +01:00
3b09c3a48a actions: updated setup-php-action to pmmp/setup-php-action@c7fb29d835 2023-04-26 14:40:39 +01:00
87781cff4d Update GitHub Actions PHP versions 2023-04-26 14:38:40 +01:00
db0cf4bb5a Update composer dependencies 2023-04-26 14:35:05 +01:00
a0346fb6d3 Merge branch 'minor-next' into major-next 2023-04-26 14:29:32 +01:00
eb4679fefd Merge remote-tracking branch 'origin/stable' into minor-next 2023-04-26 14:28:29 +01:00
a4f2b99ed5 InGamePacketHandler: queue slots for syncing if they appear in requestChangedSlots
this is essentially a prediction without the actual predicted item. We have to sync these regardless of what happens.

fixes #5708
2023-04-24 14:06:29 +01:00
3ecc980bc4 ÂInventoryManagerEntry: fixed incorrect PHPDoc type 2023-04-24 13:42:11 +01:00
107b56154b ItemStackRequestExecutor: fixed stonecutter recipes
this uses the same dodgy hack used by CraftingTransaction, which assumes that getResultsFor() does not care about the crafting inputs.

While this is currently OK, since none of the currently-implemented recipes care about inputs anyway, it will become a problem when we implement shulker box recipes, so this needs to be addressed.

However, it can't be addressed without BC breaks, so this will have to be dealt with in PM5.

closes #5715
2023-04-24 13:35:00 +01:00
f86fde064d CraftingManager: fixed uninitialized field
I'm having deja vu about this ...
2023-04-24 12:34:34 +01:00
edcaeef831 VanillaBlocks: reduce width of element block registration 2023-04-21 21:33:45 +01:00
d4ca566fd0 Move block permutation generation into Block
this allows sealing off a whole bunch of internal APIs.
2023-04-21 20:38:28 +01:00
6c0ad9589b Block: rename isSameType() to hasSameTypeId()
this should remove any ambiguity about its behaviour.
2023-04-21 20:25:21 +01:00
84a16ce69a HandlerList: fixed crash on getting unused priority
these sub-arrays are no longer allocated if no handlers are registered.

fixes #5713
2023-04-21 16:19:15 +01:00
d06d3bc871 4.19.4 is next 2023-04-21 15:53:05 +01:00
11e34b3e5c Release 4.19.3 2023-04-21 15:53:02 +01:00
f9318bf286 TimingsHandler: stop throwing exceptions when timers aren't stopped in the right order
this is usually because of an uncaught exception interacting with a try...finally block.
This will normally result in a crash anyway, and we don't want to obscure the real error.
2023-04-21 15:38:11 +01:00
769be8e140 Fix CSÂ 2023-04-20 00:18:32 +01:00
c878bd8289 Merge remote-tracking branch 'origin/minor-next' into major-next 2023-04-20 00:18:19 +01:00
71b78b02d3 Merge remote-tracking branch 'origin/stable' into minor-next 2023-04-19 23:57:26 +01:00
4147d0dc75 tools/generate-blockstate-upgrade-schema: give better errors when a weird new blockstate version is found 2023-04-19 16:43:29 +01:00
674b65f789 Item: optimise serializeCompoundTag() a little 2023-04-18 16:18:34 +01:00
a77fc8109f TypeConverter: avoid repeated calls to getId() and getMeta() 2023-04-18 15:02:52 +01:00
6102740ee3 TypeConverter: use a less slow hack to restore meta values on items sent by the client
this isn't even really needed anymore, since we don't decode items from the client since 4.18.

However, this may still be useful for tools.
2023-04-18 15:00:34 +01:00
40168a457e TypeConverter: fixed coreItemStackToNet() causing item NBT to be prepared twice
hasNamedTag() calls getNamedTag(), which calls serializeCompoundTag(), which writes the item's properties into the given NBT tag.
2023-04-18 14:43:25 +01:00
d07acd0013 RakLibInterface: split error ID into 4-character chunks
this makes it easier to read, since the error ID can't be copy-pasted from the disconnection screen on the client.
2023-04-17 14:05:46 +01:00
0629d11e13 Avoid unnecessary events work in handleDataPacket if the events have no registered handlers
this particular optimisation became possible thanks to changes in 4.19.

I observed that the allocation of Event objects and calling ->call() was costing us a significant percentage of the time taken in PlayerAuthInputPacket handlers. This change produces a measurable 2 microsecond reduction in overhead for PlayerAuthInputPacket handling when players are not moving (10.7 -> 8.7 microseconds). On a server with 200 players, this translates into a 1% reduction in CPU load for PlayerAuthInputPacket alone. It will also benefit other packets, but not to the extent that PlayerAuthInputPacket benefits.
2023-04-16 20:51:55 +01:00
9561ae5af7 Entity: micro optimisation for checkBlockIntersections() 2023-04-16 17:57:51 +01:00
56fbd45dd5 Entity: avoid double-checking block intersections for moving entities
fixes #1824
2023-04-16 17:38:26 +01:00
b5dc72b0ee tools/simulate-chunk-selector: fixed the script being completely broken
getopt() behaviour is really, really dumb
2023-04-16 16:47:17 +01:00
4ba57f2b03 RegisteredListener: use try...finally to stop timings
While event handlers should not throw exceptions, we need to make sure the timings get stopped in the correct order, because the parent Event timer will be stopped due to using a finally block.
If this happens while the handler timing is still running, a second exception will occur, obscuring the real error.
2023-04-16 00:40:43 +01:00
1026811741 Merge branch 'minor-next' into major-next 2023-04-14 21:00:08 +01:00
84cb070d56 Merge branch 'stable' into minor-next 2023-04-14 20:12:33 +01:00
df0d72bf61 4.19.3 is next 2023-04-14 18:43:44 +01:00
a534ac759a Release 4.19.2 2023-04-14 18:43:41 +01:00
5ab954b7a0 Update composer dependencies 2023-04-14 18:31:57 +01:00
6c6f686f8e Timings: be more intelligent about shortening timer names
non-pocketmine classes may reuse the names of pocketmine core classes. We don't want timers to get erroneously reused in this case.
2023-04-14 18:24:53 +01:00
bf7975da57 Timings: use class to index packet timings, not IDs
on multi version servers, the same packet may have different IDs, or different packets might use the same ID. In these cases, we don't want the timings to get split up or erroneously reused.
2023-04-14 18:22:35 +01:00
7aeedd8220 Timings: fixed every player getting its own timings
we need a more consistent way to deal with this
2023-04-14 17:32:56 +01:00
3dd1ce2d02 4.19.2 is next 2023-04-14 16:47:46 +01:00
5a29d07021 Release 4.19.1 2023-04-14 16:47:43 +01:00
692e1253c6 Fixed AABB height for farmland and grass paths (fixed in 1.19.50) 2023-04-14 16:02:28 +01:00
ab0c444823 Player: fixed ticking chunks not being re-registered if they never left the view distance
closes #5699
2023-04-14 16:02:28 +01:00
e48a4aaa55 World: fixed chunk ticking not being disabled by setting chunk ticking radius to 0
I can't believe I missed this ...
2023-04-14 16:02:28 +01:00
6fc4ce0f86 ÂTimingsCommand: include HTTP response code in debug message
we should probably show this in the regular response message, but we need new translations for that.
2023-04-14 16:02:27 +01:00
6acabf7a1b Block: add clarifying note about isSameType()
I'm still not happy with this method though...
2023-04-13 13:40:53 +01:00
10243c7b2c Bump phpstan/phpstan from 1.10.11 to 1.10.13 (#5697)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.11 to 1.10.13.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.11...1.10.13)

---
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>
2023-04-13 13:19:24 +01:00
b122703fd0 BaseCoral: fixed late property initialization 2023-04-13 13:18:47 +01:00
e40774d62f Block: make internal methods private (they are no longer used outside of Block) 2023-04-13 13:06:56 +01:00
027d8f7377 always the CS... 2023-04-13 12:55:18 +01:00
5950707267 Block: simplify required type data / state data bits code 2023-04-13 12:55:09 +01:00
6cace51a21 Remove unused variable 2023-04-13 12:47:17 +01:00
6703f46a08 Remove random dead TODOs 2023-04-13 12:47:08 +01:00
874fdf5adb ItemBlock: reference blocks directly (take 2)
This was first attempted in f64dc01bd1, but reverted, since I hadn't considered how to handle stripping state data from blocks.

This removes the abusable API RuntimeBlockStateRegistry::fromTypeId() and related methods. These were only used to allow ItemBlocks to magically start referencing other blocks if the blocks were overridden by a plugin, but this was never a well-supported use-case anyway.

Instead of relying on RuntimeBlockStateRegistry, we remember the state that the block had during its constructor, and use that to normalize the non-item properties for asItem().

closes #5609
2023-04-13 12:44:54 +01:00
1c626baf1a Fixed dodgy custom block registration test 2023-04-13 12:27:55 +01:00
c3a2199f0e Reduce global usage in world providers 2023-04-13 12:05:37 +01:00
499b29b53a Merge branch 'minor-next' into major-next 2023-04-12 21:04:08 +01:00
8102586ee0 Merge branch 'stable' into minor-next 2023-04-12 21:04:03 +01:00
18b528f72d ItemStackRequestExecutor: fixed borked taking of created items
closes #5695
2023-04-12 21:01:46 +01:00
0336394098 Human: remove useless NameTag tag
this is not written anywhere, so this code never does anything.
2023-04-12 16:44:10 +01:00
7e92da126d DelegateInventory: fixed slots being synced twice and breaking ItemStackRequests
the second time the slot is synced, there is no prediction, so the slot update isn't associated with a request anymore. This causes subsequent requests in the same packet to fail, since the dependency request ID isn't associated with the slot anymore.

This change fixes the problem by only allowing the backing inventory to trigger a call to DelegateInventory->on*Change(). While we could have removed and re-added the listener instead, this way is safer since it doesn't assume that the backing inventory won't modify the given item in setItem().

closes #5692
2023-04-12 15:43:51 +01:00
b80d7a57e3 Merge branch 'minor-next' into major-next 2023-04-11 23:56:28 +01:00
1569bed37a Merge branch 'stable' into minor-next 2023-04-11 23:56:22 +01:00
ba62e0f9cb WorldManager: fixed borked pre-generation for new worlds' spawn terrain
perhaps directly altering the behaviour of selectChunks() wasn't a good
idea? ...
2023-04-11 23:55:53 +01:00
a6e79c5004 TimingsHandler: remove useless paste metadata
these fields are not used by any version of timings, so this code is redundant.
2023-04-11 23:45:01 +01:00
858d4a2ed2 changelog: fixed indentation
I have no idea what happened here...
2023-04-11 23:35:14 +01:00
18658cb74d 5.0.0-BETA3 is next 2023-04-11 23:27:01 +01:00
dd9ea4ee02 Release 5.0.0-BETA2 2023-04-11 23:27:01 +01:00
ed88d68fd7 Remove stuff deprecated in 4.19.0 2023-04-11 23:20:58 +01:00
9bddcc72f7 Merge branch 'minor-next' into major-next 2023-04-11 22:51:50 +01:00
87d8c1ea11 4.19.1 is next 2023-04-11 22:48:05 +01:00
89deb0fe18 Release 4.19.0 2023-04-11 22:48:02 +01:00
ad88490e84 Mark TickingChunkEntry as internal 2023-04-11 22:34:11 +01:00
3490e2b06a Mark RegisteredListenerCache as internal 2023-04-11 22:33:44 +01:00
946c2fbacc Ticking chunks rewrite (#5689)
This API is much more flexible than the old, allowing any arbitrary set of chunks to be ticked.

These changes also improve the performance of random chunk ticking by almost entirely eliminating the cost of chunk selection. Ticking chunks are now reevaluated when a player moves, instead of every tick.

The system also does not attempt to check the same chunks twice, leading to further improvements.

Overall, the overhead of random chunk selection is reduced anywhere from 80-96%. In practice, this can offer a 5-10% performance gain for servers with sparsely distributed players.
2023-04-11 20:01:19 +01:00
1c0eed56f1 Added runtime test for event handler inheritance, to ensure I don't accidentally break it with optimisations 2023-04-11 13:52:37 +01:00
a0dadc6e37 Merge branch 'minor-next' into major-next 2023-04-10 14:38:23 +01:00
9e9b4db00f Merge branch 'stable' into minor-next 2023-04-10 14:32:33 +01:00
e667b5c7db 4.18.5 is next 2023-04-10 14:17:56 +01:00
f61f72180f Release 4.18.4 2023-04-10 14:17:53 +01:00
3f82150837 Update Composer dependencies 2023-04-10 14:06:50 +01:00
017fcde6aa always the CS... 2023-04-10 13:56:53 +01:00
24374297e7 NetworkSession: extract rate limiting functionality into its own unit, and apply a separate rate limit to game packets 2023-04-10 13:53:22 +01:00
76ebedff6a HandlerList: remove unnecessary variable 2023-04-07 22:58:30 +01:00
3ea8d27a3b HandlerList: improve listener list development to make way for #5678 2023-04-07 22:55:27 +01:00
d6c923b525 ExperienceOrb: add get/setDespawnDelay
closes #5645

the code for this is borrowed from ItemEntity. I didn't feel like a base class was appropriate, and we can't (yet) declare constants in traits.
2023-04-07 22:33:30 +01:00
7b55c984bf InGamePacketHandler: reduce debug noise on outdated movements 2023-04-07 21:40:46 +01:00
f5b4d64668 Player: increase max distance between movements to allow high levels of speed to work correctly
speed 255 may allow the player to move as much as 14.8 blocks per tick when sprinting.
2023-04-07 21:35:58 +01:00
1683aa681d TimingsHandler: added format version 2023-04-06 15:08:49 +01:00
bf84caa02c Timings: record peak tick time and active ticks
this information is useful for determining the sizes of lag spikes, and giving more accurate average times.
2023-04-06 15:05:40 +01:00
734adec90d TimingsCommand: log the response body on failed paste 2023-04-06 14:46:02 +01:00
4724195791 Improved performance of event calls
This change significantly reduces the amount of work done by event handlers. Instead of traversing all of the priorities and event parent chain multiple times, we reduce event handlers down to a simple list, which doesn't require any logic to iterate over.
Previously, calling an event with lots of parents costed more than an event which directly descended from Event.
In addition, we had to do a lot of usually useless work to check all priorities, when in practice, only NORMAL will be used in almost all cases.

This change makes it more cost effective to implement the feature suggested by #5678; however, it will still require additional changes.
2023-04-05 23:02:44 +01:00
f32a853bd4 HandlerList: remove useless isset 2023-04-05 21:37:08 +01:00
dbcd2b1e65 ItemTypeIds::toBlockTypeId() now returns null for non-blockitem IDs
closes #5648
2023-04-05 21:04:00 +01:00
61b0ad3e7f PreSpawnPacketHandler: added dedicated timer for the humongous amount of crap that has to be sent pre-spawn 2023-04-05 20:58:49 +01:00
b2f755720d Use a proper Breakdown timing group instead of the unwieldy INCLUDED_BY_OTHER_TIMINGS_PREFIX 2023-04-05 20:47:47 +01:00
8ef2780dcd Use group format for tasks 2023-04-05 20:35:54 +01:00
7e1467f3f7 Merge branch 'minor-next' into major-next 2023-04-05 20:14:59 +01:00
b19c7212ab Merge branch 'stable' into minor-next 2023-04-05 20:12:31 +01:00
14c1a9550d Update composer dependencies 2023-04-05 20:12:21 +01:00
9037d5f16b 4.18.4 is next 2023-04-05 20:07:38 +01:00
8b64ea9e65 Release 4.18.3 2023-04-05 20:07:23 +01:00
2936726bf8 Fixed packets sent by EntityEventBroadcaster not firing DataPacketSendEvent
closes #5670

I'm not super happy with this fix, since it can still be broken if StandardPacketBroadcaster is replaced by something else. However, fixing that problem is probably going to require internal BC breaks, which are not suitable for a patch release.
2023-04-03 22:46:14 +01:00
9cd07f6721 NetworkBroadcastUtils: remove dead code
we don't allow changing the target list anymore, since it increases internal complexity, so this code is redundant.
2023-04-03 22:37:22 +01:00
4bb8daa1a5 ItemStackRequestExecutor: allow any action to take from the created output slot
fixes #5679
2023-04-03 22:24:40 +01:00
6e8eda4ac1 Fixed creative inventory items getting modified by ItemStackRequests 2023-04-03 22:22:21 +01:00
73522d06ef ... 2023-03-31 21:51:07 +01:00
a6a360d179 Revert "Be more concise in event handler timing names"
This reverts commit 9db7e5f0ca.
2023-03-31 21:51:00 +01:00
199ef7401f Revert "Timings: do not shorten event handler timing names"
This reverts commit a2ff9649d5.
2023-03-31 21:49:25 +01:00
d731f5485a Merge branch 'minor-next' into major-next 2023-03-31 21:29:42 +01:00
f63d349be4 Merge remote-tracking branch 'origin/stable' into minor-next 2023-03-31 21:28:14 +01:00
02e11b5a60 Timings tree (#5587)
Split timings into tree reports
this will allow the timings site to display timings as a tree, instead of as a list as is done now, which will enable more precise identification of performance issues.

An example of this can be seen here: https://timings.pmmp.io/?id=302629

The format changes are fully backwards compatible, as the timings site
aggregates timings from timers with the same names, and doesn't limit
how much extra data can appear at the end of a line.
2023-03-31 21:26:58 +01:00
4a770e5801 CS 2023-03-31 20:32:42 +01:00
a2ff9649d5 Timings: do not shorten event handler timing names
this doesn't work very well in tree view timings
2023-03-31 19:44:06 +01:00
a862cf5144 Workaround ItemStackRequest offhand incorrect slot bug
closes #5667

this appears to be a client bug specific to ItemStackRequest.
2023-03-31 17:27:11 +01:00
5ac0d7ae11 TimingsRecord: fixed incorrect violations calculation
closes #5665
2023-03-31 17:08:59 +01:00
0c47455b24 Timings: ensure that Average Players count is shown properly when custom player classes are used 2023-03-30 18:12:06 +01:00
09bff60b04 Merge branch 'minor-next' into major-next 2023-03-29 23:57:19 +01:00
821dd8885b Merge branch 'stable' into minor-next 2023-03-29 23:56:08 +01:00
a78ae73119 4.18.3 is next 2023-03-29 23:52:31 +01:00
17a1266056 Release 4.18.2 2023-03-29 23:52:31 +01:00
217d7ab4cf Merge tag '4.17.2' into stable 2023-03-29 23:50:58 +01:00
9e8c0a6bea Release 4.17.2 2023-03-29 23:47:49 +01:00
dc1b5a9285 it might help if we actually included the fix 2023-03-29 23:46:53 +01:00
c3a16d9b1f ItemStackResponseBuilder: fixed durability appearing to reset when moving durables around the inventory
closes #5656
2023-03-29 23:31:46 +01:00
982d05affd Merge branch 'major-next' of github.com:pmmp/PocketMine-MP into major-next 2023-03-29 23:22:12 +01:00
10f3145af2 Merge branch 'minor-next' into major-next 2023-03-29 23:22:02 +01:00
bed218d1dd Fixed the first letter of event timing names getting trimmed off when src-namespace-prefix is not used 2023-03-29 23:11:30 +01:00
5e1f837a73 ... 2023-03-28 22:46:18 +01:00
b49a9ae81d Added timings for calling events
this gives a somewhat better overview of events, particularly if many plugins are subscribed to the same costly event (e.g. PlayerMoveEvent).

In addition, it allows us to see the frequency that events are occurring.
2023-03-28 17:26:20 +01:00
bea878e9e9 Implement anvil fall damage (#5312) 2023-03-27 20:17:08 +01:00
04197d6b80 Merge remote-tracking branch 'origin/minor-next' into major-next 2023-03-27 19:08:34 +01:00
4c60e82110 Merge remote-tracking branch 'origin/stable' into minor-next 2023-03-27 19:08:18 +01:00
beb0713a40 4.18.2 is next 2023-03-27 18:03:17 +01:00
cd603e8266 Release 4.18.1 2023-03-27 18:03:16 +01:00
af385668c2 InventoryManager: give more detailed information on failure to get info for held item 2023-03-27 17:55:39 +01:00
3ee62d8440 InGamePacketHandler: increase max ItemStackRequest actions to 60
due to implementation quirks + some unforeseen ways these actions can behave, there can be as many as 53 actions in a single crafting request. This is an edge case, but it has to be catered for.
2023-03-27 15:44:42 +01:00
811639f2cd InGamePacketHandler: relax errors on normal transactions to fix book editing
for some reason book edits generate a transaction in addition to BookEditPacket. PM has never used the transaction, and it doesn't pass anyway because CreateItemAction can't be used in survival mode.
However, since the strict validation introduced since ItemStackRequest, this dud transaction now causes the player to get kicked without these changes.
2023-03-27 13:26:26 +01:00
58974765a6 InGamePacketHandler: fixed crash when attempting to drop more of an item than is available 2023-03-27 13:26:26 +01:00
eca9fe50b6 Bump build/php from a464454 to 9d8807b (#5654)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `a464454` to `9d8807b`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](a464454d1e...9d8807be82)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 13:03:30 +01:00
1959d6dc9b Fix CS 2023-03-27 12:59:26 +01:00
9db7e5f0ca Be more concise in event handler timing names 2023-03-27 01:19:17 +01:00
c1cef19f84 stringifyKeys 2023-03-27 01:17:15 +01:00
cebdb95265 Optimise plugin timings report entries
this format is already supported by the timings host, so no changes are required to support this.
2023-03-27 01:15:42 +01:00
006cdaf6ea RakLibInterface: log the name of the session which triggered an unhandled exception
this makes it easier to identify what sequence of events led up to the crash.
2023-03-26 18:56:24 +01:00
32577354fc Merge branch 'minor-next' into major-next 2023-03-25 21:03:50 +00:00
acc8ae87fb 4.18.1 is next 2023-03-25 20:51:38 +00:00
0e8b28716a Release 4.18.0 2023-03-25 20:51:34 +00:00
0220a30780 Merge branch 'minor-next' into major-next 2023-03-25 20:26:59 +00:00
7c77233d12 Merge branch 'stable' into minor-next 2023-03-25 20:26:54 +00:00
6f02b83a26 Update composer dependencies 2023-03-25 20:26:50 +00:00
fbfdf749f2 Merge branch 'stable' into minor-next 2023-03-25 20:25:48 +00:00
0818388bd5 Allow remapped oldState and newState to accept null, to make it easier for third-party tools to use the schemas
since PHP emits empty JSON objects as arrays, this makes it pretty annoying to work with the schemas in other languages. However, nullability is something most languages understand pretty easily.

This should continue to support old schemas.
2023-03-25 19:41:40 +00:00
289c0b08f4 Explicitly state that pocketmine\network\mcpe is an internal package 2023-03-24 14:06:25 +00:00
dd37b531ad CONTRIBUTING.md: document network API policy 2023-03-24 14:02:23 +00:00
341a9b78b5 LegacyStringToItemParser: update documentation 2023-03-24 13:48:33 +00:00
58d5126ada InventoryManager: fixed crashes when setting contents or slots of inventories during InventoryCloseEvent (and other similar logic) 2023-03-24 13:31:30 +00:00
3b11191043 Merge remote-tracking branch 'origin/minor-next' into major-next 2023-03-22 22:49:22 +00:00
f978c1e9a0 Merge remote-tracking branch 'origin/stable' into minor-next 2023-03-22 22:45:41 +00:00
0b8193aeb3 4.17.2 is next 2023-03-22 22:35:25 +00:00
00286e761c Release 4.17.1 2023-03-22 22:35:24 +00:00
db59f71130 attempt to fix ghcr.io docker image push 2023-03-22 22:29:00 +00:00
b11457d605 Fixed uncaught exception when retrieving a packet from the pool 2023-03-22 22:24:25 +00:00
ea386c42d3 InGamePacketHandler: fixed dropping items from unselected hotbar slots 2023-03-21 14:45:18 +00:00
043e81e737 4.18.0-ALPHA3 is next 2023-03-21 00:26:19 +00:00
66a4c4c88b Release 4.18.0-ALPHA2 2023-03-21 00:26:19 +00:00
1a9322c00a ItemStackRequestExecutor: added some missing @throws 2023-03-21 00:23:31 +00:00
c8d9477da1 ItemStackRequestExecutor: make non-final, and make some stuff protected
this allows for plugin extension, for example to implement anvils.
2023-03-21 00:22:21 +00:00
08e8ef275f remove comment 2023-03-21 00:17:24 +00:00
e57fbff28c ItemStackRequestExecutor: added a sanity check for recipe repetitions 2023-03-21 00:16:03 +00:00
f90315c4a2 ItemStackRequestExecutor: harden against invalid item counts
these cases should all be impossible, but that's assuming that the core code doesn't start using them for a different purpose in the future.
2023-03-21 00:13:21 +00:00
955f7944bb ItemStackRequestExecutor: fixed another possible crash condition 2023-03-21 00:06:33 +00:00
ccd288d7fa Avoid repeated calls to getItemInHand() in drop item handler 2023-03-21 00:04:29 +00:00
097632902a InGamePacketHandler: fixed crash condition in drop item handler 2023-03-21 00:02:32 +00:00
a4d34be6df Merge branch 'minor-next' into major-next 2023-03-20 23:42:40 +00:00
e7771d76f2 Cover buffered inventory sync in timings 2023-03-20 23:29:02 +00:00
ecc830a689 InventoryManager: avoid calling TypeConverter::getInstance() in a loop 2023-03-20 23:24:52 +00:00
ee72e80fbb ItemStackResponseBuilder: removed incorrect code
the client expects that all itemstacks must be acked by ItemStackResponse, regardless of whether the server changed them to some other item.
We'll overwrite the item to the correct thing at the end of the tick anyway.
2023-03-20 23:21:24 +00:00
63310cf764 Do not cache ItemStacks for every item
this is very memory inefficient, and only provides a performance advantage in cold code anyway.
2023-03-20 23:18:43 +00:00
1992d3b6db InventoryManager: avoid useless work in trackItemStack()
this attempts to accommodate slots being set to themselves, which is a rare enough occurrence (only plugins will cause it) that it doesn't make sense to penalize every inventory update this way.
attempting to avoid changing the itemstackID in this way is detrimental to performance, and it doesn't actually matter if we set a new itemstackID anyway.
2023-03-20 23:08:17 +00:00
035a0a4e9d InventoryManager: specialize trackItemStack() to avoid useless lookups 2023-03-20 22:57:58 +00:00
23ea721164 Reduce packets-per-batch limit to 100
this should be well in excess of requirements with the ItemStackRequest system in use.
2023-03-20 22:15:02 +00:00
7cdab75b05 Merge branch 'minor-next' into major-next 2023-03-20 22:12:54 +00:00
2bf7941aec Merge branch 'item-stack-request-pm5' into major-next 2023-03-20 22:07:09 +00:00
8408da8534 Merge branch 'item-stack-request' into minor-next 2023-03-20 22:05:50 +00:00
453ad997e9 Merge branch 'item-stack-request' into item-stack-request-pm5 2023-03-20 22:05:12 +00:00
c9601ae67d Fixed crash when opening crafting table and other 'UI' inventories 2023-03-20 22:00:38 +00:00
758b5ee500 InventoryManager: fixed armor slots hack
the correct condition for this should be an unsynced armor slot changed during a transaction, but conveying this information to syncSlot() is a bit of a hassle, so this will do for now.
2023-03-20 21:27:56 +00:00
ca6d51498f Buffer slot and content syncing until the end of the tick
we may receive multiple requests in one tick (e.g. crafting in a batch)
2023-03-20 19:16:00 +00:00
e8085e22a0 Fixed crash when opening main inventory
the InventoryManagerEntry was getting overwritten, since we don't expect to open the same inventory with two different window IDs.
2023-03-20 18:40:18 +00:00
a83fc85f1e InventoryManagerEntry: fixed missing default 2023-03-20 17:32:44 +00:00
3d70a169e1 Reduce chaos in InventoryManager
the information in these arrays is usually needed all at the same time, so it doesn't make sense to force multiple array lookups for it.

in addition, this (obviously) cleans up the code quite a lot.
2023-03-20 17:31:54 +00:00
6ccb8f7373 git 2023-03-20 16:57:38 +00:00
59bae9b077 Give InventoryManager internals clearer names
and stop mixing 'window' and 'inventory' terminology...
2023-03-20 16:53:57 +00:00
2751e1ec02 replacing new Vector3(0, 0, 0) with Vector3::zero() (#5640) 2023-03-20 12:54:28 +00:00
c91168db66 ... 2023-03-20 01:35:15 +00:00
4e55433ed8 Fixed request rejecting 2023-03-20 01:35:03 +00:00
eece6c4433 InGamePacketHandler: remove dead code 2023-03-20 01:28:18 +00:00
67b7b60d18 .............. 2023-03-20 01:19:07 +00:00
804feedb67 Added some dumb limits 2023-03-20 00:54:33 +00:00
d57aca1367 CS 2023-03-20 00:53:00 +00:00
7b0816e42f Properly handle transaction building errors instead of kicking the player 2023-03-20 00:52:26 +00:00
4864444440 Added CraftingManager::getCraftingRecipeFromIndex() 2023-03-19 22:14:23 +00:00
52ea4feac0 Updated pocketmine/locale-data 2023-03-19 16:53:02 +00:00
01d557062a Remove dead baseline 2023-03-19 16:41:01 +00:00
a619fd2be6 Scrub PHPStan baselines 2023-03-19 16:37:38 +00:00
05d9298958 PHPStan 1.10.7 2023-03-19 16:33:59 +00:00
f696a5881b Merge remote-tracking branch 'origin/stable' into minor-next 2023-03-19 16:23:09 +00:00
419962d3a2 Added timer for player-specific movement code
players use an entirely different pathway for movement processing, which could be costly.
2023-03-19 16:12:47 +00:00
054c06fab9 Add specialized entityBaseTick timer for item entities
since item merging is a potential hotspot, we want to know if this code section is a performance problem.
Current timers only tell us whether overall ticking of a particular entity is slow, but that includes movement and therefore isn't particularly helpful.
2023-03-19 15:59:06 +00:00
7bc5d8c824 Rename more timers 2023-03-19 15:57:36 +00:00
607bdfa42f Timings: added new timers for entity move collision checks and projectile move ray tracing
projectiles get their own distinct sub-timer, since the logic is completely different from regular entities.
2023-03-19 15:49:35 +00:00
eec53f9ae0 Timings: clean up timer names 2023-03-19 15:39:44 +00:00
3d56bd267c Timings: fixup network timer inheritance 2023-03-18 23:13:25 +00:00
9a969e21c7 ÂNetworkSession: ensure onResolve handler for CompressBatchPromise is covered by network send timings 2023-03-18 22:49:52 +00:00
195bc3b623 NetworkSession: prevent dev client asserts from missing ability flags 2023-03-18 21:53:17 +00:00
2177d8d352 Push Docker image tags to ghcr.io 2023-03-17 16:32:28 +00:00
471625e697 readme: remove docker hub shield
sadly there isn't any ghcr replacement right now.

[ci skip]
2023-03-17 16:24:13 +00:00
2135776c19 readme: goodbye docker hub, won't miss you
[ci skip]
2023-03-17 16:21:57 +00:00
765aef0810 4.18.0-ALPHA2 is next 2023-03-16 21:45:21 +00:00
bd21feffc4 Release 4.18.0-ALPHA1 2023-03-16 21:45:18 +00:00
cf0e7b4213 Merge branch 'minor-next' into major-next 2023-03-16 15:04:27 +00:00
5b324f695c Merge branch 'stable' into minor-next 2023-03-16 15:04:19 +00:00
9caed10488 update-updater-api: use github.repository_owner to make fork testing of this workflow less obnoxious 2023-03-16 15:03:14 +00:00
83945ff0a0 Do not update release channels if the new build has a lower version ID
this prevents stuff like 5.0.0 beta versions getting overwritten by 4.x beta versions.
2023-03-16 15:02:42 +00:00
ef45180b80 Rename DataPacketPreReceiveEvent -> DataPacketDecodeEvent
thank you @IvanCraft623 for the suggestion
2023-03-16 13:40:37 +00:00
ec2b53f61a Remove unnecessary PacketBatch instantiations 2023-03-16 13:35:12 +00:00
11ef6414b0 Server: remove deprecated method 2023-03-16 13:32:46 +00:00
abd4ef01eb Merge branch 'minor-next' into major-next 2023-03-15 23:02:41 +00:00
941fd03998 Remove useless code 2023-03-15 22:58:10 +00:00
1af8da3c1f Merge branch 'minor-next' of github.com:pmmp/PocketMine-MP into minor-next 2023-03-15 22:54:05 +00:00
a5985dcf7d Merge branch 'stable' into minor-next 2023-03-15 22:53:44 +00:00
183d1f4038 Implement DataPacketPreReceiveEvent (#5559)
closes #5554

This is called just before the packet is decoded, allowing the event to be used to drop packets from clients without wasting CPU time decoding them. This can be particularly useful for mitigating denial-of-service attacks.
2023-03-15 22:47:19 +00:00
08ee825d91 StandardPacketBroadcaster: Include varint length prefix in length calculation
varints encode 7 bits per byte, so a log with base 128 will tell us how many bytes are required to encode the length of the packet.
2023-03-15 22:41:19 +00:00
337a254768 Use NetworkBroadcastUtils for broadcasting packets
this eradicates all but 4 usages of Server in Entity, which is extremely cool.
2023-03-15 22:28:51 +00:00
a31e3331fd Move Server::broadcastPackets() to NetworkBroadcastUtils::broadcastPackets()
this has no business being in Server, and it also doesn't need to be an instance method, since it never uses $this.
2023-03-15 22:25:23 +00:00
acebbeed16 Added version channels for update.pmmp.io 2023-03-15 20:59:36 +00:00
e0fdbe6eb1 make-release: don't automatically push
this is rather obnoxious when attempting to push test releases to a
fork.
2023-03-15 20:47:01 +00:00
cc8660629b First look at shared EntityEventBroadcaster,
this improves performance in PvP servers and other areas where lots of players or entities exist in one space.

fixes #5622
2023-03-15 18:22:56 +00:00
e7e19abe85 IPv4 and IPv6 RakLibInterface instances now both use the same broadcaster and context
fixes #5625
2023-03-15 17:17:56 +00:00
72853677bb Fixed mushroom blocks for PM5
closes #5284
2023-03-15 16:54:13 +00:00
5f9e0081fd Fixed mushroom block silk-touch drops and block picking behaviour
fixes #5284
2023-03-15 16:36:35 +00:00
b266f45152 Bump build/php from 71b9f9d to a464454 (#5637)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `71b9f9d` to `a464454`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](71b9f9d2d7...a464454d1e)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-15 13:44:20 +00:00
4ba4d556ed Tidy up world version related things
I decided to scrap the max schema ID stuff, since it just adds extra places to forget updating. Instead, it's better to use minor version locks and version metadata, as we do for BedrockData and BedrockProtocol.
2023-03-14 23:27:16 +00:00
6c29c3d2dd Merge branch 'item-stack-request' into item-stack-request-pm5 2023-03-14 22:56:47 +00:00
34ced382db Eliminate final remaining usage of TypeConverter::netItemStackToCore()
instead, we can verify that the held items match by comparing the received ItemStack with the one cached in InventoryManager, which is more cost effective and closes off internal item deserializers to external attacks.
2023-03-14 22:56:11 +00:00
dace20ad1f Merge branch 'item-stack-request' into item-stack-request-pm5 2023-03-14 22:34:47 +00:00
a573a279fa Merge branch 'minor-next' into item-stack-request 2023-03-14 22:25:49 +00:00
14f141fab2 NetworkSession: Stop counting DataPacketReceiveEvent in handler timings
we want it to be included in receive timings, but not handler timings. Handler timings should reflect the time spent in the actual session PacketHandler, not in the event.
2023-03-14 19:00:15 +00:00
10d22a55ec Updated composer dependencies (PM5) 2023-03-14 18:50:34 +00:00
777b4d6ac3 PM5-specific updates for 1.19.70 2023-03-14 18:50:04 +00:00
c500ccd891 Merge branch 'minor-next' into major-next 2023-03-14 18:43:43 +00:00
daff955bc4 Merge remote-tracking branch 'origin/stable' into minor-next 2023-03-14 18:42:14 +00:00
85a64d56fb Updated composer dependencies (major-next) 2023-03-14 18:42:01 +00:00
cc69383b6f Merge branch 'minor-next' into major-next 2023-03-14 18:40:57 +00:00
0022d82779 Merge commit 'd376399b7f332384532a82eaf69b9b02dad5bd0c' into minor-next 2023-03-14 18:39:03 +00:00
7cad9be0d2 Bump build/php from b2207cf to 71b9f9d (#5634)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `b2207cf` to `71b9f9d`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](b2207cf70d...71b9f9d2d7)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-14 18:32:10 +00:00
2f862a552a actions: Replace deprecated ::set-output commands 2023-03-14 18:31:25 +00:00
590f6dad08 4.17.1 is next 2023-03-14 18:14:40 +00:00
9564c81582 Release 4.17.0 2023-03-14 18:14:40 +00:00
3de7a8c27f Updated for 1.19.70 2023-03-14 18:08:10 +00:00
d376399b7f Update composer dependencies
bedrock-item-upgrade-schema and bedrock-block-upgrade-schema are now minor-version-locked, to prevent introducing new upgrade schemas not intended for the currently in-use version
previously I'd intended to do this using max schema IDs, but this has proven to be error-prone, so it makes more sense to lock them in using package version constraints instead.
2023-03-14 17:29:25 +00:00
e2071e59c8 actions: update PHP versions 2023-03-13 17:44:10 +00:00
a123194368 BlockStateData: added getVersionAsString() 2023-03-13 16:14:19 +00:00
8e280ebb8b RuntimeBlockMapping: avoid unnecessary PacketSerializer usage 2023-03-11 22:16:24 +00:00
f03afba10e Merge branch 'minor-next' into major-next 2023-03-11 22:13:31 +00:00
fa7c38276c Fixing gigantic clusterfuck with protocol contexts and broadcasting
fixes #5623
2023-03-11 21:54:14 +00:00
b13e97de3d Timings: fixed receivePacket timer showing 2x the actual number of received packets 2023-03-11 19:13:10 +00:00
328b87fc18 Bump phpstan/phpstan from 1.10.4 to 1.10.6 (#5617)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.4 to 1.10.6.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.4...1.10.6)

---
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>
2023-03-10 11:49:34 +00:00
f94040dead Merge branch 'minor-next' into major-next 2023-03-08 23:33:35 +00:00
7c95a65ade ... 2023-03-08 23:14:11 +00:00
2b88b215bf CS cleanup 2023-03-08 23:10:11 +00:00
54c19fd662 Open-source script that generates recipes and other goodies for BedrockData
this script has been lurking in my workspace for years, waiting to be cleaned up and open-sourced.
2023-03-08 23:04:09 +00:00
9b1ec261c4 ... 2023-03-08 22:20:12 +00:00
6151576baa Added model for smithing recipe 2023-03-08 21:50:03 +00:00
acaa1a9ce1 contributing: update table to reflect branch name changes
these branches were renamed to make them more auto-complete-friendly.
2023-03-07 17:28:31 +00:00
fff8f0f815 Use Item->canStackWith() instead of Item->equals() wherever possible 2023-03-07 17:08:35 +00:00
867b8945e4 5.0.0-BETA2 is next 2023-03-07 16:51:57 +00:00
9e329d55a8 Release 5.0.0-BETA1 2023-03-07 16:51:53 +00:00
be68c6a819 Merge branch 'next-minor' into next-major 2023-03-07 16:30:06 +00:00
3aec0fa3df 4.16.1 is next 2023-03-07 16:19:51 +00:00
fa131dab12 Release 4.16.0 2023-03-07 16:19:50 +00:00
bb4a82b1e7 Merge branch 'next-minor' into stable 2023-03-07 16:15:57 +00:00
93d844a281 build/make-release: improve support for non-stable release channels 2023-03-07 16:12:27 +00:00
616844696e 4.15.4 is next 2023-03-07 15:33:03 +00:00
71e3e36522 Release 4.15.3 2023-03-07 15:33:03 +00:00
dedd1d7fb3 Merge branch 'next-minor' into next-major 2023-03-07 15:25:44 +00:00
9d442f2104 Update composer dependencies 2023-03-07 15:25:22 +00:00
a1b42d419f Merge branch 'stable' into next-minor 2023-03-07 15:24:24 +00:00
ef942a627f actions: drop concurrency group
this is causing builds to get randomly cancelled when multiple branches are pushed at once.
2023-03-07 15:23:12 +00:00
fd8c276bd2 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-03-07 15:15:21 +00:00
a49957682e Update RakLib 2023-03-07 15:15:05 +00:00
b399b2086c Merge branch 'next-minor' into next-major 2023-03-07 15:14:13 +00:00
9783380d1a Merge branch 'stable' into next-minor 2023-03-07 15:13:39 +00:00
a784d93bfd Update composer dependencies 2023-03-07 15:13:16 +00:00
a05e8b366f Bump phpstan/phpstan from 1.10.3 to 1.10.4 (#5610)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.3 to 1.10.4.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.3...1.10.4)

---
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>
2023-03-07 14:40:08 +00:00
8933064cd5 Fixed missing blockstate upgrader 2023-03-06 17:02:33 +00:00
87a2e0460c Ping Discord news subscribers on new releases 2023-03-04 17:09:32 +00:00
6db2b022fb Merge branch 'next-minor' into next-major 2023-03-04 16:58:03 +00:00
4073c3fb39 Update composer dependencies 2023-03-04 16:56:08 +00:00
e227e6d8bf Merge branch 'stable' into next-minor 2023-03-04 16:55:56 +00:00
3aa40829ae Update composer dependencies 2023-03-04 16:55:31 +00:00
035d4b7263 MemoryManager: stringify floats, fixes #5598 2023-03-04 16:47:58 +00:00
3db1492c18 Fix CS again 2023-03-04 16:43:29 +00:00
a523189149 Added separate timings for broadcast and session buffer compression 2023-03-04 16:41:41 +00:00
f8893efb94 Don't bother with global batch compression if there is only 1 recipient
this allows the session to achieve better ratios, and also reduces worker pool spam.
2023-03-04 16:34:00 +00:00
70f1ee3e97 draft-release: set prerelease flag properly 2023-03-04 16:29:26 +00:00
eb2f0ed3d0 4.16.0-BETA3 is next 2023-03-04 16:19:34 +00:00
14e7d3e143 Release 4.16.0-BETA2 2023-03-04 16:19:34 +00:00
6d636fc2c7 4.16.0-BETA2 is next 2023-03-04 16:18:04 +00:00
a39f61a33d Release 4.16.0-BETA1 2023-03-04 16:18:01 +00:00
a42a67fc50 Update consistency check 2023-03-04 15:53:56 +00:00
5eeb63f64b always the CS ... 2023-03-04 15:52:57 +00:00
b9d62de29d Pack wall connections into 7 bits for runtime data encoding 2023-03-04 15:47:34 +00:00
aaec21f544 Compressor: Use minCompressionThreshold exclusively
closes #5589
2023-03-04 15:07:50 +00:00
0edc5f8113 Bump phpunit/phpunit from 9.6.3 to 9.6.4 (#5597)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.6.3 to 9.6.4.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/main/ChangeLog-9.6.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.6.3...9.6.4)

---
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>
2023-03-03 14:06:18 +00:00
a382f0fd92 Bump phpstan/phpstan-phpunit from 1.3.8 to 1.3.10 (#5602)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.3.8 to 1.3.10.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.3.8...1.3.10)

---
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>
2023-03-03 14:05:59 +00:00
95c18ef99a Block: change confusing naming of decode/computeStateData
these actually accept a combination of type and state data, so it's a bit inconsistent with other references to 'state data'.
2023-03-02 17:42:44 +00:00
972f107972 Block: added documentation for describeType() and describeState() 2023-03-02 17:31:52 +00:00
e15e53859f tidy 2023-03-02 17:25:48 +00:00
4692552fdc Block: improve documentation of type ID and state ID 2023-03-02 16:32:33 +00:00
cbb58d3e0d Block: reduce method placement chaos 2023-03-02 16:23:40 +00:00
7c974a12e1 Revert "ItemBlock: drop the charade about overriding built-in block types"
This reverts commit f64dc01bd1.

I forgot that the ItemBlock constructor implicitly strips off any states
of the origin block, which is something that we unfortunately can't do
any other way right now, since the blocks don't remember their default
states.
2023-03-02 15:51:55 +00:00
f64dc01bd1 ItemBlock: drop the charade about overriding built-in block types
this allows cleaning up a whole lot of abusable mess from the API, and we never properly supported overriding built-in block types anyway.
2023-03-02 15:50:18 +00:00
33140482bb ItemTypeIds: added fromBlockTypeId() and toBlockTypeId()
this allows checking the type of a blockitem without being required to create a block to do it.
2023-03-02 15:28:50 +00:00
77fe0a69ba ItemIdentifier: remove dead TODO comment 2023-03-02 15:10:46 +00:00
948aa059c3 ÂCommand: fixed inconsistent API method name 2023-03-02 15:09:52 +00:00
407b78de3b Merge branch 'next-minor' into next-major 2023-02-28 19:25:05 +00:00
0fcd2e7894 Merge branch 'stable' into next-minor 2023-02-28 19:23:25 +00:00
369e0855a7 Update composer dependencies 2023-02-28 19:17:46 +00:00
a6cf39b94e Update composer dependencies 2023-02-25 20:39:01 +00:00
17afd38274 Bump phpstan/phpstan from 1.10.1 to 1.10.3 (#5593)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.1 to 1.10.3.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.1...1.10.3)

---
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>
2023-02-25 20:36:33 +00:00
8f024cb382 Bump docker/build-push-action from 3.3.0 to 4.0.0 (#5545)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.3.0 to 4.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.3.0...v4.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-25 20:04:34 +00:00
e7209679fb ... 2023-02-24 22:23:00 +00:00
da054736b1 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-02-24 22:19:38 +00:00
d92173cded 4.15.3 is next 2023-02-24 22:18:34 +00:00
308cdb6863 Release 4.15.2 2023-02-24 22:18:34 +00:00
ae50b952f1 Accept 1.19.63 (same protocol, different protocol version) 2023-02-24 22:15:58 +00:00
7608d5f04e Use BedrockDataFiles in more places 2023-02-23 22:03:35 +00:00
9ae830fd54 Merge branch 'next-minor' into next-major 2023-02-23 22:00:29 +00:00
f44946cb49 ... 2023-02-23 22:00:24 +00:00
c82b43a586 Merge branch 'next-minor' into next-major 2023-02-23 22:00:14 +00:00
f704bfb63a Use BedrockData 2.0.0 2023-02-23 21:52:17 +00:00
9acb4d64db Added generated constants for available BedrockData files
this makes it easier to detect unused files, detect removed files, and also avoid typos in usages.
2023-02-23 21:45:12 +00:00
5854b1c8c2 Merge branch 'next-minor' into next-major 2023-02-22 22:51:51 +00:00
8234360c8d Avoid creating batch buffers just to determine whether a batch should be globally compressed
Instead, sum together the lengths of encoded packet buffers and use that to decide whether to build the buffer or not.
2023-02-22 22:43:10 +00:00
6a64486f55 StandardPacketBroadcaster: Improve performance when broadcasting small packets
In refactors during PM4, I stripped out packet buffer caching, as it was problematic when events alter packets in undetectable ways.
However, I never cleaned this part of the code up properly after enabling DataPacketSendEvent to include multiple packets and multiple targets, so we were still individually encoding the packet(s) for every single session if the sum total of the sizes was below 256 bytes.

This change encodes packets once in the StandardPacketBroadcaster and retains their buffers to post to the session's send buffer directly if the resulting batch is below compression threshold.
This code is still not optimal (see ##5589), but fixing this brings broadcasting performance back to PM3 levels, without any of PM3's problems.
2023-02-22 21:52:12 +00:00
6ec778d0af Bump phpstan/phpstan from 1.9.18 to 1.10.1 (#5588)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.18 to 1.10.1.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.9.18...1.10.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-22 13:47:54 +00:00
737a63b0a3 Merge branch 'next-minor' into next-major 2023-02-21 18:33:03 +00:00
75bb4f8da6 Merge branch 'stable' into next-minor 2023-02-21 18:32:58 +00:00
efdd7a186d World: fixed population timer sometimes not being stopped 2023-02-21 18:31:33 +00:00
627c62a230 5.0.0-ALPHA10 is next 2023-02-21 16:44:31 +00:00
9a67fbf27a Release 5.0.0-ALPHA9 2023-02-21 16:44:27 +00:00
94ffef1a99 ItemIdMetaUpgrader: consistency of API method naming 2023-02-21 16:14:31 +00:00
2feb9ca903 ItemIdMetaUpgrader: consistency of API method naming 2023-02-21 16:12:44 +00:00
50b8d39aba Merge branch 'next-minor' into next-major 2023-02-21 15:41:57 +00:00
c4ecb3d128 Merge branch 'stable' into next-minor 2023-02-21 15:37:06 +00:00
b574d49d36 4.15.2 is next 2023-02-21 15:23:25 +00:00
47e9ecd257 Release 4.15.1 2023-02-21 15:23:25 +00:00
799739fe86 Updated build/php submodule to pmmp/PHP-Binaries@b2207cf70d 2023-02-21 15:22:38 +00:00
59a04c971f Getter and setter for gravity (#5584)
closes #5525
2023-02-21 15:01:22 +00:00
168af31fd7 Bump phpstan/phpstan from 1.9.17 to 1.9.18 (#5585)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.17 to 1.9.18.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.9.17...1.9.18)

---
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>
2023-02-20 18:39:29 +00:00
871bd169a8 Timings: remove unnecessary code 2023-02-19 17:58:12 +00:00
4dbcd714bd NetworkSession: fixed some segments of recv/send logic not being covered by their respective network timings 2023-02-19 17:21:10 +00:00
d5e92b4ae6 ... 2023-02-19 16:53:04 +00:00
2a3288c4f9 Avoid useless throwaway PacketBatch objects 2023-02-19 16:50:03 +00:00
9cdb641936 Added encode packet timings
these changes required some new APIs in BedrockProtocol.
2023-02-19 16:47:20 +00:00
42df1a5c70 Fixed merge error 2023-02-17 20:19:32 +00:00
b56b35b10d ItemEntity: fixed a bunch of suspicious logic in entityBaseTick()
closes #5580
2023-02-17 20:14:38 +00:00
0e0f5e85eb Merge branch 'next-minor' into next-major 2023-02-17 20:00:51 +00:00
324bc27b5a Merge branch 'stable' into next-minor 2023-02-17 19:59:28 +00:00
71aad310c6 stfu 2023-02-17 16:39:46 +00:00
38828e2b42 4.15.1 is next 2023-02-17 16:37:34 +00:00
9a6d7b505c Release 4.15.0 2023-02-17 16:37:34 +00:00
1e3b025916 1.19.62 2023-02-17 16:36:32 +00:00
55a48e0c84 Block: specifying required type/state data bits is no longer required
RuntimeDataSizeCalculator allows calculating the number of required bits from describeType directly, which considerably reduces boilerplate code.
2023-02-16 16:45:19 +00:00
c2f6d8139a Added interface RuntimeDataDescriber 2023-02-16 16:23:32 +00:00
ceff230d73 Simplify generation of enum serializers code 2023-02-16 15:57:54 +00:00
e6f1cb69d1 RuntimeBlockStateRegistry: throw a hard error on blockstates that return different state data than they were given
this suggests improper validation of state data.
2023-02-16 15:44:58 +00:00
4c3892b2d6 RuntimeBlockStateRegistry: separate permutation expansion from register() 2023-02-16 15:41:43 +00:00
396d64c60b 4.14.2 is next 2023-02-15 15:19:39 +00:00
d7a0f5362e Release 4.14.1 2023-02-15 15:19:38 +00:00
75f74454c6 Implemented reinforced deepslate (#5553) 2023-02-15 15:15:04 +00:00
7611155ff9 CS 2023-02-15 15:13:12 +00:00
c0f3dbdd70 Regenerate constants for block and item data handling 2023-02-15 15:12:53 +00:00
c5dcd268ad CS 2023-02-15 15:04:41 +00:00
910c4c4b24 Updated BedrockProtocol 2023-02-15 15:02:00 +00:00
2fd6e769e6 NetworkSession: Improved packet budgeting
this fixes players getting kicked during server lag spikes.

closes #5532
2023-02-15 14:59:05 +00:00
aacd92bf08 Command: fix setPermissions docblock 2023-02-13 14:46:37 +00:00
caebe14dab Use an array for command permissions
it doesn't make sense to have to parse the string every time we want to verify permissions, nor to expect that people will somehow know to use ; to separate them without it being documented anywhere...
2023-02-13 14:44:55 +00:00
cb10360c20 SimpleCommandMap: require commands to have a permission
fixes #5305
2023-02-13 14:24:30 +00:00
082f9e1647 Deny permission to use a command if no permission is set
Having no permission is almost always a bug. We already have behaviour elsewhere in the core that assumes undefined permission = permission denied.

This behaviour might confuse some people, but I think it's much less dangerous than accidentally allowing everyone to use your command.
2023-02-13 14:22:36 +00:00
d891646d0a Fix CS 2023-02-13 14:10:42 +00:00
886b40a455 ÂLocalize disconnect reasons for RakLib disconnects 2023-02-13 14:10:25 +00:00
525f62e1e4 ÂRakLib 0.15 2023-02-13 14:00:16 +00:00
69155015c9 Double quote array expansions to avoid re-splitting elements. (#5570)
See: https://github.com/koalaman/shellcheck/wiki/SC2068
2023-02-13 12:24:47 +00:00
6854830b6e start.sh: Use -n instead of ! -z (#5567)
See https://github.com/koalaman/shellcheck/wiki/SC2236
2023-02-13 12:21:35 +00:00
2d56aa50b9 A bunch of mostly inseparable changes to PlayerPreLoginEvent
including support for separated disconnect reasons and disconnect screen messages (closes #4512)

While the refactoring of kick reason -> kick flag wasn't exactly in my agenda, I realized that these changes would become pretty confusing and inconsistent with other events if they weren't refactored.
Hopefully I don't have to break this API again for a while...
2023-02-13 11:32:32 +00:00
5d0388e747 PlayerPreLoginEvent no longer implements Cancellable
please see #5516 for motivation on this, but I don't think anyone will be complaining - this behaviour made no sense and caused a lot of confusion for people who were trying to set custom ban messages.
2023-02-13 11:10:29 +00:00
074e7586cb Merge branch 'next-minor' into next-major 2023-02-11 17:17:08 +00:00
2c413768a5 Merge branch 'stable' into next-minor 2023-02-11 17:15:12 +00:00
fbaf8e3fc8 Update composer dependencies 2023-02-11 17:13:12 +00:00
c62845e92a 4.14.1 is next 2023-02-08 20:21:43 +00:00
c7930ce9ec Release 4.14.0 2023-02-08 20:21:42 +00:00
475888b031 InGamePacketHandler: do not process repeated skin change requests for the same full skin ID
this fixes a feedback loop with persona skins in 1.19.60.
2023-02-08 20:16:41 +00:00
40b90bb722 InGamePacketHandler: log a debug when processing skin change requests 2023-02-08 19:47:12 +00:00
5a4550a4fc CS 2023-02-08 18:55:49 +00:00
7bbc04e6de Silence PlayerSkinPacket debug messages during spawn response stage
the client sends its skin here in 1.19.60 for some reason, which makes no sense - I can only assume it's a bug
2023-02-08 18:55:38 +00:00
3ba662f64f 1.19.60 2023-02-08 18:46:37 +00:00
5d7b99daf4 Bump phpstan/phpstan from 1.9.15 to 1.9.16 (#5560)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.15 to 1.9.16.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.9.15...1.9.16)

---
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>
2023-02-08 10:55:09 +00:00
e47627f565 Bump build/php from f51e954 to fb297eb (#5558)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `f51e954` to `fb297eb`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](f51e954743...fb297eb511)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-08 10:09:15 +00:00
39207c7992 Bump phpstan/phpstan from 1.9.14 to 1.9.15 (#5557)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.14 to 1.9.15.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.9.14...1.9.15)

---
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>
2023-02-07 12:39:49 +00:00
2f12bb9943 Merge branch 'next-minor' into next-major 2023-02-06 12:34:57 +00:00
41ab698f93 wrong filename 2023-02-06 12:29:54 +00:00
e45a6d8311 Merge branch 'stable' into next-minor 2023-02-06 12:27:09 +00:00
8912a97be7 Update Composer dependencies 2023-02-06 12:11:42 +00:00
8d2a9ce67c Clean PHPStan baselines 2023-02-06 12:09:19 +00:00
811352e2ef Bump build/php from c658506 to f51e954 (#5555)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `c658506` to `f51e954`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](c6585061ca...f51e954743)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-06 11:50:10 +00:00
981385cf4a GeneratorManager: Removed redundant Closure wrapping (#5551) 2023-02-04 14:04:31 +00:00
433b0ca6cc Fix PHPStan 2023-02-02 16:23:21 +00:00
da5302ca86 BlockStateData: introduce and use current() 2023-02-02 16:21:50 +00:00
6b7a4e2c41 Split up ItemDataUpgrader (preparing for code backport) 2023-02-02 16:08:49 +00:00
e9b994cbc3 Allow limiting max schema ID loaded for item ID upgrading 2023-02-02 15:29:45 +00:00
cfa1e7486a Move legacy recipes and creative items in-house
having them here allows BedrockData to represent latest versions freely, without being limited by technical limitations of PM4.
2023-02-02 15:25:03 +00:00
3c46bf01c6 Begin removing dependence on obsolete files from BedrockData
these files were only kept for backwards compatibility, and aren't actively maintained. They are only needed for legacy conversions in the modern day era.
2023-02-02 14:47:38 +00:00
0e15a8698a BlockStateUpgrader: do not use blockstate version to manage internal schemas
these are no longer reliable.
2023-02-01 22:35:59 +00:00
d3fff4e0b2 Updated to newer BedrockBlockUpgradeSchema 2023-02-01 21:21:55 +00:00
aeb26141b2 Merge branch 'next-minor' into next-major 2023-01-30 22:19:24 +00:00
4562cfb85b 4.13.1 is next 2023-01-30 21:55:26 +00:00
cb1aac3cd4 Release 4.13.0 2023-01-30 21:55:26 +00:00
3dd1a14fb7 Merge branch 'next-minor' into stable 2023-01-30 21:52:41 +00:00
63c3127248 Scrub PHPStan baselines 2023-01-30 21:52:31 +00:00
2f283678c7 Merge branch 'next-minor' into next-major 2023-01-30 13:26:29 +00:00
96c32d24ba Update composer dependencies 2023-01-30 13:23:40 +00:00
d64a9d8b52 Merge branch 'stable' into next-minor 2023-01-30 12:58:50 +00:00
92c29b8172 Update transitive composer dependencies 2023-01-30 12:53:06 +00:00
0ac9584bbb Bump shivammathur/setup-php from 2.23.0 to 2.24.0 (#5543)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.23.0 to 2.24.0.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.23.0...2.24.0)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-30 12:49:42 +00:00
fe12e8d944 Bump build/php from 1c44c61 to c658506 (#5542)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `1c44c61` to `c658506`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](1c44c615c3...c6585061ca)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-30 12:39:14 +00:00
7529953f0a Bump phpstan/phpstan from 1.9.13 to 1.9.14 (#5523)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.13 to 1.9.14.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.9.13...1.9.14)

---
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>
2023-01-27 23:08:36 +00:00
00dbb6855a Bump build/php from 83bec42 to 1c44c61 (#5539)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `83bec42` to `1c44c61`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](83bec42c3c...1c44c615c3)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-27 23:08:08 +00:00
5226300b99 Ring bell when hit by a projectile (#5505) 2023-01-27 23:07:41 +00:00
0f81b7be15 Fixed deepslate drops (#5535)
Co-authored-by: Dylan T <dktapps@pmmp.io>
2023-01-26 15:08:15 +00:00
2b987b450b always the CS... 2023-01-26 14:58:32 +00:00
7eca3e8081 Fix typo
closes #5533
2023-01-26 14:52:50 +00:00
0975da57d6 Removed obsolete pthreads-related ignoreErrors 2023-01-26 14:51:18 +00:00
f56339c306 Fix build 2023-01-26 14:48:43 +00:00
b58d7fc82a Bump build/php from af250d7 to 83bec42 (#5534)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `af250d7` to `83bec42`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](af250d7e06...83bec42c3c)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-26 13:00:07 +00:00
2cd8e4d270 ... 2023-01-25 19:02:42 +00:00
0a3ecfdae9 Clean up terminology around block state IDs and their handling 2023-01-25 19:01:15 +00:00
2f469ef4a0 Added mangrove, azalea and flowering azalea leaves 2023-01-25 18:50:14 +00:00
ceea8220a9 Bump symfony/filesystem from 5.4.13 to 5.4.19 (#5530)
Bumps [symfony/filesystem](https://github.com/symfony/filesystem) from 5.4.13 to 5.4.19.
- [Release notes](https://github.com/symfony/filesystem/releases)
- [Changelog](https://github.com/symfony/filesystem/blob/6.2/CHANGELOG.md)
- [Commits](https://github.com/symfony/filesystem/compare/v5.4.13...v5.4.19)

---
updated-dependencies:
- dependency-name: symfony/filesystem
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-25 13:23:48 +00:00
cbaff1caec BlockPlaceEvent: use BlockTransaction, closes #1760
BlockPlaceEvent no longer extends BlockEvent, since it's now a multi-block event
getBlockReplaced() is removed
getTransaction() is added

to be honest, BlockPlaceEvent should be something like PlayerBlockPlaceEvent...
2023-01-24 15:49:42 +00:00
18013e9551 Bump build/php from b479ec4 to af250d7 (#5527)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `b479ec4` to `af250d7`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](b479ec438f...af250d7e06)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 13:51:50 +00:00
92896c78da 5.0.0-ALPHA9 is next 2023-01-23 20:38:35 +00:00
5aa8b953a8 Release 5.0.0-ALPHA8 2023-01-23 20:38:35 +00:00
375ec8e00c Fix CS 2023-01-23 20:36:02 +00:00
002f7d6826 PlayerDuplicateLoginEvent: remove dead code 2023-01-23 20:21:06 +00:00
bd3e9e1cad Do not allow more than 1 run to compile PHP at a time
this causes cache collisions and build failures
2023-01-23 20:13:29 +00:00
06ad1a2d2b Updated dependencies to release versions 2023-01-23 20:04:01 +00:00
222415859a Require pthreads ^5.1
This version of pthreads has a substantially improved API, improved
performance, improved memory usage, and much less magical and broken
behaviour.
2023-01-23 20:02:33 +00:00
6173471cca Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-01-23 19:40:14 +00:00
14b250c63f Merge branch 'next-minor' into next-major 2023-01-23 19:37:18 +00:00
644881372d Merge branch 'stable' into next-minor 2023-01-23 19:37:02 +00:00
a12aac71fd Updated setup-php-action 2023-01-23 19:36:52 +00:00
608fcd6cd7 4.12.12 is next 2023-01-22 20:44:31 +00:00
ce9b25e97a Release 4.12.11 2023-01-22 20:44:26 +00:00
f948cb0086 PocketMine.php: refuse pthreads 5.0 2023-01-21 15:30:36 +00:00
07a30ea1f9 Merge branch 'next-minor' into next-major 2023-01-20 15:42:30 +00:00
6c52723d97 Merge branch 'stable' into next-minor 2023-01-20 15:40:32 +00:00
d5b7bf77b0 Bump build/php from 6b605ed to b479ec4 (#5521)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `6b605ed` to `b479ec4`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](6b605ed7c4...b479ec438f)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-20 09:44:19 +00:00
b1a5b02d3a Updated DevTools to 1.16.1 2023-01-20 01:55:52 +00:00
74e052de51 Terminal: fix deprecation error on PHP 8.2 2023-01-20 01:30:39 +00:00
a5397d55fe Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-01-20 01:13:27 +00:00
65ef929d22 Update Actions PHP versions 2023-01-20 01:13:15 +00:00
441919c5e3 Begin testing on PHP 8.2 2023-01-20 01:12:35 +00:00
448aeec780 Bump phpstan/phpstan from 1.9.12 to 1.9.13 (#5520)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.12 to 1.9.13.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.9.12...1.9.13)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-19 13:04:28 +00:00
b8f6b66e42 First look at separating disconnect reason and disconnect screen messages (#4512) 2023-01-18 20:57:17 +00:00
365cce9d0c Merge branch 'next-minor' into next-major 2023-01-18 20:46:22 +00:00
78aea5c34c Merge branch 'stable' into next-minor 2023-01-18 20:46:10 +00:00
d7f40f75d2 PlayerPreLoginEvent: fixed documentation errors 2023-01-18 20:45:49 +00:00
41e60cb62c NetworkSession: remove unnecessary translation 2023-01-18 20:36:53 +00:00
5d2ac214a8 5.0.0-ALPHA8 is next 2023-01-18 19:50:18 +00:00
023010370b Release 5.0.0-ALPHA7 2023-01-18 19:50:18 +00:00
de3ba00684 Merge branch 'next-minor' into next-major 2023-01-18 19:48:41 +00:00
b47035fbab Merge branch 'stable' into next-minor 2023-01-18 19:48:29 +00:00
072a9202ef Merge branch 'next-minor' into next-major 2023-01-18 19:05:44 +00:00
f0925ff9dc draft-release: link to the correct channel-specific changelog
not having this made releasing alphas and betas error-prone, because I'd have to manually amend the changelog URL in the release.
2023-01-18 16:32:22 +00:00
d9324b9951 4.13.0-BETA2 is next 2023-01-18 16:15:47 +00:00
1d9336ed67 Release 4.13.0-BETA1 2023-01-18 16:15:43 +00:00
d37142af4b Merge branch 'stable' into next-minor 2023-01-18 15:30:42 +00:00
7c068101b7 CSÂ 2023-01-18 15:17:37 +00:00
217f9aea02 4.12.11 is next 2023-01-18 15:16:33 +00:00
2f5e08067d Release 4.12.10 2023-01-18 15:16:30 +00:00
a8556dff02 RakLibInterface: include Snooze events in Connection Handler timings 2023-01-18 15:02:33 +00:00
664089861a Bump phpstan/phpstan from 1.9.11 to 1.9.12 (#5517)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.11 to 1.9.12.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.9.11...1.9.12)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-18 14:27:51 +00:00
7314151c47 LevelDB: code cleanup 2023-01-17 22:47:43 +00:00
7abfc46567 First look at 3D biome support 2023-01-17 21:41:30 +00:00
3a13f5cf5f Merge branch 'next-minor' into next-major 2023-01-16 19:56:51 +00:00
edb8f19a0c Merge branch 'stable' into next-minor 2023-01-16 19:56:38 +00:00
6c0254c1eb Block: document parameters of place() 2023-01-16 19:49:24 +00:00
0bb9fb09cc CS again 2023-01-16 19:39:24 +00:00
ab21fcdd67 Server: fixed load statistics not including Snooze processing time
this has been a bug ever since Snooze was first introduced. The load statistic, similarly to timings, did not account for time spent processing notifications between ticks. The problem is that this is often where a significant amoutn of the load actually comes from, because Snooze is most often activated due to incoming packets.

This change fixes the problem by including the time spent processing notifications since the previous tick in the current tick's usage metric.
2023-01-16 19:26:32 +00:00
d9b8251f7b Merge branch 'next-minor' into next-major 2023-01-16 18:31:51 +00:00
ad6a423d12 Merge branch 'stable' into next-minor 2023-01-16 18:30:13 +00:00
b03df4f1e6 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-01-16 18:25:34 +00:00
0a2a6e2b3a 4.12.10 is next 2023-01-16 18:25:20 +00:00
0eb751c1c9 Release 4.12.9 2023-01-16 18:25:17 +00:00
b59b1e491e Bump phpunit/phpunit from 9.5.27 to 9.5.28 (#5514)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.27 to 9.5.28.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/9.5.28/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.27...9.5.28)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 18:06:42 +00:00
95e8c68fde Bump docker/build-push-action from 3.2.0 to 3.3.0 (#5513)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 18:06:31 +00:00
7e16f9be8f InGamePacketHandler: handle block actions before use item transactions
the START_BREAK and transaction to break the block may arrive in the same packet, causing events to be fired in the wrong order.

fixes #5490
2023-01-16 17:50:11 +00:00
768650cee0 CS 2023-01-16 17:46:50 +00:00
c2c529e2da Include Snooze interrupts in timings results
fixes #5511

This requires any Timings instances to be updated to
pmmp/timings@5410f62436, otherwise the TPS
reported will be incorrect.
2023-01-16 17:40:39 +00:00
c55e23a2c6 Localized disconnect message for spawn selection failure 2023-01-14 20:59:27 +00:00
5c2ed210fc Merge branch 'next-minor' into next-major 2023-01-14 20:53:41 +00:00
289e86e899 Make use of World::requestSafeSpawn() 2023-01-14 17:55:00 +00:00
7d59bafd83 World: added requestSafeSpawn() (async)
this simplifies usages of safe spawns, since the caller doesn't need to know which chunks will be needed for the spawn to be selected.

We'll need this in the future, because safe spawns may also get diverted horizontally as well as vertically, which might require loading adjacent chunks as well as the chunk the position is actually in.
2023-01-14 17:42:17 +00:00
950eddf405 Fix build 2023-01-13 17:57:41 +00:00
1bbe053848 Language: fixed another couple of hardcoded translation keys 2023-01-13 17:52:20 +00:00
69967a0e55 Properly localize jukebox popups 2023-01-13 17:48:56 +00:00
0132ff47cb Merge branch 'next-minor' into next-major 2023-01-13 17:46:35 +00:00
2ed48c8469 ... 2023-01-13 17:46:16 +00:00
d786ed5ebf WorldManager: fixed debug spam 2023-01-13 17:43:02 +00:00
8909aa6a18 Merge branch 'next-minor' into next-major 2023-01-13 17:29:25 +00:00
a9f06fc5f4 Replaced hardcoded record.nowPlaying with KnownTranslationKeys 2023-01-13 17:27:57 +00:00
a14346e98c Merge branch 'next-major' of github.com:pmmp/PocketMine-MP into next-major 2023-01-13 17:20:21 +00:00
b76265cd37 PlayerChatEvent: introduce new formatting API
this API is simultaneously more powerful and cleaner than the previous system.
The previous system relied on undocumented behaviour and was limited to non-localizable strings.

This enables custom servers to implement their own chat formats (e.g. containing localizable tags) which will be displayed in each player's own language (once per-player language has been properly implemented, anyway).
2023-01-13 17:20:08 +00:00
dff3f45d22 Constify more tick-related things 2023-01-13 16:29:09 +00:00
1e17d86421 Constify server TPS and server tick time
this makes it significantly easier to perform experiments involving the server TPS.
2023-01-13 16:03:15 +00:00
ba18a81e88 NetworkSession: fixed rate limit getting exhausted after 2.5 seconds during PvP 2023-01-13 15:28:03 +00:00
6dd006e730 Update BlockTypeIds.php 2023-01-13 01:31:24 +00:00
b57fcb52d4 Merge branch 'next-minor' into next-major 2023-01-12 22:17:52 +00:00
2c20b20ad2 Merge branch 'stable' into next-major 2023-01-12 22:17:35 +00:00
329c2a6c0f Merge branch 'stable' into next-minor 2023-01-12 22:17:00 +00:00
39218017ca Fixed walls and thin blocks not connecting to each other
closes #5498
2023-01-12 22:16:41 +00:00
a4494a2133 Merge branch 'next-minor' into next-major 2023-01-12 22:11:14 +00:00
fc487b17be DumpMemoryCommand: use localized description 2023-01-12 22:10:13 +00:00
ecd8f151f1 Merge branch 'next-minor' into next-major 2023-01-12 22:08:25 +00:00
c671d8a80b ItemFrame: fixed support conditions 2023-01-12 21:57:35 +00:00
ca1f1bf09f Fixed glowing item frames
due to technical limitations, this requires separating them back into two different block types. However, this isn't too egregious since it's just one flag, and actually simplifies some code.

closes #5478
2023-01-12 21:52:52 +00:00
91ac47ecba Merge branch 'stable' into next-minor 2023-01-12 21:47:37 +00:00
f4a1d69075 Bell: fixed support requirements
this somehow got overlooked in the support types refactor.
2023-01-12 21:45:25 +00:00
cbeae906e1 Torch: remove unused variable 2023-01-12 21:34:44 +00:00
b25e8e26f0 BaseBanner: fixed incorrect support requirements 2023-01-12 21:31:50 +00:00
a79be994de World: fixed block placement when clicking on replaceable blocks
in vanilla, it appears to behave as if the player always clicked on the up face if a block was replaced.

In PM, we were still using the original face, which caused bugs when, for example, placing a button next to a wall by clicking on the side of tallgrass. The button would replace the tallgrass, but stick to the wall, instead of placing itself on the ground like vanilla expects.

This may appear unusual to anyone who also happens to implement canBePlacedAt(), since the facing behaviour will be different. However, this behaviour appears to match vanilla, and even slabs (which I feared might break because of this change) work perfectly.

In the future, it may be desirable to pass some other value here, such as null, to indicate that the clicked block is being replaced. However, that's a BC break and therefore outside of the scope of a stable bug fix.
2023-01-12 21:11:48 +00:00
e26c8b9e9f block: eliminate suspicious usages of $blockClicked in place() 2023-01-12 20:35:26 +00:00
4e9c3e101d Bell: fixed blocks not being able to be placed when not ringing the bell 2023-01-12 19:42:33 +00:00
d295e1be54 PressurePlate: destroy self when no support is present 2023-01-12 19:36:47 +00:00
2f3fcef97c Fixed blocks incorrectly using blockClicked for support checks
this caused some interesting bugs, such as being able to place floating pressure plates by clicking on the side of a solid block halfway up a wall.
2023-01-12 19:36:23 +00:00
4df1f7f502 Updated composer dependencies (next-minor) 2023-01-12 19:03:55 +00:00
d74719704e Merge branch 'stable' into next-minor 2023-01-12 19:02:07 +00:00
c5056e0a43 phpstan 1.9.11 2023-01-12 19:01:57 +00:00
a47aa50477 Update composer dependencies 2023-01-12 18:59:18 +00:00
5021096bdd Fixed walls and thin blocks not connecting to each other
closes #5498
2023-01-09 20:46:57 +00:00
9c391a6809 Declare built-in command names inside the constructor (#5487)
This increases code consistency by placing the name in the same place where everything else about the command is defined.
2023-01-09 20:43:08 +00:00
f7930a3a0b 4.12.9 is next 2023-01-09 00:04:40 +00:00
bb7df60a4d Release 4.12.8 2023-01-09 00:04:40 +00:00
992cb06da6 NetworkSession: fixed rate limit not being increased correctly on Windows
due to the 15ms scheduler interval, the server will often sleep 45ms instead of 50ms, which causes the budget not to get updated.
2023-01-09 00:01:56 +00:00
bb3f87f862 NetworkSession: allow 2 batches per tick
apparently InventoryTransactionPacket may arrive outside of the normal update cycle, since it's prioritized to reduce latency.
2023-01-09 00:00:39 +00:00
d2eddf9d33 relocate comments 2023-01-08 20:56:51 +00:00
81ca0c8fbf Language: do not parse translations if the text was a plain key
this unintentionally allowed translations to reference other translations 1 level deep, which is not desired behaviour.
This also improves performance for the cases where formatting isn't used.
2023-01-08 20:56:12 +00:00
fc77b14760 4.12.8 is next 2023-01-08 20:23:18 +00:00
52b6f1a492 Release 4.12.7 2023-01-08 20:23:15 +00:00
0233e74f4f NetworkSession: micro optimisation - do not check if a debugger is active unless the packet limit is exceeded 2023-01-08 19:45:14 +00:00
dd355c58d8 NetworkSession: fix CS 2023-01-08 19:35:43 +00:00
267032cff9 NetworkSession: do not rate limit packets if a debugging session is active 2023-01-08 19:31:39 +00:00
545d18eea7 Merge branch 'next-major' of github.com:pmmp/PocketMine-MP into next-major 2023-01-08 17:07:32 +00:00
9b4b960eb2 Remove deprecated methods 2023-01-08 17:07:22 +00:00
d4b8c47a65 Language: document poorly-named function parseTranslation() 2023-01-08 16:46:25 +00:00
4a3d9f8f83 Make client-aware translation handling more coherent
I have no clear idea why this was still using translateString(), since it's entirely unnecessary when we aren't selectively translating.
2023-01-08 16:45:57 +00:00
1c96e7936c Remove dead translation code
we don't translate raw string parameters anywhere else these days, so there's no reason to do so here either. The parameters array is already reduced to string[] by this point anyway.
2023-01-08 16:20:05 +00:00
c5ca0857ee TileFactory: removed outdated TODO (#5503)
[ci skip]
2023-01-08 15:56:14 +00:00
6cecd690b2 CS 2023-01-07 21:33:53 +00:00
91e38d1f97 NetworkSession: compensate for server lag in batch budgeting 2023-01-07 21:33:34 +00:00
653178c1fd 4.12.7 is next 2023-01-07 16:22:01 +00:00
eb06535ed1 Release 4.12.6 2023-01-07 16:22:01 +00:00
f9bcc8e862 NetworkSession: added a rate-limit for incoming batches 2023-01-07 16:19:02 +00:00
faaec12aaf Update BedrockProtocol 2023-01-06 22:16:29 +00:00
1123a5aa23 InventoryManager: Track predictions using ItemStack directly, instead of internal Item
this removes the need for deserializing network itemstacks to core items, thereby eliminating a whole bunch of potential security issues.
2023-01-06 20:45:08 +00:00
8633804f15 InventoryManager: disentangle slot tracking from slot syncing 2023-01-06 20:26:19 +00:00
d3cea2ca7c CS 2023-01-06 02:07:31 +00:00
c2918709a3 Merge branch 'next-minor' into next-major 2023-01-06 01:59:04 +00:00
ece49f011c Merge branch 'stable' into next-minor 2023-01-06 01:50:17 +00:00
5d6dba96af Merge branch 'stable' into item-stack-request 2023-01-06 01:47:27 +00:00
f43ca405d4 4.12.6 is next 2023-01-06 00:44:58 +00:00
d146175d27 Release 4.12.5 2023-01-06 00:44:58 +00:00
3baa5ab712 InGamePacketHandler: removed obsolete workaround 2023-01-06 00:41:57 +00:00
b24eb153f9 Constrain inventory transaction predictions
these are now only used for actions done with a closed inventory window. This means that they can only predict the slots of inventory, offhand and armor (total 41 slots) and perhaps include some DropItem actions.
2023-01-05 21:18:30 +00:00
36525d9055 Fixed multi-output recipe handling 2023-01-05 20:41:44 +00:00
3d6baa8a55 Working creative inventory, with a few more hacks than I'd like 2023-01-05 18:09:57 +00:00
30d3869eea Remove dead code 2023-01-05 17:26:58 +00:00
81697111b9 Merge branch 'item-stack-request' of github.com:pmmp/PocketMine-MP into item-stack-request 2023-01-05 17:24:15 +00:00
eedc943766 Confine legacy transaction handling to dropping items only 2023-01-05 17:23:50 +00:00
e647e8c933 World: Use existing function to notify nearby blocks of an update (#5494) 2023-01-05 16:55:35 +00:00
c02bead12b Bump phpstan/phpstan from 1.9.6 to 1.9.7 (#5495)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.6 to 1.9.7.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.9.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.9.6...1.9.7)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-05 16:46:45 +00:00
e9ca25c1cb typo 2023-01-05 16:45:56 +00:00
a513cca582 Stop Dependabot from creating PRs for locale-data minor and major versions 2023-01-05 16:45:22 +00:00
c6e11a8453 Remove unnecessary ternary operator (#5493) 2023-01-04 23:22:31 +00:00
2e9a3f9160 Working crafting :woohoo: 2023-01-04 22:29:29 +00:00
9a47c1d401 Bump shivammathur/setup-php from 2.22.0 to 2.23.0 (#5474)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.22.0 to 2.23.0.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.22.0...2.23.0)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-04 20:15:11 +00:00
433f5451d7 Improve World::notifyNeighbourBlockUpdate() doc (#5491) 2023-01-04 20:11:55 +00:00
85231215e7 Implemented Sculk (#5489) 2023-01-04 20:10:46 +00:00
64e505defb Bump phpstan/phpstan from 1.9.4 to 1.9.6 (#5492)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.4 to 1.9.6.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.9.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.9.4...1.9.6)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-04 20:05:34 +00:00
3d4ed5308e Merge branch 'stable' into item-stack-request 2023-01-04 01:28:42 +00:00
33d1755eae Player: fixed not receiving slot updates for small crafting grid
I'm not really sure why this tracking logic is here and not in InventoryManager, but for now it is what it is.
2023-01-04 01:28:25 +00:00
58dd4a44e3 Merge branch 'stable' into item-stack-request 2023-01-04 00:41:58 +00:00
fc63c54116 CraftingManager: more detailed type information for shapelessRecipes and shapedRecipes 2023-01-04 00:32:26 +00:00
5fdbb19852 Fixed a whole bunch of issues with legacy transactions 2023-01-04 00:13:51 +00:00
6b2156151f Merge branch 'stable' into item-stack-request 2023-01-03 23:51:37 +00:00
db07976aab TypeConverter: do not send useless meta to the client 2023-01-03 23:50:31 +00:00
d8d236842f Fixed merge error 2023-01-03 19:54:41 +00:00
f51717323b Merge branch 'stable' into item-stack-request 2023-01-03 19:53:25 +00:00
0e4b79ea77 InGamePacketHandler: fixed client-side predictions not getting rolled back for block placement 2023-01-03 19:43:21 +00:00
588c9b114b 4.12.5 is next 2023-01-03 19:30:02 +00:00
b095f606c1 Release 4.12.4 2023-01-03 19:29:47 +00:00
b312e93176 Limit list max size in transactions
this duct tape is to limit the impact of a security vulnerability being actively exploited.
2023-01-02 22:59:48 +00:00
42db3abf5e QueryInfo->setPlayerList() now accepts string[] instead of Player[] (#5476) 2022-12-31 13:04:22 +00:00
172ce659b8 Use str_starts_with, str_ends_with and str_contains instead of strpos (#5485) 2022-12-31 13:02:23 +00:00
61933624d2 NetworkSession: Lift batch limit to 1300 to allow shift-click crafting to work correctly
the theoretical limit for transactions in this case is 64x9 (inputs) + 64x9 (output on crafting grid) + 64 (outputs to main slot) + 64 CraftingEventPackets = 1280.
This is an extreme case which assumes that a recipe could generate up to 64x10 (640) output items per iteration, filling every slot of the output grid, which should never occur in any reasonable circumstances.
2022-12-30 22:11:35 +00:00
0d31b25fba Use str_starts_with and str_contains instead of strpos (#5482) 2022-12-30 21:41:30 +00:00
90beaeaeb4 4.12.4 is next 2022-12-28 21:01:50 +00:00
466f7e98ed Release 4.12.3 2022-12-28 21:01:47 +00:00
59be901efe Fixed unauthenticated sessions taking up player slots 2022-12-28 20:42:33 +00:00
2da9b76452 Added translatable descriptions for permissions 2022-12-27 20:29:38 +00:00
c79806eaf0 NetworkSession: localize session open, close, and player name discovery messages 2022-12-27 20:11:46 +00:00
7ac6bd79a9 Localized remaining disconnection screens (except one or two that should never actually happen) 2022-12-27 20:05:59 +00:00
6b8b7311f0 Support localized disconnect screen messages for PlayerLoginEvent 2022-12-27 18:57:32 +00:00
f173b91ca1 Introduce support for Translatable disconnection messages
this allows localizing disconnection screens (at least, once #4512 has been addressed) and the disconnect reasons shown on the console.

We already had disconnect messages implicitly localized in a few places, so this is just formalizing it.
This does break BC with any code that previously passed translation keys as the disconnect screen message, because they'll no longer be translated (only Translatables will be translatated now).
2022-12-27 18:36:07 +00:00
9796dfd4d9 Fix build 2022-12-27 18:32:22 +00:00
c1ba735c9e Move common protocol disconnection logic to NetworkSession 2022-12-27 18:05:50 +00:00
8fd4918429 Use Filesystem::fileGetContents() in more places 2022-12-25 18:26:53 +00:00
c89df7eb1c Merge remote-tracking branch 'origin/next-minor' into next-major 2022-12-25 18:22:13 +00:00
0d169b4e80 Filesystem: added fileGetContents to reduce ErrorToExceptionHandler boilerplate code 2022-12-25 17:13:51 +00:00
b1c0eae1f6 NetworkSession: tidy up common disconnection logic 2022-12-24 20:36:18 +00:00
80832ff763 NetworkSession: do not send packets to disconnected sessions
this is mostly harmless, since the packets land in a buffer that gets discarded, but we also need to avoid calling DataPacketSendEvent.
2022-12-24 20:12:50 +00:00
f7d0d16eb3 NetworkSession: defer destructive cleanup until the next session tick() call
this fixes crashes when kicking players during PlayerJoinEvent and various other events.
2022-12-24 20:06:00 +00:00
6375139d0b DefaultPermissions: improve readability slightly 2022-12-24 17:47:17 +00:00
a8edb92565 Merge branch 'next-major' of github.com:pmmp/PocketMine-MP into next-major 2022-12-24 17:42:09 +00:00
133884da72 Remove deprecated permissions 2022-12-24 17:41:59 +00:00
b4c7d33388 Implement Medicine (from Education Edition) (#5450) 2022-12-24 17:38:12 +00:00
d37841c214 Merge branch 'next-minor' into next-major 2022-12-24 17:34:37 +00:00
2a81a421f3 Merge branch 'next-minor' into next-major 2022-12-24 17:23:30 +00:00
567bd8abb5 Add .self and .other permissions for gameplay-altering commands (#5470)
I'm not quite sure this is the best way to enable such functionality, but it's already used for some other stuff, so I'm not too worried for now.

This allows the following commands to have their usage limited to self or others:
- /effect
- /enchant
- /gamemode
- /give
- /spawnpoint
- /teleport
- /title

I envision this being useful for creative mode servers, and test servers such as test.pmmp.io.
2022-12-24 17:22:18 +00:00
3d038b28ff SplashPotion: const-ify missed NBT key 2022-12-24 15:19:56 +00:00
0c9b6a6797 DatFilePlayerDataProvider: added documentation 2022-12-23 19:00:45 +00:00
639f089c55 .. 2022-12-23 18:59:36 +00:00
9010b2743c Move player data storage handling behind an interface 2022-12-23 18:58:49 +00:00
4c91c4aaf1 ÂMemoryManager: replace switch with match 2022-12-23 17:36:08 +00:00
f8cc015c51 Merge branch 'next-minor' into next-major 2022-12-23 16:58:59 +00:00
17125ce0e3 Merge branch 'stable' into next-minor 2022-12-23 16:56:54 +00:00
3987ee6cb2 PluginDescription: const-ify plugin.yml parsing keys 2022-12-23 16:11:03 +00:00
51a684c0ea PermissionParser: remove hardcoded default strings in defaultFromString() 2022-12-23 16:03:01 +00:00
43e69041fc PermissionParser: use constants for keys 2022-12-23 16:00:38 +00:00
5d2b0acfc8 GamemodeCommand: report failure if the target's game mode is already the desired game mode
this has irritated me for years.
2022-12-22 18:38:10 +00:00
7d1d62042c attempted fix for GitHub rate limiting php-cs-fixer installation
from https://github.com/shivammathur/setup-php/issues/678#issuecomment-1363128626
2022-12-22 18:13:03 +00:00
2a33c9ed3b Fix PHPStan 2022-12-22 16:53:14 +00:00
b03733442b Move translation flattening logic from Player to NetworkSession
this is network-specific stuff, so it doesn't belong in Player.
2022-12-22 16:51:09 +00:00
9c9929ff39 Player: break cycle between sendMessage() and sendTranslation() 2022-12-22 16:37:36 +00:00
566a8a261f Player: deprecate sendTranslation() in favour of sendMessage() 2022-12-22 16:32:54 +00:00
a9e5f92958 Show death message on death screen (#5386) 2022-12-22 15:36:31 +00:00
17dde140a5 Bump phpstan/phpstan-phpunit from 1.3.2 to 1.3.3 (#5465)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.3.2 to 1.3.3.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.3.2...1.3.3)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-22 15:23:10 +00:00
b3473960b4 Implemented chain (#5454) 2022-12-22 15:22:04 +00:00
044d35956e 5.0.0-ALPHA7 is next 2022-12-19 22:21:14 +00:00
da4315df05 Release 5.0.0-ALPHA6 2022-12-19 22:21:13 +00:00
83bfe790fa Prepare 5.0.0-ALPHA6 changelog 2022-12-19 22:18:24 +00:00
ee7d4728d8 World: added cache for isChunkTickable()
this considerably reduces the amount of work done by the function, since it's usually checking the same chunks over and over again.
2022-12-19 21:20:21 +00:00
923dcec4e7 Revert "World: do not refresh ticked chunks list every tick"
This reverts commit aebcfc516f.

this has edge cases in the handling of adjacent chunk locks which I
didn't consider at the time. Once accounting for those edge cases, it
became significantly more complex to the point that I realized this
needed more planning.
2022-12-19 20:57:51 +00:00
1e5597f0d5 World: account for null chunk edge case in tickChunk()
the target chunk may no longer be loaded if it was unloaded during a previous chunk's tick (e.g. during BlockGrowEvent).
Since the parent function iterates over a pre-selected array of chunks, the chunk will still be present in the list even if it's no longer loaded by the time it's reached.
2022-12-19 20:20:52 +00:00
aebcfc516f World: do not refresh ticked chunks list every tick
this is just wasting CPU time, since the effects aren't noticeable on such a small timescale anyway.
This reduces the CPU impact of chunk selection by 95%. However, this is the lesser part of chunk ticking, and the lion's share of the performance impact still comes from actually ticking the chunks.
2022-12-19 20:17:29 +00:00
97ef209c5f HandlerList: added missing class-string type for constructor 2022-12-19 16:26:36 +00:00
16f90f4120 EntityFactory: remove legacy save IDs
this can be more cleanly handled using BedrockData.
2022-12-19 16:04:32 +00:00
ec59dc1c80 SuspiciousStewTypeIdMap: fixed uninitialized fields 2022-12-19 15:58:26 +00:00
973b8130db Merge remote-tracking branch 'origin/next-minor' into next-major 2022-12-19 15:57:06 +00:00
99faeb8d05 Merge remote-tracking branch 'origin/stable' into next-minor 2022-12-19 15:55:59 +00:00
1305fd5fb2 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2022-12-19 15:52:56 +00:00
7a137f932f Updated build/php submodule to pmmp/php-build-scripts@6b605ed7c4 2022-12-19 15:52:44 +00:00
63e8b1cf3a Bump phpstan/phpstan from 1.9.3 to 1.9.4 (#5458)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.3 to 1.9.4.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.9.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.9.3...1.9.4)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-19 15:39:59 +00:00
65bce762ff Updated transient Composer dependencies 2022-12-19 15:34:17 +00:00
529700bb8b PotionTypeIdMap: fixed uninitialized fields
I have no idea why this didn't ever cause a problem before... probably an edge-case in the typed properties implementation
2022-12-19 15:33:15 +00:00
f38b15cf83 Added tag for fire blocks 2022-12-19 15:22:09 +00:00
0efd928db6 Apply a prefix to block type tags 2022-12-19 15:11:06 +00:00
9809909072 BedrockWorldData: remove unused custom fields 2022-12-19 15:06:06 +00:00
de3af9e660 Fix CS 2022-12-19 15:02:59 +00:00
a30c649607 BedrockWorldData: enable commands by default 2022-12-19 14:59:55 +00:00
d7ebabd771 Fixed the client asking to upgrade PM-generated worlds 2022-12-19 14:56:04 +00:00
be1087c071 Accept worlds from 1.19.40 and up 2022-12-19 14:55:24 +00:00
b27c47335c JavaWorldData: remove Bedrock-compatible hacks
we don't need these, since we don't write to Java world formats anymore anyway.
2022-12-19 13:43:28 +00:00
58eec637c1 Constify NBT keys in world data handling
this code is one giant mess that needs to be cleaned up though...
2022-12-19 13:39:41 +00:00
4f86ea9933 Merge branch 'next-major' of github.com:pmmp/PocketMine-MP into next-major 2022-12-18 22:25:44 +00:00
6e2685cbbb Merge branch 'next-minor' into next-major 2022-12-18 22:25:32 +00:00
b2017c8462 and more 2022-12-18 22:14:31 +00:00
bf44edd179 Constify a bunch of NBT keys, pass 1 2022-12-18 22:12:15 +00:00
44e288554a Implement new records (#5433) 2022-12-18 21:15:27 +00:00
ffa88aff67 Merge branch 'next-minor' into next-major 2022-12-18 21:05:26 +00:00
aa374083d8 Accept new BedrockProtocol version 2022-12-18 21:00:52 +00:00
1785cbb6b5 Implement FallingBlock missing sounds (#5348) 2022-12-18 19:33:50 +00:00
3d75094874 Standardize explosion radius terminology
closes #5061
2022-12-15 22:43:36 +00:00
8c0d3943d8 Added length validation for resource pack encryption keys 2022-12-15 22:36:06 +00:00
d02c6668b2 ResourcePackManager: added setPackEncryptionKey()
this allows plugins to install their own encrypted resource packs
2022-12-15 22:29:34 +00:00
880d01daea ResourcePackManager: added setResourceStack()
this enables plugins to modify the resource pack stack however they see fit.

Modifying the existing stack can be done by doing array modifications on the result of getResourceStack() and then setting it back again using this method.
2022-12-15 22:10:53 +00:00
50b70708fb ResourcePackManager: extracted loadPackFromPath() private method from constructor body 2022-12-15 21:59:54 +00:00
ba4d038972 ShapelessRecipe: make type parameter mandatory 2022-12-15 21:41:33 +00:00
437fa615b8 4.12.3 is next 2022-12-15 21:08:28 +00:00
0ee6cdb058 Release 4.12.2 2022-12-15 21:08:23 +00:00
97d6a79b25 Updated BedrockProtocol 2022-12-15 20:37:36 +00:00
8b5e4c1c16 Updated PHPStan 2022-12-15 20:16:56 +00:00
c5d716dc9d Added keep on death methods for items (#5395) 2022-12-15 20:10:20 +00:00
4d79aced07 Merge branch 'next-minor' into next-major 2022-12-15 19:50:27 +00:00
95d0a3bf41 Merge branch 'stable' into next-minor 2022-12-15 19:38:22 +00:00
cf707e15c2 fix 2022-12-15 19:36:16 +00:00
1308cda5c2 Implemented hook method Item::onInteractEntity() (#5432)
this is called when the player right-clicks on an entity to do some action, such as shearing, naming etc.
2022-12-15 19:30:52 +00:00
214a5ddc15 Bump netresearch/jsonmapper from 4.0.0 to 4.1.0 (#5446)
Bumps [netresearch/jsonmapper](https://github.com/cweiske/jsonmapper) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/cweiske/jsonmapper/releases)
- [Changelog](https://github.com/cweiske/jsonmapper/blob/master/ChangeLog)
- [Commits](https://github.com/cweiske/jsonmapper/compare/v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: netresearch/jsonmapper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-15 19:28:11 +00:00
9f7dfe3355 Bump phpunit/phpunit from 9.5.26 to 9.5.27 (#5447)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.26 to 9.5.27.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/main/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.26...9.5.27)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-15 19:21:39 +00:00
9b55d18393 Bump ncipollo/release-action from 1.11.2 to 1.12.0 (#5451)
Bumps [ncipollo/release-action](https://github.com/ncipollo/release-action) from 1.11.2 to 1.12.0.
- [Release notes](https://github.com/ncipollo/release-action/releases)
- [Commits](https://github.com/ncipollo/release-action/compare/v1.11.2...v1.12.0)

---
updated-dependencies:
- dependency-name: ncipollo/release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-15 19:20:28 +00:00
84f9136b95 Implement anvil damage on fall (#5345) 2022-12-15 19:12:18 +00:00
31465525e3 Fixed PHP-CS-Fixer not import global constants. (#5449) 2022-12-12 17:12:33 +00:00
74613b9b09 Bump phpstan/phpstan-phpunit from 1.2.2 to 1.3.0 (#5445)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.2.2 to 1.3.0.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.2.2...1.3.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-10 21:17:03 +00:00
1cefe24414 InGamePacketHandler: fixed transaction predictions not getting rolled back for failed use/release/interact transactions
this was caused by b5cfab497d.
2022-12-10 21:16:08 +00:00
4357c110c8 Add the event: WorldParticleEvent (#5428) 2022-12-06 14:19:14 +00:00
8bf85d4a18 bootstrap: avoid using is_writable() to check for data directory access permissions
closes #5440
2022-12-06 14:13:37 +00:00
b5e6dec0c6 Filesystem: capture error information from attempted lock file creation 2022-12-06 14:06:08 +00:00
a3306914cc bootstrap: do not require the plugins dir to be writable
on a modern installation, the plugins folder does not need to be writable by the server. Perhaps DevTools should be checking this for /genplugin, but it's not required otherwise.
2022-12-06 13:58:50 +00:00
3b32ea1b0b Update PhpStorm code style settings 2022-12-06 13:22:54 +00:00
7ec32f981e Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2022-12-06 13:22:15 +00:00
b0c87e9d06 Added phpdoc_align rule for php-cs-fixer 2022-12-06 13:21:57 +00:00
99996b62d6 Align PhpDoc @param tags according to PHP-CS-Fixer 2022-12-06 13:21:20 +00:00
fed2a6d917 Add the event: WorldSoundEvent (#5322) 2022-12-06 13:06:40 +00:00
8e600b4a78 ItemBlock: fixed unnecessary double singleton usage 2022-12-06 12:48:28 +00:00
1d4b6dc66e Only reduce durability when armor reduced damage. (#5444)
https://minecraft.fandom.com/wiki/Durability#Armor_durability
2022-12-05 21:10:36 +00:00
1cb6d9f5af Bump dessant/support-requests from 2 to 3 (#5442)
Bumps [dessant/support-requests](https://github.com/dessant/support-requests) from 2 to 3.
- [Release notes](https://github.com/dessant/support-requests/releases)
- [Changelog](https://github.com/dessant/support-requests/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dessant/support-requests/compare/v2...v3)

---
updated-dependencies:
- dependency-name: dessant/support-requests
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-05 21:10:09 +00:00
18c2e90574 fix CS 2022-12-05 14:47:44 +00:00
142ccc7e87 Merge branch 'next-minor' into next-major 2022-12-05 14:14:39 +00:00
174c9a48f5 Merge branch 'next-minor' of github.com:pmmp/PocketMine-MP into next-minor 2022-12-05 14:12:45 +00:00
0a9b52618d 4.12.2 is next 2022-12-04 23:11:48 +00:00
7ae6425d05 Release 4.12.1 2022-12-04 23:11:48 +00:00
b5cfab497d Clean up inventory content syncing, fixes #5441
these remnants should have been cleaned up in 4.11, but I somehow managed to skip over them.
2022-12-04 23:05:30 +00:00
ca3b5c38b7 Added internal support for tag recipe ingredients 2022-12-02 14:03:58 +00:00
bc8def3be1 Update BedrockData 2022-12-02 13:02:18 +00:00
774e23137e changelog: added detail about InventoryManager internals changes
this isn't considered part of the API, but certain specialized popular plugins (e.g. InvMenu) require it.
2022-12-01 20:48:38 +00:00
3984d220bb Implemented the swift sneak enchantment (#5404)
Co-authored-by: Dylan T <dktapps@pmmp.io>

closes #5301
2022-12-01 20:38:41 +00:00
43bc3c7b25 Added tool to dump JSON contents of encoded crashdump data 2022-12-01 19:36:31 +00:00
eb62dc3294 Added documentation for RegistryTrait, EnumTrait and CloningRegistryTrait 2022-11-30 21:04:17 +00:00
28d8526d8d Merge branch 'next-minor' into next-major 2022-11-30 20:05:30 +00:00
0b497654f2 Merge remote-tracking branch 'origin/stable' into next-minor 2022-11-30 19:51:24 +00:00
279056fe2f 4.12.1 is next 2022-11-30 16:35:58 +00:00
cd233b123b Release 4.12.0 2022-11-30 16:35:58 +00:00
64dd5e3bf6 Update dependencies for 1.19.50 2022-11-30 16:32:04 +00:00
4e5cc57560 Bump build/php from 9353116 to 27cc1fc (#5438)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `9353116` to `27cc1fc`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](9353116fa8...27cc1fcdfa)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 11:15:09 +00:00
d476a4c1aa Implement a Living::getDisplayName() (#5384) 2022-11-27 19:48:55 +00:00
95263795a8 Durable: fix misbehaviour of isBroken() since fe982c697b (#5436)
this broke tool and armour break sounds.
2022-11-27 00:13:41 +00:00
2db86d151f Bump ncipollo/release-action from 1.11.1 to 1.11.2 (#5414)
Bumps [ncipollo/release-action](https://github.com/ncipollo/release-action) from 1.11.1 to 1.11.2.
- [Release notes](https://github.com/ncipollo/release-action/releases)
- [Commits](https://github.com/ncipollo/release-action/compare/v1.11.1...v1.11.2)

---
updated-dependencies:
- dependency-name: ncipollo/release-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-26 20:26:02 +00:00
8f20b9da91 Rename ExplosionPrimeEvent to EntityPreExplodeEvent (#5434) 2022-11-26 19:55:16 +00:00
b0c6e8d8e0 StringToItemParser: added lookupAliases() and lookupBlockAliases()
this permits reverse-lookuping all registered aliases that map to the given item (including properties).
this may be useful for plugins to use for generating configs, instead of using IDs or some godawful hack using getName().
2022-11-26 19:32:39 +00:00
f0358b09b7 changelog: added commit links to internals changes 2022-11-25 21:47:27 +00:00
80a432d9ff Merge branch 'next-minor' into stable 2022-11-25 20:30:57 +00:00
ec9f9a469f 4.11.1 is next 2022-11-25 20:29:49 +00:00
d450264e1c Release 4.11.0 2022-11-25 20:29:46 +00:00
5e92f55d35 4.10.3 is next 2022-11-25 15:20:18 +00:00
58c1bfe5d2 Release 4.10.2 2022-11-25 15:20:15 +00:00
d03caafc2b Merge branch 'next-minor' into next-major 2022-11-25 15:00:39 +00:00
641d35a30f Updated pocketmine/locale-data to get new translations 2022-11-25 14:59:58 +00:00
642630a4d2 ... 2022-11-25 14:57:47 +00:00
b6982a84ef Merge branch 'next-minor' into next-major 2022-11-25 14:52:56 +00:00
d634b3de18 Update composer dependencies 2022-11-25 14:41:44 +00:00
d79e6354a0 Merge branch 'stable' into next-minor 2022-11-25 14:41:05 +00:00
ff63983de4 Update transient composer dependencies 2022-11-25 14:39:34 +00:00
588215044e Update BedrockProtocol 2022-11-25 14:37:37 +00:00
5c1e9a35a9 Fix missing sounds when interacting with item frames (#5383)
closes #5168
2022-11-25 14:28:41 +00:00
aad9f5fb45 Terminal: use fallback escape codes if TERM env var is not set
tput requires a value for TERM, so it will generate errors if the var is
not set, as it appears not to be in PhpStorm on macOS.
2022-11-24 22:52:33 +00:00
a8dca190c6 Updated build/php submodule to pmmp/php-build-scripts@9353116fa8 2022-11-24 21:07:59 +00:00
fdb07cdbcd Added more missing native types according to 8.0 standards 2022-11-23 14:21:38 +00:00
3b6ff3c42b Apply union types in some places (BC breaks) 2022-11-23 14:03:35 +00:00
e5f5fe80f9 BlockGrowEvent: Remove unnecessary Cancellable implementation (#5359)
this is already implemented by BaseBlockChangeEvent
2022-11-23 13:29:23 +00:00
36ab34df29 Implement BlockDeathEvent (#5420)
closes #4711
2022-11-23 12:57:26 +00:00
23ae0c7cac Add Furnace->getType() : FurnaceType method (#5425)
closes #4761 

this targets next-major due to BC-breaking changes to Furnace::__construct()
2022-11-23 12:32:15 +00:00
1bc5e225ab Candle: Fix support type (#5422) 2022-11-21 14:38:18 +00:00
dda8ff18b1 Missing space (#5419) 2022-11-21 10:25:17 +00:00
6562335120 CrashDump: fixed failure to generate crash report when error messages contain invalid characters
closes #2986
2022-11-15 22:00:20 +00:00
0c463a8721 PlayerCreationEvent: update woefully inadequate documentation
closes #4581
2022-11-15 21:45:08 +00:00
a66f966b08 Update API documentation for Inventory methods 2022-11-15 21:00:13 +00:00
cca22046ab Updated pocketmine/locale-data 2022-11-15 20:21:39 +00:00
858d3dce8e Implement Weeping & Twisting vines (#5396) 2022-11-15 15:29:42 +00:00
d19f0bf7be Language: added getAll() 2022-11-15 15:27:14 +00:00
ff2391e74a FormattedCommandAlias: use new string for description 2022-11-15 15:26:55 +00:00
39e10da88d PlayerChatEvent: replace hardcoded translation key with KnownTranslationKeys constant 2022-11-15 15:15:34 +00:00
34839da757 Fix missing sound when a projectile strikes an amethyst block (#5382)
closes #5358
2022-11-15 14:50:05 +00:00
b3b8516661 5.0.0-ALPHA6 is next 2022-11-13 14:47:41 +00:00
90305a0b92 Release 5.0.0-ALPHA5 2022-11-13 14:47:37 +00:00
613ce251c5 Merge branch 'next-minor' into next-major 2022-11-13 14:32:54 +00:00
beed6efd4e 4.11.0-BETA3 is next 2022-11-13 14:30:11 +00:00
e5bc4deb12 Release 4.11.0-BETA2 2022-11-13 14:29:59 +00:00
2fcff13578 World: added getter and setter for simulation radius 2022-11-12 23:32:12 +00:00
b4b8ef1c6b World: Improve performance of ticked chunk selection when lots of loaders use the same chunk
since we use the same simulation distance for every loader, multiple loaders on the same chunk will produce the same set of ticked chunks.
2022-11-12 22:21:30 +00:00
9650b7f03a Update PHPStan to 1.9.2 2022-11-12 17:31:39 +00:00
a205d64732 Merge branch 'next-minor' into next-major 2022-11-12 17:02:56 +00:00
a3502a711d Merge branch 'stable' into next-minor 2022-11-12 17:01:58 +00:00
83ddcce987 World: Considerably simplify ticked chunk selection
WARNING: This WILL have a performance impact on larger servers, but that's the price to pay for having crops actually grow.

The old overengineered method for doing this was causing glacially slow crop growth, vanilla parity issues and really just didn't make much sense. This method is probably incorrect too, but it will at least produce visible results.
2022-11-12 16:57:35 +00:00
732dac6fc1 Player: revert accidental change from ef100b248b 2022-11-12 14:43:22 +00:00
d5e3636908 Timezone: Apparently timezone_id returned by timezone_abbreviations_list() may be null... 2022-11-12 14:40:37 +00:00
ef100b248b Improved doc comment for Internet::getIP() (#5406) 2022-11-12 13:52:49 +00:00
d03bbb0426 Implemented darkness effect (#5402) 2022-11-10 12:57:14 +00:00
93e661aa4e Removed useless @inheritDoc (#5399) 2022-11-09 13:40:35 +00:00
50efcf7424 Bump ramsey/uuid from 4.5.1 to 4.6.0 (#5400)
Bumps [ramsey/uuid](https://github.com/ramsey/uuid) from 4.5.1 to 4.6.0.
- [Release notes](https://github.com/ramsey/uuid/releases)
- [Changelog](https://github.com/ramsey/uuid/blob/4.x/CHANGELOG.md)
- [Commits](https://github.com/ramsey/uuid/compare/4.5.1...4.6.0)

---
updated-dependencies:
- dependency-name: ramsey/uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-09 13:40:09 +00:00
a7ac6070dc Correct damage calculation for non-arrow projectiles (#5394) 2022-11-07 20:05:53 +00:00
069062f122 4.11.0-BETA2 is next 2022-11-07 15:18:09 +00:00
bf7014e0ec Release 4.11.0-BETA1 2022-11-07 15:18:05 +00:00
824ed0a56a Merge branch 'stable' into next-minor 2022-11-07 15:04:48 +00:00
b3ccf41307 4.10.2 is next 2022-11-07 14:50:44 +00:00
a39938e6b6 Release 4.10.1 2022-11-07 14:50:43 +00:00
d5bf88acc0 Added missing changelog items for 4.10.0 release
these really ought to have been released in 4.9.2, but it's too late for that now.
2022-11-07 14:43:11 +00:00
2d0602d19f World: fixed spawning in the void when the spawn terrain is higher than y=70 on default worlds
fixes #5390
2022-11-07 14:24:17 +00:00
1a5cc8212c World: fixed spawning in the void when the spawn terrain is higher than y=70 on default worlds
fixes #5390
2022-11-07 14:23:29 +00:00
3a2a23b236 Fixed totem activating when having 1HP instead of 0HP (#5380) 2022-11-07 13:54:14 +00:00
1a8c8af523 Bump shivammathur/setup-php from 2.21.2 to 2.22.0 (#5375)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.21.2 to 2.22.0.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.21.2...2.22.0)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-07 13:40:53 +00:00
1e9d83f014 BaseInventory: validate given array in setContents() (#5391) 2022-11-07 13:09:05 +00:00
68e862b6fa Scrub PHPStan baselines (next-major) 2022-11-04 20:53:20 +00:00
c915334c2b Merge branch 'next-minor' into next-major 2022-11-04 20:51:49 +00:00
6153a2ac70 Merge remote-tracking branch 'origin/stable' into next-minor 2022-11-04 20:51:40 +00:00
ed452b9ccd Scrub PHPStan baselines 2022-11-04 20:51:22 +00:00
c19880e045 bootstrap: fix PHPStan error 2022-11-04 20:50:27 +00:00
01bad344a0 Merge branch 'next-minor' into next-major 2022-11-04 20:47:26 +00:00
cdbdcb5d67 Merge branch 'stable' into next-minor 2022-11-04 20:44:28 +00:00
29301614e8 Remove dead comments (#5389) 2022-11-04 20:23:56 +00:00
2fdc46c165 PHPStan 1.9 features 2022-11-04 20:23:34 +00:00
bfd1b2c635 PHPStan 1.9.1 2022-11-04 18:28:07 +00:00
d9638cef96 Merge branch 'next-minor' into next-major 2022-11-02 16:04:16 +00:00
1671405cd0 Merge branch 'stable' into next-minor 2022-11-02 16:03:30 +00:00
fe982c697b Durable: reset durability when overstacked items are broken
this is not really defined behaviour, but it makes more sense than the current behaviour, which makes the tool unbreakable unintentionally.

fixes #5378
2022-11-02 15:42:44 +00:00
1572b31b8d FormattedCommandAlias: do not fill empty strings for missing placeholder arguments
this is pretty much always going to cause unexpected behaviour, as most execute() implementations don't expect empty strings, and it can also pad the args with dummy entries, breaking argument count requirements (e.g. aliasing say  and using the alias with no arguments will confuse the target command).

Instead:
- Drop arguments that cannot be resolved (leave them unspecified)
- If they are at the end of the argument sequence, this is OK - it will behave the same as if some optional arguments weren't specified.
- If they are in the middle of the argument sequence, this will generate an error - this is preferable to having the target invoked with an empty string, which might cause unexpected behaviour.

fixes #5379
2022-11-02 15:02:29 +00:00
fba4895a17 Merge branch 'next-minor' into next-major 2022-10-31 19:11:39 +00:00
b6f6671a81 Merge branch 'stable' into next-minor 2022-10-31 15:34:24 +00:00
6da467b142 Updated composer dependencies 2022-10-31 15:27:56 +00:00
44af519cd6 SpawnResponsePacketHandler: silence PlayerAuthInputPacket debug spam (#5368) 2022-10-30 19:24:26 +00:00
fb31e6085e StatusCommand: fix condition order for TPS colour (#5366) 2022-10-26 23:26:55 +01:00
e4548da173 4.10.1 is next 2022-10-26 01:19:08 +01:00
0d5287bf0b Release 4.10.0 2022-10-26 01:19:02 +01:00
a9361b3f8b Changes for 1.19.40 2022-10-25 23:11:41 +01:00
6e4c62744e Bump phpstan/phpstan from 1.8.10 to 1.8.11 (#5364)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.8.10 to 1.8.11.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.9.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.8.10...1.8.11)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-25 19:55:01 +01:00
9a0ead6deb Validate paths in --data and --plugins
closes #2861
2022-10-21 14:28:22 +01:00
d74824c8d5 Correctly use Command->getLabel() instead of Command->getName()
getName() essentially serves as an ID for the command for CommandExecutors. It has no other sane use case.

Since it's not unique (multiple commands with the same name may be registered, and the fallback alias will be used on conflict), it cannot be used for array indexing. It's also not correct to use it for any display purpose, since the command may not be able to be invoked by its 'name' if there was a conflict.

There is an open debate about what to do with getName() and the wider CommandExecutor ecosystem, but that's a topic for another discussion.

closes #5344
2022-10-18 19:34:12 +01:00
d4eb73abe9 Bump phpstan/phpstan from 1.8.9 to 1.8.10 (#5351)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.8.9 to 1.8.10.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.9.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.8.9...1.8.10)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-18 16:56:55 +01:00
d1d5020c53 FallableTrait: add default implementation of tickFalling() to reduce Fallable pollution (#5350)
this is only used by concrete powder currently, so it doesn't make much sense to reimplement it in every implementor of Fallable.
2022-10-18 16:56:21 +01:00
9f6c6b2b71 Merge branch 'next-minor' into next-major 2022-10-16 16:58:50 +01:00
bd01a919e5 Move command timings to Timings::
this avoids duplicate timings entries when command labels are changed and changed back, or if multiple command maps are in use.
In addition, it also solves some PHPStan issues :)
2022-10-16 16:57:10 +01:00
0039af984d Merge branch 'next-minor' into item-stack-request 2022-10-16 16:56:26 +01:00
7864294336 Merge branch 'stable' into next-minor 2022-10-16 16:53:14 +01:00
2a910c1cc2 World: more minor documentation improvements 2022-10-16 16:50:42 +01:00
cd04a3db2e World: ensure that addParticle/addSound don't send stuff to players who are not in range, even when an array of targets is given
closes #5347
2022-10-16 16:45:52 +01:00
572def9245 World: Improve quality of type information 2022-10-16 16:21:59 +01:00
20f5bed926 Bump phpstan/phpstan from 1.8.8 to 1.8.9 (#5341)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.8.8 to 1.8.9.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.9.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.8.8...1.8.9)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-16 15:36:01 +01:00
14d17a9546 Remove Erroneous documentation (#5346) 2022-10-16 15:21:35 +01:00
b74c092d9b Server: removed reference to nonexistent API method 2022-10-15 15:06:43 +01:00
53cae8911d Merge branch 'next-minor' into next-major 2022-10-14 21:53:25 +01:00
7bcc663b60 Migrate core code to using symfony/filesystem
webmozart/path-util is retained for plugin compatibility, but is dropped in 5.0
2022-10-14 21:51:29 +01:00
b3bda788d9 Server: Deprecated getPlayerByPrefix()
this is only used for commands anyway, but we can't get rid of it yet.
2022-10-14 21:45:09 +01:00
2cc8a56e68 Server: fixed borked serverCommand timings 2022-10-14 20:02:44 +01:00
b70f7afbd6 Fix CS according to latest version of php-cs-fixer 2022-10-13 21:07:07 +01:00
92783a6db9 Merge branch 'next-minor' into next-major 2022-10-13 21:06:39 +01:00
57deb60355 Merge branch 'stable' into next-minor 2022-10-13 21:03:50 +01:00
92e47b98f8 Updated DevTools submodule to pmmp/DevTools@bd0fa048da 2022-10-13 21:02:39 +01:00
b84c110819 Fix CS according to newest php-cs-fixer 2022-10-13 21:00:57 +01:00
e1b0e00c6f DataPacketSendEvent: add array type validation
this API is used directly by plugins, so anything goes.
2022-10-13 17:10:33 +01:00
774df0fa4c DataPacketSendEvent: added setPackets()
this is an implicit BC break, since plugins may assume that the packets in this array aren't going to change.
However, in practice, it's not likely to cause any real issues.
2022-10-13 17:06:09 +01:00
f88ae93897 BC break: Replaced webmozart/path-util with symfony/filesystem, closes #5332 2022-10-13 16:43:36 +01:00
4fadb63f67 Bump build/php from 50062b5 to 14ed8ea (#5337)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `50062b5` to `14ed8ea`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](50062b5861...14ed8eaadd)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-13 16:29:01 +01:00
c83f0896ac Bump ncipollo/release-action from 1.10.0 to 1.11.1 (#5319)
Bumps [ncipollo/release-action](https://github.com/ncipollo/release-action) from 1.10.0 to 1.11.1.
- [Release notes](https://github.com/ncipollo/release-action/releases)
- [Commits](https://github.com/ncipollo/release-action/compare/v1.10.0...v1.11.1)

---
updated-dependencies:
- dependency-name: ncipollo/release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-13 13:07:03 +01:00
0d29a138fb Bump docker/build-push-action from 3.1.1 to 3.2.0 (#5336)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.1.1...v3.2.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-13 13:06:25 +01:00
421379fc77 SplashPotion: Use World::getCollidingEntities() instead of World::getNearbyEntities() (#5326)
fixes spectator players receiving effects from splash potions
2022-10-11 22:57:35 +01:00
293cea7714 4.9.2 is next 2022-10-11 22:47:58 +01:00
15645759e9 Release 4.9.1 2022-10-11 22:47:54 +01:00
8dc0d506f4 Merge branch 'next-minor' into next-major 2022-10-11 22:29:21 +01:00
8c651ce4b4 t Merge remote-tracking branch 'origin/next-minor' into next-major 2022-10-11 22:06:18 +01:00
db7cee6f22 Player: check if the item meaningfully changed before discarding it in creative
fixes #5220
2022-10-11 22:06:03 +01:00
6ae7cb288e Merge remote-tracking branch 'origin/stable' into next-minor 2022-10-11 21:59:40 +01:00
7df2719fce Update Composer dependencies 2022-10-11 21:57:22 +01:00
10b8dcfdd1 Bump phpstan/phpstan from 1.8.6 to 1.8.8 (#5324)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.8.6 to 1.8.8.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.9.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.8.6...1.8.8)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-07 11:43:39 +01:00
c1fbac412e event: ensure that modifications to items expected to be readonly have no effect
this isn't a very glorious fix, but it's the best I have for now.
2022-10-07 11:33:14 +01:00
3feaa18f6c DelegateInventory: use WeakReference and __destruct to clean up inventory listener
this is more sane, since it allows the delegate to be reused without unexpected behaviour.
2022-09-30 15:12:37 +01:00
1c6a2b66f7 Merge remote-tracking branch 'origin/next-minor' into next-major 2022-09-29 22:38:26 +01:00
41970feb57 Entity: Fire EntitySpawnEvent/ItemSpawnEvent on the first entity tick, instead of in the constructor (#5314)
This allows plugins to modify the entity via setters in EntitySpawnEvent without their changes getting overwritten by setter calls directly after the 'new YourEntity' statement.

As well as benefiting plugins, this also clears a path for a BC-breaking change in PM5 (to have the programmer use addEntity() to spawn entities, instead of the constructor doing it, which will improve on a number of data handling aspects).

fixes #4973

This targets next-minor because it has some side effects on plugins that depended on the old behaviour, such as VanillaHopper, so it's not suitable for a patch release.
2022-09-29 22:30:12 +01:00
0edf2ea6a4 ConcretePowder: fix CS 2022-09-29 21:50:15 +01:00
cd4bb91676 Living: alter eye height so the player doesn't drown on the surface of water when swimming
fixes #4989
2022-09-29 00:15:07 +01:00
2be527060f Sign: Fixed desync of colour and glowing state when using dye on signs
fixes #4932
2022-09-28 23:34:08 +01:00
6f68c6d8a0 Melon: extend Solid instead of Transparent, fixes #5050 2022-09-28 23:07:53 +01:00
ac16378410 Silence pre-spawn PlayerAuthInputPacket debug spam 2022-09-28 21:58:23 +01:00
1f9dfa77bf PreSpawnPacketHandler: emit a separate debug message for sending creative data 2022-09-28 21:58:23 +01:00
0c7f8470b9 Avoid repeated strtolower usages in a couple of places 2022-09-28 21:30:06 +01:00
fc56c041f3 Correct knockback from explosions (#5161) 2022-09-28 21:09:07 +01:00
d6bbf8217d ResourcePackManager: avoid repeated operation 2022-09-28 20:57:17 +01:00
22486dd75e Mushroom: check the light for placement, unless placed on mycelium or podzol (#5054)
The previous behaviour was inconsistent with vanilla.
2022-09-28 18:41:23 +01:00
37ec1193ea Update PHPStan baselines 2022-09-28 18:34:01 +01:00
1366a43c22 Implement Turtle Shell (#5235) 2022-09-28 18:19:15 +01:00
383dc2a2b9 Fix the copper block scrape sound (#5147)
Co-authored-by: Dylan T <dktapps@pmmp.io>
2022-09-28 18:18:53 +01:00
bda0ca23b4 Living: deprecated hasLineOfSight() 2022-09-28 17:34:51 +01:00
b21cd82e94 Allow specifying a key for encrypted resource packs (#5297) 2022-09-28 17:27:33 +01:00
1c7b1e9e5d Fix sugarcane behaviour on fertilizers (#4930) 2022-09-28 16:38:24 +01:00
4b41b2f9ae Merge remote-tracking branch 'origin/next-minor' into next-major 2022-09-28 16:15:35 +01:00
b87e4d8bd3 Introduce and use TextFormat::addBase() (#5268)
This function adds "base" format to a string. The given formats are inserted directly after any RESET code in the sequence.

An example of where this is needed is in the logger.

Without this change, the following code:
$logger->notice("I'm a " . TextFormat::RED . "special" . TextFormat::RESET . " cookie");

causes the "cookie" part of the message to show as grey, instead of the expected aqua for NOTICE level messages.

There are also many workarounds for this problem throughout the server, mostly in command outputs, being forced to use WHITE instead of RESET to avoid breaking the logger output.
2022-09-28 16:13:11 +01:00
a6cc611e9f Merge branch 'next-minor' into next-major 2022-09-28 01:06:11 +01:00
86a2f8e360 Merge branch 'stable' into next-minor 2022-09-28 01:01:51 +01:00
def2f8c145 InventoryManager: ensure the windowID is valid before attempting to remove any window
this is currently a harmless bug, since remove() isn't currently doing any heavy lifting.
2022-09-28 01:01:42 +01:00
6f4ea886b0 Merge branch 'next-minor' into next-major 2022-09-28 00:39:00 +01:00
ed7c95549d PreSpawnPacketHandler: add a bunch of debug messages
this is useful for observing timings during first spawn, so that performance issues can be more easily spotted.
2022-09-27 21:08:31 +01:00
cfb0cad7e0 Console commands now write to stdout directly, instead of being fed through the logger
this has a number of implications:
- Console command outputs are now (obviously) not logged. This is consistent with every other type of command sender, be it RCON, players, or anything else.
- The assumption that the console command sender must be able to see the logger output is now broken, since the command sender can receive output separately from the logs.

In the future, it might be desirable to send the console command output to stderr instead of stdout, so that stdout can be silenced while still allowing commands to be used.

closes #2543
2022-09-27 21:03:03 +01:00
83e5b0adb6 ConsoleCommandSender is no longer responsible for forwarding broadcast messages to the logger (#5311)
This is a step towards implementing #2543.
2022-09-27 20:58:33 +01:00
4650a3bb22 CONTRIBUTING: added a table of what types of changes are accepted by what branches 2022-09-27 18:13:59 +01:00
5e5661de75 Play burp sound when consuming a FoodSource (#5158) 2022-09-27 17:21:55 +01:00
e2f1b10165 Bump phpunit/phpunit from 9.5.24 to 9.5.25 (#5308)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.24 to 9.5.25.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/main/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.24...9.5.25)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-27 17:18:58 +01:00
455f9fa92e Bump tests/plugins/DevTools from bd0fa04 to 95921c6 (#5307)
Bumps [tests/plugins/DevTools](https://github.com/pmmp/DevTools) from `bd0fa04` to `95921c6`.
- [Release notes](https://github.com/pmmp/DevTools/releases)
- [Commits](bd0fa048da...95921c6d87)

---
updated-dependencies:
- dependency-name: tests/plugins/DevTools
  dependency-type: direct:production
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-27 17:18:47 +01:00
dec188d4ad TaskHandler: mark some public methods as @internal (#5310)
closes #5309
2022-09-27 17:17:29 +01:00
2db3498891 Updated DevTools submodule to pmmp/DevTools@bd0fa048da 2022-09-24 21:26:42 +01:00
ab0202ba29 Block: correct documentation for getIdInfo() on PM5 2022-09-24 18:14:18 +01:00
9295afe8b9 Merge branch 'next-minor' into next-major 2022-09-24 18:12:38 +01:00
a7dfa0907c Merge branch 'stable' into next-minor 2022-09-24 18:07:56 +01:00
f448b2e685 Block: Improve documentation for a whole bunch of methods 2022-09-24 18:06:46 +01:00
6a0c54f850 Block: Relocate and document addVelocityToEntity()
maybe we should consider merging this with onEntityInside(), since they are both called for the same reasons? ...
2022-09-24 17:32:02 +01:00
77a18d0aea Block: add documentation for getFrictionFactor()
has no one ever questioned the fact that a higher _friction_ factor _reduces_ the block's friction???
2022-09-24 17:05:38 +01:00
140a809c40 Block: improve documentation of hasEntityCollision() and onEntityInside() 2022-09-24 17:04:42 +01:00
cb7c136035 Added documentation for some base Block classes 2022-09-24 16:54:21 +01:00
1bc8fb1851 BlockStateToObjectDeserializer: reduce code duplication in legacy slab handling 2022-09-24 16:32:02 +01:00
f6a9949942 Remove PlayerCommandPreprocessEvent
closes #4284
2022-09-24 15:35:49 +01:00
18c9ccb01c 5.0.0-ALPHA5 is next 2022-09-24 15:17:54 +01:00
b6289e5807 Release 5.0.0-ALPHA4 2022-09-24 15:17:53 +01:00
24ac543313 Prepare alpha4 changelog 2022-09-24 15:09:33 +01:00
83a136a176 EntityFactory: Avoid code duplication on validation of creation functions (#5294) 2022-09-24 13:55:24 +01:00
3f7d8a3777 Bump phpstan/phpstan-strict-rules from 1.4.3 to 1.4.4 (#5300)
Bumps [phpstan/phpstan-strict-rules](https://github.com/phpstan/phpstan-strict-rules) from 1.4.3 to 1.4.4.
- [Release notes](https://github.com/phpstan/phpstan-strict-rules/releases)
- [Commits](https://github.com/phpstan/phpstan-strict-rules/compare/1.4.3...1.4.4)

---
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-24 13:45:39 +01:00
Ali
3c55db531d HealthBoostEffect: Ensure that current health is within limits after reducing max health on removal(#5303) 2022-09-24 13:45:12 +01:00
1609b11c8e Make blockstate (de)serializer names a bit less verbose 2022-09-24 13:43:00 +01:00
cf9610c710 BlockStateToBlockObjectDeserializer: added mapSimple() for symmetry's sake
this will also make it marginally easier to switch to a unified system.
2022-09-24 13:41:41 +01:00
590eb74703 Make Block(De)Serializer much less nasty to interact with
this makes it a lot less inconvenient to access the primary blockstate serializer/deserializer, which is necessary for registering new blocks.
2022-09-24 13:31:50 +01:00
c24370b8ac CraftingDataCache: Fix Cartography's recipe block name (#5302) 2022-09-23 14:59:44 +01:00
93d4475111 Bump phpstan/phpstan from 1.8.5 to 1.8.6 (#5299)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.8.5 to 1.8.6.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.8.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.8.5...1.8.6)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-23 11:42:50 +01:00
e4fc523251 Introduce Player::sendToastNotification() (#5102) 2022-09-23 11:37:08 +01:00
b39eaaf91f Merge branch 'next-minor' into next-major 2022-09-21 15:07:11 +01:00
7804172846 Player: added API documentation for some functions 2022-09-21 14:46:04 +01:00
7d29ac8293 Merge branch 'stable' into next-minor 2022-09-21 14:21:27 +01:00
481bda8cd5 Bump build/php from cf79c01 to 50062b5 (#5293)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `cf79c01` to `50062b5`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](cf79c01722...50062b5861)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-21 12:43:06 +01:00
d1c75da14b Player: lock flight state in spectator mode
players should not be able to stop flying in spectator mode
2022-09-20 21:53:51 +01:00
89e29448ee Merge branch 'stable' into next-minor 2022-09-20 20:18:06 +01:00
66e70e5b0e 4.9.1 is next 2022-09-20 20:09:38 +01:00
785dc71256 Release 4.9.0 2022-09-20 20:09:38 +01:00
d459afaa54 fix CS 2022-09-20 20:00:40 +01:00
db586233da Changes for 1.19.30 support 2022-09-20 19:50:27 +01:00
23e98a30f5 ItemEntity: don't ignore parent's savable state 2022-09-20 14:50:35 +01:00
5bc7ca6569 ItemEntity: disable saving if the contained item is air or has a zero count 2022-09-20 14:45:10 +01:00
f39d2a9be3 bootstrap: update JIT warning 2022-09-20 14:43:05 +01:00
2a982d48ad Do not always make the coral dead immediately after placement (#5149) 2022-09-17 17:48:23 +01:00
47d98af6ac Bump ramsey/uuid from 4.5.0 to 4.5.1 (#5292)
Bumps [ramsey/uuid](https://github.com/ramsey/uuid) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/ramsey/uuid/releases)
- [Changelog](https://github.com/ramsey/uuid/blob/4.x/CHANGELOG.md)
- [Commits](https://github.com/ramsey/uuid/compare/4.5.0...4.5.1)

---
updated-dependencies:
- dependency-name: ramsey/uuid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 12:53:46 +01:00
9f97654f6f Update InstantDamage and Regeneration values (#5279) 2022-09-15 20:26:37 +01:00
f80ffd8de0 Merge branch 'next-minor' into next-major 2022-09-15 13:59:21 +01:00
82ba7903c8 Fixed wrong key being used for entity type ID in save data (#5288)
closes #5260
2022-09-15 13:40:48 +01:00
441b06f6c7 Merge branch 'stable' into next-minor 2022-09-15 12:44:53 +01:00
112974758e Updated PHPStan to 1.8.5 2022-09-15 12:13:50 +01:00
313850eec4 Updated composer dependencies 2022-09-15 12:08:36 +01:00
a82923acb4 Updated Actions PHP versions 2022-09-15 12:03:36 +01:00
67887afd6b Updated php-cs-fixer version for Actions 2022-09-15 12:03:04 +01:00
3d03bb1301 Fix CS 2022-09-15 12:01:26 +01:00
c063198b89 Fixed incorrect array key type in BrewingStandTest 2022-09-02 20:01:52 +01:00
f3ca6de1eb shut 2022-09-02 20:00:52 +01:00
88eafdd614 Improve type info for RegistryTrait::getAll() and its users 2022-09-02 19:57:22 +01:00
6dd5fec4ea ExperienceManager: remove superfluous doc comment 2022-09-02 19:38:23 +01:00
6866c86d39 BaseInventory: fix CS 2022-09-02 19:36:45 +01:00
a735a69870 BaseInventory: improve type info available to setContents() and internalSetContents() 2022-09-02 19:36:08 +01:00
a0ea74c08f Inventory: Improve quality of type info of arrays 2022-09-02 19:34:12 +01:00
ca4b8a5827 World: remove local static recursion guard variable, closes #3125 2022-09-02 19:24:09 +01:00
f88c4d9a8c Remove more unnecessary local static variable usages
these are never mutated. Local constants would be better, if we had those.
2022-09-02 19:19:04 +01:00
66cd156d80 Utils: use static property for core count cache, instead of local static variable 2022-09-02 19:18:01 +01:00
222049927a Language: fixed bogus callable reference in array_map
for some reason phpstan only reports this under checkImplicitMixed.
2022-09-02 19:15:05 +01:00
d72e947d15 BlockFactory: avoid unnecessary local static variable usage
phpstan treats these as always mixed, because it can't be sure what their types will be.
2022-09-02 19:14:35 +01:00
770cca2efa Server: harden response handling for crash report submission
this eliminates some checkImplicitMixed errors in phpstan.
2022-09-02 19:13:54 +01:00
033dac3d16 Server: be explicit about the player promise resolver type
since there's no way for phpstan to infer the type of this, it becomes implicit mixed, which can conceal bugs.
2022-09-02 19:13:16 +01:00
1ee02d7e02 Do not install pocketmine/locale-data 2.8.9 (it's incorrectly versioned)
the changes made in 2.8.9 should have been released as a new minor version, not a patch.
2022-09-02 18:43:39 +01:00
85678aa356 phpstan 1.8.3 2022-09-02 18:28:33 +01:00
1d253bc8c2 Utils: remove 32-bit specific code from javaStringHash()
this was necessary in the days of 32-bit, but for 64-bit, the 0xffffffff mask is sufficient and produces the exact same result.
2022-09-02 18:23:49 +01:00
973a56ab28 Update composer dependencies 2022-09-02 18:02:16 +01:00
9e0b4621be Fixed languages-not-found bug (#5272)
* Fixed languages-not-found bug

* Update Language.php

Co-authored-by: Dylan T <odigiman@gmail.com>
2022-09-02 03:51:31 +01:00
ffb3af3e0d fix CS 2022-09-02 00:59:58 +01:00
b3f03d7ae6 Poll console on the main thread, instead of using a separate thread
There's no need to use an extra thread for this, since there's no concern of a socket getting stuck in a blocking read.

This is one less thing that can go wrong because of pthreads.
2022-09-02 00:58:49 +01:00
2585160ca2 ConsoleReaderChildProcess: Commit suicide if the parent process dies and doesn't clean up
This happens if the main server process was forcibly killed, e.g. by the kill command on Linux, or taskkill/TaskManager on Windows.

Previously, the process would stick around as a zombie, which messed up terminals in some cases (e.g. git bash), though even having zombies with no side effects is bad enough.
2022-09-02 00:25:31 +01:00
14d3e6c7d5 Allow disabling the console reader via pocketmine.yml
Useful to save resources on headless servers where the console is never used (e.g. hosted server, Docker, etc.)
2022-09-01 23:43:54 +01:00
65ec318c30 PluginManager: Ensure dependents are disabled before dependencies in disablePlugins() (#5227)
this could later be expanded to disablePlugin() to make this disable order mandatory, to provide certainty for plugin devs.

Alternative solutions to this include disabling plugins in the opposite order that they were enabled in, but this doesn't allow for random plugin disables. This way seemed to make sense.
2022-08-31 18:43:30 +01:00
a25cb3741a Limit valid supporting blocks of dead bush (#5055) 2022-08-31 02:18:18 +01:00
b7a15b6e01 Bump phpunit/phpunit from 9.5.23 to 9.5.24 (#5266)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.23 to 9.5.24.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/main/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.23...9.5.24)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-31 02:11:18 +01:00
456439566b Language: treat empty translation files the same as missing ones 2022-08-31 01:53:15 +01:00
d5762d3f44 Item: allow describing type data to a reader as well as a writer
we don't currently need this, but it's better to have it in case we need it after PM5 release.

This is also now consistent with blocks.
2022-08-27 19:18:30 +01:00
5c5d96d00b ItemBlock: remember fuel time, fireproof and max stack size
this avoids repeatedly creating blocks for no reason when calling these methods.

This does assume that these methods always return the same result for a given block type, but I think that's a fair enough assumption.
2022-08-27 18:04:11 +01:00
4dabac8420 Merge branch 'next-minor' into next-major 2022-08-27 17:28:06 +01:00
5b89833d5c Merge branch 'stable' into next-minor 2022-08-27 17:27:15 +01:00
fb25e05416 InventoryManager: fixed current window getting removed in race conditions with close window ACK
this could be observed by pressing E and immediately clicking a chest, which, if timed correctly, would lead to the chest lid closing, but the inventory being opened anyway.
2022-08-27 17:26:43 +01:00
7fd4c12ea1 First look at (mostly) unified item serializer registrar
this halves the amount of code needed to implement most items.
2022-08-27 15:10:55 +01:00
78b5be8dd0 4.8.2 is next 2022-08-26 19:16:39 +01:00
0a92e91a30 Release 4.8.1 2022-08-26 19:16:39 +01:00
b3a13a2f21 in future, do not allow Copilot to write changelogs ... 2022-08-26 19:13:13 +01:00
08b9495bce DyeColorIdMap: fixed uninitialized offset error on invalid dye colours 2022-08-26 18:58:00 +01:00
4bd2325828 Remove obsolete TreeType magic numbers 2022-08-26 17:07:35 +01:00
64ac20173b ItemDeserializer: remove unnecessary code
these are legacy IDs and are upgraded to modern IDs before ever reaching this code.
2022-08-26 17:06:09 +01:00
ca3612e4ff Preparations for attempted unification of ItemSerializer and ItemDeserializer 2022-08-26 16:18:13 +01:00
6799dcff51 StringToItemParser: improve some readability slightly 2022-08-26 15:54:21 +01:00
5779622235 Bump phpunit/phpunit from 9.5.22 to 9.5.23 (#5252)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.22 to 9.5.23.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/main/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.22...9.5.23)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-25 19:29:25 +01:00
d4c4ae3d7a Merge branch 'next-minor' into next-major 2022-08-25 19:27:29 +01:00
c16893cbac Merge branch 'stable' into next-minor 2022-08-25 19:25:19 +01:00
7f175b47e6 Fix CS 2022-08-25 18:19:22 +01:00
0e73ffe555 CrashDump: Added JIT mode to data
this is necessary for identifying JIT-specific bugs, which, unfortunately, are very common.
2022-08-25 17:39:40 +01:00
1ffd38b37b Utils: fixed currentTrace() when xdebug is loaded, but not in develop mode
this is really dumb... why does it register the functions at all if they aren't usable ???
2022-08-25 16:56:26 +01:00
bd13f39156 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2022-08-24 20:04:15 +01:00
0c446c276c 4.8.1 is next 2022-08-24 20:03:57 +01:00
0284e65f60 Release 4.8.0 2022-08-24 20:03:56 +01:00
b0d787b3d3 Update BedrockProtocol for 1.19.21 2022-08-24 19:54:41 +01:00
65e3ed43d5 Bump build/php from e90ff50 to cf79c01 (#5248)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `e90ff50` to `cf79c01`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](e90ff50310...cf79c01722)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-24 18:47:04 +01:00
75eba9c9ed 4.7.4 is next 2022-08-22 19:28:47 +01:00
b5a049d1fe Release 4.7.3 2022-08-22 19:28:43 +01:00
bd9fcffe62 Bump build/php from f292501 to e90ff50 (#5242)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `f292501` to `e90ff50`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](f292501a70...e90ff50310)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-22 14:42:17 +01:00
feffbc2c5b Bump phpunit/phpunit from 9.5.21 to 9.5.22 (#5243)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.21 to 9.5.22.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/main/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.21...9.5.22)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-22 14:33:16 +01:00
53b51c99b4 Bump pocketmine/locale-data from 2.8.6 to 2.8.7 (#5244)
Bumps [pocketmine/locale-data](https://github.com/pmmp/Language) from 2.8.6 to 2.8.7.
- [Release notes](https://github.com/pmmp/Language/releases)
- [Commits](https://github.com/pmmp/Language/compare/2.8.6...2.8.7)

---
updated-dependencies:
- dependency-name: pocketmine/locale-data
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-22 14:32:50 +01:00
5cb77c8365 GiveCommand: fix CS 2022-08-22 00:55:17 +01:00
bf8befc40b Remove dead comment on GiveCommand (#5241) 2022-08-22 00:49:22 +01:00
f75ca312cc Worker: Unstack tasks in a synchronized block
this prevents any tasks still left in the queue on shutdown getting pulled out by the worker when we're attempting to shut it down.
This led to various race conditions, most notably weird cases where PopulationTask would inexplicably find its expected generator state had not been correctly set up.
2022-08-21 21:57:11 +01:00
d144832928 GiveCommand: limit max amount in line with vanilla 2022-08-21 21:19:16 +01:00
709a869045 Vines can now only be placed on full cube blocks (#5053)
fixes #2673
2022-08-21 21:04:24 +01:00
ac056044ce Updated PHPStan baseline 2022-08-21 20:46:38 +01:00
fc8434308b SignText: changed misleading documentation
this looks like a leftover from the days when sign text was handled by the tile directly
2022-08-21 20:45:23 +01:00
5426b41447 InventoryTransaction: prevent client-authoritative item overstacking
this cheat is often used to carry more items in the inventory, wear multiple pieces of armour in one slot, and more.
2022-08-21 20:35:23 +01:00
af2babec23 GiveCommand: do not accept negative amounts 2022-08-21 20:28:39 +01:00
fedd541663 Dye now can be used to change Sign text color (#4690) 2022-08-21 20:05:09 +01:00
1ecb10acba Merge branch 'next-minor' into next-major 2022-08-21 19:19:07 +01:00
5d5366a7c8 Merge branch 'stable' into next-minor 2022-08-21 19:11:59 +01:00
717ab1989a Update setup-php-action to pmmp/setup-php-action@82a44d659b 2022-08-21 18:14:07 +01:00
83db186b6a Updated setup-php-action to pmmp/setup-php-action@e128aee02f 2022-08-20 18:53:08 +01:00
6a4e5aba8b Update setup-php-action to pmmp/setup-php-action@330b4c2940 2022-08-20 18:03:30 +01:00
c13170a00b Avoid implicit integer cast in Normal::pickBiome()
this throws deprecation warnings on PHP 8.1.
2022-08-20 17:16:38 +01:00
98778052bb actions: start building on 8.1 2022-08-20 16:32:36 +01:00
e86e8254a8 Workaround PHPStan "feature" phpstan/phpstan#7701 2022-08-20 16:29:26 +01:00
1b852ac290 bootstrap: do not complain about xdebug if mode is 'off'
if xdebug.mode=off, the performance impact is the same as if xdebug wasn't loaded.
2022-08-19 16:45:40 +01:00
10b799fadb Bump shivammathur/setup-php from 2.21.1 to 2.21.2 (#5238)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.21.1 to 2.21.2.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.21.1...2.21.2)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-19 15:51:44 +01:00
bc5008334a Bump pocketmine/locale-data from 2.8.3 to 2.8.6 (#5239)
Bumps [pocketmine/locale-data](https://github.com/pmmp/Language) from 2.8.3 to 2.8.6.
- [Release notes](https://github.com/pmmp/Language/releases)
- [Commits](https://github.com/pmmp/Language/compare/2.8.3...2.8.6)

---
updated-dependencies:
- dependency-name: pocketmine/locale-data
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-19 15:51:04 +01:00
3235d128e5 Fixed handling of fake requests during block placement and other actions 2022-08-18 18:25:49 +01:00
2b7510945a First look at ItemStackRequest usage (very unstable) 2022-08-18 17:38:57 +01:00
d6af2b12f4 Merge branch 'complex-inventory-rewrite' into next-minor 2022-08-18 17:30:00 +01:00
ad2d59923c Merge branch 'stable' into next-minor 2022-08-18 17:06:15 +01:00
792c1b62b7 Introduce and use TransactionBuilder for inventory evacuations 2022-08-18 17:04:12 +01:00
e90abecf38 Rewrite InventoryManager handling of complex mapped inventories
this turned out to be necessary when dealing with the ItemStackRequest system.
2022-08-17 14:42:30 +01:00
575dd47db7 4.7.3 is next 2022-08-16 17:51:26 +01:00
e4a5defabb Release 4.7.2 2022-08-16 17:51:26 +01:00
6e8f11d5e8 UnknownBlock: fixed type data encoding 2022-08-16 17:42:18 +01:00
c9626c610b Skin: Correctly handle errors produced by commented JSON decoder 2022-08-16 17:35:23 +01:00
b65e0f64f6 Implement Suspicious Stew (#5224) 2022-08-16 17:26:32 +01:00
8fb7fff6b9 Update SECURITY.md 2022-08-16 17:22:22 +01:00
5c8d8ff61f Update SECURITY.md 2022-08-16 17:04:25 +01:00
99b55f7427 actions: use newer php-cs-fixer 2022-08-15 17:26:42 +01:00
dce8bd6d21 CS: Standardize new with braces 2022-08-15 17:16:23 +01:00
8fa81242d6 Sugarcane: fixed support conditions (#5052) 2022-08-15 17:08:26 +01:00
223de3ad23 Implement Fire Charge (#5225) 2022-08-15 17:00:58 +01:00
2f4a9469b6 Player: spectator shouldn't able to pick blocks they don't have (#5111)
Jury is out on whether they should be able to pick blocks at all, or be considered to have infinite resources, but this solution has been used in a few other places already anyway, so it can be cleaned up another time.
2022-08-15 16:48:37 +01:00
8e97e9dcda SimpleCommandMap: Enforce command permissions by default (#4681)
this resolves many security issues, as well as removing a ton of boilerplate code.
It may be desirable to react to permission denied; this can be done by overriding Command->testPermission(), or by using setPermissionMessage() to set a custom permission denied message.
2022-08-15 16:42:51 +01:00
304bb84af2 BlockFormEvent: Added getCausingBlock() method (#5226) 2022-08-15 16:26:48 +01:00
cb020988d4 5.0.0-ALPHA4 is next 2022-08-14 20:12:25 +01:00
eeb95872ea Release 5.0.0-ALPHA3 2022-08-14 20:12:24 +01:00
1b0d353fa3 Merge branch 'next-minor' into next-major 2022-08-14 20:11:40 +01:00
4d34885b15 Merge branch 'stable' into next-minor 2022-08-14 20:11:10 +01:00
c5b2488fc1 oh come on... 2022-08-14 20:02:07 +01:00
d62df585f2 4.7.2 is next 2022-08-14 19:56:00 +01:00
19d7c2b552 Release 4.7.1 2022-08-14 19:55:56 +01:00
d4f96a155a Support axis rotation of Muddy Mangrove Roots (implemented in 1.19.20) 2022-08-14 18:53:01 +01:00
43a3151de3 Merge branch 'next-minor' into next-major 2022-08-14 18:49:19 +01:00
f7ab0a3b92 Merge branch 'stable' into next-minor 2022-08-14 18:37:56 +01:00
bf4f6e5d53 Bamboo: fixed supporting block requirements (#5196) 2022-08-14 17:37:55 +01:00
036e06e889 Revert "Workaround items in blockentity NBT not being processed correctly in 1.19.10"
This reverts commit 2b61c025c2.
2022-08-14 17:25:55 +01:00
9343a0b800 Added build log link to Discord release embed 2022-08-14 17:20:01 +01:00
14b4644b03 Added build_log_url to build_info.json 2022-08-14 17:20:01 +01:00
464b65b25c Bump docker/build-push-action from 3.1.0 to 3.1.1 (#5213)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-12 21:11:11 +01:00
f1c571a528 WaterCauldron: fixed dye not being cleared when using water bottles or buckets, close #5221 (#5222) 2022-08-12 21:10:31 +01:00
15586ed80e Fix CS 2022-08-12 21:09:15 +01:00
0f8ad8ecf7 Update permission doc output format 2022-08-12 20:47:38 +01:00
82b9afef77 Allow generating RST permission summaries, to be used on doc.pmmp.io 2022-08-12 18:00:52 +01:00
2fc84f6c67 ItemFactory: treat durables with negative meta as unknown items
fixes #5117
2022-08-12 17:24:43 +01:00
566f5935a3 CraftingManagerFromDataHelper: do not register recipes with unknown outputs
fixes #5093

we don't need to check the inputs, since unknown input items shouldn't be obtainable anyway.
2022-08-12 17:19:47 +01:00
44e4dabf6e Fixed Turtle Master potions giving no effects 2022-08-12 17:05:08 +01:00
8acc535218 ffs 2022-08-09 19:27:54 +01:00
e9a1cb7ce5 4.7.1 is next 2022-08-09 19:24:02 +01:00
a21419d120 Release 4.7.0 2022-08-09 19:24:01 +01:00
c2b599166c Added new shiny webhook for Discord release notifications 2022-08-09 19:21:36 +01:00
df7a1fcba6 Changes for 1.19.20 2022-08-09 19:06:05 +01:00
d77a95e4af actions/draft-release: bake the full changelog blob URL into the release notes, to ensure it works properly in emails and embeds 2022-08-06 15:49:04 +01:00
5c72807b16 Bump shivammathur/setup-php from 2.21.0 to 2.21.1 (#5199)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.21.0 to 2.21.1.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.21.0...2.21.1)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  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>
2022-08-06 15:39:36 +01:00
5c6927e16c 4.6.3 is next 2022-08-06 15:35:47 +01:00
9abbb85a93 Release 4.6.2 2022-08-06 15:35:47 +01:00
554182b2cb Update composer dependencies 2022-08-06 15:27:11 +01:00
d669a6f0c7 ReversePriorityQueue: add ReturnTypeWillChange attribute
it's doubtful any plugin dev is extending this, but nonetheless, we can't change it in a patch.
2022-07-27 03:51:06 +01:00
723ae9eca0 Fixed tallgrass being unplaceable since d9b050fb68 (#5197) 2022-07-27 02:43:05 +01:00
79125b8426 Added APIs to get a new unique block/item type ID
this centralization is needed to avoid conflicts between different plugins fighting over the same hardcoded IDs.
2022-07-24 22:02:47 +01:00
6ba3b39541 Added tests for BlockTypeIds and ItemTypeIds 2022-07-24 21:57:51 +01:00
f4de4bd971 Fixed FloatingTextParticle merge error 2022-07-24 21:41:40 +01:00
c8a8e33fc1 Merge branch 'next-minor' into next-major 2022-07-24 21:24:08 +01:00
16ed16722a Merge branch 'stable' into next-minor 2022-07-24 21:21:37 +01:00
42f9336f7a Split packet receive timings into decode and handle subcomponents 2022-07-24 21:16:52 +01:00
5d9f783037 InGamePacketHandler: do not update player rotation if it didn't change
setRotation() does an alarmingly large amount of work...
2022-07-24 21:07:35 +01:00
01ca14c314 InGamePacketHandler: avoid processing movement if position is unchanged since last tick 2022-07-24 21:00:12 +01:00
608c6ed6db Improved suboptimal code in Player::handleMovement() 2022-07-24 20:51:28 +01:00
c26631d06d InGamePacketHandler: avoid useless object allocations when forceMoveSync=false (99.9% of the time) 2022-07-24 20:44:27 +01:00
b75bc61a64 InGamePacketHandler: don't bother checking for flag changes if the flag fields are identical
we don't need to check this on a bit by bit level if the integers are the same.

this saves 2-3 microseconds per packet on my machine, which doesn't sound like much, but it adds up when there are lots of players.
2022-07-24 20:35:49 +01:00
3724479be3 InGamePacketHandler: improve performance of input flag resolving 2022-07-24 20:33:35 +01:00
eb916fe43d Use a falling block entity to improve client side performance of FloatingTextParticle (#4714)
Performance tests show that this has a considerable client-side performance advantage over using players. In my local tests, using 1000 floating texts in a 10x10x10 area, I observed an FPS increase from 1.5 to 8.0.
2022-07-24 18:22:21 +01:00
5e3b3a0700 Fix assert spam on debug clients 2022-07-24 17:51:02 +01:00
e3640907ba fix PHPStan 2022-07-24 00:14:17 +01:00
d9b050fb68 First look at using (very) basic tags for dynamic block properties
this allows plugins to, for example, add their own custom dirt-like blocks which support having flowers placed on them.
2022-07-24 00:08:02 +01:00
817591910b Fix CS 2022-07-23 21:01:49 +01:00
6a2315a63d Accept BlockTypeInfo in Block constructor, instead of BlockBreakInfo
this will allow more stuff to be passed via the constructor without having to change dozens of classes to do it.
2022-07-23 20:42:54 +01:00
89b784734e Fixed crimson/warped planks being usable as furnace fuel 2022-07-23 18:45:57 +01:00
b751207969 Added missing blast resistance to Crying Obsidian 2022-07-23 18:24:09 +01:00
cffa3b8a72 Reduce BlockBreakInfo code width further by specializing for common tool types
this considerably reduces width and makes adding new stuff much less irritating.
2022-07-23 18:21:04 +01:00
91e91b1d9f Reduce code width when tool tiers are given to BlockBreakInfo
this is the majority of uses of harvest level
2022-07-23 17:56:08 +01:00
102406ee79 Added froglights 2022-07-23 17:40:38 +01:00
4419161a49 Updated consistency check 2022-07-23 17:39:26 +01:00
38e495babf Added mangrove roots and muddy mangrove roots 2022-07-23 17:20:23 +01:00
17635e770b ................. 2022-07-23 16:49:58 +01:00
b13f333b2e Added mud and packed mud 2022-07-23 16:40:46 +01:00
a7313ed9d9 Added rooted dirt 2022-07-23 16:12:17 +01:00
e10a624444 4.6.2 is next 2022-07-22 19:35:10 +01:00
b20e04539d Release 4.6.1 2022-07-22 19:34:57 +01:00
4852f8029a AsyncTask: update documentation 2022-07-21 23:26:46 +01:00
bedf79e2cd BaseWorldProvider: don't crash the server when encountering an unknown block 2022-07-21 16:12:27 +01:00
f6c9bf5cd1 Merge branch 'next-minor' into next-major 2022-07-20 20:55:33 +01:00
2d2df22ee7 Ignore some PHPStan errors 2022-07-20 20:47:34 +01:00
2940547026 Eliminate repeated calls to Position->getWorld()
as well as improving readability, it also improves performance in some areas.
2022-07-20 20:44:05 +01:00
24e72ec109 ContainerTrait: improve performance of block destroy hook
this was creating useless vector3s for every iteration, as well as repeatedly invoking Position->getWorld() for no reason.
2022-07-20 20:39:37 +01:00
47adcf763d LegacyStringToItemParser: special-case air, which the item deserializer doesn't recognize 2022-07-20 20:20:14 +01:00
67682cbf27 Added chorus plant and flower 2022-07-20 20:19:36 +01:00
c1acf44337 Implement cauldrons (#5163)
the following things are currently not implemented:

- particle/sound effects when an entity extinguishes itself
- particle/sound effects when mixing different stuff in a cauldron
- powder snow cauldron

both of these things are contingent on #5169, but for the time being, the PR is functionally complete and I want to move on to something else without being stalled by the particle+sound problem (which I haven't yet decided how to solve).
2022-07-20 16:12:58 +01:00
466307a43f Attempting to reduce IDE performance hit of working in StringToItemParser 2022-07-20 15:46:43 +01:00
44c4118080 fix CS again 2022-07-20 15:22:47 +01:00
c4f85e526b Bump shivammathur/setup-php from 2.20.0 to 2.21.0 (#5181)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.20.0 to 2.21.0.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.20.0...2.21.0)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-20 15:19:21 +01:00
6cee428287 Bump docker/build-push-action from 3.0.0 to 3.1.0 (#5182)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-20 15:18:38 +01:00
bcba064d69 Bump build/php from 1110349 to f292501 (#5180)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `1110349` to `f292501`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](11103498ca...f292501a70)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-20 15:16:34 +01:00
2fa92e5e02 erge branch 'next-minor' into next-major 2022-07-19 20:36:09 +01:00
dbc0b9634b Merge branch 'stable' into next-minor 2022-07-19 20:35:47 +01:00
86647683bc fix CS again 2022-07-19 20:35:34 +01:00
fa201b081c Added spore blossoms
I got tired of the flood of warning messages every time someone joined the dev server...
2022-07-19 20:28:12 +01:00
de3bbb71fa Merge branch 'next-minor' into next-major 2022-07-19 20:20:30 +01:00
040516054f Merge branch 'stable' into next-minor 2022-07-19 20:20:10 +01:00
64f0e58e60 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2022-07-19 20:17:15 +01:00
62f21516d1 build/generate-registry-annotations.php: allow processing a single file
this is useful for automatically invoking the script via a PhpStorm file watcher.
2022-07-19 20:17:07 +01:00
c553f7cf06 build/generate-registry-annotations.php: write to stderr on error 2022-07-19 20:15:44 +01:00
eccfb3bbe2 World: fix borked check 2022-07-19 17:59:53 +01:00
87b840ff97 Added a hack to allow tiles to trigger client-side render updates on blocks without actually changing the block
Bedrock block entity updates don't directly trigger block rendering
updates. This is a problem when the block entity data affects the
block's appearance directly (e.g. cauldron water colour, flower pot
contents), because it means changing them won't directly result in a
client-side render update.

This hack allows tiles to spoof block updates without actually changing
the server-side block, keeping the internals and API clean of random
shitbox workarounds.

fixes #5174
fixes #4944
2022-07-19 17:47:46 +01:00
f64e306fb8 Make BlockIdMetaUpgrader API less dumb
the old impl prevented registering more than one meta -> state mapping since the legacy numeric ID map would throw an exception if attempting to map the same ID more than once.
2022-07-19 16:21:56 +01:00
9a8902d1fe LegacyToStringMap: don't throw if the existing mapping is the same as the one we want to register
this was making it inconvenient for plugins to use BlockIdMetaUpgrader->addMapping(), because the block legacy ID map contains IDs up to 1.16, but the table of mapped 1.12 blockstates only goes up to ... well ... 1.12. This left a gap of several versions' blocks unable to be mapped.
2022-07-19 16:08:05 +01:00
b36b65927c BlockDataUpgrader: expose BlockIdMetaUpgrader via getter 2022-07-19 16:02:35 +01:00
afaf9dbc88 Rename LegacyBlockStateMapper -> BlockIdMetaUpgrader
this more accurately describes what it's used for.
2022-07-19 15:32:08 +01:00
b0a492c063 Move simple block (de)serializer registrations into their own functions 2022-07-18 18:47:30 +01:00
6d4279671e A giant hack to cut down code needed for runtime block serialization by 50%
this also avoids repeated information and inconsistencies.
2022-07-18 18:25:41 +01:00
cf34f88a67 Make Block::decodeState() and encodeState() more codegen-friendly 2022-07-18 15:48:03 +01:00
b8d1b00985 phpstan fail very sad :( 2022-07-18 15:26:14 +01:00
8660dfe576 Generate traits for runtime enum serialization instead of helper classes 2022-07-18 15:16:33 +01:00
172bd9a129 ... 2022-07-17 21:24:27 +01:00
012b668537 Avoid bogus assumptions about block and item NBT on tiles 2022-07-17 21:23:41 +01:00
fec89b7803 Lava burns entities for only 8 seconds in Bedrock (#5173) 2022-07-17 20:50:15 +01:00
4f2f9b4352 Block::readStateFromWorld() now returns the block object that should be used for the target position
this enables changing the block type completely if the situation calls for it.
2022-07-16 20:04:08 +01:00
b3f8b5ff37 Fix CS 2022-07-16 20:01:29 +01:00
81edb1bed4 GlassBottle: implement filling using API changes from 4afd3dcabf
closes #4827
2022-07-16 20:00:43 +01:00
d0ff6d2e36 Enable various types of interaction to return items to the player, without needing to have a bunch of boilerplate creative mode and held item checks
it became glaringly obvious that this was needed because of #4827 and #4868.

this is further needed with the addition of cauldrons.
2022-07-16 19:50:33 +01:00
4afd3dcabf Merge branch 'next-minor' into next-major 2022-07-16 15:11:19 +01:00
4e3964ffce Armor: added clearCustomColor() 2022-07-16 15:10:07 +01:00
c7f5215a51 5.0.0-ALPHA3 is next 2022-07-14 22:54:29 +01:00
66f2116e57 Release 5.0.0-ALPHA2 2022-07-14 22:54:28 +01:00
c15c59ae0d changelog for 5.0.0-ALPHA2
[ci skip]
2022-07-14 22:52:07 +01:00
07786dc4bc RuntimeDataWriter: fixed doc comment 2022-07-14 22:51:12 +01:00
259f44e57c Merge branch 'next-minor' into next-major 2022-07-14 22:05:04 +01:00
93254523e6 Merge branch 'stable' into next-minor 2022-07-14 22:04:38 +01:00
2b61c025c2 Workaround items in blockentity NBT not being processed correctly in 1.19.10
closes #5154

this hack sends only the bare essential data to create the tiles in LevelChunkPacket,
and then separately sending the full tile data using BlockActorDataPacket afterwards.

This is necessary because the client doesn't handle items correctly in NBT when chunks are sent without using the SubChunkRequest system.
In 4.6 this is observed with incorrect items shown in item frames; in 5.0 it's seen with items simply not showing up at all (difference due to modernization of the serialization format in 5.0).
2022-07-14 21:54:01 +01:00
e5804df24b Merge branch 'next-minor' into next-major 2022-07-14 20:59:13 +01:00
e00f8e3a32 Merge branch 'stable' into next-minor 2022-07-14 20:59:06 +01:00
c8320fe849 Merge branch 'next-minor' into next-major 2022-07-14 20:50:49 +01:00
e2855aadff Simplify handling of broken transactions for crafting and friends
this allows stuff like smithing tables to work without needing any extra hacks.

Implementing enchanting or anvils would require some extra work, but I don't plan to implement those under the legacy transaction system anyway.
2022-07-14 20:50:06 +01:00
21ed5a450f Updated BlockFactory consistency check 2022-07-14 20:42:16 +01:00
ba2baba7cc Added netherite blocks and items 2022-07-14 20:39:09 +01:00
c7133bc2e6 InGamePacketHandler: don't kick the player out of inventory windows on actor events
this is sent when the player crafts something using an anvil.
2022-07-14 20:36:11 +01:00
d4f4fda442 Merge branch 'next-minor' into next-major 2022-07-14 19:54:50 +01:00
4d6ec66270 Merge branch 'stable' into next-minor 2022-07-14 19:54:38 +01:00
baf75089f5 Entity: cancel fire damage for fireproof entities 2022-07-14 19:53:25 +01:00
b4ce5ed515 ItemDeserializer: throw a more specific exception on unknown items 2022-07-14 19:16:15 +01:00
eb8fb63409 Added cartography and smithing tables
these have working inventories, and their crafting menus will 'just work' once the items for the associated recipes have been implemented (maps, netherite).
2022-07-14 18:01:47 +01:00
Ali
705df7d508 EffectManager: remove redundant check (#5153) 2022-07-14 17:56:18 +01:00
91719051e2 BlockStateToBlockObjectDeserializer: removed TODO mess
these were useful when writing the initial version from scratch; not so much for implementing random blocks
2022-07-14 16:50:08 +01:00
d321094081 Added hanging roots 2022-07-14 16:47:55 +01:00
323d31005f Added glowing item frames 2022-07-14 16:24:20 +01:00
0c7370e564 Added wither rose 2022-07-14 16:07:16 +01:00
3dd4c42fd3 Merge branch 'next-minor' into next-major 2022-07-14 16:06:35 +01:00
f1a63098bd Merge branch 'stable' into next-minor 2022-07-14 16:06:15 +01:00
75d7adfb2d WitherEffect: fixed incorrect damage interval 2022-07-14 16:05:35 +01:00
7dd8876515 TNT: remove the old unreliable way of ignition on burning arrow collide 2022-07-14 00:23:12 +01:00
d0067cfac5 TNT now ignites when hit by a burning projectile 2022-07-14 00:12:02 +01:00
eafc23c756 Added candles and cakes with candles 2022-07-13 23:54:41 +01:00
20cb67461f Block: add the current class to the exception messages for block runtime data serialization 2022-07-13 19:50:35 +01:00
8b2d941502 Offset integer ranges in runtime block data serialization
this is useful for stuff like snow layers where the range doesn't start at 0.
2022-07-13 19:49:30 +01:00
dea0207e4e Merge branch 'next-minor' into next-major 2022-07-13 17:06:04 +01:00
4b1052022c Merge branch 'stable' into next-minor 2022-07-13 17:00:58 +01:00
32f9fcd4e9 Ignore coral_hang_type_bit on coral_fan_hang3
it's always written, but never used.
2022-07-13 16:38:37 +01:00
9d535e2917 4.6.1 is next 2022-07-13 01:28:42 +01:00
3ccd288afd Release 4.6.0 2022-07-13 01:28:37 +01:00
06655bee78 Updated to 1.19.10 2022-07-13 00:59:49 +01:00
2ba51567d8 RuntimeBlockMapping: avoid keeping two copies of the same blockstate data in memory 2022-07-10 17:41:01 +01:00
14933a731b Implement copper waxing, unwaxing and scraping, minus particles
there is a LevelEvent for the particles, but it's both particle and sound, which doesn't integrate well with the existing API.
2022-07-10 01:00:13 +01:00
a22276e679 there's always one ... 2022-07-10 00:19:27 +01:00
260e54e4b1 Skeleton for copper blocks, stairs and slabs 2022-07-10 00:18:35 +01:00
a44c089f98 REEEEEEEEEEEEEE 2022-07-09 20:40:18 +01:00
5e70ae2066 Added lightning rods 2022-07-09 20:18:22 +01:00
ad7528e3f3 Added warped wart blocks, gilded blackstone and crying obsidian 2022-07-09 20:00:10 +01:00
99ff78a8a5 Updated BedrockData 2022-07-09 18:57:32 +01:00
9ffee7cfc3 always the CS ... 2022-07-09 16:30:59 +01:00
ccb3c3cb05 BlockStateData: use array<Tag> instead of CompoundTag to store state properties
this reduces the footprint of RuntimeBlockMapping by a further 1 MB, as well as simplifying various parts of the code, and solidifying the immutability guarantee of BlockStateData.
2022-07-09 16:03:51 +01:00
151f2c3f3a BlockStateDictionary: reduce memory footprint by 5 MB by deduplicating blockstate NBT keys and values 2022-07-08 21:51:44 +01:00
66d655731a Don't barf on air itemstacks found on disk
closes #5143

this is caused by bugs in PM4, where it saved air itemstacks when it wasn't supposed to.

These issues are now all addressed in PM5, since ItemSerializer won't accept air itemstacks.
2022-07-08 18:19:46 +01:00
54a773be0c SubChunk::__construct(): rename blocks to blockLayers 2022-07-07 20:04:16 +01:00
d894c5e97f Drop string ID -> legacy ID conversion tables
these are not used for anything anymore
2022-07-07 20:00:25 +01:00
419b21281d Fix Copilot mixup 2022-07-07 19:54:04 +01:00
56e6a55645 LegacyBlockStateMapper: provide a way to add custom upgrade mappings
this will be needed by plugin developers to upgrade old custom blocks from PM4.
2022-07-07 19:44:16 +01:00
c67e42a723 Add a hook to enable blocks to react to projectiles colliding with them
this enables implementing blocks such as the target block.
2022-07-07 01:44:13 +01:00
3e4f01d85e VanillaBlocks: fixed case of some names 2022-07-07 01:27:30 +01:00
da9937933b Implemented honey bottle 2022-07-07 01:06:17 +01:00
2142eb3cc9 VanillaItems: sort lines alphabetically 2022-07-07 01:01:05 +01:00
690efb09e3 Fixed ItemTypeIds::FIRST_UNUSED_ITEM_ID 2022-07-07 00:55:34 +01:00
e4d24e1edd Invert dependency between VanillaBlocks and BlockFactory 2022-07-07 00:22:08 +01:00
4d6fb2b925 Removed ItemFactory 2022-07-06 23:57:29 +01:00
0ad2985247 Update documentation for Item::__construct() 2022-07-06 23:54:29 +01:00
976502e3db Move item type initialization to VanillaItems
ItemFactory no longer has an obvious purpose, thanks to this ...
2022-07-06 23:47:51 +01:00
b0c76f4db5 Fixed botched unit tests 2022-07-06 23:28:08 +01:00
8886a023f1 Reduce the size of block_factory_consistency_check.json by improving the storage format
this reduces the size by 65%, but more importantly, doesn't cause several pages of flooding in git diff.
2022-07-06 23:20:13 +01:00
ae70c63798 Added tinted glass 2022-07-06 23:01:17 +01:00
986daab511 ItemFactory: remove dead TODO comment 2022-07-06 22:25:17 +01:00
eb404bddb4 5.0.0-ALPHA2 is next 2022-07-06 21:52:37 +01:00
30079f6fd0 Release 5.0.0-ALPHA1 2022-07-06 21:52:37 +01:00
ce87424336 update changelog [ci skip] 2022-07-06 21:49:03 +01:00
06d3fc2880 Changelog for 5.0.0-ALPHA1 2022-07-06 21:41:13 +01:00
d40e864821 Item: update documentation of legacyJsonDeserialize() 2022-07-06 21:15:27 +01:00
88a5a95479 Block: mark new functions as @internal 2022-07-06 17:26:15 +01:00
00db73a5b2 Merge branch 'next-minor' into next-major 2022-07-06 16:20:06 +01:00
5a8983dd81 Merge branch 'stable' into next-minor 2022-07-06 16:17:04 +01:00
269b6ed16a FallableTrait: fixed logic for block replacement
closes #5126

I don't know why it wasn't done this way to begin with. FallingBlock always used canBeReplaced()...
2022-07-06 16:16:49 +01:00
f031c3c602 Updated NBT dependency 2022-07-06 15:19:19 +01:00
a377795db9 Fixed SoulFire damage (#5138) 2022-07-06 14:57:07 +01:00
a8728a02f6 BlockStateDictionary: extract a more generic helper method for decoding block palette files 2022-07-06 14:37:46 +01:00
dc8f65c0dd Remove unnecessary BlockStateDictionary usages 2022-07-06 14:33:27 +01:00
5c4288de01 block/Light: fixed placement when clicking on another light block
closes #5132
2022-07-06 14:23:32 +01:00
46b79fbe85 StringToItemParser: fixed light_15 and light_block_15 aliases being missing 2022-07-06 14:11:33 +01:00
494cb580f3 Add sound after wood stripping (#5124) 2022-07-06 14:06:52 +01:00
64e93ae4e1 Fixed spyglass using animation (#5137) 2022-07-06 14:02:43 +01:00
f3e09dd7d5 Bump shivammathur/setup-php from 2.19.1 to 2.20.0 (#5135)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.19.1 to 2.20.0.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.19.1...2.20.0)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-06 13:28:46 +01:00
fe93609c8d Added mud bricks and related blocks 2022-07-06 00:02:51 +01:00
ebe6782295 Remove TODO comment 2022-07-05 23:37:55 +01:00
638d03846c Added blast resistance for cobbled and polished deepslate 2022-07-05 23:11:12 +01:00
f57cd95ad5 Added blast resistances to some blocks
following values extracted from BDS
2022-07-05 23:02:04 +01:00
d725ded7b6 Added new ores 2022-07-05 21:43:47 +01:00
a8dae96bb0 register honeycomb blocks properly 2022-07-05 21:03:27 +01:00
e5b038ebcd Lava: implement basalt generators 2022-07-05 20:50:11 +01:00
a005cd6e33 Set the correct max stack size for spyglass (#5133) 2022-07-05 20:43:46 +01:00
5536672e4b Updated consistency check 2022-07-05 20:42:53 +01:00
a42bb9626d Added another handful of blocks
clearing out my workspace...
2022-07-05 20:42:22 +01:00
3c017af6a0 Added a handful of new easy items 2022-07-05 16:46:57 +01:00
412dcaa744 Implemented crimson, warped and mangrove signs 2022-07-05 16:18:54 +01:00
51ce358734 Add header to generator for now 2022-07-05 15:40:24 +01:00
d09c45e362 Verify up-to-dateness of RuntimeEnum serializers on Actions 2022-07-05 15:15:02 +01:00
86d2ecfaff Added runtime enum serializer generation script 2022-07-05 15:13:38 +01:00
68cbe46600 Exterminate legacy item IDs 2022-07-05 15:12:55 +01:00
c5282b059b ... 2022-07-05 14:27:02 +01:00
4e71cc7d79 Remove ItemFactory::get(), use ItemFactory::fromTypeId() for VanillaItems
soon we'll invert the dependency and set up all this stuff in VanillaItems directly, rendering ItemFactory (mostly) unnecessary.
2022-07-05 14:26:02 +01:00
6be92ea6f7 fix CS 2022-07-05 14:14:27 +01:00
325f1cf82e Generalize runtime block data serialization
we want to reuse this code for item type data
2022-07-05 14:13:37 +01:00
1714e2fd35 CoralFan: fixed coralType not being initialized 2022-07-05 14:07:34 +01:00
0a23e91329 Rename BlockFactory::fromFullBlock() -> BlockFactory::fromStateId() 2022-07-05 13:46:19 +01:00
a059d03b37 Remove BlockFactory::get(), optimise fromFullBlock() pathway 2022-07-05 13:43:26 +01:00
bd773c2f84 VanillaBlocks: use BlockFactory::fromTypeId() 2022-07-05 13:40:07 +01:00
d9544b5d0e Added soul fire 2022-07-04 22:32:35 +01:00
4909c0f257 Fixed schema loading when the file path contains at least 4 numbers in a row
this spectactularly stupid bug could also have been addressed using a [^\/] in place of the . in the pattern, but I thought it made sense to make it impossible for this to happen again by making sure the regex only sees the file name.

fixes #5129
2022-07-04 22:15:50 +01:00
56cf59355f Use more consistent exceptions 2022-07-04 21:38:18 +01:00
9f0b32e748 Updated creative and crafting data to 1.19 2022-07-04 20:28:07 +01:00
59c5770cf2 Durable: do not write Damage tag if damage is zero
fixes creative inventory getting borked to hell
2022-07-04 20:11:39 +01:00
45be6e19f3 Update BedrockBlockUpgradeSchema 2022-07-04 16:17:27 +01:00
405e552efd ItemTranslator: use GlobalItemDataHandlers
this ensures that plugin serializers will actually be used on the network.
2022-07-04 15:47:28 +01:00
e44a291697 Rename ItemTypeIds -> ItemTypeNames for consistency's sake 2022-07-04 15:46:24 +01:00
d9c61f0492 Publish script used to generate ItemTypeIds 2022-07-04 15:43:13 +01:00
68e704bf97 Bump shivammathur/setup-php from 2.19.0 to 2.19.1 (#5098)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.19.0 to 2.19.1.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.19.0...2.19.1)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  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>
2022-07-04 15:15:17 +01:00
afd37ca892 Fix PHPStan errors 2022-07-04 15:13:48 +01:00
03b8077054 generate-block-serializer-consts: don't pollute the global namespace 2022-07-04 14:58:21 +01:00
17abd50f69 Publish script used to generate BlockTypeNames, BlockStateNames and BlockStateStringValues 2022-07-04 14:56:50 +01:00
2c33d8429e tests: remove unnecessary Block::getName() override 2022-07-03 20:08:56 +01:00
cbebb70af6 Planks: remove useless constructor 2022-07-03 19:58:04 +01:00
6604d22ceb BlockLegacyIdHelper: clean up code 2022-07-03 19:53:34 +01:00
ce59228688 BlockLegacyMetadata: remove unused constants 2022-07-03 19:45:13 +01:00
386c385a08 Updated BlockFactory consistency check 2022-07-03 19:07:45 +01:00
dd615c775d Added various blocks made from mangrove, crimson and warped wood 2022-07-03 19:01:34 +01:00
6176f0d9df Regenerate ItemTypeIds 2022-07-03 18:43:29 +01:00
33eef99d1f Added axis support for all-sided logs 2022-07-03 17:27:25 +01:00
3e7d34c8ad BlockFactory: remove TODO list
we're tracking this somewhere else now
2022-07-03 14:33:42 +01:00
e302e5a85f Implemented chiseled deepslate, chiseled nether brick and cracked nether brick 2022-07-03 03:04:06 +01:00
4acf7aadbd Added quartz bricks 2022-07-03 02:11:50 +01:00
227a481473 generate-block-palette-spec: include blocks with no properties 2022-07-03 02:01:28 +01:00
a3016abf53 Added polished deepslate block/slab/stair/wall 2022-07-03 02:00:43 +01:00
89632f3514 Added deepslate, cobbled/tiles/bricks walls/slabs/stairs/cubes 2022-07-03 01:43:27 +01:00
c7ba791ff8 Block: remove obsolete note from Block::isSameType() 2022-07-03 00:49:57 +01:00
db9c7de35c Remove obsolete shim items for Bed and Skull
now that the colour and skull type are included in the block type data, it's no longer necessary to maintain shim items to retain this information in the item data.
2022-07-03 00:47:42 +01:00
017ebb9b47 Updated consistency check 2022-07-03 00:02:03 +01:00
3f937605ac Added calcite 2022-07-02 23:54:51 +01:00
b818ed0d08 Regenerated TODO list 2022-07-02 23:17:46 +01:00
0e0b858b69 Added raw copper, gold and iron blocks 2022-07-02 23:17:10 +01:00
0d0296d535 Light block brightness can be changed by right-clicking on it 2022-07-02 22:48:10 +01:00
2a0fade893 Implemented Light blocks 2022-07-02 22:39:11 +01:00
30149c6ed4 wtf happened here ... 2022-07-02 22:06:47 +01:00
c84033213f Updated BlockFactory consistency check 2022-07-02 21:55:35 +01:00
c4fc352db1 Remove empty line 2022-07-02 21:54:36 +01:00
172214386a Added a batch of simple blocks from 1.16 and 1.17 2022-07-02 21:53:59 +01:00
b661c94915 StringToItemParser: added glazed_terracotta alias 2022-07-02 21:34:20 +01:00
7750f9581a BlockObjectToBlockStateSerializer: make adding stateless blocks less annoying 2022-07-02 21:03:25 +01:00
451971b866 BlockObjectToBlockStateSerializer: make stairs less annoying to implement 2022-07-02 20:57:18 +01:00
d49597fe5f BlockStateToBlockObjectDeserializer: make stairs less annoying to implement 2022-07-02 20:51:31 +01:00
bcdbb09c2c Updated BlockFactory consistency check 2022-07-02 20:19:58 +01:00
ff90c83d66 Implemented log stripping via axe right-click 2022-07-02 19:16:15 +01:00
248eacd042 GlazedTerracotta: make colour dynamic, like all other coloured blocks
made possible by stripping out legacy mess
2022-07-02 18:30:23 +01:00
7430e1fbc0 Coral: remove obsolete workaround 2022-07-02 17:51:48 +01:00
b125d4d25f Strip all remaining legacy item ID/meta stuff from blocks
the doors are now finally open, we can:
- make all the wood types dynamic
- fix glazed terracotta
- add all the new blocks

LET'S GOOOOOOOOOOOO
2022-07-02 17:48:11 +01:00
323c563684 Break Block's dependence on ItemFactory, and item legacy IDs
let's GOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
2022-07-02 17:29:28 +01:00
9740891a2f Move BlockLegacyMetadata to pocketmine\data package 2022-07-02 17:01:10 +01:00
b5914f4587 phpstorm ... 2022-07-02 16:58:28 +01:00
3792ef5a50 Move blockstate data runtime serialization to a more appropriate package 2022-07-02 16:48:41 +01:00
7994da07be Crafting recipe network serialization no longer depends on PM's internal legacy metadata
WOOOOOOOOOOOOOOOOOOOOOOHOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!
2022-07-02 16:37:43 +01:00
8858b16a25 Fucking CS again 2022-06-30 20:18:25 +01:00
a64adbfffe Fix PHPStan errors 2022-06-30 20:16:55 +01:00
ba079bd9aa Avoid implicit ItemFactory reliance for blocks with special items
this hasn't yet been addressed for signs, since they are a bit of a pain in the ass.
2022-06-30 20:00:41 +01:00
db2b523762 Item is no longer JsonSerializable
before anyone starts screaming:

1) it's easy to create your own wrapper that converts items to arrays
2) there is no longer a single standard way to encode items.
3) the way that item serialization now works requires an ItemSerializer, which, barring singleton use, must be dependency-injected. Since there's no way to inject dependencies into jsonSerialize(), this means that its behaviour cannot be customized.
2022-06-30 19:16:49 +01:00
4bd087fc83 Fix CS 2022-06-30 19:09:49 +01:00
af8f2c47f3 ShulkerBoxInventory: avoid usage of legacy ItemIds 2022-06-30 19:03:07 +01:00
2a0b500010 Block: Separate encoding of type and state data
the terminology of this needs improvement, but...

the basic concept here is that 'type' data will persist on an itemstack, while 'state' data will not.

Type data consists of things like:
- Colour
- Coral type
- Wet/dry (sponges)
- Live/dead (coral)
- Wood type

State data consists of things like:
- Facing
- Axis
- Powered/unpowered
- Open/closed

In the past, with the old system, this information was separated by way of getStateBitmask(). This solution was fraught with problems, but achieved the basic goal: removing unwanted block properties from items.
2022-06-30 18:08:34 +01:00
c22a840d27 Update VanillaBlocks:
for some reason some stuff was returned using non-default states
2022-06-30 17:52:07 +01:00
f8547ad57c LegacyStringToItemParserTest: do not rely on the presence of legacy ID and meta in the API 2022-06-30 16:39:50 +01:00
9898577135 Bump phpstan/phpstan from 1.7.15 to 1.8.0 (#5120)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.7.15 to 1.8.0.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.8.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.7.15...1.8.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-30 16:09:03 +01:00
cab56b0479 fix PHPStan 2022-06-29 17:18:44 +01:00
ff96f1b93c CreativeInventory: do not disable meta comparison for durable items
this check no longer applies, and it's usually undesirable to avoid comparing meta in every other case.
2022-06-29 16:58:52 +01:00
09c1e161e0 Fix merge error 2022-06-29 16:54:57 +01:00
66c09fdc3b Merge branch 'next-major' into modern-world-support 2022-06-29 16:54:15 +01:00
4d9f2bc9b1 Merge branch 'next-minor' into next-major 2022-06-29 16:53:50 +01:00
38651fde74 Merge branch 'stable' into next-minor 2022-06-29 16:53:31 +01:00
de917afc6f Fix CS 2022-06-29 16:11:46 +01:00
5e4e5147d9 Remove ItemFactory involvement from brewing
this involves a very nasty hack for potion container change, but for the time being it can't be helped.
2022-06-29 16:11:15 +01:00
8831dff61b Leaves: remove ItemFactory dependency
this is ugly, but it should only be temporary while we liberate the core from legacy nastiness.
Once the liberation is complete, we'll be able to do a lot of cool stuff like making wood types dynamic.
2022-06-29 16:09:55 +01:00
83c46a4b54 LegacyStringToItemParser: remove bogus test
this test is obsolete since ea3d5ac563, since durable items no longer use meta to represent damage.
2022-06-29 15:26:56 +01:00
ea3d5ac563 LegacyStringToItemParser: use string IDs directly
this allows plugins to add their own mappings (though they should really be using StringToItemParser) without needing any legacy numeric ID bullshit in the mix.
2022-06-29 15:25:50 +01:00
ce6b09291a LegacyStringToItemParser: bypass ItemFactory, use GlobalItemDataHandlers directly 2022-06-29 15:18:11 +01:00
2cb722b674 Fixed durability handling (ish) 2022-06-29 15:17:16 +01:00
784d602600 Fixed ItemBreakParticle using untranslated internal ID/meta for network data
this caused it to display particles for incorrect items. It may also have been possibly responsible for client crashes.
2022-06-29 14:01:39 +01:00
dd63681f94 Assign auto-generated runtime type IDs to all items 2022-06-29 13:50:58 +01:00
15c99cfe77 4.5.3 is next 2022-06-29 02:18:50 +01:00
d5fa0a2fc5 Release 4.5.2 2022-06-29 02:18:50 +01:00
0da9260994 Updated composer dependencies 2022-06-29 02:13:32 +01:00
56428e8a4e Make more item stuff dynamic 2022-06-29 00:26:16 +01:00
6058032807 Make potion types dynamic
It became obvious this was needed when I wanted to make new IDs for existing items - there's no way I'm unrolling those registrations...
2022-06-28 23:33:25 +01:00
c0e178c19c fix CS 2022-06-27 17:15:16 +01:00
541a624d48 ItemFactory::get() now consistently throws SavedDataLoadingException on any error, including unknown items 2022-06-27 17:14:43 +01:00
2fd9b751b6 Log: remove dead code 2022-06-27 16:26:53 +01:00
7deee31502 Block: make decodeStateData() and computeStateData() final 2022-06-27 15:40:39 +01:00
0afb67be7d Improve BlockFactory initialization performance
as expected, expanding data range unconditionally resulted in some performance issues ...
2022-06-27 15:37:05 +01:00
bedc9cf518 Item::jsonDeserialize(): remove bogus phpdoc (we don't actually know if this is even valid) 2022-06-27 14:30:12 +01:00
b61a934c9f CraftingManagerFromDataHelper: fixed recipes with unknown items being registered without said items 2022-06-27 14:23:14 +01:00
65ed7d7794 Remove Item::hasAnyDamageValue() 2022-06-27 13:35:43 +01:00
55cb68e5b5 Burn meta wildcards from Item, allow more dynamic recipe inputs
this was an obstacle for getting rid of legacy item IDs.
2022-06-27 13:33:26 +01:00
bc5a600d59 Added item stack serialize/deserialize methods 2022-06-26 17:02:55 +01:00
3d61345543 Remove ItemFactory::air() 2022-06-25 16:18:35 +01:00
b56d049103 Updated BlockFactory consistency check 2022-06-25 16:12:15 +01:00
27d7672273 Item frames can now be placed on the up or down faces of blocks 2022-06-25 16:10:39 +01:00
db8bf672f0 fix item frames 2022-06-25 16:10:06 +01:00
f57e02849a Wall: move function for consistency 2022-06-25 16:01:11 +01:00
03fdbd9f7b fix CS 2022-06-25 15:59:52 +01:00
1da4c45979 Add runtime support for wall connections
this doesn't match the 1.16+ behaviour yet, but it at least recognizes walls that are already in the post-1.16 way and doesn't break them if not interacted with.
2022-06-25 15:59:38 +01:00
b9542b4908 ItemFactory: fix isRegistered() again
we really need to get rid of the ItemFactory legacy nasties so we can burn this code
2022-06-25 15:52:43 +01:00
00b4e4016c Obliterate BlockLegacyIds 2022-06-25 14:42:32 +01:00
cac72d73fb ItemFactoryTest: remove bogus test case 2022-06-25 14:34:19 +01:00
b268818eda ItemFactory: fixed bogus usage of BlockFactory::isRegistered()
ItemFactory IDs don't necessarily correspond to BlockFactory ones anymore.
2022-06-25 14:02:55 +01:00
e3a9324e8d Updated BlockFactory tests to avoid BlockFactory::get() (which is getting ready to die) 2022-06-24 23:44:55 +01:00
8e002fc1ca BlockTest: fixed unintentional use of global BlockFactory 2022-06-24 23:41:13 +01:00
61da920db0 Fixed consistency check 2022-06-24 23:33:18 +01:00
1bce583cf3 Removed BlockIdentifierFlattened
this was necessary to inform BlockFactory of how to map blocks with multiple IDs; this is no longer necessary under the revamped system
2022-06-24 23:31:05 +01:00
5f7521027e FlowerPot: remove usage of legacy variant 2022-06-24 23:24:03 +01:00
f24f2d9ca9 Hit block legacy metadata with the biggest nuke you've ever seen
This commit completely revamps the way that blocks are represented in memory at runtime.

Instead of being represented by legacy Mojang block IDs and metadata, which are dated, limited and unchangeable, we now use custom PM block IDs, which are generated from VanillaBlocks.
This means we have full control of how they are assigned, which opens the doors to finally addressing inconsistencies like glazed terracotta, stripped logs handling, etc.

To represent state, BlockDataReader and BlockDataWriter have been introduced, and are used by blocks with state information to pack said information into a binary form that can be stored on a chunk at runtime.
Conceptually it's pretty similar to legacy metadata, but the actual format shares no resemblance whatsoever to legacy metadata, and is fully controlled by PM.
This means that the 'state data' may change in serialization format at any time, so it should **NOT** be stored on disk or in a config.

In the future, this will be improved using more auto-generated code and attributes, instead of hand-baked decodeState() and encodeState(). For now, this opens the gateway to a significant expansion of features.
It's not ideal, but it's a big step forwards.
2022-06-24 23:19:37 +01:00
be2fe160b3 Throw a more specific exception on unknown block IDs 2022-06-24 22:52:48 +01:00
8b80c70b9c Merge branch 'next-major' into modern-world-support 2022-06-24 01:41:47 +01:00
9cc24c2c39 Merge branch 'next-minor' into next-major 2022-06-24 01:40:50 +01:00
63ee03a7be Merge branch 'stable' into next-minor 2022-06-24 01:40:39 +01:00
df2d1fd4f9 of course there were two bugs on one line ... 2022-06-24 01:40:26 +01:00
04b855235a Merge branch 'next-major' into modern-world-support 2022-06-24 01:35:46 +01:00
72d8b54188 Merge branch 'next-minor' into next-major 2022-06-24 01:33:15 +01:00
088a2e478c Merge branch 'stable' into next-minor 2022-06-24 01:32:53 +01:00
9f65fb5f90 Fixed top-side skulls with no-drop flag set being treated as unknown blocks 2022-06-24 01:31:11 +01:00
1c689b10b9 ItemSerializer: fixed item NBT being discarded
I'm still not sure on the wisdom of allowing NBT usage in here ...
2022-06-23 21:29:52 +01:00
82f9a25d88 Fix PHPStan 2022-06-23 21:24:09 +01:00
8822bdbefa Fix CS 2022-06-23 21:22:52 +01:00
21cf3813be Add extra interfaces to make it easier to get at the actual blockstate serializer/deserializer
this still is a pain the ass, but it's much less so than before.
2022-06-23 20:01:19 +01:00
adf8a61814 BlockStateToBlockObjectDeserializer: make map() public
this allows plugins to implement their own blocks using this deserializer.
2022-06-23 19:40:11 +01:00
6964012464 fix a bunch of bugs 2022-06-23 19:34:08 +01:00
5ed75731f2 First (untested) look at hooking all the itemstack serializer/deserializer stuff together
this should address #5063 and related issues, if it works correctly.
2022-06-23 19:02:16 +01:00
d8bba6ed3d git add -p bites again 2022-06-23 16:55:50 +01:00
0da174842e Fix build 2022-06-23 16:46:09 +01:00
1533fcf8f6 Separate block legacy data upgrading from block deserialization
this commit provides a central place where all block data can go to be upgraded to the latest version (currently 1.19), irrespective of how old it is.

Previously I had issues during debugging, because it wasn't possible to just upgrade a block without deserializing it into a Block object, which isn't currently supported for many blocks.
This commit solves that problem by separating the upgrading from the deserialization.
2022-06-23 16:45:02 +01:00
caa4b78a3f Update composer dependencies 2022-06-21 20:21:02 +01:00
14352a05bc reword support bot message 2022-06-11 15:54:44 +01:00
bb5b52d998 Player: fix terrain getting redrawn when moving in noclip mode 2022-06-09 13:48:29 +01:00
301b0aba82 Allow Item (de)serializer to accept dynamic BlockState(De)Serializer 2022-06-08 16:22:35 +01:00
c8e318df8c phpstorm stoobid 2022-06-08 16:21:32 +01:00
4aa1a3da8b Moving more stuff around 2022-06-08 15:57:02 +01:00
680615eed8 Namespace rename 2022-06-08 15:54:45 +01:00
1da6202e6e Update composer dependencies 2022-06-08 15:28:37 +01:00
5e22b70b6d this is a joke ... 2022-06-08 14:56:25 +01:00
831738b29c Added BedrockItemUpgradeSchema dependency 2022-06-08 14:53:58 +01:00
e78f20391e seriously? ... 2022-06-08 14:21:57 +01:00
0a22e4606d Wow, I'm really getting sloppy... 2022-06-08 13:51:15 +01:00
02513818a9 4.5.2 is next 2022-06-08 02:50:34 +01:00
d641812c52 Release 4.5.1 2022-06-08 02:50:33 +01:00
a851496293 Updated BedrockProtocol 2022-06-08 02:46:01 +01:00
0bb30b6201 Merge branch 'next-major' into modern-world-support 2022-06-07 20:26:59 +01:00
bd2516eded Merge branch 'next-minor' into next-major 2022-06-07 20:26:15 +01:00
35fd71eddf Fix CS in VersionInfo
this got overlooked because I just nuked the changes coming in from stable and didn't notice the formatting changes.
2022-06-07 20:26:02 +01:00
e956cfed1c Branch-specific 1.19.0 stuff 2022-06-07 20:14:00 +01:00
cf7d42b3ea Fix CS according to new rules 2022-06-07 20:02:24 +01:00
1ff69136a3 Merge branch 'next-major' into modern-world-support 2022-06-07 20:01:40 +01:00
aa9f8781ff Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
be168beba0 Merge branch 'stable' into next-minor 2022-06-07 19:55:58 +01:00
01a8bce2dd Fix whitespace error in support.yml workflow 2022-06-07 19:54:51 +01:00
1f8009954c Fix PHPStan errors 2022-06-07 19:52:16 +01:00
becbd562d6 FormattedCommandAlias: fixed incorrect arguments array being passed to the target 2022-06-07 19:47:45 +01:00
3a9e4bc357 Fix CS 2022-06-07 19:40:00 +01:00
3ce1be2a23 Added script to generate incremental item upgrade schemas 2022-06-07 19:39:06 +01:00
fe4ff3325b Add tool to dump JSON specification for block palettes
this makes for easier reading to determine available properties.
2022-06-07 19:05:49 +01:00
82edb20e0c 4.5.1 is next 2022-06-07 17:57:39 +01:00
64a8c462f9 Release 4.5.0 2022-06-07 17:57:39 +01:00
4ec97d0f7a InGamePacketHandler: added missing break
I'm getting sloppy ...
2022-06-07 17:52:59 +01:00
016a80bb70 1.19.0 changes 2022-06-07 17:47:13 +01:00
ce66a400a7 Updated composer dependencies 2022-06-07 17:44:06 +01:00
50776875bb 4.4.3 is next 2022-06-07 15:54:55 +01:00
bcb0e2ff1f Release 4.4.2 2022-06-07 15:54:55 +01:00
1584768c80 PaintingMotive: fixed botched painting fix from 0ea3861d43
I knew I should have used a singleton for this ...
2022-06-07 15:48:20 +01:00
c29e23b2f1 TypeConverter: port 5fd685e07d to modern-world-support 2022-06-06 22:13:26 +01:00
57132204ec ItemTranslator: throw only the expected exception types 2022-06-06 22:09:32 +01:00
860fa719b2 ItemTranslator: Accept dynamic BlockStateDictionary instead of using singleton
this will be needed for handling protocol updates in the future
2022-06-06 21:50:43 +01:00
c89f7f8e5e TypeConverter: duct tape for crafting recipe block inputs 2022-06-06 21:47:04 +01:00
13bb1c26fb ItemTranslator now operates directly using Item, rather than using item ID/meta + ItemFactory
in almost all cases where ItemTranslator is used, an Item already exists, so it doesn't make any sense to make ItemTranslator go and create another item instance just to pass to ‰ItemSerializer.
2022-06-06 20:51:26 +01:00
86e7ae341f ItemSerializer: Prohibit serializing recipe input wildcards 2022-06-06 20:48:44 +01:00
5fd685e07d TypeConverter: fix crash on arbitrary out-of-bounds item IDs
I don't know why I didn't consider this fix necessary when the item meta bug was originally discovered.
2022-06-06 19:29:44 +01:00
93124c79ea Fixed incorrect unknown item filtering logic
this caused recipes with wildcard inputs to not show up at all.
2022-06-06 18:50:40 +01:00
08fbf92d8d Filter out recipes containing unknown items 2022-06-06 18:25:14 +01:00
f08f82edfd Merge branch 'next-major' into modern-world-support 2022-06-06 17:33:19 +01:00
b57f0a2b7e Fixed uninitialized typed properties 2022-06-06 17:23:43 +01:00
5c85aa6e58 Eliminate remaining usages of legacy block ID+meta on disk
flower pots loaded from vanilla worlds should now correctly display the plant inside
2022-06-05 21:49:51 +01:00
02568bb049 Remove ItemFactory usage from Bucket 2022-06-05 21:19:38 +01:00
d2613039ed Replace BlockLegacyIds usages with BlockTypeIds where possible 2022-06-05 21:17:10 +01:00
f97c22c341 Merge branch 'next-major' into modern-world-support 2022-06-05 20:48:49 +01:00
2a24982bc4 ParticleCommand: standardise usage, don't use legacy block/item IDs 2022-06-05 20:47:54 +01:00
6ecfbd1bde FishingRod: make class less useless 2022-06-05 20:20:16 +01:00
f2dc9187f0 Use covariant types for InventoryHolder and Container implementors 2022-06-05 18:49:48 +01:00
b661097c51 changelog: fix mistake
[ci skip]
2022-06-05 17:59:36 +01:00
0771295899 4.4.2 is next 2022-06-05 16:15:38 +01:00
702816458c Release 4.4.1 2022-06-05 16:15:34 +01:00
e040c2b281 InventoryManager: fixed windows not opening when the server removes windows
closes #5094
2022-06-05 16:03:24 +01:00
5a43db1c6d LevelDB: remove stale TODO comment
this has been addressed by folding to state 0 in the legacy blockstate mapper.
2022-06-04 18:47:29 +01:00
dab7686656 Merge branch 'next-major' into modern-world-support 2022-06-04 18:43:11 +01:00
38cf9fc6e6 Fixed some timings not being initialized in unit tests
previously this error was unnoticed, since uninitialized typeless properties are populated by NULL, but now it causes an error to be thrown.
2022-06-04 18:27:22 +01:00
083a35f970 Modernize property type declarations 2022-06-04 18:16:32 +01:00
e12e4e8fb8 StatusCommand: fixed output of global memory limit (#5090)
Fix incorrect "Maximum memory (manager)" output
2022-06-04 17:41:55 +01:00
d15a90899e build fix 2022-06-04 17:38:45 +01:00
237c2866e0 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2022-06-04 17:35:18 +01:00
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
7355798e77 Exit with error code if the server failed to start
this ensures that external tools such as start.cmd actually see an error if there is one
2022-06-03 18:34:54 +01:00
01af70f671 Merge branch 'next-major' into modern-world-support 2022-06-02 20:24:25 +01:00
23695fb900 RegionLoader: remove dead static property
[bc break]
2022-06-02 16:55:22 +01:00
4b662d65b3 PluginManager: check graylist before doing any loadability checks
fixes #5087
2022-06-02 16:29:22 +01:00
2bb99fa677 Modernize Position and Location
[bc break]
2022-06-01 21:21:31 +01:00
7b8eeb42f6 Use typed properties in src/entity package
[bc break]
2022-06-01 21:19:02 +01:00
2029e3be20 Entity: remove dead code
[bc break]
2022-06-01 21:01:56 +01:00
6ee551c5e1 Remove premature optimisation from World::getCollidingEntities()
this is already covered in more fine-grained detail by canCollideWith().

[bc break]
2022-06-01 21:00:54 +01:00
b7e2b3e94a Entity: Require declaration of gravity and drag via abstract methods
this guarantees that subclasses will actually declare them.

[bc break]
2022-06-01 20:51:18 +01:00
c87a3b054c composer.json: fix make-devtools command 2022-06-01 20:04:47 +01:00
f3c9b59856 Bump version for PM5 2022-06-01 19:54:32 +01:00
4b73bedd57 Bump version to 4.6.0+dev 2022-06-01 19:45:20 +01:00
8b86e43d51 Update support.yml 2022-06-01 15:56:47 +01:00
eade2d2af0 4.4.1 is next 2022-06-01 15:37:48 +01:00
f2299a562f Release 4.4.0 2022-06-01 15:37:48 +01:00
ef15dc883a Merge branch 'next-major' into modern-world-support 2022-06-01 15:34:26 +01:00
3fcf6372e0 Merge branch 'stable' into next-minor 2022-06-01 15:32:37 +01:00
533cb77c50 Updated dependencies 2022-06-01 15:29:39 +01:00
681a9bb0e1 Bump build/php from 8138c6a to 1110349 (#5075)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `8138c6a` to `1110349`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](8138c6a4a4...11103498ca)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-31 17:18:47 +01:00
6c080dae55 Bump shivammathur/setup-php from 2.18.1 to 2.19.0 (#5076)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.18.1 to 2.19.0.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.18.1...2.19.0)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-31 17:18:27 +01:00
670fb4de74 Bump phpstan/phpstan from 1.7.1 to 1.7.4 (#5074)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.7.1 to 1.7.4.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.7.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.7.1...1.7.4)

---
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>
2022-05-30 16:09:30 +01:00
bf199d3a74 duct tape for recipes 2022-05-27 20:40:32 +01:00
bd8dd48dee Assign new IDs to every block 2022-05-27 18:07:31 +01:00
6d7318af43 Liquid: fixed merge regression 2022-05-26 18:48:45 +01:00
adfabca684 Merge branch 'next-major' into modern-world-support 2022-05-26 16:02:32 +01:00
97c0d72e28 ItemFactory: use import aliases to reduce code width 2022-05-26 15:55:33 +01:00
4ccae2d1de BlockFactory: use import aliases to reduce code width 2022-05-26 15:50:29 +01:00
b36c6ea13b StringToItemParser: Use import aliases to reduce code width 2022-05-26 15:40:18 +01:00
39b8daeeec Living: fixed a usage of hardcoded numeric ID 2022-05-25 22:23:14 +01:00
776b8d2f95 Harden BlockStateDeserializer further against bugs 2022-05-25 21:56:17 +01:00
c492352d50 changelog: fix typo
[ci skip]
2022-05-25 17:09:29 +01:00
8f1452acd1 4.4.0-BETA2 is next 2022-05-25 16:44:32 +01:00
8a2ba584ab Release 4.4.0-BETA1 2022-05-25 16:44:17 +01:00
2b27b8a230 fixed fucky wucky 2022-05-24 21:52:10 +01:00
383be5426e Rewrite network item serialization to use ItemSerializer 2022-05-24 21:44:57 +01:00
81b51c0791 fixing special block serialization 2022-05-24 21:29:20 +01:00
227f28a6d2 Use VanillaItems::AIR() instead of ItemFactory 2022-05-24 15:47:27 +01:00
d8dc32ec4b PhpStorm sucks
I'm very sure I enabled 'Ensure every file ends with a line break' ...
2022-05-24 15:22:23 +01:00
0fc24c94cd Fix PHPStan 2022-05-24 15:20:11 +01:00
24bd403e23 Updated VanillaItems 2022-05-24 15:19:22 +01:00
81eafde074 Hacks for banners and coral fans 2022-05-24 15:07:38 +01:00
a2ea0cea86 Update unit tests 2022-05-24 14:47:46 +01:00
5ce5e1d2b0 Throw proper exceptions for serialize/deserialize failures
this allows them to be caught and properly reported in tests.
2022-05-24 14:46:18 +01:00
901a51a9dd Added serialize/deserialize support for stonecutter 2022-05-24 14:31:40 +01:00
567bd8e330 Merge branch 'next-major' into modern-world-support 2022-05-24 14:19:34 +01:00
812d5c3f58 Merge branch 'stable' into next-minor 2022-05-24 14:17:53 +01:00
9a5a03ef83 Bump phpstan/phpstan from 1.6.8 to 1.7.1 (#5067)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.6.8 to 1.7.1.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.7.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.6.8...1.7.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-24 13:46:09 +01:00
38d75f3aab Player: Be more explicit about not parsing chat messages when messageCounter is zero
the length check technically accounts for this, but future readers might not realize this
2022-05-22 16:46:53 +01:00
03c505aaa7 Merge branch 'next-major' into modern-world-support 2022-05-22 16:21:48 +01:00
179cac45f5 Merge branch 'stable' into next-minor 2022-05-22 16:21:05 +01:00
1591881bf2 4.3.5 is next 2022-05-22 16:12:24 +01:00
7bbb2617c8 Release 4.3.4 2022-05-22 16:12:12 +01:00
2ec65ba799 ExplosionPrimeEvent: require a positive explosion radius 2022-05-21 23:22:04 +01:00
3dd7c09351 Improve documentation of ExplosionPrimeEvent and EntityExplodeEvent 2022-05-21 23:00:34 +01:00
afc6e8878d EntityExplodeEvent: clamp yield in range 0-100 2022-05-21 22:44:45 +01:00
7eaf1246a0 Explosion: cap yield at 100%
this could overflow if the explosion size is less than 1.
While this currently doesn't have any negative effects, if we decided to support >100% yield, this would cause some issues.
2022-05-21 22:43:26 +01:00
645c44ae9c Explosion: remove unused variables 2022-05-21 22:41:28 +01:00
331b05c681 Improve documentation of EntitySpawnEvent and EntityDespawnEvent 2022-05-21 22:11:37 +01:00
3abe80184a Update ItemSpawnEvent doc (#5059) 2022-05-21 22:09:21 +01:00
7618b13c6e ItemDespawnEvent: improve documentation 2022-05-21 21:57:14 +01:00
351cd4bfd7 Improve documentation of world-related events 2022-05-21 21:46:53 +01:00
1154c7c1ab PlayerQuitEvent: improve documentation 2022-05-21 21:23:13 +01:00
4a3e42f82e PlayerTransferEvent: add documentation 2022-05-21 21:21:51 +01:00
8ecf9717d6 PlayerItemHeldEvent: add documentation
since some nuances of the intended behaviour were previously unclear...
2022-05-21 21:21:13 +01:00
3ca80b353b InventoryTransactionEvent: rewrite documentation 2022-05-21 21:20:11 +01:00
7d172e2211 PlayerCommandPreprocessEvent: updated documentation 2022-05-21 21:07:29 +01:00
e934e2bd26 PlayerDropItemEvent: updated documentation
this can be triggered by dropping an item outside of the inventory menu while the inventory window is open.
2022-05-21 21:05:27 +01:00
3177d19730 PlayerKickEvent: improved woefully inadequate documentation 2022-05-21 21:03:56 +01:00
82104a8251 UpdateNotifyEvent: updated documentation 2022-05-21 20:32:30 +01:00
e9a17374d1 Rewrite documentation of CommandEvent
no wonder people get the idea to use this shit for banning commands ...
2022-05-21 20:29:25 +01:00
a31bd19b5a Deprecated PlayerCommandPreProcessEvent
to be removed in PM5

see #4284
2022-05-21 20:20:09 +01:00
c82dfef9b0 Player: fix weird behaviour when teleporting sleeping players
closes #4672
2022-05-21 20:08:12 +01:00
1181b13b5d Player: call InventoryCloseEvent after doing the necessary business
closes #4626

this does change the behaviour of getCurrentWindow() during InventoryCloseEvent, but no one should be using that anyway, since InventoryCloseEvent->getInventory() exists.
2022-05-21 19:23:59 +01:00
688be0a404 Server: apply server.properties difficulty to newly generated worlds
see #5057

jury is out on whether or not this should override difficulty on preexisting worlds, but it's non-controversial that it should apply at least to newly generated worlds.
2022-05-21 18:46:38 +01:00
33e6b63fe5 Explosion: remove unused local variable in explodeB() 2022-05-21 17:39:11 +01:00
5d92eddc82 InventoryTransaction: provide object ID of failed action for debugging identification
closes #3235
2022-05-21 17:35:21 +01:00
0324392cd8 Clean PHPStan baseline 2022-05-21 17:12:47 +01:00
01b0742bd4 LightUpdate: account for virtual nodes in prepareNodes()
fixes #3959
2022-05-21 17:07:49 +01:00
02cf6ae46c Added PlayerDeathEvent->setKeepXp(), closes #4002 (#4015) 2022-05-21 16:41:14 +01:00
fcb2ccab99 NetworkSession: Sync all attributes on respawn 2022-05-21 16:22:35 +01:00
a38a5c67f1 GiveCommand: show the search term in audit message, instead of the ID
this is more useful in the longer term.
2022-05-21 15:49:17 +01:00
a45a96b3ee ShulkerBoxInventory: fixed inappropriate usage of BlockLegacyIds when comparing item IDS 2022-05-21 15:40:25 +01:00
f67104c81e Merge branch 'next-major' into modern-world-support 2022-05-20 17:50:38 +01:00
86efa0aae6 Merge remote-tracking branch 'origin/stable' into next-minor 2022-05-20 17:49:04 +01:00
2b84cb7be4 DisablePluginException now can be used to disable plugins (#4780)
closes #2671
2022-05-20 17:01:34 +01:00
26df37e6ef Minecart: fixed max stack size to match vanilla (#5051) 2022-05-20 16:57:48 +01:00
554f96bc24 InventoryManager: Defer opening new windows to the client until the window close handshake has been completed
fixes #5021 and probably a bunch of other inventory related glitches

When the server initiates a window close, it does so by sending a ContainerClose to the client, which causes the
client to behave as if it initiated the close itself. It responds by sending a ContainerClose back to the server,
which the server is then expected to respond to.

Sending the client a new window before sending this final response creates buggy behaviour on the client, which
is problematic when switching windows. Therefore, we defer sending any new windows until after the client
responds to our window close instruction, so that we can complete the window handshake correctly.

This is a pile of complicated garbage that only exists because Mojang overengineered the process of opening and
closing inventory windows.
2022-05-20 16:54:15 +01:00
6482aa7c64 Block: introduce logic for face support types (#4886)
fixes #4856
fixes #458
fixes #4529
fixes #3299

Added API method Block::getSupportType(Facing) : SupportType
Added SupportType enum
fixes torch, lantern, door etc. placement on slabs and upside-down stairs
2022-05-20 15:18:34 +01:00
68491be847 Merge branch 'next-major' into modern-world-support 2022-05-20 11:21:35 +01:00
6d941640a9 Merge branch 'stable' into next-minor 2022-05-20 11:14:59 +01:00
0ea3861d43 Fixed paintings not working in newly generated worlds
Paintings would not work unless at least one entity was loaded from disk
(or saved).
2022-05-20 11:13:14 +01:00
a323a5e56d Bump docker/login-action from 1 to 2 (#5048)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1 to 2.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-18 13:30:39 +01:00
79caba22a7 Bump docker/build-push-action from 2.10.0 to 3.0.0 (#5046)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.10.0 to 3.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2.10.0...v3.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-18 13:29:44 +01:00
30815bc8a2 Bump actions/upload-artifact from 2 to 3 (#5047)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-18 13:29:19 +01:00
df3a69dcb7 Modernize private property declarations in Threaded classes
I previously avoided this due to being unsure of the effects; however, it's clear that we already use typed properties on Threaded things in other places anyway, and the only known issues are with uninit properties, and arrays.
2022-05-17 22:42:18 +01:00
d4b7f66e15 Promote some constructors 2022-05-17 22:34:58 +01:00
8e767da29e Modernize some final remaining private property declarations 2022-05-17 21:55:57 +01:00
c0b15de504 Modernize private static property declarations 2022-05-17 21:55:16 +01:00
1d5430937f Modernize private property declarations in src/timings 2022-05-17 21:54:45 +01:00
9de88aa734 Modernize private property declarations in src/scheduler 2022-05-17 21:53:38 +01:00
9e59819f06 Modernize private property declarations in src/resourcepacks 2022-05-17 21:52:07 +01:00
c60311617d Modernize private property declarations in src/plugin 2022-05-17 21:37:45 +01:00
7bc3dcdefd Modernize private property declarations in src/player 2022-05-17 21:36:51 +01:00
22edca610c Modernize private property declarations in src/permission 2022-05-17 21:28:42 +01:00
6eac2ea7a5 Modernize private property declarations in src/network 2022-05-17 21:22:33 +01:00
cd016bedce Network: Improve typeinfo for PHPStan on bannedIps 2022-05-17 21:19:48 +01:00
95ad3f16e1 Modernize private property declarations in src/item 2022-05-17 20:59:24 +01:00
fb4d332d1a Modernize private property declarations in src/inventory/transaction 2022-05-17 20:51:22 +01:00
a06b9294df Modernize private property declarations in src/inventory 2022-05-17 20:49:12 +01:00
221c6b8570 Remove useless @var 2022-05-17 20:46:24 +01:00
eb95e2a97e Modernize private property declarations in src/event 2022-05-17 20:45:50 +01:00
ec6769a6fc Modernize private property declarations in src/entity 2022-05-17 20:42:17 +01:00
343a12626e Modernize private property declarations in src/data 2022-05-17 20:35:59 +01:00
d11d77d328 Modernize private property declarations in src/crash 2022-05-17 20:35:24 +01:00
20eb80fc9a Modernize private property declarations in src/console 2022-05-17 20:34:55 +01:00
071067effb Fixed flower pot accepting any block 2022-05-17 20:30:02 +01:00
89cc449808 Update exhaustion values for 1.18.30 (#5034) 2022-05-17 18:28:19 +01:00
1e59679ec2 Implemented Stonecutter (#4732) 2022-05-17 16:01:03 +01:00
8b8560a701 Added PlayerPostChunkSendEvent (#4937)
this is primarily useful for debugging plugins, but could also be useful for other things, such as spawning fake blocks, particles, etc.
2022-05-17 15:40:01 +01:00
161ab5af16 Bump docker/setup-buildx-action from 1 to 2 (#5042)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-17 15:24:47 +01:00
ab41594da2 Bump actions/checkout from 2 to 3 (#5041)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-17 15:24:23 +01:00
80d4c11061 Bump ncipollo/release-action from 1.8.6 to 1.10.0 (#5040)
Bumps [ncipollo/release-action](https://github.com/ncipollo/release-action) from 1.8.6 to 1.10.0.
- [Release notes](https://github.com/ncipollo/release-action/releases)
- [Commits](https://github.com/ncipollo/release-action/compare/v1.8.6...v1.10.0)

---
updated-dependencies:
- dependency-name: ncipollo/release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-17 15:17:33 +01:00
e767796986 Bump shivammathur/setup-php from 2.12.0 to 2.18.1 (#5043)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.12.0 to 2.18.1.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.12.0...2.18.1)

---
updated-dependencies:
- dependency-name: shivammathur/setup-php
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-17 15:16:08 +01:00
dea7031b86 Bump actions/cache from 2 to 3 (#5044)
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-17 15:15:52 +01:00
7e3d099d5b Update dependabot.yml 2022-05-17 15:08:52 +01:00
8b1bd5b7ff World: do not hardcode length of day in computeSunAnglePercentage() 2022-05-16 18:17:32 +01:00
d807840d57 Merge branch 'next-major' into modern-world-support 2022-05-16 18:03:10 +01:00
4dbac79e86 Merge branch 'stable' into next-minor 2022-05-16 18:02:25 +01:00
5abc7f866a 4.3.4 is next 2022-05-16 17:50:41 +01:00
9dc2a01c2e Release 4.3.3 2022-05-16 17:50:29 +01:00
6f0aa360d1 Bump build/php from 19222cf to 8138c6a (#5039)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `19222cf` to `8138c6a`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](19222cfb28...8138c6a4a4)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-16 17:20:24 +01:00
2f2ffe0aa4 fix phpstan 2022-05-13 21:03:49 +01:00
4430f6c5fd Updated upgrade schemas 2022-05-13 20:51:23 +01:00
a75bc5d537 Mojang cannot be relied on ... 2022-05-13 20:50:38 +01:00
7c3b78b0a0 ItemFactory: fix missing registration for dead coral fans
closes #5032

this is evidently not an ideal solution, and something more dynamic would be preferred so that we don't have to manually register an item for every permutation.
2022-05-13 13:53:28 +01:00
643556a366 Broaden scope of testing for item serializer/deserializer
this change will cause failing tests; it has found a problem with coral fans of which I was previously unaware
2022-05-13 13:35:58 +01:00
1a598bdfd8 RuntimeBlockMapping: make constructor more useful
this allows providing more customisable data sources.
2022-05-12 21:20:28 +01:00
e27f80fd85 Remove unused code 2022-05-12 21:06:33 +01:00
d922f003f6 Fixed consistency check 2022-05-12 20:39:03 +01:00
d17032dd8c Test all known blockstates, not just the ones found in VanillaBlocks
VanillaBlocks isn't guaranteed to be a complete record. For example, I've considered moving chemistry blocks to a separate EducationBlocks registry.
In such a case, the blocks are still expected to serialize correctly, but they won't be in VanillaBlocks.
2022-05-12 16:45:44 +01:00
4c03aabe0f I'm going to kill myself... 2022-05-12 16:44:21 +01:00
3ae9341c52 [BC break] doors don't have a powered flag in Bedrock 2022-05-12 16:43:44 +01:00
d10d660a4d fix PHPStan 2022-05-12 16:37:50 +01:00
107b0e1728 CS again, kill me 2022-05-12 16:35:12 +01:00
7769857f6a Added unit test to verify all VanillaBlocks serialize and deserialize correctly 2022-05-12 16:34:24 +01:00
cb97f37d13 First look at modern-spec serializer/deserializer for items
this is not yet used by anything
2022-05-12 16:26:38 +01:00
6c92e73b46 Switch to modernized BedrockData 2022-05-12 15:30:35 +01:00
c1a01e91bf Merge branch 'next-major' into modern-world-support 2022-05-11 20:46:32 +01:00
12e4724b19 Merge remote-tracking branch 'origin/stable' into next-minor 2022-05-11 20:45:16 +01:00
52e74296de Stop the server if any plugin failed to load or enable (#4951)
closes #3080 

If plugins fail to load for some reason, it's highly likely that some critical functionality of the server is compromised. For example:
- if an NPC plugin fails to load, all custom entities added by that plugin will be deleted from worlds
- if a world protection plugin fails, players will be able to grief your otherwise immutable lobby map
- if a worldgen plugin fails, worlds using custom generators won't load
- if a permission plugin fails, players might have access to commands and features they aren't supposed to have
- the list goes on...

This change makes the server commit graceful suicide if any plugin fails to load for error-related reasons, including (but not limited to):
- Incompatible API version
- Missing dependencies
- Invalid plugin.yml
- Invalid main class

Plugins prevented from loading by `plugin_list.yml` are not considered errors and **are not** included in this change. If a plugin is disallowed from loading due to the `plugin_list`, the server will continue to run as if the plugin was not present.
2022-05-11 20:43:38 +01:00
3b7e274c34 Server: localize 'forcing server shutdown' message 2022-05-11 14:54:29 +01:00
db6abfb227 Stop the server if generators specified for new worlds are not valid
I thought I did this already in eff856d8e5, but it looks like my brain slipped a gear.

Without this change, it's possible to crash the server by specifying an invalid generator for the default world if it doesn't yet exist.
2022-05-11 14:35:20 +01:00
2adaca2521 README: remove unnecessary things
[ci skip]
2022-05-11 13:53:52 +01:00
b6f39035f8 README: fix logo URLs
[ci skip]
2022-05-11 13:52:00 +01:00
cfd550451f Added dark mode variant of the logo (#5014)
Since the text is barely visible on dark mode (black on black), i added an inverted version that only shows with dark mode using the [picture](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture) tag.
The tag is supported in all browsers except IE since ~2015
I added an exception block for old IE versions, new versions dropped support for `[if IE]` though
2022-05-11 13:44:20 +01:00
60d3bddfbc Merge branch 'next-major' into modern-world-support 2022-05-11 13:14:42 +01:00
9ff1bf6deb Merge remote-tracking branch 'origin/stable' into next-minor 2022-05-11 13:12:45 +01:00
212c94ce98 PluginManager: Log an error message when a plugin disables itself during enabling 2022-05-11 13:07:45 +01:00
77530b0c24 Bump build/php from 0b5760b to 19222cf (#5027)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `0b5760b` to `19222cf`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](0b5760bb3b...19222cfb28)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-11 12:55:36 +01:00
3e1246acff FormattedCommandAlias: Invoke commands directly with pre-parsed arguments
this resolves a range of issues with quoted arguments when using placeholders, as well as improving performance (no redundant combine -> re-parse needed).
2022-05-10 16:03:09 +01:00
4c29f98292 "Fix CS" are going to be my final words ... 2022-05-10 15:39:44 +01:00
5cc0d92eff Fixed PHPStan errors 2022-05-10 15:38:26 +01:00
b875b68fc7 Fix PHPStan error in CommandStringHelperTest 2022-05-10 15:24:14 +01:00
a5ebbf8adb Fix CS again 2022-05-10 15:23:55 +01:00
217385efb9 CommandStringHelper::parse() returns a non-empty list of strings 2022-05-10 15:22:46 +01:00
f70c36baf9 SimpleCommandMap: parse config-defined commands according to the same rules as manually typed commands 2022-05-10 15:21:39 +01:00
eda4ae9181 Added unit tests for CommandStringHelper 2022-05-10 15:11:29 +01:00
d2e421c424 CommandStringHelper: fixed backslashes not being removed from escaped quotes
this time, without breaking eval commands ... stripslashes likes to strip ALL backslashes, whether they are actually escaping something or not, which is super annoying.
2022-05-10 15:09:57 +01:00
6da53536ca Merge branch 'next-minor' of github.com:pmmp/PocketMine-MP into next-minor 2022-05-10 14:30:21 +01:00
1da6aa40f8 Leaves: drop sticks with a 2% chance (#5019)
as per vanilla
2022-05-10 14:17:18 +01:00
a913736235 fix CS 2022-05-10 14:13:01 +01:00
124edeacaf fix build 2022-05-10 14:11:46 +01:00
a216f4d089 Utils: improve representation of int, float and null in stack trace parameters 2022-05-10 14:07:07 +01:00
17b0e0be84 Utils: use match to clean up stringifyValueForTrace() 2022-05-10 14:04:52 +01:00
81d8aed2e2 Utils: account for named variadic arguments in printableTrace() 2022-05-10 13:59:42 +01:00
69418084bc Boat: fixed max stack size to match vanilla (#5018) 2022-05-10 13:16:04 +01:00
593a4b65ea World: fixed crash when using unloadChunk() during ChunkPopulateEvent, ChunkLoadEvent or when using ChunkListeners
I sure hope there isn't any other cases where this edge case can appear ...

closes #5022
2022-05-10 13:09:26 +01:00
869d340f10 Regenerate PHPStan baselines 2022-05-10 12:38:20 +01:00
5d64d4a1e3 Updated phpstan-strict-rules 2022-05-10 12:34:27 +01:00
cc3c5bdb8d Bump phpstan/phpstan from 1.6.7 to 1.6.8 (#5025)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.6.7 to 1.6.8.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.7.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.6.7...1.6.8)

---
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>
2022-05-10 12:32:22 +01:00
e1c4150dff 4.3.3 is next 2022-05-10 00:57:50 +01:00
755ca1af9b Release 4.3.2 2022-05-10 00:57:50 +01:00
7d78b9cb2c Bump build/php from f5d7b45 to 0b5760b (#5023)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `f5d7b45` to `0b5760b`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](f5d7b45990...0b5760bb3b)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-10 00:55:07 +01:00
91f802ac7a Bump phpstan/phpstan from 1.6.3 to 1.6.7 (#5015)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.6.3 to 1.6.7.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.7.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.6.3...1.6.7)

---
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>
2022-05-05 11:49:27 +01:00
72cfea3a63 SimpleCommandMap: extract command string parsing code into its own unit 2022-05-01 22:05:38 +01:00
a353872327 FormattedCommandAlias: match placeholders using regex 2022-05-01 21:16:13 +01:00
f4d71d0b48 FormattedCommandAlias: reduce complexity of buildCommand() 2022-05-01 21:04:38 +01:00
a6299b0927 pocketmine.yml: moar docs for command aliases hidden features 2022-05-01 16:16:32 +01:00
6e372d9e36 Entity: fixed setNameTagVisible not having immediately visible effect 2022-05-01 14:54:41 +01:00
ad8132ae11 Bump build/php from 7b357f8 to f5d7b45 (#5004)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `7b357f8` to `f5d7b45`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](7b357f8cf9...f5d7b45990)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-01 14:04:38 +01:00
0326c4964b Merge branch 'next-major' into modern-world-support 2022-04-28 21:06:44 +01:00
5d39d7a1c8 Version bump to 4.4 2022-04-28 21:00:49 +01:00
937bb4c6ce Merge branch 'stable' into next-minor 2022-04-28 21:00:23 +01:00
cf15a0913d World: fixed a corner case assertion failure in generation system
This required the following:
- A generation task (taskA) to already be running for any chunk (chunkA)
- A chunk (chunkB) is requested for generation, and the task (taskB) to do the generation
  is commenced immediately
- chunkB generation promise is aborted (e.g. due to chunk unload) and
  taskB is orphaned
- chunkB is subsequently re-requested, but ends up in the generation
  queue because taskB is still running
- taskA completes and drains the generation queue
- chunkB attempts to be populated a second time, but taskB has not yet
  been collected, resulting in an assertion failure.

This bug has been appearing intermittently ever since PM 4.0 release.
For most users there is no obvious effect since production servers don't
have assertions enabled; however, it's unclear what kind of weird side
effects this bug may have had.
2022-04-28 20:23:23 +01:00
33cf085692 PHPStan 1.6.3 2022-04-28 16:06:20 +01:00
3752225ed5 World: fix CS 2022-04-28 16:00:34 +01:00
5cf572892f WorldManager: fixed missing initializer for $defaultWorld 2022-04-28 15:38:20 +01:00
20ff5d5a3d Modernize property declarations in src/entity/animation 2022-04-28 15:33:13 +01:00
b88a47929f Modernize property declarations in src/world/* 2022-04-28 15:06:17 +01:00
159392e738 wtf is this shitbox code 2022-04-28 14:57:57 +01:00
2f03af51dd Modernize property declarations in src/world/sound 2022-04-28 14:57:01 +01:00
cb76c149e1 Modernize property declarations in src/world/particle 2022-04-28 14:55:53 +01:00
6d7bf1c5d8 Utils: fixed missing property initializer 2022-04-28 14:52:21 +01:00
ed2a239334 Modernize property declarations in src/world/generator 2022-04-28 13:16:21 +01:00
46c504e529 Modernize property declarations in src/ 2022-04-28 13:14:23 +01:00
0e7e776862 Modernize property declarations in src/utils 2022-04-28 13:12:12 +01:00
de12b701ac Modernize type declarations in src/world/format 2022-04-28 13:07:58 +01:00
b402df8b91 Modernize property declarations in pocketmine\crafting namespace 2022-04-25 13:15:48 +01:00
dca457b1e0 Modernize property declarations in pocketmine\command namespace 2022-04-25 13:09:14 +01:00
72cff0ee11 Modernize property declarations in pocketmine\block namespace 2022-04-25 13:00:29 +01:00
09778e3f1b Fixed build failure 2022-04-25 12:56:16 +01:00
9f5d4180c9 Spawnable: remove dead code, deprecate isDirty() and setDirty() 2022-04-25 12:46:01 +01:00
c8a7a53d70 event: modernize property declarations where possible
only private fields are modified; protected ones can't be changed in case someone extended the classes
2022-04-25 00:06:26 +01:00
223893fd5c PlayerChangeSkinEvent: remove obsolete doc comment 2022-04-24 21:56:49 +01:00
a58551af5b 4.3.2 is next 2022-04-23 16:03:15 +01:00
f7dce4af88 Release 4.3.1 2022-04-23 16:03:14 +01:00
dff5c30172 Updated BedrockProtocol to 9.0.1 2022-04-23 16:01:08 +01:00
e8994dbc17 Bump build/php from 1fae6b8 to 7b357f8 (#4987)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `1fae6b8` to `7b357f8`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](1fae6b8d4a...7b357f8cf9)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-23 14:20:47 +01:00
aaba8a2a9a Bump phpstan/phpstan from 1.5.6 to 1.5.7 (#4975)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.5.6 to 1.5.7.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.6.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.5.6...1.5.7)

---
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>
2022-04-21 16:45:16 +01:00
27056b6c37 Player: creative players should not be damaged by the void (#4978) 2022-04-21 16:39:36 +01:00
9930de01b9 Bump phpstan/phpstan-phpunit from 1.1.0 to 1.1.1 (#4979)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.1.0...1.1.1)

---
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>
2022-04-21 16:38:36 +01:00
37f0ccdb7e fix CS 2022-04-20 14:58:57 +01:00
43e61336cf Support 1.18.30 worlds 2022-04-20 14:58:32 +01:00
e383f6d8f8 Merge branch 'next-major' into modern-world-support 2022-04-20 14:29:22 +01:00
6dbfdd970f Merge branch 'stable' into next-minor 2022-04-20 14:23:51 +01:00
cfea0dac76 Push back to 4.4.0 2022-04-20 14:22:31 +01:00
cd021f49cd 4.3.1 is next 2022-04-20 14:15:12 +01:00
e4ce467c0b Release 4.3.0 2022-04-20 14:15:06 +01:00
6b4687a36b RuntimeBlockMapping: unseal constructor to facilitate easier testing of new versions 2022-04-20 14:00:20 +01:00
c085bf0db4 Changes for 1.18.30 2022-04-20 13:59:50 +01:00
e0d4bd985e 4.2.11 is next 2022-04-20 13:03:25 +01:00
3339225fe8 Release 4.2.10 2022-04-20 13:03:25 +01:00
df33e179e5 Player: fixed chat newlines denial-of-service vulnerability
irresponsibly reported in #4974

closes #4974
2022-04-20 13:01:05 +01:00
624a7dff16 4.2.10 is next 2022-04-19 16:53:12 +01:00
1d314ad4ce Release 4.2.9 2022-04-19 16:53:11 +01:00
5a98b08ee8 Fixed several crashes on bad data due to inadequate TAG_List type checks 2022-04-19 16:48:18 +01:00
be863015bf Merge branch 'next-major' into modern-world-support 2022-04-19 15:32:44 +01:00
8edf2c4507 Update blockstate upgrade schemas 2022-04-19 15:31:39 +01:00
ded7e24f67 Merge branch 'stable' into next-minor 2022-04-19 15:27:55 +01:00
e73bb07da0 Updated locale data 2022-04-19 15:27:00 +01:00
d9d02d526a Updated PHP versions for GitHub Actions 2022-04-19 15:06:00 +01:00
f272986903 4.2.9 is next 2022-04-17 20:45:32 +01:00
988da8eaab Release 4.2.8 2022-04-17 20:45:32 +01:00
ea7f706aed RakLib 0.14.4 2022-04-17 20:41:18 +01:00
52e3f1e269 ZippedResourcePack: ensure non-empty file
ZipArchive raises deprecation errors on empty files for some reason
2022-04-17 20:32:23 +01:00
4c9d2a989e cs again 2022-04-17 19:32:30 +01:00
022db5cbe3 NetworkSession: compare usernames case-insensitively
the current data management system uses case-insensitive names, so we can't allow different players with the same name in different cases to join, or we will have duplication exploits.

This typically only applies to offline servers, since Xbox Live doesn't permit reuse of a username, same case or otherwise.

closes #4965
2022-04-17 19:28:10 +01:00
42474c14aa World: reduce blockhash padding for Y axis to accommodate new height range 2022-04-15 19:47:25 +01:00
63b2e7cc4f fix CS 2022-04-15 19:25:39 +01:00
3edb735850 Regenerate PHPStan baseline 2022-04-15 19:12:08 +01:00
eafbc3a468 Expand height range to include -64 to 320 2022-04-15 19:10:24 +01:00
c1c3475e5a RuntimeBlockMapping: reuse the state ID for unknown blocks
this doesn't really provide any meaningful benefit, unless there are a very large number of unrecognized states
2022-04-15 19:06:56 +01:00
3bbf558883 4.2.8 is next 2022-04-15 16:36:47 +01:00
1d68d9f71a Release 4.2.7 2022-04-15 16:36:42 +01:00
f2e8824242 fix CS 2022-04-15 16:24:15 +01:00
a0e47b5a64 phpstan 1.5.6 2022-04-15 16:21:05 +01:00
f7465f55e7 Update transient composer dependencies 2022-04-15 16:17:33 +01:00
453bf6d73b fix build 2022-04-10 21:37:10 +01:00
3353a00641 List command aliases in /help <commandName> 2022-04-10 21:32:46 +01:00
e388cb1643 Merge branch 'stable' into next-minor 2022-04-10 21:23:04 +01:00
741182c55f InGamePacketHandler: skip processing movement if the player's position
was changed during processing other properties (#4913)

fixes #4952
2022-04-10 21:02:45 +01:00
2efce35331 PluginManager: fixed updating disabled scheduler when plugins cause other plugins to be disabled from within scheduled tasks 2022-04-10 21:00:16 +01:00
d1dfbd95e2 Entity: workaround teleport client bug #4394 by despawning and respawning the entity (#4870)
this is a sucky solution but it works well enough for this scenario.

From my research it appears that while the client-side MovementInterpolator is active on the client and hasn't yet reached its target, any teleport sent during the lerp will get overridden by the lerp.
This appears to last 3-4 ticks (about 150-200 ms) which explains why this can be reproduced by stopping movement just before the ender pearl lands (human reaction times would make the reproduction unreliable otherwise).

Things to note:
- All entities are affected by this bug.
- MovePlayerPacket appears not to have the problem, but we can't use it because it doesn't work for non-players.
- MoveActorAbsolute and MoveActorDelta are both handled by the same code and will have the same lerping bug.

This is the cleanest solution I could come up with.
2022-04-08 23:12:01 +01:00
4fc712119f FlowerPot: allow removing the planted item
closes #4896
closes #4898

this is not completely consistent with client-side predictions due to a bug in the client, which I believe is a problem limited to the legacy transaction system.
2022-04-08 23:07:08 +01:00
1aee5b1ed8 Bump ramsey/uuid from 4.2.3 to 4.3.1 (#4929)
Bumps [ramsey/uuid](https://github.com/ramsey/uuid) from 4.2.3 to 4.3.1.
- [Release notes](https://github.com/ramsey/uuid/releases)
- [Changelog](https://github.com/ramsey/uuid/blob/5.x/CHANGELOG.md)
- [Commits](https://github.com/ramsey/uuid/compare/4.2.3...4.3.1)

---
updated-dependencies:
- dependency-name: ramsey/uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dylan T <dktapps@pmmp.io>
2022-04-08 22:22:51 +01:00
fefd3e6b29 Document how to passthru arguments to aliased commands 2022-04-07 23:36:04 +01:00
9b43be9d9c Improved documentation of pocketmine.yml aliases 2022-04-07 23:10:18 +01:00
ea677154cb InGamePacketHandler: rely exclusively on prediction mismatch checking to re-sync slots during bad transactions
fixes #4894
closes #4926
relying on the core code to guess which slots should be synced is unreliable at best.
2022-04-04 21:58:19 +01:00
7f2802e75f Bump phpstan/phpstan from 1.5.3 to 1.5.4 (#4942)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.6.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.5.3...1.5.4)

---
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>
2022-04-04 14:03:07 +01:00
f924208881 Update PlayerPreLoginEvent documentation (#4940)
Removed outdated documentation that was very misleading. Replaced with better documentation that accurately describes how to cancel the event.
2022-04-03 17:59:07 +01:00
6bea2961d9 Bump phpunit/phpunit from 9.5.19 to 9.5.20 (#4939)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.19 to 9.5.20.
- [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.19...9.5.20)

---
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>
2022-04-01 23:52:55 +01:00
ac3a6033b9 PluginManager: account for possible abstract main classes
idk why anyone does this, but it shouldn't cause a core crash ...
2022-04-01 23:42:37 +01:00
d7e6b01216 4.2.7 is next 2022-04-01 23:01:15 +01:00
26aee7ff73 Release 4.2.6 2022-04-01 23:01:15 +01:00
319c8fe32c Updated BedrockProtocol 2022-04-01 22:59:43 +01:00
ce121ccea9 Bump phpstan/phpstan from 1.5.2 to 1.5.3 (#4935)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.5.2 to 1.5.3.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.6.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.5.2...1.5.3)

---
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>
2022-03-31 13:37:32 +01:00
ede9e78fbd ItemBlock: make final, and document its purpose more clearly 2022-03-29 12:49:49 +01:00
7f1a4185b5 Bump phpstan/phpstan from 1.5.1 to 1.5.2 (#4933)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.6.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.5.1...1.5.2)

---
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>
2022-03-29 12:41:54 +01:00
4c433fd75b Remap invalid metadata values to zero
this is a bit less sophisticated than the way we do it with BlockFactory, but this shouldn't usually have any relevance anyway - it's only used for correcting bogus states.
2022-03-28 18:13:14 +01:00
53c2c4939e Merge branch 'next-major' into modern-world-support 2022-03-28 17:23:13 +01:00
7d1464f0a1 Merge branch 'stable' into next-minor 2022-03-28 17:18:54 +01:00
8cc7fb9dd9 fix CS 2022-03-28 17:16:35 +01:00
194cb1fb84 phpstan 1.5.1 2022-03-28 17:12:00 +01:00
8ea106c091 4.2.6 is next 2022-03-28 16:35:10 +01:00
a6cb3313b0 Release 4.2.5 2022-03-28 16:34:57 +01:00
c6374b79b0 Improve crashdump ergonomics
hopefully this will result in less people making useless pastes that don't contain backtraces ...
2022-03-24 19:46:11 +00:00
993adc8c82 LevelDB: remove deprecated constants
there's no point pretending we can maintain BC on this now
2022-03-24 12:59:45 +00:00
9f4418e01d Wall: separate connection calculation into its own method
we'll need this once wall connections start actually being stored instead of just being recalculated on every read.
2022-03-24 12:52:51 +00:00
8bf1fb7b1d Merge branch 'next-minor' into modern-world-support 2022-03-24 12:50:45 +00:00
f25beab6cb Use constants for compound meta values 2022-03-23 15:58:27 +00:00
3c5300556a Fixed tests 2022-03-23 15:27:57 +00:00
334c9daa6a BlockFactory: change property cache arrays to use regular arrays instead of SplFixedArray
this does come at a performance cost, but is necessary for metadata expansion.

we finally concede that this is not going to happen without BC breaks, however small they might be ...
2022-03-23 15:22:57 +00:00
b52bb5016c BlockIdentifier: enforce that ID and variant must be non-negative 2022-03-23 14:39:02 +00:00
310104f786 BlockFactory: change fullList to non-fixed array
when we expand the metadata range, having a fixed array here will present some problems due to significantly increased memory footprint (2x for every bit added).
2022-03-23 14:34:15 +00:00
901449b0b1 Player: simplify PlayerItemHeldEvent calling on content change
the second parameter to this callback is the OLD slots, not the changed slots. This means that ALL slots are included, including empty and unchanged slots.
2022-03-23 13:47:01 +00:00
ed95679953 Merge branch 'next-minor' into modern-world-support 2022-03-23 13:42:46 +00:00
a9f2766a8b Merge branch 'stable' into next-minor 2022-03-23 13:39:41 +00:00
4e777572c9 fix CS 2022-03-23 13:28:21 +00:00
90a8595a40 Check for mismatched inventory slot predictions in transactions
this should limit the problems caused by mismatched gameplay features that result in ghost items, such as #4896.
2022-03-22 17:42:19 +00:00
bf71eb448a Reduce chaos in inventory classes 2022-03-22 17:19:55 +00:00
2c29d272ad BaseInventory: move setMaxStackSize() to a more sensible place 2022-03-22 17:11:48 +00:00
98aa2b9ff9 Inventory: move removeItem() next to remove()
this should hopefully be more attention grabbing and a bit less misleading, since people will wonder why there are 'remove' and 'removeItem' both.

we really need to rename one of these...
2022-03-22 17:08:30 +00:00
ea33a04d00 Player: ensure that PlayerItemHeldEvent is called when the contents of the held slot changes
in PM3, this was done by implicitly relying on the client to send a MobEquipmentPacket selecting the same hotbar slot when the slot contents changes.
In PM4, we avoid relying on this, and fire the event directly when the listener detects a held slot change.
This ensures that the behaviour remains consistent regardless of what the client starts doing in the future.

closes #4905
2022-03-22 16:53:02 +00:00
9963fcf849 PluginManager: return the created RegisteredListener from registerEvent()
this allows the handler to be later unregistered when used with a plain closure instead of a magic `Listener`.
2022-03-22 16:20:37 +00:00
ab93135b84 Merge branch 'stable' into next-minor 2022-03-22 15:49:58 +00:00
4a94cb85a2 fix CS 2022-03-22 15:44:11 +00:00
b7e6854189 RegistryTrait: enforce name validation rules on everything, not just enums
fixes #4916
2022-03-22 15:41:17 +00:00
2b8a54f8ff Entity: added a guard to prevent __construct() from running multiple times
this typically happens due to flawed logic in child classes in plugins which causes parent::__construct() to get called multiple times.
2022-03-22 15:33:31 +00:00
a5dab0f61e Bump build/php from b6bb711 to 1fae6b8 (#4918)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `b6bb711` to `1fae6b8`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](b6bb7114b3...1fae6b8d4a)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 21:05:13 +00:00
824f1f24ff Build release Docker images on GitHub Actions (#4891)
this has been tested on a fork using GitHub Container Registry, but we'll have to do an actual release to test if it will work with Docker Hub. However, I don't expect there to be any problems.

This is one of two remaining jobs to be migrated off Jenkins.
2022-03-20 01:03:27 +00:00
f4f5c3128f EnumTrait: fixed regex not accepting member names with 1 character
this also fixes EnumTrait accepting invalid non-numeric characters for the first character, such as @.
2022-03-19 16:47:36 +00:00
fdd42fd15f 4.2.5 is next 2022-03-18 20:20:47 +00:00
05a5e5eac1 Release 4.2.4 2022-03-18 20:20:32 +00:00
c8e1cfcbee TypeConverter: account for possible out-of-range meta in items 2022-03-18 19:34:51 +00:00
869dda9a45 Bump phpunit/phpunit from 9.5.18 to 9.5.19 (#4900)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.18 to 9.5.19.
- [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.18...9.5.19)

---
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>
2022-03-15 19:39:49 +00:00
e2c647ef91 Bump phpstan/phpstan from 1.4.9 to 1.4.10 (#4899)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.4.9 to 1.4.10.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.5.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.4.9...1.4.10)

---
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>
2022-03-15 12:04:50 +00:00
05fdd94754 fix CS 2022-03-12 00:57:32 +00:00
4a599b58ff Bump phpstan/phpstan from 1.4.8 to 1.4.9 (#4893)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.4.8 to 1.4.9.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/master/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.4.8...1.4.9)

---
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>
2022-03-10 20:18:53 +00:00
05792826bc EntityFactory: use import aliases to improve readability slightly 2022-03-09 23:39:45 +00:00
fbf7ad4295 4.2.4 is next 2022-03-09 22:52:42 +00:00
6c1c0c867e Release 4.2.3 2022-03-09 22:52:38 +00:00
5c0eb92d81 Entity: harden setRotation(), setMotion(), addMotion() and teleport() against NaN/INF values 2022-03-09 22:36:44 +00:00
1e88412a8f Entity: harden constructor against dodgy locations containing NaN/INF components 2022-03-09 22:31:24 +00:00
f97ce6afef Harden APIs which accept Vector3/Position/Location in event namespace 2022-03-09 22:22:37 +00:00
879476d8e0 ItemFrame: added missing bounds check for setItemDropChance() 2022-03-09 22:20:04 +00:00
6d584cf008 EntityDataHelper: prevent INF/NaN being loaded from disk to come back and break things after the fact 2022-03-09 22:16:07 +00:00
8efa299c65 phpstan 1.4.8 2022-03-09 18:30:54 +00:00
b6e7ad187a Updated composer dependencies 2022-03-09 18:07:28 +00:00
5ef73ca9aa Entity: Remove outdated comment 2022-03-09 18:02:57 +00:00
c50518a4ca build/generate-registry-annotations: specify type that PHPStan can't infer 2022-03-09 17:53:10 +00:00
4c98780bdb Fixed PHPStan iterable types for LevelDBIterator 2022-03-09 17:28:59 +00:00
856fd2a33b fix PHPStan failures 2022-03-09 17:26:05 +00:00
581bbfe255 DiskResourceProvider: add @var for type that PHPStan can't infer 2022-03-09 17:18:40 +00:00
b4e1edaa64 CommandSender: provide more detailed types for getScreenLineHeight() and setScreenLineHeight() 2022-03-09 17:17:51 +00:00
025f6407e2 Fire: fixed sticking to transparent top-sides of blocks
closes #4879
closes #2819
2022-03-09 16:59:26 +00:00
10c0d83fa5 ShulkerBox: Allow opening unless the lid is obstructed by a solid block (#4885)
fixes #4884
2022-03-09 16:37:23 +00:00
9a6ec14cbf Bump phpunit/phpunit from 9.5.16 to 9.5.18 (#4892)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.16 to 9.5.18.
- [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.16...9.5.18)

---
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>
2022-03-09 16:32:47 +00:00
f77fec0c3c doxygen -u doxygen/doxygen.conf 2022-03-09 16:28:38 +00:00
5d970cf5bd Fire: do not overwrite blocks during burning unless they were unchanged by onIncinerate()
onIncinerate() by custom blocks might produce custom results which aren't supposed to be burned away (e.g. wood could turn into charred wood, or something of that nature).
closes #4764
2022-03-03 19:19:59 +00:00
58e186440b Bump build/php from d110b60 to b6bb711 (#4871)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `d110b60` to `b6bb711`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](d110b60bef...b6bb7114b3)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-03 19:02:30 +00:00
6a39caa204 Fixed mycelium spreading onto coarse dirt (#4816) 2022-03-03 19:02:13 +00:00
91f81d4c8e Sweet Berry Bush now absorbs fall damage (#4876) 2022-03-03 19:00:44 +00:00
2b81b53dfa Merge branch 'stable' into next-minor 2022-03-03 18:50:12 +00:00
dfd8c4e4b8 TaskScheduler: throw an exception if attempting to heartbeat a disabled scheduler 2022-03-03 18:49:17 +00:00
c9c50e16ec PluginManager: fixed mishandling of self-disabling plugins in enablePlugins()
this caused a leak of the plugin context, PluginEnableEvent to be called with a disabled plugin, and the plugin's scheduler to get ticked.
2022-03-03 18:48:52 +00:00
eff856d8e5 Stop the server if any world listed by config fails to load or be generated during startup
closes #3162

this does not affect worlds loaded by plugins; they may continue to handle errors as they see fit
2022-03-03 18:40:11 +00:00
90a369f0b6 Humans can now do emotes (#4610)
added the following API methods:
- Human::emote()
2022-03-03 18:19:30 +00:00
ba05b4f024 Whitelist command now kicks non-whitelisted online players (#4774)
closes #3868
2022-03-03 18:15:21 +00:00
3e90c3072a 4.2.3 is next 2022-03-02 23:00:33 +00:00
12946fbe46 Release 4.2.2 2022-03-02 23:00:29 +00:00
70f923714c Merge branch 'stable' into next-minor 2022-03-02 18:43:34 +00:00
7cd394b0fb Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2022-03-02 18:30:38 +00:00
0bca098707 doxygen: remove footer timestamp 2022-03-02 18:30:26 +00:00
d47a7f48bd BrewingStand: avoid duplicate method call (#4874) 2022-03-02 17:32:56 +00:00
f181c60209 Fixed typo (occured => occurred) (#4873)
[ci skip]
2022-03-02 16:28:02 +00:00
784c34f784 Update README.md 2022-03-02 02:29:04 +00:00
03fa5387ac StringToItemParser: recognize cod, raw_cod and cooked_cod 2022-03-01 21:49:36 +00:00
1ea0b8a9df VanillaBlocks generator now reverse-lookups ID constants instead of baking numeric IDs into the code
this makes it easier to spot errors.
similar treatment as VanillaItems received in the previous commit
2022-02-26 16:17:23 +00:00
566e4a4196 VanillaItems generator now reverse-lookups ID constants instead of baking numeric IDs into the code
this makes it easier to spot errors.
there's nothing we can do about the metadata values, but IDs can be quite easily constified.
there might be some weird artifacts where constants are aliased (e.g. appleenchanted) , but this is inarguably better than baking numeric IDs.
2022-02-26 16:10:34 +00:00
61265604fb Bump phpunit/phpunit from 9.5.15 to 9.5.16 (#4863)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.15 to 9.5.16.
- [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/commits/9.5.16)

---
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>
2022-02-24 14:20:19 +00:00
29909e7f44 Bump phpunit/phpunit from 9.5.14 to 9.5.15 (#4859)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.14 to 9.5.15.
- [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.14...9.5.15)

---
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>
2022-02-23 13:13:51 +00:00
a95749f968 Now using new repository for block upgrade schemas 2022-02-22 22:09:47 +00:00
3232a83965 InventoryManager: beware possible crash due to invalid items 2022-02-22 16:50:36 +00:00
c816bbdb6e Remove unused import that php-cs-fixer doesn't see 2022-02-22 16:46:23 +00:00
4f25ab10e9 InventoryManager: Do not sync slots the client correctly predicted during using items
closes #4825
2022-02-22 16:46:23 +00:00
f04099c5de Bump phpunit/phpunit from 9.5.13 to 9.5.14 (#4854)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.13 to 9.5.14.
- [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.13...9.5.14)

---
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>
2022-02-21 15:46:51 +00:00
fdb82f5fb8 Bump build/php from 30eed13 to d110b60 (#4852)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `30eed13` to `d110b60`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](30eed13faa...d110b60bef)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 04:14:08 +00:00
75d4c47384 LevelDB: fixed incorrectly writing always newest protocol version in world saves
this made it impossible to tell the difference between PM worlds and bedrock worlds modified post-1.12.
2022-02-20 21:08:31 +00:00
bd4c2b5245 MemoryManager: scrub string keys for dumping
fixes crashes such as https://crash.pmmp.io/view/5986490
this also ensures that the order of elements is maintained when decoded by another software.
2022-02-20 20:54:03 +00:00
d60dba2de0 DumpMemoryCommand: fixed memory dump dir 2022-02-20 20:39:53 +00:00
51a3043dfd PlayerInventory: fixed isHotbarSlot() returning bogus result for 9 2022-02-20 20:29:51 +00:00
5415ca2fa9 Merge branch 'next-minor' into modern-world-support 2022-02-19 20:36:20 +00:00
7098bcec8c 4.2.2 is next 2022-02-19 20:20:58 +00:00
6d65512531 Release 4.2.1 2022-02-19 20:20:58 +00:00
3ed336fa0e Merge branch 'stable' into next-minor 2022-02-19 20:16:49 +00:00
b26b1cd32f Fixed swimming hitbox glitch
fixes #4815
relates to Sandertv/gophertunnel#88
2022-02-19 20:14:17 +00:00
54db842d16 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2022-02-19 19:26:39 +00:00
31a0085efb Update setup-php-action to pmmp/setup-php-action@aa636a4fe0 2022-02-19 19:26:30 +00:00
715355e148 Update GitHub Actions to PHP 8.0.16. 2022-02-19 19:20:08 +00:00
55dfacea8d Item: Improve performance of nbtSerialize() (#4831)
Replace hasNamedTag() with $nbt->count() > 0
This avoids a duplicate indirect call to Item::serializeCompoundTag() method call when serializing items with namedtags.
2022-02-16 00:32:12 +00:00
e98cf39b47 cs 2022-02-11 21:18:56 +00:00
dda2f42e59 updated BedrockData 2022-02-11 21:13:59 +00:00
bc46e148df Updated to support new tag storage format 2022-02-11 21:13:28 +00:00
55c744cc00 Added missing changes to the 4.0 changelog (#4820) 2022-02-11 17:39:45 +00:00
169a3217de fix build 2022-02-10 20:56:53 +00:00
905eee3198 BlockStateUpgrader: do not apply backwards-incompatible schemas to blockstates already on the correct version
this notably led to corruption of glow_lichen and sculk_vein in 1.18.10.
2022-02-10 20:51:31 +00:00
8a11ed70e3 improve reusability 2022-02-10 19:38:50 +00:00
db9d769db6 fix CS #2 2022-02-10 13:49:40 +00:00
45150f1a52 fix CS 2022-02-10 13:47:20 +00:00
0f07b2499c Added blockstate upgrade schema generator 2022-02-10 13:45:39 +00:00
0a0383d9bd BlockStateUpgradeSchema: added isEmpty() 2022-02-10 13:03:29 +00:00
7e903fde5b Fixed multiple players being able to sleep in the same bed 2022-02-10 00:57:43 +00:00
1b3e50d0a3 Implement support for remappedPropertyValuesIndex schema format 2022-02-10 00:00:01 +00:00
dc5ddf1c1b make the build pass 2022-02-09 20:18:38 +00:00
03cf635adc Removed pointless array cast 2022-02-09 20:17:28 +00:00
77ba8b81f8 Updated BedrockData 2022-02-09 20:16:54 +00:00
0ce3f763db reEEEEEEEEEEEEEEEEE 2022-02-09 20:13:59 +00:00
0226f5466c Added support for upgrading states via remap (needed for end rods and all-sided-logs) 2022-02-09 20:05:20 +00:00
166ffe430a Updated for 1.18.10 2022-02-08 22:56:04 +00:00
1905f87942 Merge branch 'next-minor' into modern-world-support 2022-02-08 22:25:46 +00:00
d702113fb5 Merge branch 'stable' into next-minor 2022-02-08 22:23:00 +00:00
4f44a067b0 4.2.1 is next 2022-02-08 20:14:19 +00:00
44818e6d14 Release 4.2.0 2022-02-08 20:14:19 +00:00
325131dd30 Protocol changes for 1.18.10 2022-02-08 20:08:15 +00:00
38eeda6e8b Merge branch 'stable' into next-minor 2022-02-07 19:32:07 +00:00
1eb59fb9b5 4.1.1 is next 2022-02-07 19:22:54 +00:00
1c60aa9769 Release 4.1.0 2022-02-07 19:22:53 +00:00
c2d3b23449 fixed BlockFactory consistency test - remapped states are no longer returned by getAllKnownStates() 2022-02-07 18:04:02 +00:00
fe2c3d08a0 Reduce memory footprint of state remapping tables
this becomes a significant problem when expanding metadata size.
2022-02-07 17:31:41 +00:00
7a0f62ce5a Merge branch 'next-minor' into modern-world-support 2022-02-07 17:23:19 +00:00
735e4cc3bc Merge branch 'staging/4.1' into next-minor 2022-02-07 17:22:42 +00:00
e9dd9df0a0 Merge remote-tracking branch 'origin/stable' into staging/4.1 2022-02-07 17:22:18 +00:00
032b15efe0 fix BlockFactory consistency check 2022-02-07 15:49:32 +00:00
256826d9c7 Fixed uninitialized color fields of stained glass, stained clay and stained hardened glass 2022-02-07 15:39:54 +00:00
c273b29dec BambooSapling: fixed wrong bit being used for readiness
closes #4809
2022-02-07 15:38:05 +00:00
e58b3ba46c First look at loading 1.13+ worlds 2022-02-07 03:06:59 +00:00
dd3b79b142 phpstorm sucks 2022-02-07 02:50:43 +00:00
863f9560b0 RuntimeBlockMapping: make fallbackStateData not useless 2022-02-07 02:49:19 +00:00
f870568e62 fix RuntimeBlockMapping 2022-02-07 02:46:50 +00:00
9e03136861 fix CS 2022-02-07 02:43:57 +00:00
1b48603d07 another vague commit restructuring stuff 2022-02-07 02:41:50 +00:00
4e6fb4b12c Merge branch 'next-minor' into modern-world-support 2022-02-07 02:22:47 +00:00
c19a038d47 LevelDB: Added a whole bunch of constants 2022-02-07 00:54:00 +00:00
95bc013e97 Merge branch 'staging/4.1' into next-minor 2022-02-06 23:56:47 +00:00
7ddd547190 Merge remote-tracking branch 'origin/stable' into staging/4.1 2022-02-06 23:55:52 +00:00
38e34093cf ResourcePackManifest: Stop throwing exceptions on extra properties (#4804)
This code currently throws errors when properties other than the base required ones are added. This can be from resource packs created by "bridge.", where the IDE adds a "generated_with" property to the manifest. This leads to resource packs created by bridge., which are otherwise completely valid, not being loaded.
2022-02-06 23:22:22 +00:00
d55eed803d make build green 2022-02-05 21:12:11 +00:00
dd1ebb5915 4.0.10 is next 2022-02-05 16:08:23 +00:00
df1cdbe921 Release 4.0.9 2022-02-05 16:08:10 +00:00
7846ea8acc LevelDB: do not barf on chunk version 8
this covers a wide range from 1.2.13 to 1.8.
2022-02-05 04:18:37 +00:00
1dc0d5f96a WorldManager: do not calculate safe spawn if there are no players in the unloaded world 2022-02-04 19:24:51 +00:00
712ffb3e31 WorldManager: fixed loading the default world's spawn chunk when unloading the default world
yo dawg
I heard you like loading and unloading
so I put some loading inside your unloading
so you can load while you unload
2022-02-04 19:22:37 +00:00
8f5813b003 Move PM core-specific serializer/deserializer stuff to data/bedrock/blockstate/convert 2022-02-04 17:23:51 +00:00
337aab4f0d Use more class aliases to reduce code width 2022-02-04 16:47:54 +00:00
1155f91574 BlockStateSerializer: separate serializer registration from constructor 2022-02-04 16:41:45 +00:00
9fbb2ef46a remove SORT_ASC 2022-02-04 00:27:09 +00:00
4d88f8f7f4 shut 2022-02-04 00:24:57 +00:00
f33633efcb Remove rogue var_dump 2022-02-04 00:23:01 +00:00
324d203f4e Fuck you git 2022-02-04 00:21:26 +00:00
0cc997f531 Checking in BlockStateUpgrader and a bunch of unit tests 2022-02-04 00:16:48 +00:00
2a4111868c Fixed incorrect doc for EncryptionContext (#4791)
* Fixed incorrect doc for EncryptionContext

* Update src/network/mcpe/encryption/EncryptionContext.php

Co-authored-by: Dylan T <odigiman@gmail.com>
2022-02-02 13:12:33 +00:00
123701ed76 Bump tests/plugins/DevTools from 39510af to e884a4c (#4788)
Bumps [tests/plugins/DevTools](https://github.com/pmmp/DevTools) from `39510af` to `e884a4c`.
- [Release notes](https://github.com/pmmp/DevTools/releases)
- [Commits](39510af5bc...e884a4c234)

---
updated-dependencies:
- dependency-name: tests/plugins/DevTools
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-02 00:05:33 +00:00
28dce8783f Bump build/php from bd329db to 30eed13 (#4787)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `bd329db` to `30eed13`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](bd329dba08...30eed13faa)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-02 00:05:17 +00:00
3781b62d35 Update dependabot.yml 2022-02-01 23:58:49 +00:00
859f062267 StringToItemParser: fixed *_concrete_powder giving concrete instead of concrete powder 2022-02-01 23:29:47 +00:00
f85f2cae98 fix CS 2022-02-01 20:02:12 +00:00
6644fd472c fixed more stupid bullshit 2022-02-01 20:00:50 +00:00
101b71ed02 Fixed trapdoor rotation 2022-02-01 19:40:00 +00:00
e808b7aac4 Fixed asymmetric API 2022-02-01 19:39:39 +00:00
f4f4ea1483 fix CS 2022-02-01 17:44:12 +00:00
979f6f3d57 Rewrite RuntimeBlockMapping to use BlockStateSerializer 2022-02-01 17:34:32 +00:00
cab9b6c862 Add a wrapper type for blockstate NBT 2022-02-01 17:29:30 +00:00
4d935aa8b6 Torch facings are the wrong way round :( 2022-02-01 17:12:12 +00:00
ccfe485c06 Fixed end rod up/down state 2022-02-01 13:56:05 +00:00
1a800cf4df fixed match indentations 2022-02-01 05:28:52 +00:00
fe7d942500 fix CS 2022-02-01 05:26:14 +00:00
f323e3c43f BlockStateSerializer can now serialize all currently implemented PM blocks 2022-02-01 05:21:16 +00:00
40e46dbca2 Fixed tests 2022-02-01 04:08:28 +00:00
7d70865db0 Fixed deserializer not handling walls properly 2022-02-01 04:01:56 +00:00
dbe99e5821 Vine: added hasFace() 2022-02-01 04:01:16 +00:00
25fdf7e442 NetherReactor: Remove dead code
the state is not exposed anywhere, and we already remap invalid states to default now anyway.
2022-02-01 04:00:49 +00:00
a91e7f7202 deduplicate weighted pressure plate deserializer code 2022-01-31 20:45:33 +00:00
cdafb1b0c4 standardize codegen for coral fans 2022-01-31 20:45:11 +00:00
69db9f8a30 Reduce duplication of code 2022-01-31 20:31:54 +00:00
c4228edf3c BlockStateDeserializerHelper: fixed mistake in decodeLiquid() 2022-01-31 18:15:02 +00:00
03e3ecdbd3 Revert "BlockStateValues now includes integer values too"
This reverts commit 0626edbcdd.
2022-01-31 17:51:49 +00:00
0626edbcdd BlockStateValues now includes integer values too 2022-01-31 17:49:29 +00:00
d03f4d76a2 ws 2022-01-31 02:30:54 +00:00
710201fd51 shut CS 2022-01-31 01:20:52 +00:00
ab5a7b0d04 an absolute motherload of stuff I did today 2022-01-31 01:18:56 +00:00
15425d01bc BanEntry: clean up getString() 2022-01-28 21:53:28 +00:00
0642364a44 block: added constants for various integer property bounds 2022-01-28 21:27:30 +00:00
cfdbfa3d58 Liquid: fixed implicit assumption of 0 == air 2022-01-28 21:07:41 +00:00
e9a6c0ba58 Liquid: added missing bounds check for setDecay() 2022-01-28 21:03:44 +00:00
466b018319 Merge branch 'staging/4.1' into next-minor 2022-01-28 20:40:20 +00:00
d16b6fe61e Merge branch 'stable' into staging/4.1 2022-01-28 20:40:07 +00:00
7a75fcda44 Merge branch 'bell-4745' into stable 2022-01-28 20:21:28 +00:00
8d289ab01d Bell: fixed collision boxes
closes #4745
2022-01-28 20:20:41 +00:00
363a9689b4 Prepare 4.2.0+dev 2022-01-28 15:10:19 +00:00
40c7497efe Updated BedrockProtocol to 7.3.1 2022-01-28 15:06:56 +00:00
440a48b973 added serializers for newly implemented blocks 2022-01-27 16:58:32 +00:00
f01887fb1e Merge branch 'next-minor' into r13-world-support 2022-01-27 16:47:46 +00:00
6ccb1ff114 4.1.0-BETA3 is next 2022-01-27 00:55:09 +00:00
1d2593208a Release 4.1.0-BETA2 2022-01-27 00:55:02 +00:00
a7bdef69e2 Merge remote-tracking branch 'origin/stable' into next-minor 2022-01-27 00:40:34 +00:00
d9ea647925 InGamePacketHandler: add a hack for swimming AABB client bug 2022-01-27 00:28:54 +00:00
6673289c33 Fixed spectator players being able to drop items (#4775)
closes #4765
2022-01-27 00:03:19 +00:00
822af4f7f5 Bump pocketmine/locale-data from 2.4.2 to 2.4.3 (#4773)
Bumps [pocketmine/locale-data](https://github.com/pmmp/Language) from 2.4.2 to 2.4.3.
- [Release notes](https://github.com/pmmp/Language/releases)
- [Commits](https://github.com/pmmp/Language/compare/2.4.2...2.4.3)

---
updated-dependencies:
- dependency-name: pocketmine/locale-data
  dependency-type: direct:production
  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>
2022-01-26 00:45:05 +00:00
3155c90396 Fixed incorrect drops for Cobweb (#4759) 2022-01-26 00:25:00 +00:00
1dbfedce4c Bump pocketmine/locale-data from 2.3.33 to 2.4.2 (#4769)
Bumps [pocketmine/locale-data](https://github.com/pmmp/Language) from 2.3.33 to 2.4.2.
- [Release notes](https://github.com/pmmp/Language/releases)
- [Commits](https://github.com/pmmp/Language/compare/2.3.33...2.4.2)

---
updated-dependencies:
- dependency-name: pocketmine/locale-data
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-26 00:19:02 +00:00
3ab5b5a79d 4.0.9 is next 2022-01-25 23:33:24 +00:00
8a4bc72b34 Release 4.0.8 2022-01-25 23:33:20 +00:00
6cbc14f2b2 World: fixed block update bug introduced by 3faeb5a556 2022-01-25 21:53:15 +00:00
75d0fc4749 BlockFactory: Make stone slab registration a little less unpleasant to read 2022-01-25 19:23:04 +00:00
ea161af4e5 Added FurnaceType->getCookSound() 2022-01-25 19:01:49 +00:00
0bf5f97fe9 Implement furnace sound (#4755)
closes #4363 

The following classes have been added:
- BlastFurnaceSound
- SmokerSound
- FurnaceSound
2022-01-25 18:52:31 +00:00
b9f1bcf0e4 Implement PlayerViewDistanceChangeEvent (#4749)
closes #4550
2022-01-25 18:00:26 +00:00
32b07e0940 World: avoid repeated getInstance() calls in hot paths 2022-01-24 21:08:12 +00:00
99f087e5e1 Bump phpunit/phpunit from 9.5.12 to 9.5.13 (#4767)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.12 to 9.5.13.
- [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.12...9.5.13)

---
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>
2022-01-24 14:21:49 +00:00
22a4117109 Merge remote-tracking branch 'origin/stable' into next-minor 2022-01-23 15:47:13 +00:00
aaf7a88de7 HayBale: fixed fall damage 2022-01-22 21:26:44 +00:00
e0da99a973 feat: Implement Brewing (#4413)
The following API constants have been added:
- tile\BrewingStand::BREW_TIME_TICKS
The following public API methods have been added:
- utils\BrewingStandSlot->getSlotNumber() : int
- CraftingManager->getPotionTypeRecipes() : array<string, array<string, PotionTypeRecipe>>
- CraftingManager->getPotionContainerChangeRecipes() : array<int, array<string, PotionContainerChangeRecipe>>
- CraftingManager->registerPotionTypeRecipe(PotionTypeRecipe $recipe) : void
- CraftingManager->registerPotionContainerChangeRecipe(PotionContainerChangeRecipe $recipe) : void
The following classes have been added:
- BrewingRecipe
- PotionTypeRecipe
- PotionContainerChangeRecipe
- BrewItemEvent
- BrewingFuelUseEvent
- PotionFinishBrewingSound
2022-01-22 16:54:58 +00:00
b2630a0920 Merge remote-tracking branch 'origin/stable' into next-minor 2022-01-22 14:46:55 +00:00
67a0ae0246 Fixed incorrect drops for ender chest (#4751) 2022-01-22 14:01:56 +00:00
5ae20459dd 4.1.0-BETA2 is next 2022-01-22 02:23:09 +00:00
587da478a6 Release 4.1.0-BETA1 2022-01-22 02:23:06 +00:00
419bb9eba6 Player: fixed parameter name inconsistency 2022-01-22 01:33:31 +00:00
82f1c2766c Merge branch 'stable' into next-minor 2022-01-22 01:00:40 +00:00
b3fec3d86f Merge branch 'legacy/pm3' into stable 2022-01-22 00:54:46 +00:00
60ef2db892 3.27.1 is next 2022-01-22 00:36:48 +00:00
e21446e583 Release 3.27.0 2022-01-22 00:36:47 +00:00
7bf0bc2ca7 Merge commit 'b33a75a6d121bdbdd23765795a375f1ec1a5f7c9' into stable 2022-01-22 00:32:49 +00:00
e5a9123522 PocketMine.php: require ext-crypto 2022-01-22 00:30:05 +00:00
09201ac14b Fixed chunk sending
we can't cache the encapsulated stuff anymore because of encryption.
2022-01-22 00:24:31 +00:00
0697c7d316 Clean up according to newer php-cs-fixer 2022-01-21 23:45:49 +00:00
1eae133118 fixed PHPStan build 2022-01-21 23:39:37 +00:00
d28be4eaf2 Quick and dirty backport of encryption, preserving BC 2022-01-21 23:05:21 +00:00
b33a75a6d1 Updated transient dependency junk 2022-01-21 20:45:36 +00:00
f9c8c0e34d 4.0.8 is next 2022-01-21 19:39:31 +00:00
58ba4f680f Release 4.0.7 2022-01-21 19:39:30 +00:00
8c5cc67e07 Updated baseline 2022-01-21 19:38:59 +00:00
ab8b24bcd2 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2022-01-21 19:15:59 +00:00
94c4f58667 Fixed bogus test 2022-01-21 19:13:36 +00:00
c10eda5eae InGamePacketHandler: limit depth of form responses to 2
form responses should only contain string|int|float|bool|null. Arrays or objects appearing in here are likely malicious.
2022-01-21 19:11:58 +00:00
ed312863a7 ignore phpstan bug 2022-01-21 18:43:53 +00:00
387c13beff InGamePacketHandler: fixed invalid JSON being treated as form close 2022-01-21 18:32:58 +00:00
56fe71d939 InGamePacketHandler: fixed crash in form handling when invalid JSON is given 2022-01-21 17:34:13 +00:00
73d8c87b76 Bump phpunit/phpunit from 9.5.11 to 9.5.12 (#4748)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.11 to 9.5.12.
- [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.11...9.5.12)

---
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>
2022-01-21 14:53:03 +00:00
fc53f3721a Avoid direct mutations of Entity->location 2022-01-20 21:49:14 +00:00
345ac75aac Remove PHPStan rules (no longer needed)
this is enforced by php-cs-fixer now instead.
2022-01-20 19:25:34 +00:00
32db27af78 php-cs-fixer: add logical_operators rule 2022-01-20 19:23:33 +00:00
4e956d5d1d Replace remaining disallowed operators 2022-01-20 19:23:19 +00:00
61f8144280 Replace disallowed operators in src/updater/ 2022-01-20 19:21:04 +00:00
ae03c70dfc Replace disallowed operators in src/permission/ 2022-01-20 19:20:51 +00:00
e986a0a4f2 Replace disallowed operators in src/inventory/ 2022-01-20 19:20:32 +00:00
b85fe0e72a Replace disallowed operators in src/scheduler/ 2022-01-20 19:20:03 +00:00
03f47d0a78 Replace disallowed operators in src/plugin/ 2022-01-20 19:19:20 +00:00
3f8f5cd200 Replace disallowed operators in src/crafting/ 2022-01-20 19:18:26 +00:00
aa6bd4438a Replace disallowed operators in src/event/ 2022-01-20 19:17:17 +00:00
22fb02c4e6 Replace disallowed operators in src/item/ 2022-01-20 19:16:50 +00:00
373880e582 Replace disallowed operators in src/player/ 2022-01-20 19:16:00 +00:00
8f525ab399 Replace disallowed operators in src/entity/ 2022-01-20 19:14:28 +00:00
be1996752a Replace disallowed operators in src/network/ 2022-01-20 19:11:32 +00:00
2bcb629d78 Scrub baseline 2022-01-20 19:08:44 +00:00
aae5962f6a Replace disallowed operators in src/world/ 2022-01-20 19:05:23 +00:00
282b430b1f Replace disallowed operators in src/utils/ 2022-01-20 19:02:26 +00:00
c47dfa1fb8 Replace disallowed operators in build/ 2022-01-20 19:00:54 +00:00
8db137882c Scrub baseline 2022-01-20 16:58:38 +00:00
79d1feff9c Replace disallowed operators in src/block/ 2022-01-20 16:57:09 +00:00
2f32bd877a Replace disallowed operators in src/command/ 2022-01-20 16:49:58 +00:00
22bc3bc3f9 Replace disallowed operators in src/console/ 2022-01-20 16:49:04 +00:00
6846f1e78a Replace disallowed operators in tests/ 2022-01-20 16:48:36 +00:00
4d55935bd8 Replace disallowed operators in tools/ 2022-01-20 16:48:06 +00:00
9c328690f8 Baseline for new rules (for now) 2022-01-20 16:46:41 +00:00
b60dd1e9b4 Ban 'and' and 'or' operators via PHPStan 2022-01-20 16:44:59 +00:00
86bcc49972 Merge branch 'stable' into next-minor 2022-01-20 16:30:49 +00:00
061d851fbd World: do not update entities which have been flagged for despawn
fixes #4718
2022-01-20 16:27:21 +00:00
a67aef0477 PlayerInteractEvent: updated documentation 2022-01-20 16:10:37 +00:00
088745cf3b Implemented ChestPairEvent
closes #2829
2022-01-19 22:08:06 +00:00
8cdfef7861 Added missing sound for creating grass path and farmland
closes #2776
2022-01-19 21:49:05 +00:00
a0bb7059c1 Merge remote-tracking branch 'origin/stable' into next-minor 2022-01-19 19:48:51 +00:00
858024afb7 Remove useless docs noticed by php-cs-fixer 3.5 2022-01-18 00:24:12 +00:00
eaaf00ca2b Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2022-01-18 00:23:39 +00:00
f1723acfd3 UnsafeForeachArrayOfStringRule: use statically analysable function reference
this will ensure that it get automatically updated during refactors.
2022-01-18 00:23:29 +00:00
8da27ea0aa UnsafeForeachArrayOfStringRule: fixed outdated function name 2022-01-18 00:15:44 +00:00
388622d55d Bump pocketmine/locale-data from 2.3.0 to 2.3.33 (#4735)
Bumps [pocketmine/locale-data](https://github.com/pmmp/Language) from 2.3.0 to 2.3.33.
- [Release notes](https://github.com/pmmp/Language/releases)
- [Commits](https://github.com/pmmp/Language/compare/2.3.0...2.3.33)

---
updated-dependencies:
- dependency-name: pocketmine/locale-data
  dependency-type: direct:production
  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>
2022-01-17 20:46:38 +00:00
bac6a2a1eb cs: enable fully_qualified_strict_types rule 2022-01-16 22:12:51 +00:00
b9b76eaed2 Server: add notice about obsoletion 2022-01-16 22:11:50 +00:00
9f4fcfafdb Fixed some incorrect block breaking times (#4723) 2022-01-16 20:57:16 +00:00
853ecd2408 InGamePacketHandler: fix function ordering 2022-01-16 16:16:42 +00:00
33421258b6 Silence MovePlayerPacket debug spam 2022-01-16 15:40:18 +00:00
c221484fc3 fixed CS 2022-01-15 22:27:06 +00:00
d9deb571ed Added LecternPlaceBookSound 2022-01-15 22:26:56 +00:00
42d07c74d7 added missing redstone power flag logic 2022-01-15 22:19:47 +00:00
1366c49f1f Implemented Lectern (#4708)
Co-authored-by: Covered123 <58715544+JavierLeon9966@users.noreply.github.com>
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2022-01-15 21:21:29 +00:00
6679c53e56 BrewingStand: fixed collision box 2022-01-15 16:41:27 +00:00
ee6548aa50 Merge branch 'stable' into next-minor 2022-01-14 00:45:49 +00:00
9d061e86af 4.0.7 is next 2022-01-13 21:46:30 +00:00
f7d25f251e Release 4.0.6 2022-01-13 21:46:30 +00:00
0ccb47fb07 make-release: trap more errors 2022-01-13 21:46:06 +00:00
0973472842 actions: bump to 8.0.14 2022-01-13 21:23:23 +00:00
f126479c37 InGamePacketHandler: check the validity of facing values given by the client 2022-01-13 21:21:15 +00:00
d34f4b28b3 Bump pocketmine/binaryutils from 0.2.3 to 0.2.4 (#4726)
Bumps [pocketmine/binaryutils](https://github.com/pmmp/BinaryUtils) from 0.2.3 to 0.2.4.
- [Release notes](https://github.com/pmmp/BinaryUtils/releases)
- [Commits](https://github.com/pmmp/BinaryUtils/compare/0.2.3...0.2.4)

---
updated-dependencies:
- dependency-name: pocketmine/binaryutils
  dependency-type: direct:production
  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>
2022-01-13 14:21:32 +00:00
8a65fd273a Updated RakLib to 0.14.3 2022-01-10 22:29:38 +00:00
248cc0ef49 actions: colorize diff output on CS failure 2022-01-10 22:06:07 +00:00
d1726aa20c CS: use fully_qualified_strict_types 2022-01-10 21:41:56 +00:00
58e1e7bd6f Worker: fixed missing AsyncTask import for documentation (#4719)
OCD from f5c9c02e09
2022-01-10 15:12:37 +00:00
a5c0958adf Filesystem::safeFilePutContents() now consistently throws RuntimeException in all expected failure cases
unexpected cases may still throw ErrorException (such as undefined variables) but we don't want to capture those.
2022-01-09 16:33:31 +00:00
fd880d8465 Filesystem: Use ErrorToExceptionHandler to improve error output 2022-01-09 16:26:42 +00:00
a323fb7bb5 Updated pocketmine/errorhandler to 0.6.0 2022-01-09 16:22:59 +00:00
0a5b146189 substr() returns an empty string instead of false in 8.0
an empty string will pass through preg_match_all() without any harmful effects, so we don't need to check for it.
2022-01-07 22:38:00 +00:00
1948b00008 Merge branch 'stable' into next-minor 2022-01-07 21:51:05 +00:00
b4e1871899 Updated PHPStan baseline 2022-01-07 21:49:49 +00:00
78eaa0993d Merge branch 'legacy/pm3' into stable 2022-01-07 21:48:28 +00:00
bee2aba813 Updated PHPStan baseline 2022-01-07 21:46:35 +00:00
af81f80cf3 Updated PHPStan 2022-01-07 21:45:35 +00:00
dbbbc4f9c9 updated phpstan baseline 2022-01-07 21:39:19 +00:00
51f2a78dcf World: break random tick blocks initializing out of constructor
and fix a variable clobber by foreach as a side effect
2022-01-07 21:36:49 +00:00
5128bc02bb Reduce code duplication between BaseCoral and CoralBlock 2022-01-07 21:32:44 +00:00
4f4aa62479 ConcretePowder: call BlockFormEvent when coming in contact with water 2022-01-07 21:19:08 +00:00
c267e7b3c2 Call BlockMeltEvent when frosted ice melts 2022-01-07 21:15:05 +00:00
3faeb5a556 disable-block-ticking directive now supports names a la /give 2022-01-07 21:06:06 +00:00
0bc578b8fc Block: added getTypeId() 2022-01-07 21:03:19 +00:00
661848c5e7 fix more EOF newlines 2022-01-07 20:39:43 +00:00
75fc7a2d1f Merge branch 'stable' into next-minor 2022-01-07 20:16:35 +00:00
43c5d08042 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2022-01-07 20:15:30 +00:00
6d249026cc Merge branch 'legacy/pm3' into stable 2022-01-07 20:15:15 +00:00
ed2145b6a4 php-cs-fixer: enforce EOF newlines 2022-01-07 20:12:21 +00:00
3e6c157217 Bump phpstan/phpstan from 1.3.1 to 1.3.3 (#4712)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.3.1 to 1.3.3.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/master/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.3.1...1.3.3)

---
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>
2022-01-07 15:20:33 +00:00
4f8a0bad25 RegistryTrait: avoid overwriting parameter variables 2022-01-06 23:54:54 +00:00
fb29653ed7 Merge remote-tracking branch 'origin/stable' into next-minor 2022-01-06 22:43:57 +00:00
ffa8cf3ec3 Update to BedrockProtocol 7.3.0 2022-01-06 22:42:16 +00:00
86beeb8255 readme: update badge links
[ci skip]
2022-01-06 17:11:03 +00:00
230a3c9839 Bump phpstan/phpstan from 1.2.0 to 1.3.1 (#4702)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.2.0 to 1.3.1.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/master/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.2.0...1.3.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-05 13:49:29 +00:00
35f205b476 4.0.6 is next 2022-01-04 20:51:37 +00:00
e7d17eb4d3 Release 4.0.5 2022-01-04 20:51:36 +00:00
73168a0e39 Merge branch 'legacy/pm3' into stable 2022-01-04 20:49:32 +00:00
e8893dd91f 3.26.6 is next 2022-01-04 20:47:31 +00:00
a4af1609ea Release 3.26.5 2022-01-04 20:47:31 +00:00
8c4b8a9042 CS 2022-01-04 20:44:10 +00:00
6492cac5c1 Merge pull request from GHSA-c6fg-99pr-25m9 2022-01-04 20:40:55 +00:00
958a9dbf0f Merge pull request from GHSA-c6fg-99pr-25m9
* Skin: impose length limits on skinID, geometryName and geometryData fields

* Skin: remove extra newline
2022-01-04 20:40:55 +00:00
3ed57ce49a Merge pull request from GHSA-p62j-hrxm-xcxf
This checks the following things:
- Validity of UTF-8 encoding of title, author, and page content
- Maximum soft and hard lengths of title, author, and page content (soft
  limits may be bypassed by uncancelling PlayerEditBookEvent; hard
  limits may not be bypassed)
- Maximum number of pages. Books with more than 50 pages may still be
  edited, but may not have new pages added.
2022-01-04 20:39:02 +00:00
68f3399cfd Merge pull request from GHSA-p62j-hrxm-xcxf
This checks the following things:
- Validity of UTF-8 encoding of title, author, and page content
- Maximum soft and hard lengths of title, author, and page content (soft
  limits may be bypassed by uncancelling PlayerEditBookEvent; hard
  limits may not be bypassed)
- Maximum number of pages. Books with more than 50 pages may still be
  edited, but may not have new pages added.
2022-01-04 20:39:02 +00:00
aeab19a616 Fixed world spawn point not updating to players (#4699)
closes #4383
2022-01-04 20:31:27 +00:00
8532e9c8e0 Merge remote-tracking branch 'origin/stable' into next-minor 2022-01-04 14:38:15 +00:00
7bee72ef2d Use ~ instead of ^ for constraints on BedrockData and BedrockProtocol
I got these two mixed up - they are exactly the opposite of what I thought. ~ is the stricter operator.
2022-01-04 00:54:09 +00:00
0d595e4324 Update Language dependency 2022-01-04 00:47:04 +00:00
e43e0189df InGamePacketHandler: do not pass bare integers from BookEditPacket directly into event
while these currently happen to be identical, they may not be in the future.

Really this should be represented by an enum.
2022-01-03 20:20:32 +00:00
decd1da2d0 BaseSign: remove dead TODO comment 2022-01-03 19:33:03 +00:00
bcc0f1e733 Fixed desynchronization of hunger when cancelling food-related events (#4691) 2022-01-03 19:11:32 +00:00
e04dfe96af Merge branch 'stable' into next-minor 2022-01-01 17:55:17 +00:00
f62cfe8ae3 4.0.5 is next 2022-01-01 16:50:03 +00:00
b903e90dc2 Release 4.0.4 2022-01-01 16:50:02 +00:00
c8247786d7 Player: check chat length check with strlen() before mb_strlen()
mb_strlen() is O(n), whereas strlen() is O(1). If we receive very large chat messages (e.g. 2 MB), mb_strlen() will take a very long time to return a result (around 8ms on my machine).
Since the max size of a UTF-8 character is 4 bytes (according to standard), we can use strlen() with 4x the char limit to gate it and prevent this from happening.
2022-01-01 16:46:00 +00:00
f486b5f4a7 Player: fixed fall damage when sprinting down stairs (#4685)
Due to the way positions are updated over the network, we only see the end result of a movement and not its preceding actions. In addition, we don't know for sure whether the MCPE collision checks work the same exact way as PM.

TL;DR: It's possible for the client to capture and send a movement frame after they collided with a step and then already moved forward from it some distance, resulting in a weird arc pattern.

This PR checks the range between the old and new positions for collision boxes to ensure that all possible areas are checked for detecting fall damage.

This has been tested and successfully resolves various issues involving running down stairs:
- missing sounds
- random fall damage
2022-01-01 15:41:19 +00:00
54d6b83fc2 Entity: pass the appropriate value for AFFECTED_BY_GRAVITY 2022-01-01 15:39:46 +00:00
eedea38669 Improve performance of loading player inventories 2022-01-01 15:26:42 +00:00
3c6146b5e0 ContainerTrait: avoid absurdly inefficient use of setItem()
this substantially improves the performance of loading containers such as chests.
2022-01-01 15:05:32 +00:00
72f2c794ab SimpleInventory: improved performance of setContents()
avoid the overhead incurred by clear() and setItem(), because in internalSetContents(), we already have no listeners or viewers to talk to anyway, so this is just spamming shit into /dev/null.
2021-12-31 18:32:19 +00:00
193a1b3f4e TextFormat: Added MINECOIN_GOLD (§g) color code support (#4670) 2021-12-30 23:53:05 +00:00
62afa2f28d Entity: extract getBlocksIntersected() from getBlocksAroundWithEntityInsideActions() 2021-12-29 23:04:54 +00:00
207f7ec309 Player: avoid unnecessary network updates on repeated calls to setAllowFLight(), setHasBlockCollision() and setAutoJump() 2021-12-29 20:22:16 +00:00
e0a6bc1d4a Lava: remove useless code, closes #4678 2021-12-29 20:13:07 +00:00
5c994e4a24 Player: removed an old hack for setFlying() feedback loop
this is no longer a concern, since we now check if the sent state matches the current state before doing anything, at multiple layers.
2021-12-29 18:41:11 +00:00
d94578a420 Player: remove dead TODO comment 2021-12-29 18:32:53 +00:00
0a0de018a5 InGamePacketHandler: fixed player jump handling 2021-12-29 18:28:22 +00:00
a1d217e12b InGamePacketHandler: fixed missing synchronization of metadata when plugins cancel PlayerToggle*Event 2021-12-29 18:23:05 +00:00
e102339637 InGamePacketHandler: remove dead code from PlayerActionPacket handling 2021-12-29 17:29:19 +00:00
7124d44b92 Player: prevent PlayerToggle(Sprint|Sneak|Fly|Glide|Swim)Events from firing multiple times with the same value
this happens with swimming due to bugs in the client.
2021-12-29 17:24:49 +00:00
38b6b39cb3 Filesystem: workaround a stupid Windows issue in safeFilePutContents()
occasionally Windows will randomly decide to deny us access to rename the file for no reason whatsoever. If this happens, we attempt an old-style copy and delete.
If the rename failed for a legit reason, the copy and delete should also fail and generate an error message. If it was Windows being a spaz, it should work normally without errors.
2021-12-29 15:26:34 +00:00
767dfd9947 Merge branch 'stable' into next-minor 2021-12-27 21:55:13 +00:00
fcc4757209 Merge branch 'legacy/pm3' into stable 2021-12-27 21:54:56 +00:00
d9c70cb176 start.cmd: prevent idiotic behaviour when paths contain characters such as brackets
god I hate this shit so much
2021-12-27 21:54:32 +00:00
4aab0565c0 ChunkCache: fixed corner case in cache restart on AsyncTask error
the cache may have been destroyed since the task inception, leading to an exception being thrown.
2021-12-27 18:11:55 +00:00
87170ab067 Player: move reach distances to constants 2021-12-27 17:32:04 +00:00
74ac0f5862 Player: move max chat length to constant 2021-12-27 17:06:19 +00:00
f5144d49b1 Merge branch 'stable' into next-minor 2021-12-27 16:52:22 +00:00
8943d8a2a7 Player: fixed maximum message size limits to match vanilla bugrock 2021-12-27 16:51:47 +00:00
0da29beb1d Bump pocketmine/locale-data from 2.2.0 to 2.2.1 (#4667)
Bumps [pocketmine/locale-data](https://github.com/pmmp/Language) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/pmmp/Language/releases)
- [Commits](https://github.com/pmmp/Language/compare/2.2.0...2.2.1)

---
updated-dependencies:
- dependency-name: pocketmine/locale-data
  dependency-type: direct:production
  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-12-27 16:43:32 +00:00
157048264c Bump phpunit/phpunit from 9.5.10 to 9.5.11 (#4675)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.10 to 9.5.11.
- [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.10...9.5.11)

---
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-12-27 16:43:19 +00:00
95b6cb21f2 Implement BlockMeltEvent (#4666) 2021-12-27 16:36:59 +00:00
c858c0dc79 Merge remote-tracking branch 'origin/stable' into next-minor 2021-12-27 16:09:20 +00:00
b55aa78aec Changelog: Replaced non-existent method (#4676) 2021-12-27 15:33:02 +00:00
091673d8f1 Fixed "You can only sleep at night" message (#4671) 2021-12-23 23:52:07 +00:00
18e26d975b Fixed swimming and gliding for PlayerAuthInputPacket 2021-12-19 17:31:47 +00:00
d41f933e7b Implement swimming/gliding including AABB recalculation (#4446)
- The following events have been added:
  - PlayerToggleGlideEvent
  - PlayerToggleSwimEvent
- The following API methods have been added:
  - Entity->getSize()
  - Living->isSwimming()
  - Living->setSwimming()
  - Living->isGliding()
  - Living->setSwimming()
  - Player->toggleSwim()
  - Player->toggleGlide()
2021-12-19 17:10:41 +00:00
65dabefa3b Config: improve config loading and parsing error handling
closes #4654
closes #3454
2021-12-19 16:53:29 +00:00
44e8603a6d InGamePacketHandler: fixed borked sneak/sprint after switch to PlayerAuthInputPacket
closes #4659
2021-12-19 00:52:53 +00:00
e3614d1a82 Entity: fixed game performance issue with large scale entities
this->size refers to the scaled height, but the client wants the base (unscaled) size in these properties.
This caused immense lag when, for example, setting the scale of a player to 10, because their collision box would become 180 by 60, instead of the expected 18 by 6.
2021-12-18 22:38:45 +00:00
16fd5456aa Merge branch 'stable' into next-minor 2021-12-18 00:39:58 +00:00
93caf72f34 KickCommand: Add missing space
closes #4660
closes #4661
2021-12-17 21:09:14 +00:00
089f22d903 Merge branch 'next-minor' of github.com:pmmp/PocketMine-MP into next-minor 2021-12-16 23:39:14 +00:00
fc3a6c6984 Implemented fire spread (#4617) 2021-12-16 23:36:34 +00:00
1ab285f573 PrepareEncryptionTask: remove usage of no-op function 2021-12-16 18:47:50 +00:00
aa56c66a3c ProcessLoginTask: drop usage of no-op method
this is no longer useful since 8.0.
2021-12-16 18:46:34 +00:00
920462bdcc Merge branch 'stable' into next-minor 2021-12-16 01:46:52 +00:00
e6e1bca676 4.0.4 is next 2021-12-16 01:35:43 +00:00
795ebd1824 Release 4.0.3 2021-12-16 01:35:42 +00:00
5f03887b47 Merge branch 'legacy/pm3' into stable 2021-12-16 01:34:10 +00:00
9979a64ad2 3.26.5 is next 2021-12-16 01:23:22 +00:00
75a72786f9 Release 3.26.4 2021-12-16 01:23:21 +00:00
3d205c6e5f Updated transient dependency junk 2021-12-16 01:20:05 +00:00
2955a92837 Updated pocketmine/nbt to 0.2.19 2021-12-16 01:19:30 +00:00
e70f81a111 Updated pocketmine/nbt to 0.3.2 2021-12-16 01:08:23 +00:00
482bc462d3 VersionString: Use multiplication instead of bitshift for version IDs
this makes them more recognizable, and also fixes #4630.

This is technically a BC break (behavioural change), but since nothing appears to use this functionality anyway except PM itself, I don't think it matters.
2021-12-15 14:32:50 +00:00
de82424fb2 XpManager: add APIs to prevent owning Human from attracting XP orbs (#4623)
Fixes #4589

The following API methods are added:

- `XpManager->canAttractXpOrbs()`
- `XpManager->setCanAttractXpOrbs()`

Possible future scope: flip this on its head to allow spectator players to attract XP orbs, in case someone wants that for some reason ???

Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2021-12-15 04:40:46 +00:00
d487e43766 InGamePacketHandler: fixed block breaking borked by enabling PlayerAuthInputPacket 2021-12-15 04:01:40 +00:00
57e1509c3a Updated translation APIs 2021-12-15 03:24:13 +00:00
6494375a53 SetupWizard: ask for max view distance 2021-12-15 03:15:04 +00:00
4466166f8b Merge branch 'stable' into next-minor 2021-12-15 03:12:41 +00:00
0da1810aaa Updated composer dependencies 2021-12-15 03:12:26 +00:00
3aa34b59a5 Ask for IPv6 port in setup wizard 2021-12-15 02:22:04 +00:00
c04b00d09d Updated Language to 2.2.0 2021-12-15 02:15:24 +00:00
6e67c7532a Bump default max render radius to 16 chunks
It's 2021, this is making PM look bad to new users (as if we need something else to make PM look bad...)
2021-12-15 01:46:50 +00:00
5f8ebd81d7 it's MAX view distance, not fixed 2021-12-15 01:42:29 +00:00
79b5109953 Move some configuration constants to .. well .. constants 2021-12-15 01:40:29 +00:00
4d37b79ff7 Server: fixed not being able to deop players whose names were added to ops.txt with uppercase letters in them
same as iTXTech/Genisys#1204

why didn't anyone report this???
2021-12-15 01:08:59 +00:00
60938c8c9d Random: fixed nextSignedInt() not actually returning signed ints
closes #4646
closes #4645

Impact assessment by core usage search and poggit suggests that the impact of this change will be close to zero.
However, since it changes behaviour which plugins might be unknowingly relying on, it's going into 4.1 rather than a patch release.
2021-12-15 00:59:10 +00:00
49a8afd126 Merge branch 'next-minor' of github.com:pmmp/PocketMine-MP into next-minor 2021-12-14 23:16:40 +00:00
dbad5dd611 Merge branch 'stable' into next-minor 2021-12-14 23:16:01 +00:00
ea1fceece2 Merge branch 'legacy/pm3' into stable 2021-12-14 23:15:53 +00:00
7fb1669c6d php-cs-fixer: added binary_operator_spaces and unary_operator_spaces rules 2021-12-14 23:14:39 +00:00
a41404bd8a Allow gamemode strings for gamemode property in server.properties (#4638)
closes #2692
2021-12-14 22:56:22 +00:00
4b06fe73f2 Merge branch 'stable' into next-minor 2021-12-14 22:54:39 +00:00
929abb04be Merge branch 'legacy/pm3' into stable 2021-12-14 22:54:17 +00:00
a09817864b php-cs-fixer: add return_type_declaration space_before 2021-12-14 22:50:43 +00:00
45c4a9673d Player: fixed arm swing animation not showing during attack cooldown of victim
closes #4650
2021-12-14 19:03:42 +00:00
4ad8cb02a5 BlockIdentifier: ensure that the tile class given is valid 2021-12-14 17:36:25 +00:00
1c6907c636 Merge branch 'stable' into next-minor 2021-12-14 01:27:21 +00:00
7e6bbcc393 Sync composer deps 2021-12-14 01:27:11 +00:00
7184c02bb6 Merge branch 'next-minor' of github.com:pmmp/PocketMine-MP into next-minor 2021-12-14 00:35:04 +00:00
8a94aa10a4 Merge branch 'stable' into next-minor 2021-12-14 00:34:54 +00:00
c334e6dec7 Updated locale-data dependency 2021-12-14 00:31:44 +00:00
89a766b799 Bump fgrosse/phpasn1 from 2.3.1 to 2.4.0 (#4644)
Bumps [fgrosse/phpasn1](https://github.com/fgrosse/PHPASN1) from 2.3.1 to 2.4.0.
- [Release notes](https://github.com/fgrosse/PHPASN1/releases)
- [Changelog](https://github.com/fgrosse/PHPASN1/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fgrosse/PHPASN1/compare/v2.3.1...v2.4.0)

---
updated-dependencies:
- dependency-name: fgrosse/phpasn1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-13 21:39:44 +00:00
7e99e5167c Merge branch 'legacy/pm3' into stable 2021-12-13 12:36:26 +00:00
f5bbd30dbb Fixed skins appearing black when using RTX resource packs, closes #4537 2021-12-13 12:35:55 +00:00
3be8472ae2 MemoryManager: fixed dumping of uninitialized properties
closes #4643
2021-12-13 12:11:49 +00:00
22bb1ce8e0 4.0.3 is next 2021-12-12 23:27:54 +00:00
178dcb71a9 Release 4.0.2 2021-12-12 23:27:50 +00:00
0a58fd5472 GeneratorManager: fixed addGenerator() being case-sensitive when overwrite=true
this was caused by 083a1e1ff6.

This was discovered by a new PHPStan rule I'm working on, which disallows overwriting the values of parameter variables. During the refactor of this function to correct the error, another error appeared: Variable might not be defined.

This is yet another excellent example of why mutability is bad.
2021-12-12 21:58:07 +00:00
e06eefeab0 build/generate-known-translation-apis: fixed incorrect positional parameter order
closes #4639
2021-12-11 21:28:52 +00:00
ede07c4314 Mark KnownTranslationKeys and KnownTranslationFactory as @internal 2021-12-11 21:24:18 +00:00
cba00bf1e2 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2021-12-10 23:24:38 +00:00
e81bee3866 ConsoleReaderThread: disable opcache for console reader subprocess 2021-12-10 23:24:18 +00:00
e6b85988b2 Bump fgrosse/phpasn1 from 2.3.0 to 2.3.1 (#4636)
Bumps [fgrosse/phpasn1](https://github.com/fgrosse/PHPASN1) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/fgrosse/PHPASN1/releases)
- [Changelog](https://github.com/fgrosse/PHPASN1/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fgrosse/PHPASN1/compare/v2.3.0...v2.3.1)

---
updated-dependencies:
- dependency-name: fgrosse/phpasn1
  dependency-type: direct:production
  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-12-10 22:37:28 +00:00
b50591303b README: make shield show download count for 4.0.1, not 3.26.3 2021-12-10 20:23:48 +00:00
9e75c1463a Implement carving pumpkin (#4637) 2021-12-10 19:45:15 +00:00
a94b88424e Merge branch 'stable' into next-minor 2021-12-10 19:15:57 +00:00
448f26cefc SimpleCommandMap: do not strip backslashes from unquoted command arguments 2021-12-10 18:27:49 +00:00
fa48100da5 PluginDescription: ensure base type of decoded document is actually an array
fixes #4628
2021-12-10 18:08:50 +00:00
bcf8a3424c Merge branch 'legacy/pm3' into stable 2021-12-10 18:02:06 +00:00
69d5bfa0d4 3.26.4 is next 2021-12-10 17:55:11 +00:00
549fb923bf Release 3.26.3 2021-12-10 17:55:07 +00:00
6d5c463bdd PlayerExperienceChangeEvent: added range checks to setNewProgress()
WE FINALLY FUCKING FOUND IT

This took several years to identify because PHP's exception stack traces don't show the actual values of parameters, but rather the values of the variables they were assigned to.

This means that if the parameter variable is mutated, the exception trace will show the value of the variable inside the function, not the value that was actually passed.
2021-12-10 17:29:57 +00:00
911ad344c9 Human: do not mutate parameter variables in setXpAndProgress()
this caused a mystery that took 3 entire years to debug.
2021-12-10 17:27:28 +00:00
3b77462935 WritableBookBase: fixed crash when finding pages containing corrupted UTF-8 characters
maybe we should treat this as corrupted? but for now, it's consistent with how we deal with signs.
2021-12-10 16:39:13 +00:00
6b40ed7bf8 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2021-12-10 16:32:32 +00:00
1ed9302f5a ItemEntity: clone items given to the constructor directly
this fixes some bizarre mutability issues that occurred when using World->dropItem() with the same object multiple times.
2021-12-10 16:31:56 +00:00
b3dab0beef readme: added total downloads & latest downloads badges
[ci skip]
2021-12-10 00:40:29 +00:00
7ad1afee89 Merge branch 'next-minor' of github.com:pmmp/PocketMine-MP into next-minor 2021-12-09 13:54:06 +00:00
292827a311 Switch to PlayerAuthInputPacket for movement handling
sticking with the non-rewind version for now, for simplicity's sake.

We do want the rewind version at some point for server side knockback, but that's a job for later.

For now, using this packet fixes various problems with slightly-incorrect positions and rotations (e.g. AimTP no longer requires you to jump to get the exact correct rotation; previously it would hit the wrong block at long distances due to errors of a fraction of a degree due to the client not sending its position.

Note that this might cause some performance degradation since the packet is sent every tick. This has yet to be assessed, but the advantages offered are undeniable in any case.
2021-12-09 13:53:53 +00:00
f8ed23cc1e ClearCommand: Add OffHandInventory to $inventories (#4631) 2021-12-09 11:19:33 +00:00
6ddaed97fa 4.0.2 is next 2021-12-09 00:48:45 +00:00
036b90d247 Release 4.0.1 2021-12-09 00:48:42 +00:00
d909cd8a91 Merge branch 'legacy/pm3' into stable 2021-12-09 00:33:05 +00:00
06eaf9f273 3.26.3 is next 2021-12-09 00:27:03 +00:00
1e56ed2ea3 Release 3.26.2 2021-12-09 00:26:59 +00:00
dccb8a3595 Merge branch 'legacy/pm3' into stable 2021-12-09 00:00:11 +00:00
0ace807756 Merge commit 'b081394125f90c14d6894b24e2edb32f3284b3a0' into stable 2021-12-08 23:59:51 +00:00
40895a86e5 draft-release: stick a banner on the release notes to declare obsolescence 2021-12-08 23:55:43 +00:00
b081394125 Do not restrict the allowed update channels client-side
we really should have an endpoint on the server that deals with this.
2021-12-08 21:57:16 +00:00
f48cf68cac updater: log a message when an update was found, but it's an older version 2021-12-08 21:55:44 +00:00
264cff70ec Release new PM3 builds onto pm3 channel 2021-12-08 21:55:12 +00:00
3aabfa4ab0 bootstrap: display value of PHPRC when PHP binary is borked
PHPRC overrides the search path for php.ini, which might break the php.ini locating.
2021-12-08 20:48:44 +00:00
922ce2e312 Merge branch 'stable' into next-minor 2021-12-08 20:10:23 +00:00
0793e7e094 PluginLoadabilityChecker: fixed logic of extension compatibility check
if the extension doesn't specify any version, we can't do any constraint other than *.
2021-12-08 20:08:53 +00:00
7a385ddc8b simulate-chunk-selector: remove unused colour allocation 2021-12-08 20:04:03 +00:00
2254f31bec Use Utils::assumeNotFalse() in tools/ 2021-12-08 20:01:19 +00:00
77a74d84e2 CrashDump: phpversion() could return false for a loaded extension
if the extension wrote NULL into the zend_module_entry->version field, phpversion() will return false.
2021-12-08 19:58:28 +00:00
5b868e6d5e Merge branch 'stable' into next-minor 2021-12-08 19:40:25 +00:00
889d048ca3 Make use of Utils::assumeNotFalse() in a bunch of places
I've stuck to only doing this in the places where I'm sure we should never get false back. Other places I'm less sure of (and I found more bugs along the way).
2021-12-08 19:39:04 +00:00
8b73549355 Use JSON_THROW_ON_ERROR for json_encode() and json_decode() 2021-12-08 19:14:07 +00:00
c6466a6da9 Utils: added crutch assumeNotFalse()
this can be used to get PHPStan to shut up about stuff that will never return false in normal contexts.
It's more fine-grained than @phpstan-ignore-line and less hassle than ignoreErrors (and works in PhpStorm too).
In addition, it's easy to search for references.
2021-12-08 18:58:39 +00:00
3d9e19546f EntityShootBowEvent: fixed incorrect field type 2021-12-07 23:35:45 +00:00
45b4fa0e96 Server: improve confusing condition in crashDump() 2021-12-07 23:08:06 +00:00
bf29409a45 Server: fixed PHPStan level 7 error in crashDump() 2021-12-07 23:06:10 +00:00
503c888838 bootstrap: use phpversion() for checking extension presence
fixes 2 PHPStan errors on level 7
2021-12-07 22:50:16 +00:00
e0eeb87ea0 World: simplify tile position checking code 2021-12-07 16:45:20 +00:00
78ffad5ffc World: add checks for tile position outside of world bounds, closes #4622 2021-12-07 16:41:52 +00:00
1d14c8cb6b Merge branch 'stable' into next-minor 2021-12-07 00:41:48 +00:00
49d0d01f9f Merge branch 'next-minor' of github.com:pmmp/PocketMine-MP into next-minor 2021-12-07 00:41:17 +00:00
ed4978c31b Added VanillaItems::AIR()
we don't usually add VanillaItems entries for blocks since they already exist in VanillaBlocks, but air has a special use case specifically as an itemstack, so we make an exception for this case.
2021-12-07 00:41:07 +00:00
3728ddbf24 ClearCommand: Cleanup logic & fix vanilla disparities (#4619) 2021-12-06 23:57:07 +00:00
5a351d3b17 StringToItemParser: fixed not recognizing slime or slime_block 2021-12-06 23:51:30 +00:00
0c012ca5d9 Replace usages of ItemFactory in tests with VanillaItems 2021-12-06 23:45:36 +00:00
0530cb72df StringToItemParser: fixed some bogus aliases inherited from Item::fromString() 2021-12-06 23:44:41 +00:00
8f2ca92f02 Implement dropped item merging (#4419)
- The following classes have been added:
  - `ItemMergeEvent`
  - `ItemEntityStackSizeChangeAnimation`
- The following API methods have been added:
  - `ItemEntity->isMergeable()`
  - `ItemEntity->tryMergeInto()`
  - `ItemEntity->setStackSize()`
2021-12-06 22:23:18 +00:00
ce54d268f2 Player: allow controlling client-sided block collisions irrespective of Spectator Mode (#4563)
- Added the following API methods:
  - `Player::hasBlockCollision()`
  - `Player::setHasBlockCollision()`

This enables spectator-like noclip behaviour in other gamemodes (could be useful for builders).
2021-12-06 21:14:22 +00:00
cd850b111d SplashPotion: added getType() (#4613) 2021-12-06 20:29:01 +00:00
ee060f3e02 Update PHPUnit dependency junk 2021-12-06 16:42:40 +00:00
e7deffa9af Update in-house dependency versions 2021-12-06 16:41:43 +00:00
6e4b73c183 FallingBlock: fixed crash when block is unable to be determined 2021-12-06 16:40:47 +00:00
62f150586f Bump pocketmine/locale-data from 2.0.20 to 2.0.22 (#4621)
Bumps [pocketmine/locale-data](https://github.com/pmmp/Language) from 2.0.20 to 2.0.22.
- [Release notes](https://github.com/pmmp/Language/releases)
- [Commits](https://github.com/pmmp/Language/compare/2.0.20...2.0.22)

---
updated-dependencies:
- dependency-name: pocketmine/locale-data
  dependency-type: direct:production
  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-12-06 15:01:12 +00:00
8ed9551ac9 Bump pocketmine/binaryutils from 0.2.2 to 0.2.3 (#4620)
Bumps [pocketmine/binaryutils](https://github.com/pmmp/BinaryUtils) from 0.2.2 to 0.2.3.
- [Release notes](https://github.com/pmmp/BinaryUtils/releases)
- [Commits](https://github.com/pmmp/BinaryUtils/compare/0.2.2...0.2.3)

---
updated-dependencies:
- dependency-name: pocketmine/binaryutils
  dependency-type: direct:production
  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-12-06 14:59:42 +00:00
2486dabd8a Fire: extract more unrelated changes from #4617 2021-12-06 01:04:59 +00:00
4d2d0f1d35 changelog: mention removal of Player->getLowerCaseName()
closes #4618
2021-12-06 00:58:21 +00:00
4f3a60ac90 Merge branch 'stable' into next-minor 2021-12-05 16:07:23 +00:00
98c31cf07b Update version number 2021-12-05 16:07:20 +00:00
9256afd439 Call BlockSpreadEvent when spreading fire to incinerated blocks 2021-12-05 16:06:29 +00:00
cac9db9bcc changelog: fixed mistake in CreativeInventory documentation, closes #4616 2021-12-05 15:01:45 +00:00
300d194185 CS again 2021-12-05 01:09:03 +00:00
13340a21d3 fix CS 2021-12-05 01:01:16 +00:00
27f599793a tools: added old-but-gold server-ping.php 2021-12-05 01:00:24 +00:00
527e975fa9 shut 2021-12-05 00:45:23 +00:00
8e37f86480 Avoid file_put_contents() when overwriting files
this fixes many cases of corruption during disk-full situations - file_put_contents() would write an empty file, destroying the original data.
fixes #3152
2021-12-05 00:26:48 +00:00
8e8cee45b8 Config: use JSON_THROW_ON_ERROR for encoding 2021-12-04 21:44:12 +00:00
1a046c6cd5 LevelDB: fixed server crash when corrupted / invalid blockstate NBT is encountered 2021-12-04 18:17:17 +00:00
e61aaaccca LevelDB: removed hack for problem fixed by 1f9400f901 2021-12-04 16:20:57 +00:00
1b86355c40 Server: Suppress "Minecraft network interface running" messages if RakLibInterface registration is cancelled (#4603) 2021-12-02 20:29:01 +00:00
1669d33f7e Updated DevTools submodule to pmmp/DevTools@39510af5bc 2021-12-02 00:58:15 +00:00
2da65c5a6e 4.0.1 is next 2021-12-01 22:33:58 +00:00
468faa464b Release 4.0.0 2021-12-01 22:33:52 +00:00
59de045ecb PM4 LET'S GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
Merge branch 'master' into stable
2021-12-01 22:19:37 +00:00
bd8308cc6f changelog: mention pocketmine subdirectory removal 2021-12-01 22:15:38 +00:00
edc3bae172 Merge branch 'stable' 2021-12-01 22:11:44 +00:00
06e7030817 Prepare changelog for 4.0.0 2021-12-01 22:09:34 +00:00
cb0af44ccb start.sh: improve errors when PHP isn't found 2021-11-30 23:51:35 +00:00
d535f02096 Make nicer errors for PHP binary not being found 2021-11-30 23:45:25 +00:00
7665f4f443 start.sh: remove 7 2021-11-30 23:43:17 +00:00
20d6b69813 3.26.2 is next 2021-11-30 22:27:42 +00:00
6b7d0307af Release 3.26.1 2021-11-30 22:27:42 +00:00
baeac2eb07 Fixed tiles not being sent with chunks 2021-11-30 22:19:28 +00:00
2850ea1e89 4.0.0-BETA16 is next 2021-11-30 19:27:05 +00:00
d560cf17fc Release 4.0.0-BETA15 2021-11-30 19:27:04 +00:00
3f6efd0018 Merge branch 'stable' 2021-11-30 19:20:40 +00:00
aea124af74 Fix inconsistent class name 2021-11-30 19:17:26 +00:00
8620e67d88 Protocol changes for 1.18.0 2021-11-30 19:16:38 +00:00
d5f81fe261 3.26.1 is next 2021-11-30 18:53:36 +00:00
0aeac3af7d Release 3.26.0 2021-11-30 18:53:36 +00:00
9931c1d50a Protocol changes for 1.18.0 2021-11-30 18:46:29 +00:00
d21a3d8750 4.0.0-BETA15 is next 2021-11-30 01:26:07 +00:00
6d62b06ce6 Release 4.0.0-BETA14 2021-11-30 01:26:07 +00:00
8be92d16fe Merge branch 'stable' 2021-11-30 01:19:54 +00:00
8079ae341a Updated build/php submodule to pmmp/php-build-scripts@bd329dba08 2021-11-30 01:19:14 +00:00
ba295dc7dc Always use LF in .neon files 2021-11-30 01:16:28 +00:00
38325c8573 Updated translations 2021-11-30 01:14:21 +00:00
f239b077b9 Fixed PHPStan complaints 2021-11-30 00:36:38 +00:00
6f8f460a6c Partially revert "ConsoleReaderChildProcess: Commit suicide in more cases"
This reverts commit cbe0f44c4f.

This achieves the same result as the reverted commit wrt. process in the
same manner (writing a keepalive into the socket and checking if it
failed to send). However, it does _not_ allow the process to die on
reaching pipe EOF, since this can cause many spams of subprocesses when
stdin is actually not a tty (e.g. in a Docker container).
2021-11-30 00:27:52 +00:00
882df94bcb ConsoleReaderThread: fixed zombie process leak 2021-11-29 23:45:10 +00:00
4a8ca603a1 Log a message when forceShutdown() is called for anything other than a graceful shutdown 2021-11-28 18:53:34 +00:00
52f0c4f3ed Removed dodgy test using invalid block metadata 2021-11-27 22:51:14 +00:00
e2815eed60 BlockFactory: remap a bunch more invalid states 2021-11-27 20:07:58 +00:00
932a88764c composer commands suck 2021-11-27 04:07:25 +00:00
9540193766 Fixed everything lighting on fire 2021-11-27 03:54:30 +00:00
cc23e0b7a1 Updated DevTools submodule to pmmp/DevTools@6af57741e6 2021-11-27 03:52:32 +00:00
1f9400f901 World: automatically remap invalid blockstates on chunk load
this fixes a wide range of blocks with invalid blockstates becoming update! blocks on the client.

The most common occurrence of this was air with nonzero metadata left behind by world editors which set blockIDs but not block metadata. This caused large ghost structures of update! blocks to appear from nowhere.

The performance impact of this is very minimal (20 microseconds per chunk load in timings, compared to average 660 microseconds to load tiles).
2021-11-27 01:12:30 +00:00
e5149756a8 WorldTimings: fixed merge error introduced by 3bf87378ef 2021-11-27 00:06:09 +00:00
bc18969a09 Merge branch 'stable' 2021-11-26 23:45:09 +00:00
c19174a174 3.25.7 is next 2021-11-26 23:37:47 +00:00
f95142f6b6 Release 3.25.6 2021-11-26 23:37:46 +00:00
7ace24caab Fixed borked build number
this was a problem before the recent clean-up; the only reason it just decided to show now is because 2000+25 is valid PHP code, so PHP saved our asses.
2021-11-26 23:36:19 +00:00
32f619ac49 3.25.6 is next 2021-11-26 23:20:48 +00:00
1bb6ac4fb6 Release 3.25.5 2021-11-26 23:20:40 +00:00
533d3aae8b Merge branch 'stable' 2021-11-26 22:41:18 +00:00
52a891ba73 shut 2021-11-26 22:32:25 +00:00
71b813d4f9 Define pocketmine\BUILD_NUMBER from phar metadata
this way we don't have to patch the code (no idea why we were doing that anyway).
2021-11-26 22:27:58 +00:00
f2540a72ad Backport improved make-release.php from PM4 2021-11-26 22:10:46 +00:00
03f13495b7 Merge branch 'stable' 2021-11-26 21:59:55 +00:00
7e0f6c02a1 Updated build/php submodule to pmmp/php-build-scripts@a59722c676 2021-11-26 21:59:39 +00:00
1bc7869f6e Added remapping for almost 4000 invalid blockstates
when a block has sole ownership of an ID, the state bitmask can be ignored and we can just claim the whole metadata range for that single block.
This fixes a large number of issues with unknown blocks on older worlds where world editors did not remove the metadata, although update blocks will currently still appear on initial chunk send due to lack of AOT conversion (TODO).
2021-11-26 01:58:52 +00:00
5556861000 ItemFactory: move SweetBerries registration to the correct place 2021-11-26 00:46:35 +00:00
7dd5d0b593 4.0.0-BETA14 is next 2021-11-25 00:40:43 +00:00
9338d42742 Release 4.0.0-BETA13 2021-11-25 00:40:40 +00:00
9346ecdc39 Merge branch 'stable' 2021-11-25 00:01:48 +00:00
c023c02b6c MemoryManager: Removed obsolete workaround for $GLOBALS not being defined on threads
this was long since fixed, and everyone has since been forced to upgrade to pthreads 4.0.0, which definitely has the fix.
2021-11-24 23:57:55 +00:00
bb7683158f Remove dead ignoreErrors patterns 2021-11-24 23:52:51 +00:00
fad96b77ce stfu 2021-11-24 23:49:56 +00:00
40575a6dcf Merge branch 'master' of github.com:pmmp/PocketMine-MP 2021-11-24 23:43:03 +00:00
40f8f042da Merge branch 'stable' 2021-11-24 23:42:53 +00:00
0fe6038c41 Merge branch 'stable' 2021-11-24 23:41:40 +00:00
adff561483 phpstan: go nuclear on OPcache
when using dynamic reflection (which is the default), any time static reflection comes into play, bad shit starts to happen because of FileReadTrapStreamWrapper.
I attempted to fix these issues (phpstan/phpstan-src#801) and failed miserably.
So, to save the hassle, it's time to just remove OPcache from the picture (which, unfortunately, also means that PHPStan will not benefit from JIT).
2021-11-24 23:40:54 +00:00
ad56392d95 Skull: fixed calculation of collision boxes (#4591) 2021-11-24 21:42:51 +00:00
472ffb28ff ScriptPluginLoader: use parseDocComment() instead of reinventing the wheel 2021-11-24 17:22:49 +00:00
726c5652f7 ScriptPluginLoader: fixed reading @tags from non-docblock lines preceding the first docblock 2021-11-24 17:07:34 +00:00
b784a04e08 Utils: fixed parseDocComment() ignoring tags containing hyphens 2021-11-24 16:38:37 +00:00
5c7125f190 Improved error handling for loading broken entity / tile data 2021-11-23 17:41:26 +00:00
eb0cf52d81 Remove useless code (#4590) 2021-11-23 17:09:33 +00:00
d8f0fd0a7e McRegion: skip chunks with TerrainGenerated=false
legacy PM used to save even ungenerated chunks, and omitted some tags when doing so which we expect to always be present.
2021-11-23 01:49:48 +00:00
fb0eebc0dc RegionWorldProvider: Show a more specific message on missing required ByteArrayTags 2021-11-23 01:39:35 +00:00
020cd7b966 CrashDump: fixed encodedData being uninitialized before getEncodedData() is called 2021-11-22 22:31:07 +00:00
c37c261c0f Separate crashdump file generation from crashdump data collection
this allows CrashDump to be used just to generate data, which will come in useful for non-crash error reporting in the future (e.g. packet decoding errors).
2021-11-22 22:19:40 +00:00
2bb97d8904 Be quiet CS 2021-11-22 15:40:47 +00:00
d3878b2d57 fixed spam 2021-11-22 15:37:33 +00:00
cbe0f44c4f ConsoleReaderChildProcess: Commit suicide in more cases
this makes it slightly less annoying to get rid of as an orphan process, though it still won't immediately die.
2021-11-22 14:58:45 +00:00
37622e02b8 Updated translations 2021-11-21 21:11:39 +00:00
ed8b4950a3 Updated BedrockProtocol 2021-11-21 21:10:58 +00:00
fc7d297f60 Added missing fields of StructureSettings 2021-11-21 20:51:35 +00:00
7b4ef293bd NetworkBinaryStream: fixed incorrect field types for StructureSettings 2021-11-21 20:49:00 +00:00
c72d66f370 Merge branch 'stable' 2021-11-20 18:28:55 +00:00
3683884b9c Updated build/php submodule to pmmp/php-build-scripts@7a2ab5b922 2021-11-20 18:27:43 +00:00
37e8b1ee8c Merge branch 'master' of github.com:pmmp/PocketMine-MP 2021-11-20 18:25:45 +00:00
046dafc34f Merge branch 'stable' 2021-11-20 18:25:30 +00:00
db135788b9 Updated transient dependencies 2021-11-20 18:19:27 +00:00
b34e6f53eb Changed visibility of Projectile->move to Protected. (#4585) 2021-11-19 23:21:10 +00:00
b4b954cc5f build/generate-registry-annotations: accommodate code with CRLF 2021-11-19 21:38:43 +00:00
7210db25b0 Bump phpstan/phpstan from 1.1.2 to 1.2.0 (#4583)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.1.2 to 1.2.0.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/master/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.1.2...1.2.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-19 14:42:01 +00:00
4599913034 Separate crashdump rendering from crashdump data collection
this allows this code to be reused for reproducing crashdumps based on the original data.
2021-11-18 00:58:20 +00:00
c48aa274e7 Merge branch 'master' of github.com:pmmp/PocketMine-MP 2021-11-15 22:52:47 +00:00
269231c228 Ban foreach(arrayWithStringKeys as k => v)
this is not as good as phpstan/phpstan-src#769 (e.g. array_key_first()/array_key_last() aren't covered by this, nor is array_rand()) but it does eliminate the most infuriating cases where this usually crops up.
2021-11-15 22:52:05 +00:00
4cad552909 Allow input of relative coordinates to setworldspawn command (#4575) 2021-11-14 20:07:37 +00:00
f2d5455c5e changelog: mention that armor right-click equipping is now supported
[ci skip]
closes #4570
2021-11-14 16:42:35 +00:00
65247b7248 changelog: add notes about ender inventory
closes #4569
2021-11-14 16:41:57 +00:00
2f408708f0 Explosion: fixed blocks with tiles not using said tiles for drop info
closes #4571
2021-11-14 16:27:47 +00:00
3dd03075cb StringToItemParser: added some quality-of-life aliases 2021-11-14 15:52:50 +00:00
82b5bca83e Merge branch 'master' of github.com:pmmp/PocketMine-MP 2021-11-14 15:52:05 +00:00
639867a640 Added missing aliases for wooden items 2021-11-14 15:51:41 +00:00
d4a382d568 Fix position of setworldspawn command (#4574)
* The world spawn position is no longer rounded

* Remove round() since the position is always int
2021-11-14 15:40:20 +00:00
399824c31c Add correct drop for Podzol (#4573) 2021-11-14 14:15:36 +00:00
ada469bc45 README: do not show beta releases on badge
[ci skip]
2021-11-12 01:35:39 +00:00
dc8243f88b Bump phpstan/phpstan from 1.1.1 to 1.1.2 (#4564)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/1.1.1...1.1.2)

---
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-11-12 00:24:23 +00:00
7668171c56 Merge branch 'master' of github.com:pmmp/PocketMine-MP 2021-11-12 00:17:07 +00:00
e4754ab029 PluginBase: Improved error messages for commands containing illegal characters 2021-11-12 00:16:53 +00:00
3276047497 Updated composer dependencies 2021-11-12 00:13:22 +00:00
49a8eff11e BUILDING: submodules are no longer required
submodules are useful (e.g. devtools, build/php) but they are not required to build a server phar.
2021-11-11 14:29:56 +00:00
73592349cd 4.0.0-BETA13 is next 2021-11-09 16:50:46 +00:00
635a9143de Release 4.0.0-BETA12 2021-11-09 16:50:42 +00:00
c3ec9c0948 Effect default duration is once again NOT hardcoded, like PM3
I have no fucking idea why I hardcoded this to begin with. Not one of my better ideas ...
2021-11-09 01:52:47 +00:00
09a2e006a8 CS AGAIN 2021-11-09 00:20:06 +00:00
fed59d3ebe added missing file 2021-11-09 00:11:39 +00:00
c7beb0a702 Clean up inventory auto close mess from PM3
on PM3 there was no concept of 'current window', we had no idea which window the player was actually looking at.
2021-11-08 23:51:25 +00:00
5be429a8c4 Ensure inventories get evacuated on server-side window close 2021-11-08 23:48:05 +00:00
ab002ca06d Improved handling of temporary inventory windows
evacuation behaviour is now consistent regardless of who is doing it
2021-11-08 23:36:58 +00:00
6efb1db107 Fixed inventories not working after dying with inventory open
closes #4185
closes #4177
2021-11-08 23:04:00 +00:00
6fdcfb01c8 Seal up main inventory open/close logic inside InventoryManager where it belongs 2021-11-08 22:58:06 +00:00
1beec348f9 3.25.5 is next 2021-11-08 22:33:09 +00:00
7306a2d939 Release 3.25.4 2021-11-08 22:33:08 +00:00
4bf338f783 Player: fixed removeWindow() causing all other inventories to be unopenable 2021-11-08 22:29:14 +00:00
255ff63fda 3.25.4 is next 2021-11-08 20:35:15 +00:00
d72f6a3ac6 Release 3.25.3 2021-11-08 20:35:14 +00:00
93a1e84ad9 TypeConverter: further simplification 2021-11-08 20:27:53 +00:00
c33f97ae41 TypeConverter: clean up absurdly overcomplicated bullshit in createInventoryAction() 2021-11-08 20:18:19 +00:00
cc4bb91fcb Implemented IPv6 support (#4554) 2021-11-08 20:03:28 +00:00
eb9012401b Merge branch 'stable' 2021-11-08 19:53:56 +00:00
3b34268ed6 Human: try to trap this stupid float cast bug in the wild 2021-11-08 19:48:39 +00:00
4c07078586 Merge branch 'stable' 2021-11-08 19:01:08 +00:00
19a3efe893 ....... 2021-11-08 18:57:14 +00:00
a1ecdc27e5 Removed Vanilla*::fromString()
these were misbegotten and should never have existed.
If someone really needs these for some reason, they can use getAll()[name].
2021-11-08 18:52:14 +00:00
f93b5be789 Added new dynamic StringToEffectParser 2021-11-08 18:49:28 +00:00
1fb60b5b3a CS fix again 2021-11-08 18:45:05 +00:00
08420c2556 Added new dynamic StringToEnchantmentParser
this should be used instead of VanillaEnchantments::fromString(), because it allows registering custom aliases.
2021-11-08 18:44:15 +00:00
18f5fb66bb Abstract the base functionality of StringToItemParser 2021-11-08 18:37:05 +00:00
a6f6b60bed fix CS again 2021-11-08 18:02:24 +00:00
c6c992a1f0 Preparations for negative Y support 2021-11-08 17:28:22 +00:00
df39a1ca07 TeleportCommand: do not hardcode world bounds 2021-11-08 17:22:01 +00:00
be6d1843de Merge branch 'master' of github.com:pmmp/PocketMine-MP 2021-11-08 17:17:20 +00:00
2b0b9bd8ed Update composer dependencies 2021-11-08 17:16:57 +00:00
76dad46e13 Bump phpstan/phpstan from 1.0.2 to 1.1.1 (#4560)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.0.2 to 1.1.1.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/1.0.2...1.1.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-08 13:36:06 +00:00
eb3530b6e6 Use pmmp/setup-php-action to compile PHP 2021-11-07 23:13:56 +00:00
4131bcef08 Changed "Level" string to "World" in Position::__toString() method. (#4559) 2021-11-07 21:11:55 +00:00
b84f7c18ec Install ext/crypto from PECL 2021-11-07 19:18:09 +00:00
45edb94607 Crafting tables now work the same way as anvils and enchanting tables
Removing almost all special-case logic for crafting tables.
2021-11-07 16:20:07 +00:00
6b316dc29a PluginManager: Make declaration of duplicate permissions a load error 2021-11-06 17:05:37 +00:00
d9d37f7fa6 ResourcePacksPacketHandler: fixed a mistake from c773e43eda
fixes #4557

Note: you may need to clear your local pack cache in order to get it working again.
2021-11-06 16:45:14 +00:00
4cb6c7dc1e PluginManager: fixed plugins being able to alter groups of other plugins' permissions
this could happen if a plugin declared a permission already declared by another plugin, and then declared a different default for it (e.g. true instead of op).
2021-11-06 16:32:19 +00:00
b392651354 pocketmine.yml: always refer to worlds as worlds in config comments, not levels 2021-11-06 02:22:14 +00:00
f81c55ce6c 4.0.0-BETA12 is next 2021-11-06 01:17:03 +00:00
002feacf8e Release 4.0.0-BETA11 2021-11-06 01:16:58 +00:00
b8523f7a18 Player: fix the fix which just degraded performance
if a chunk was requested for generation, count++ and count(activeRequests)++, which means that we would only get to submit half as many generation requests as we're allowed to.
Calculate the limit at the start and remember it instead.
2021-11-06 01:00:35 +00:00
640e88009b Player: fixed a mistake in generation rate limit
we don't want to allow sending further chunks when we haven't generated near ones, because we won't be able to see them anyway, and we might end up not needing them.
This now fully matches the results of PM3.
2021-11-06 00:57:37 +00:00
6cd272c9e1 Update transient composer dependencies 2021-11-06 00:55:13 +00:00
566c57bcd3 we no longer need submodules for these jobs 2021-11-06 00:35:39 +00:00
3c754b079c Move resources/locale to Composer dependency
all remaining submodules are now non-essential to running a server.
They are also versioned and updates can be done automatically using 'composer update'.

Finally, we can also put an end to the issue of translations being rendered incorrectly or being missing due to outdated submodules.
2021-11-06 00:32:58 +00:00
dbf9a33160 ChunkSelector: Improve algorithm to send chunks in proper circles, instead of squares
this ensures that the edge of loaded terain is always the same distance
away in any direction. This also means that when flying parallel to X or
Z axes, you now have about 12% more chunks directly in front of you,
instead of to your left and right, which gives the impression that
chunks are loading faster (they aren't, they are just being ordered in a
more sensible way).
2021-11-06 00:15:04 +00:00
07b1cff306 Bonemeal is no longer consumed when cancelling plant growth events (#4551) 2021-11-05 16:15:55 +00:00
0989c77037 Player: check that horizontal distance travelled is > 0 before adding exhaustion, or triggering a new chunk order
closes #4548
2021-11-05 15:46:55 +00:00
5107d0df4e Player: cap maximum number of active generation requests
this fixes the horrible spotty chunk loading seen in https://twitter.com/dktapps/status/1456397007946461190?s=20.
In practice, this made chunks invisible on teleport for several tens of seconds after teleporting. Having a larger chunks-per-tick with large render distance compounded to worsen the problem.
It wasn't really noticeable on small render distances, but very obvious on large ones with fast chunk sending and slow generation.

This also fixes #4187 (at least to the extent that it works on PM3, anyway).
2021-11-05 15:09:42 +00:00
579ef63663 EntityDataHelper: accept FloatTag for vector3 as well as Double
MCPE uses Float for entity positions.
2021-11-04 20:46:34 +00:00
8abc952c74 simulate-chunk-selector: do not reallocate colours on every frame 2021-11-04 19:38:40 +00:00
4c3a5fdd73 Clean PHPStan baselines from 1.0.2 2021-11-04 19:28:52 +00:00
54f287feb6 Merge branch 'stable' 2021-11-04 19:27:41 +00:00
84f8b3eb2d Move CrashDump to pocketmine\crash namespace 2021-11-04 19:23:45 +00:00
15fca84f3b remove some PHPStan error patterns 2021-11-04 19:22:49 +00:00
c60144210f Regenerate PHPStan bugs baseline 2021-11-04 19:18:29 +00:00
8ac999cbd4 Use object models for crashdump generation 2021-11-04 16:55:04 +00:00
4f8501ff34 Added a tool to visualise behaviour of ChunkSelector
I actually intended to write a tool for debugging generation, but it turns out this, as an intermediary step, is also useful and a whole bunch of fun to play with.
2021-11-04 14:14:55 +00:00
2405e45b35 Player: mark as not using item when held item slot is changed
closes #4538
2021-11-03 21:26:20 +00:00
e0b07ff308 Human: do not add more XP if totalXp limit was already reached
this matches the vanilla behaviour. For some reason it doesn't consider levels (so you can have a level higher or lower than this without actually having that amount of XP), but this matches Java behaviour as of 1.10.

fixes #4543
2021-11-03 20:45:55 +00:00
729f831b8f PHPStan 1.0.2 2021-11-03 20:26:32 +00:00
0356716e8e PopulationTask: do not expose internal fields as public
this code dates back to pthreads v2, when visibility on Threaded object fields meant different things (wtf, krakjoe??)
2021-11-03 15:23:43 +00:00
5c81b04813 PopulationTask: use typed properties 2021-11-03 15:22:49 +00:00
1ebb206762 World: fixed yet another edge case in drainPopulationRequestQueue() leading to assertion failure
really had to go fucking nuclear on it :(
2021-11-03 14:58:58 +00:00
29e2d92098 Bump phpstan/phpstan from 1.0.0 to 1.0.1 (#4541)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/1.0.0...1.0.1)

---
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-11-03 11:27:42 +00:00
ef82a2cd79 Fixed PlayerEmoteEvent::setEmoteId() being useless 2021-11-02 23:10:26 +00:00
87031627bf Do not call PlayerEmoteEvent if rate limit was reached 2021-11-02 23:09:43 +00:00
f066199971 Implement emote support (#4523) 2021-11-02 23:04:55 +00:00
a0e9eec652 4.0.0-BETA11 is next 2021-11-02 19:18:20 +00:00
fa6a432d58 Release 4.0.0-BETA10 2021-11-02 19:18:19 +00:00
102277c636 draft-release: fixed BedrockData JSON minification 2021-11-02 19:16:36 +00:00
f50f26d52e 4.0.0-BETA10 is next 2021-11-02 19:14:15 +00:00
4ca7c29cde Release 4.0.0-BETA9 2021-11-02 19:14:12 +00:00
9f64bc8180 Merge branch 'stable' 2021-11-02 17:30:36 +00:00
f75a05d7fa 3.25.3 is next 2021-11-02 17:21:49 +00:00
3dae873731 Release 3.25.2 2021-11-02 17:21:44 +00:00
aa0dc60c32 Merge branch 'master' of github.com:pmmp/PocketMine-MP 2021-11-02 17:10:19 +00:00
d184838ba0 Move Promise classes to their own namespace 2021-11-02 17:10:07 +00:00
ead8ccf08d CocoaBlock: call BlockGrowEvent when growing for any reason (#4536) 2021-11-02 17:05:07 +00:00
38f97bed52 World: fixed PopulationTask failed assumption that generator is always registered
if the worker selected previously had a generator registered, but has since been shutdown, the workerStartHook that cleans up generatorRegisteredWorkers won't yet have been called.
This results in the worker being started by the submission of PopulationTask, and the generator doesn't get preemptively registered.
2021-11-02 16:58:14 +00:00
275f145418 BedrockData is now a Composer dependency
this should put a stop to people nagging me about incorrect blocks (we have a check to make sure composer dependencies are up to date).
2021-11-02 16:45:45 +00:00
6b07f7a5ec pmmp/BedrockProtocol@5.0.0+bedrock-1.17.40 2021-11-02 16:22:56 +00:00
e131c2cefa Drop pocketmine/spl 2021-11-02 16:08:29 +00:00
e34364412b Replace InvalidStateException usages with InvalidArgument or LogicException 2021-11-02 16:05:54 +00:00
4eef458d29 Config: throw AssumptionFailedError if config type is invalid or DETECT during save()
this should never happen ... it was already checked in load()
2021-11-02 16:03:43 +00:00
8b3565b75d PopulationTask no longer depends on a World object
this means it's now possible to test generation offline without too much hassle.
World::generateChunkCallback() has been removed from public API.
2021-11-02 15:40:51 +00:00
facfd7c04a sanity check 2021-11-02 15:26:54 +00:00
65ef9f786a Use standard chunkHash() to index population chunks 2021-11-02 15:25:03 +00:00
4dc13ab3da ConsoleReaderThread: strip control characters
this fixes a bug I encountered when accidentally pressing ctrl+a+d (which inserts a chr(1) character), because it made the server unable to find the command - but still reported an error containing what looked like a valid command (character isn't printable).
2021-11-02 15:11:23 +00:00
ede4157814 Check to see if the player can start using the Releasable item. (#4532) 2021-11-02 14:36:16 +00:00
34ea199fb0 World: fixed additional edge case - population promise rejected before task completion
if this happened, the index would stay set in activeChunkPopulationTasks, eventually causing the generation queue to jam up completely and non-forced generation to come to a standstill.
2021-11-02 14:30:23 +00:00
1775699f05 World: make sure that chunks locked by PopulationTask always get unlocked, no matter what
fixes #4527
2021-11-02 14:20:42 +00:00
32a857b8b4 fix CS 2021-11-02 14:09:16 +00:00
7e4be29fc4 Gracefully force-shutdown on failure to start RakLib
this now won't generate a crashdump.
2021-11-02 13:51:01 +00:00
c17587d436 World: use new Vector3() instead of Block->getPosition()
When profiling this, I noticed that we spend a stupidly large amount of time creating useless Position objects in the case of update=true, because Vector3->sides() calls Position->getSide(), which calls Position::fromObject(parent::getSide()). This is stupid because the update logic doesn't require Positions anywhere (as evidenced by this change needing no other alterations.

A rough profile shows that this improves setBlock() performance by about 25% in the update=true case, which is a pretty big margin.
As an added bonus, it gets rid of some unrealized cyclic dependencies in World->changedBlocks.
2021-11-02 03:00:00 +00:00
0f6b7e48cb Updated BedrockProtocol:
it's weirdly satisfying that LevelChunkPacket::create() with the extra parameter turns out to be exactly the same length as the old way.
2021-11-02 01:37:56 +00:00
f2912fcdd8 Updated pocketmine/log and pocketmine/log-pthreads (BC breaks included)
AttachableLogger deals with Closures now instead of LoggerAttachment objects
ThreadedLoggerAttachment no longer implements LoggerAttachment
2021-11-01 22:22:22 +00:00
f6cb4f9597 Updated BedrockProtocol 2021-11-01 21:32:02 +00:00
54442f7e4b Merge branch 'stable' 2021-11-01 21:18:35 +00:00
5257755dc5 shut 2021-11-01 21:15:58 +00:00
8c16ecaa5b Merge branch 'stable' 2021-11-01 21:08:32 +00:00
3214da8642 pthreads 4.0.0 2021-11-01 21:01:59 +00:00
f827a555d5 Merge branch 'stable' 2021-11-01 18:13:24 +00:00
61145baded Merge commit 27ae959e8 2021-11-01 17:42:31 +00:00
4d54d6c552 Merge commit f8f39687e2 2021-11-01 17:41:47 +00:00
485bc2c565 Merge commit 94737934de 2021-11-01 17:41:10 +00:00
07b4f844a9 Merge commit debb469de1 2021-11-01 17:40:40 +00:00
19e5775f6b Merge commit 73dc0598e4 2021-11-01 17:40:06 +00:00
804fb3f603 Merge commit 141fbde660 2021-11-01 17:39:40 +00:00
6175b03433 Merge commit 69952ae2af 2021-11-01 17:36:34 +00:00
a78248a19c Merge commit '71f2a34616961d6328f06fd911b6d4450a61643e' 2021-11-01 17:33:02 +00:00
414ccb9f10 Merge commit 'd17cd658030e66009c0bb32941387c7444d3ffe0' 2021-11-01 17:31:05 +00:00
794142fe49 Merge l7/l8/l9 baselines into actual-problems
it doesn't serve any practical purpose to keep these separated, particularly since it's getting so difficult to figure out which errors are coming from which levels (since we always use 9, it doesn't really make any difference).
2021-11-01 17:27:31 +00:00
ff27c5f7db PHPStan 1.0.0 2021-11-01 17:24:20 +00:00
4d4362801f AvailableCommandsPacket: remove dead code 2021-11-01 17:01:26 +00:00
0babe0a1ab LevelDB: remove unused private method 2021-11-01 16:55:05 +00:00
d696ebcda3 Level: do not use static:: to access levelIdCounter
the field is private.
2021-11-01 16:52:27 +00:00
c3768b997a Updated to pmmp/BedrockProtocol@146498c279 2021-11-01 16:13:33 +00:00
f6480017ce Update PHPUnit dependency junk 2021-11-01 16:12:37 +00:00
9f5c16bc46 Projectile: use closure instead of do/while for reading id/data of block
not ideal, but whatever I guess... this at least provides scope isolation
2021-11-01 15:56:28 +00:00
8865bb73ba BanEntry: remove useless do/while 2021-11-01 15:52:55 +00:00
2dee1dbc28 Remove ridiculous code in ResourcePackManager 2021-11-01 15:41:21 +00:00
0f0b6f0efa Utils: eliminate usages of backtick operator 2021-11-01 15:25:56 +00:00
d5f13d8be2 Timezone: make PHPStan 1.0 happy 2021-11-01 15:24:16 +00:00
27ae959e89 Terminal: backport shell_exec() code from PM4 to make PHPStan 1.0 happy 2021-11-01 15:23:36 +00:00
f8f39687e2 Achievement: declare proper type for $list static property 2021-11-01 15:22:33 +00:00
94737934de PlayerDeathEvent: fixed LSP violation reported by PHPStan 1.0 2021-11-01 14:17:54 +00:00
debb469de1 Updated PHPUnit dependency junk 2021-11-01 13:54:04 +00:00
616eb0050d World: remove premature optimisation of setBlockAt() introduced by ece28e5d7b
closes #4531
it turns out that letting the light updates themselves handle this is faster than trying to get in the way.
2021-11-01 02:34:44 +00:00
9d30bc8b95 World: fixed assertion failure when requesting, cancelling, and then re-requesting chunks via requestChunkPopulation()
if the request/cancel/re-request happens all in the time before the queue gets drained, chunk hashes may appear multiple times in the queue. We don't want to process them twice if this happens (although it's mostly harmless anyway).
2021-11-01 02:17:11 +00:00
46b7d35cd3 Player: return from callback if used chunk status is not REQUESTED_GENERATION()
this can happen especially on large render distances when flying fast and changing direction - we decide we don't want the chunk, then, after changing direction and re-ordering chunks, we decide we do want it again, and end up registering a second callback. In this case, we need to ensure that only one of the callbacks gets executed (it doesn't matter which one).
2021-11-01 01:45:49 +00:00
c781efcf90 World: avoid calling the same logic twice in requestChunkPopulation()
orderChunkPopulation() checks the preconditions too. Have them both call an internal function that doesn't.
2021-11-01 00:36:57 +00:00
e4a54f5b6a World: deduplicate code in request/orderChunkPopulation 2021-11-01 00:33:18 +00:00
afb54f1ae4 World: flip orderChunkPopulation() condition around
this makes it more obvious that the code is similar to requestChunkPopulation() barring one distinct difference.
2021-11-01 00:25:30 +00:00
8f803df511 World: check population locks _after_ checking if the chunk is already populated, not before
this led to another case where a population request would be queued up for an already-populated chunk for no reason.
2021-10-31 23:54:27 +00:00
f4a3c40b5c World: use better variable names in orderChunkPopulation() 2021-10-31 23:48:00 +00:00
9dec82cdbc World: fixed requestChunkPopulation() queuing requests for chunks which are already populated
this led to chunk sending getting bogged down if there were more than population-queue-size chunks waiting to be generated.
2021-10-31 23:40:34 +00:00
74031d2fbe World: remove the fulfilled promise from the population request map
fixes crash when unregistering chunk loaders
2021-10-31 23:05:12 +00:00
bd60e41268 Revert "Revert "Player: do not re-request the same ungenerated chunks multiple times""
This reverts commit 3265d3f6b4.
2021-10-31 22:57:56 +00:00
96cfdc79b8 World: fixed original promise not getting fulfilled if the chunk became populated=true after a promise was already made (but not fulfilled) to populate it
this could happen if a plugin calls setPopulated(true) on a chunk after a request for its population landed in the queue, but before it actually got processed. In that case, the promise would never get fulfilled.
2021-10-31 22:54:37 +00:00
2fa0a914ff World::orderChunkPopulation() may return a pre-resolved promise
this does not indicate a failure; it indicates that the chunk has already been successfully populated.
In this case, we shouldn't be putting the task back on the queue.

This is skirting around the real bug, which is that requestChunkPopulation() doesn't check if the target chunk is already populated before it creates a new promise that it will be.
2021-10-31 22:51:37 +00:00
08636d079d Promise: expose isResolved() 2021-10-31 22:48:52 +00:00
3265d3f6b4 Revert "Player: do not re-request the same ungenerated chunks multiple times"
This reverts commit 866020dfdb.

For some fucking reason this broke resending chunks in some cases (and
sending chunks at all in others). I don't have time to debug this right
now, so it's going to have to remain broken, infuriatingly enough.
2021-10-31 21:25:21 +00:00
0f78a2b5ef Advisory chunk locking for chunk population (#4513)
this allows chunks locked for population to be modified. If the PopulationTask detects that the chunk was modified during the onCompletion(), the result of the population will be discarded and rescheduled, so that it includes user modifications.
2021-10-31 21:11:20 +00:00
f1a791ef75 Improved Promise API - separate resolver and consumer APIs
this makes creating a promise slightly more cumbersome, but I'm more concerned about people who might try to call 'new Promise' directly.
2021-10-31 19:49:57 +00:00
866020dfdb Player: do not re-request the same ungenerated chunks multiple times
this doesn't affect chunk resends, since they'll be kicked back to NEEDED, which is detected by orderChunks().
2021-10-31 18:52:37 +00:00
c580bb2434 InGamePacketHandler: mark player as not using item in more cases
fixes #4355
2021-10-31 14:41:31 +00:00
4fe3f69702 World: eliminate final remaining 'no loaders attached' debug message on player creation 2021-10-31 14:33:27 +00:00
018006541e changelog: mention block-picking changes
[ci skip]
2021-10-31 14:12:12 +00:00
fbb91d123d World::unregisterChunkListenerFromAll(): go through unregisterChunkListener()
this ensures that everything gets cleaned up properly (e.g. player chunk listeners).
2021-10-31 14:03:40 +00:00
3dc75644d9 World: avoid duplicated logger code in initChunk() 2021-10-31 14:02:25 +00:00
1cabe4baf3 World: do not crash on duplicate tiles loaded from disk
closes #4049
2021-10-31 13:58:32 +00:00
73dc0598e4 CrashDump: remove derp space 2021-10-30 23:22:37 +01:00
faad2365e2 World: Register a temporary chunk loader on chunks used by PopulationTask
fixes #3839
2021-10-30 22:17:06 +01:00
4f816d03a7 SurvivalBlockBreakHandler: remove useless code 2021-10-30 21:35:58 +01:00
1d22761d27 Remove useless newline 2021-10-30 21:25:47 +01:00
5b8ce7e3e2 Cake: fixed desync on cancellation of eating
closes #3591
we don't support eating in creative right now, but the cake shouldn't appear to be eaten when it's not.
2021-10-30 21:02:24 +01:00
08f3c18de9 Arrow: do not add pickups to creative players' inventories
closes #2932
2021-10-30 17:16:46 +01:00
141fbde660 Player: fixed getting re-banned on rejoin after unban from hardcore death
closes #2175
2021-10-30 16:58:03 +01:00
465a509858 World: remove spammy debug message 2021-10-30 16:13:01 +01:00
69952ae2af Human: limit lifetime total XP range to INT32_MAX
closes #4484
2021-10-30 16:05:10 +01:00
71f2a34616 Entity: spawnTo() must silently swallow errors
Player->showPlayer() assumes that spawnTo() will take care of all the checks necessary to ensure we don't actually spawn a player to someone it shouldn't be able to see. In PM3, there's nothing we can do about that.
This could be a problem if anything decides to override spawnTo() to do additional stuff and assumes that the function will always succeed; however, there's not much reason to do that (plugins sending packets should override sendSpawnPacket() instead).
2021-10-30 15:38:27 +01:00
63dfcc60c3 4.0.0-BETA9 is next 2021-10-29 22:35:23 +01:00
428bd5ae91 Release 4.0.0-BETA8 2021-10-29 22:35:15 +01:00
d17cd65803 3.25.2 is next 2021-10-29 22:23:28 +01:00
a8d5e8c5f6 Release 3.25.1 2021-10-29 22:23:22 +01:00
19f448d074 pocketmine/math 0.4.0 2021-10-29 21:56:56 +01:00
1c18c731ef bootstrap: check for zlib raw support in leveldb 2021-10-29 19:15:12 +01:00
8a2ecfe1d4 Merge branch 'stable' 2021-10-29 19:04:01 +01:00
089e62b44e Entity::spawnTo(): verify that the target player belongs to the same world as the entity
this should never be hit in the PM case, but it's an InvalidArgument rather than AssumptionFailedError because plugins can and do call this with bad things.
2021-10-29 18:54:00 +01:00
32a34d2494 Location: change order of constructor parameters
to be consistent with Position::__construct() and Location::fromObject() (although Location::fromObject() has no choice, thanks to the anti-feature known as late static binding ...)
2021-10-29 15:43:09 +01:00
ee9f5e0044 Location: make __construct() parameters mandatory
I did consider allowing yaw/pitch to remain optional, but considering the implicit immutability of Location, it really doesn't make any sense to create a Location with default yaw/pitch - just create a Position in that case instead.
2021-10-29 15:40:58 +01:00
88b7389080 InventoryManager: reduce code duplication 2021-10-29 15:37:52 +01:00
f1cc168d26 phpstan: exclude a couple of files from analysis temporarily
close #4472
2021-10-29 00:23:13 +01:00
fb5543a2ad Updated BedrockProtocol dependency 2021-10-29 00:16:11 +01:00
a4eda9a8f5 World: call nearby entities' onNearbyBlockChange() in setChunk()
fixes #2779 in all known cases.
2021-10-28 23:59:32 +01:00
eb75df6f8e World: Intelligently perform automatic transfer or deletion of tiles in setChunk(), depending on the context
tiles may be deleted in the following circumstances:
1) the target block in the new chunk doesn't expect a tile
2) the target block in the new chunk expects a different type of tile (responsibility of the plugin developer to create the new tile)
3) there's already a tile in the target chunk which conflicts with the old one

In all other cases, the tile will be transferred.

This resolves a large number of unintentional bugs caused by world editors replacing chunks without setting the deleteTilesAndEntities parameter to false (even the core itself does it).

closes #4520
2021-10-28 23:48:17 +01:00
c66790b6a6 World: never delete entities in setChunk()
entities exist completely independently from chunks now, so there is no need to interact with them whatsoever.
As I wrote in #4520, there's no sense in deleting entities here, since a chunk replacement is essentially just a mass block update.

On that theme, it might be a good idea to call Entity->onNearbyBlockChange() for all entities in the target and adjacent chunks when replacing a chunk, to ensure that they get the proper movement updates.
2021-10-28 23:42:28 +01:00
d78801b9d5 World: fixed tiles and entities getting deleted when adjacent chunks are modified during population 2021-10-28 22:24:47 +01:00
d410db4302 Chunk: rename DIRTY_FLAG_TERRAIN to DIRTY_FLAG_BLOCKS
we use the word 'terrain' elsewhere to refer to the combination of blocks and biomes, so using TERRAIN here is misleading.
2021-10-28 22:11:07 +01:00
a62ce64fdd Revert "Chunk: added modification counter"
This reverts commit a5418a019d.

The more I assessed this, the more I realized that this implementation
doesn't actually offer any value. Since modcounters don't persist after
chunk unload + reload, they can't be reliably used to detect changes in
chunks without additional event subscriptions.
For the purpose I actually intended to use them for (population task
cancellation) there's a) another solution, and b) modcounts are
unreliable for that too, because of the aforementioned potential for
chunks to get unloaded and reloaded.
For the case of detecting dirty chunks within PopulationTask itself,
they are also unnecessary, since the dirty flags are sufficient within
there, since FastChunkSerializer doesn't copy dirty flags.

In conclusion, this was a misbegotten addition with little real value,
but does impact performance in hot paths.
2021-10-28 21:02:04 +01:00
5db3915aad Make MemoryManager aware of ChunkCache 2021-10-28 20:28:00 +01:00
eb40b741ae StandardPacketBroadcaster now splits broadcasts by session-specific PacketSerializerContext
in the normal case, all sessions will share the same PacketSerializerContext and Compressor, so this code will be the same as before
However, for the multi-protocol hackers out there, this should reduce the maintenance burden (@Driesboy) since now only the PacketSerializerContext needs to be maintained. I recommend a separate PacketSerializerContext for each protocol (perhaps put the protocol version in the serializer context too, if you need it for some reason).
2021-10-28 20:15:37 +01:00
b3720b3f17 4.0.0-BETA8 is next 2021-10-28 17:28:53 +01:00
7effa03ba4 Release 4.0.0-BETA7 2021-10-28 17:28:48 +01:00
d0474ccd92 make-release: note which channel the build will be released into 2021-10-28 16:29:20 +01:00
2b0768f720 make-release: fixed retention of +dev on release versions 2021-10-28 16:26:56 +01:00
dba148cfaa build/make-release: make arg parsing use getopt 2021-10-28 16:25:18 +01:00
48f77abe7e Leave channel ID in VersionInfo
so that I don't have to type it out every time I make a new release. Most of the time it's going to be posted to the same channel as before anyway.
2021-10-28 16:03:43 +01:00
bb05af103d PluginManager: fixed crash when using a plugin-loader plugin (read: devtools)
closes #4518
2021-10-28 15:55:05 +01:00
0ef5c67b9b Use static constructor for MovePlayerPacket
this marks the last of the packets created using the old way.
2021-10-27 21:10:16 +01:00
6d89265510 Player: reduce code duplication
back when this was just hardcoded >> 4 everywhere, nobody thought anything of it, but now it uses constants, it's easy to cross-reference and see where the duplicates are.
2021-10-26 23:02:50 +01:00
a7d8a598e1 World: reduce code duplication for chunk coordinate calculation 2021-10-26 22:58:17 +01:00
51fbff204b World: make PhpStorm understand return type of getAdjacentChunks() 2021-10-26 20:32:09 +01:00
1873457840 PopulationTask: stop using dynamic properties 2021-10-26 20:21:58 +01:00
fca70efbb1 World: move chunk population related methods to be in the same overall place 2021-10-26 16:44:08 +01:00
8f88393184 World: Specialize generateChunkCallback() for PopulationTask
this allows us to also set the adjacent chunks before calling ChunkPopulateEvent, to give a more accurate picture of what changed.
2021-10-26 15:28:00 +01:00
b9d9b69bbe ConsoleReaderThread: trim the string before returning it
it will have a newline at the end that was added by the subprocess when posting it to the main process.
2021-10-26 01:07:14 +01:00
1d99cd329a CS again 2021-10-26 00:50:43 +01:00
bd8cba1a7f Added unit tests for Utils::testValidInstance() 2021-10-26 00:49:41 +01:00
24d4daec90 Utils::testValidInstance() now accepts interfaces for the baseName 2021-10-26 00:32:32 +01:00
4178c81209 Utils: fixed testValidInstance() not accepting the same valid class for both className and baseName
this caused problems in PlayerCreationEvent because plugins set the base class and then set the player class to the same thing.
2021-10-26 00:31:30 +01:00
94f4ef5862 PopulationTask: Throw AssumptionFailedError if center chunk is null for some reason 2021-10-25 21:07:03 +01:00
2e2515354c PopulationTask: fixed undefined method call
fuck you PhpStorm! fuck you PhpStorm! fuck you PhpStorm!
2021-10-25 20:57:43 +01:00
359d0835f3 CS 2021-10-25 20:54:39 +01:00
d4cbde6f10 PopulationTask: use modification counters to detect changed chunks
instead of using terrain dirty flags, which aren't suitable for this purpose
2021-10-25 20:53:50 +01:00
a5418a019d Chunk: added modification counter
this is independent from the terrain dirty flags (which are specifically used to track state of chunks needing to be saved).
2021-10-25 20:53:11 +01:00
baba25953f Chunk: make all parameters of __construct() mandatory and non-nullable
having the constructor fill in defaults for these invariably causes bugs.
2021-10-25 20:22:50 +01:00
d53347454b Chunk: use HeightArray::fill() 2021-10-25 20:17:30 +01:00
401e8d117b Flat: use a less dumb way to build biome array 2021-10-25 20:15:33 +01:00
9835d75f65 Chunk: removed heighArray parameter from constructor
we don't pass this anywhere, and really it should be dynamically initialized anyway, just like light.
2021-10-25 20:13:50 +01:00
b8519d1af4 World: fixed every chunk having terrain saved at least once, even if unmodified
setPopulated() sets dirty flags on the chunk, causing the autosave sweep
to think they've been changed when they haven't. We now pass
terrainPopulated to the constructor to avoid this ambiguity recurring in
the future.
2021-10-25 19:53:47 +01:00
f6e53f826b Fixed Anvil/McRegion chunks getting autosaved on first time, even when unchanged
setGenerated/setPopulated and friends set hasChanged = true, which causes the world to autosave them the first time around, even though they weren't modified.
2021-10-25 19:52:44 +01:00
42ede30e77 ... 2021-10-23 23:57:28 +01:00
04aedc6494 Updated BedrockProtocol 2021-10-23 23:54:49 +01:00
701a71a4ee Sound::encode() position is no longer nullable
making this nullable was based on the invalid assumption that global sounds have no position, but it turns out they _do_ still use the position to make the sound come from the correct direction.
2021-10-23 02:01:26 +01:00
e50072dc27 Clean PHPStan baselines 2021-10-23 01:55:10 +01:00
c77829f4ad Migrate packet creation to use ::create() methods in all but one case
MovePlayerPacket doesn't yet have a ::create() due to a complication with fields that aren't always present.
2021-10-23 01:46:01 +01:00
c773e43eda Updated BedrockProtocol to pmmp/BedrockProtocol@97fa88e9ef 2021-10-23 01:16:45 +01:00
c262c2e726 Updated composer dependencies 2021-10-23 01:14:54 +01:00
a4b65d6a3f PlayerCreationEvent: verify that the class actually exists and is instantiable
this ensures that crashdumps blame the plugin instead of the core on bad classes, such as in this case: https://crash.pmmp.io/view/5331225
2021-10-21 20:37:45 +01:00
986b4e0651 Enforce single-line PhpDoc for properties where possible 2021-10-21 20:32:37 +01:00
2971bf30a5 actions: combine code verify into one step
this way the diff takes one less click to get to.
2021-10-21 00:30:19 +01:00
4f2bcb61d6 Fixed crashdump generation when crashing before PluginManager was created 2021-10-20 23:35:04 +01:00
e2275cc8ec PluginManager: Prevent infinite recursion in loadPlugins()
if a plugin calls loadPlugins(server->getPluginPath()) during its onLoad(), and it itself is in that plugin path, an infinite recursion will occur.
2021-10-20 23:10:18 +01:00
620874d902 PluginManager: Extract checkPluginLoadability() to a PluginLoadabilityChecker unit
this can be more easily unit-tested.
2021-10-20 22:31:56 +01:00
44508a138f Moved plugin extension requirement checks to PluginManager::checkPluginLoadability()
these don't really belong in PluginDescription.
2021-10-20 22:13:30 +01:00
aa408c9a97 Fixed 9646128d01 2021-10-20 21:54:57 +01:00
6d78a0b435 CS 2021-10-20 21:52:42 +01:00
76b4b23d98 PluginManager: remove loadPlugin()
loadPlugins() is now the preferred option, since it does all the proper checks.
In addition, the server now acknowledges that loading a single plugin may cause multiple plugins to be loaded, so returning only a single Plugin is not representative of what's actually happening.
2021-10-20 21:52:19 +01:00
03fcd844eb PluginManager::loadPlugins() now accepts files as well as directories
loadPlugins() is now a superior option to loadPlugin(), since it enforces dependency checks and also supports automatic loading of plugins when new loaders are installed.
2021-10-20 21:36:14 +01:00
fecc13f362 Merge branch 'master' of github.com:pmmp/PocketMine-MP 2021-10-20 21:23:14 +01:00
9646128d01 Updated resources/locale submodule to pmmp/Language@09c709f242 2021-10-20 21:22:56 +01:00
a788954551 Fixed dependency handling across plugin loaders (#3971) 2021-10-20 20:22:00 +01:00
dc07ac33d3 protocol: fixed missing field of CraftRecipeAuto 2021-10-20 19:47:32 +01:00
ec3986827c Update BedrockProtocol to 3.0.1, widen constraint to allow newer patch versions 2021-10-20 16:20:10 +01:00
09c840b66a Update transient composer dependencies 2021-10-20 16:19:20 +01:00
80b402e529 ItemTranslator: throw the proper exceptions when failing to map network IDs 2021-10-20 14:01:39 +01:00
a3f8546ac4 4.0.0-BETA7 is next 2021-10-19 19:13:43 +01:00
46920818b5 Release 4.0.0-BETA6 2021-10-19 19:13:43 +01:00
69cb575789 Merge branch 'stable' 2021-10-19 19:05:25 +01:00
fee6478cbe Updated BedrockData and BedrockProtocol for 1.17.40 support 2021-10-19 19:00:29 +01:00
9c5cec77b1 3.25.1 is next 2021-10-19 18:27:30 +01:00
f48b703533 Release 3.25.0 2021-10-19 18:27:26 +01:00
70636f6eb4 Protocol changes for 1.17.40 2021-10-19 18:00:34 +01:00
c70b80c273 ItemEntity: implement partial itemstack pickups in the dumbest way possible
Given the various limitations and flexibilities posed by EntityItemPickupEvent, I settled on this as the simplest way to deal with the problem.

- EntityItemPickupEvent may have its destination inventory changed, so we can't cache the result of getAddableItemQuantity() to use after the event.
- The item itself may have changed, so even if we thought we could add some items before the change, we might not be able to afterwards.

Considering the above facts, it's better to just give the whole itemstack to EntityItemPickupEvent, and let plugins use getAddableItemQuantity() on their own to decide if their chosen inventory can accommodate the item or not.
If it can't, then we'll just drop it on the ground.
This also fixes a potential issue where plugins changing the item to a custom one might end up with their items and the actual items both just vanishing if the target inventory was full.
closes #4499
2021-10-17 22:37:49 +01:00
a794d24c81 Added a tool to generate a Markdown document of all core permissions 2021-10-17 17:02:18 +01:00
8db5732b44 Drop respect/validation
it's not worth this turning into compatibility baggage just so that we can parse plugin_list.yml, especially when we have new ways to handle data parsing coming in the pipeline.
For something as small as plugin_list.yml, it's easier (and in this case better too) to just validate it manually (respect/validation was anyway too strict considering it's YAML we're dealing with).
2021-10-15 17:15:46 +01:00
48f809d3fa Removed another dead PHPStan error pattern
this was actually a PHPStan bug fixed in 0.12.99.
2021-10-15 17:01:09 +01:00
0348236860 fucking CS again 2021-10-14 15:56:50 +01:00
8c07748100 RakLibInterface: print packet exception info as a block using Utils::printableExceptionInfo() 2021-10-14 15:55:08 +01:00
06e7338ff9 Move exception printing utilities from MainLogger to Utils
where they can be useful to other stuff apart from just the logger
2021-10-14 15:54:20 +01:00
bdbfa70558 Server: break some isolated stuff out of Server::__construct() 2021-10-14 15:44:18 +01:00
7a4af7a0bc SignalHandler: fix CS
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2021-10-14 15:14:27 +01:00
34b1392598 Cross-platform signal handler 2021-10-14 15:03:11 +01:00
321345fcc8 Sapling: simplify condition 2021-10-13 23:00:38 +01:00
0ac9f4fe61 BlockFactory: move SweetBerryBush to its proper place 2021-10-13 22:26:51 +01:00
2db53775e0 Sort item_from_string_bc_map using SORT_NATURAL 2021-10-13 21:01:59 +01:00
8523f0fb0b CS fix 2021-10-13 20:31:24 +01:00
b570324288 LegacyStringToItemParser: rely exclusively on item_from_string_bc_map.json, do not interpret integers given as strings
fixes #4507
2021-10-13 20:29:18 +01:00
6284cd14c7 LegacyStringToItemParser: added getMappings() 2021-10-13 20:19:44 +01:00
ce8af4e3bc 4.0.0-BETA6 is next 2021-10-13 00:02:01 +01:00
b65e89b605 Release 4.0.0-BETA5 2021-10-13 00:01:56 +01:00
d3f74d6ce1 Merge branch 'stable' 2021-10-12 23:32:43 +01:00
bbd925abc4 Merge commit '974d08efd62c52c1c8ac92cb1b67ac157908fd71' 2021-10-12 23:31:50 +01:00
4bf6205a6c Merge commit '289553fa46fc26b03db73db23481a98d6ddb12a5' 2021-10-12 23:28:35 +01:00
b5699679ef Merge commit 'e38866c4ba90f8efd5630dbe674fd7ca15f586ff' 2021-10-12 23:23:27 +01:00
824a89edfe Merge commit 'e032b8fe208a053441c9fbd377209740008cddb8' 2021-10-12 23:12:17 +01:00
ead9aae23c Updated build/php submodule to pmmp/php-build-scripts@fab0cbeaae 2021-10-12 23:10:06 +01:00
aefa0afd7c DefaultPermissions: Order registrations alphabetically 2021-10-12 22:17:46 +01:00
ec2699ffee DefaultPermissions: fix description of timings command permission 2021-10-12 22:16:20 +01:00
49c1e4c06e Implement fletching table (#4501) 2021-10-12 21:21:05 +01:00
9b94a4661b ItemTranslator: Use LegacyItemIdToStringMap instead of reading files directly 2021-10-11 22:17:40 +01:00
62f11360ee Added unit tests for getAddableItemQuantity() 2021-10-11 21:52:27 +01:00
a5833327f0 Inventory: added getAddableItemQuantity()
this mostly reuses the code from canAddItem().
2021-10-11 21:46:27 +01:00
d73ea8efe4 FlatGeneratorOptions: Do not hardcode biome ID 2021-10-11 21:32:20 +01:00
835e18ce6e Changelog: Changed utils\Color to color\Color (#4502)
[ci skip]
2021-10-11 20:15:44 +01:00
01c0602043 Server: do not attempt to generate a new world if it already exists 2021-10-11 17:48:08 +01:00
8fd475f87b WorldManager: Check generator options of worlds before loading them, too 2021-10-11 17:44:38 +01:00
34f54750c8 Added support for creation-time validation of generator options, closes #2717 2021-10-11 17:37:47 +01:00
092aabeb97 fix CS 2021-10-11 17:21:19 +01:00
89d7b7198f Server: drop support for tagging generator options onto the 'generator' key in pocketmine.yml
the 'preset' key should be used for this purpose instead.

This couldn't be dropped until now due to the shitty handling of unknown generators.
2021-10-11 17:20:49 +01:00
70deea0ef9 Flat: Move preset handling to a FlatGeneratorOptions unit 2021-10-11 16:53:08 +01:00
859cdfa5d2 GeneratorManager: removed unused parameter from getGenerator() 2021-10-11 16:18:38 +01:00
fa93a8d78f Server: Error on unknown generators when generating new worlds from config, instead of silently using DEFAULT
this is consistent with the behaviour of loading worlds.
2021-10-11 16:13:32 +01:00
7b6632941d GeneratorManager::getGenerator() now returns null for unknown generator aliases
instead of returning Normal::class (indistinguishable from successful match) or throwing an exception (pain in the ass to handle).
2021-10-11 16:04:36 +01:00
e62794e4cf TypeConverter: fixed PHPStan errors 2021-10-11 15:17:32 +01:00
500c298aaf Disallow the use of @handleCancelled on non-cancellable events
closes #3464
2021-10-11 15:12:16 +01:00
8ac16345a3 TypeConverter: account for items without properly mapped IDs
fixes #4459
2021-10-11 15:05:08 +01:00
19a66a8d03 committing the new strings would have helped ... 2021-10-11 01:14:00 +01:00
6d728e8d98 PluginManager: Improved startup performance when loading many plugins
for some reason we were reading and parsing the plugin.yml at least twice for every plugin loaded.
We were repeating work already done by the initial loadPlugins() triage (discovering correct loader, loading plugin.yml from disk, parsing plugin.yml, validating plugin.yml) every time loadPlugin() was called with that plugin.
2021-10-11 01:11:59 +01:00
e1ee320c8d PluginManager: Localize plugin loading error messages 2021-10-11 00:58:33 +01:00
965a16d19d PluginManager: Extract deterministic plugin loadability checks into a separate method 2021-10-11 00:49:32 +01:00
5bae458a91 changelog: mention that Entity->setPosition(AndRotation)() are now protected 2021-10-10 23:32:40 +01:00
2696698926 ClosureTask: relax closure checks to allow arrow functions without return typehints
nobody uses return typehints on arrow functions anyway .. they just waste space.
2021-10-10 23:31:57 +01:00
912e612743 Utils: allow validateCallableSignature() to accept a manually constructed CallbackType instead of a closure
this allows more fine-grained control without PHPStan yelling at us.
2021-10-10 23:27:09 +01:00
fd2df637b6 Block: rename getPositionOffset() -> getModelPositionOffset()
this gives a better idea of what the function does, and is also much less annoying for auto complete.
2021-10-10 22:35:38 +01:00
aa53dc6709 Entity: fixed network properties not updating when fireTicks changes
another bug that LBSG knew about, but didn't report. :/
2021-10-09 23:57:37 +01:00
c1f843a42c GarbageCollectorCommand: fixed duplicate MB suffix 2021-10-09 23:57:36 +01:00
09715906c8 StructureGrowEvent: added API to get the player who caused the growth (#4445) 2021-10-09 22:51:46 +01:00
13068ba3a7 3.24.1 is next 2021-10-09 20:20:41 +01:00
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
ccc881ee58 Switch to custom permission denied message
closes #4494
2021-10-09 00:57:15 +01:00
308d7c126a Fixed world data ::generate() functions putting level.dat in the wrong place if the world path didn't end with a / 2021-10-08 23:39:25 +01:00
4910250a81 Config: fixed writeList() 2021-10-07 21:47:09 +01:00
e0d2e24698 fix CS (again\!) 2021-10-07 21:19:44 +01:00
d5f02a0bf8 Config: expose APIs to parse/emit list configs 2021-10-07 21:18:42 +01:00
2a3a57c519 Enable parsing/emitting .properties without creating a Config object
this is useful when the contents are just going to get passed straight into a model, making Config object redundant anyway.
2021-10-07 20:53:15 +01:00
5115387feb fix CS (again) 2021-10-07 20:43:55 +01:00
dd0aaf59b5 MainLogger: Log exceptions as a single block message 2021-10-07 20:40:20 +01:00
a555f21b18 MainLogger: write messages before calling logger attachments 2021-10-07 20:32:02 +01:00
1be9b2f037 Config: drop packing of arrays
we don't handle arrays on decode, so there's no reason to support them on encode either.
2021-10-07 20:30:56 +01:00
32fd9879e5 fix CS 2021-10-07 20:16:54 +01:00
dc2e8e7e8f ServerConfigGroup: do not assume that values are always bool|string 2021-10-07 20:02:21 +01:00
847e24fc41 4.0.0-BETA5 is next 2021-10-06 23:49:30 +01:00
9e6d740570 Release 4.0.0-BETA4 2021-10-06 23:49:13 +01:00
8e3772ceef Block: fixed incorrect behaviour of isSameState() for multi-ID blocks
fixes #4492
2021-10-06 23:16:03 +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
90800a4124 Config: Try to coerce types, similar to YAML 2021-10-06 21:09:23 +01:00
4b00465e24 Clean PHPStan baselines 2021-10-06 02:14:30 +01:00
10b3596eef PluginDescription: use typed properties 2021-10-06 02:00:55 +01:00
258c38f9cd PluginDescription: loosen invalid permission message (it might be wrong type as well as not existing) 2021-10-06 01:45:40 +01:00
d07517fe8b Use an object to represent command entries in plugin manifest 2021-10-06 01:42:03 +01:00
31a176286d Do not register plugin commands without valid permissions
this could lead to harmful results, e.g. if a developer typo'd while writing the plugin.yml, an admin-only command could become accessible to everyone, since commands are by default accessible by everyone.
2021-10-06 01:18:14 +01:00
1fafce6d6f PluginBase: remove special true/false handling for command permissions
these aren't accepted as permission names anymore, and they never worked properly anyway.
2021-10-06 01:12:02 +01:00
5061bbbc25 fuck you git x2 2021-10-06 01:01:20 +01:00
a101d1cdf9 Drop pocketmine.plugin.fileError in favour of pocketmine.plugin.loadError
fileError was unnecessarily noisy, putting the directory path on the console twice. This conveys just as much information but with less wasted space.
2021-10-05 23:31:00 +01:00
fec48003d9 ..... 2021-10-05 20:29:24 +01:00
e25c03eec1 Gracefully handle errors loading plugin manifest
this isn't perfect, but it covers the common cases.
Now, the server won't spam crashdumps just because some plugin declared nested permissions.
2021-10-05 20:28:43 +01:00
7245d15abe PermissionParser: Throw more specific exceptions 2021-10-05 19:57:26 +01:00
13178a47a5 fuck you git 2021-10-05 19:11:10 +01:00
817ab88c70 Properly handle errors decoding network item NBT
since the NBT is now decoded immediately now, any incorrect NBT will cause exceptions to be thrown that we weren't handling, causing server crashes.
2021-10-05 19:10:55 +01:00
fef8297907 GiveCommand: don't crash on bogus item NBT 2021-10-05 19:09:46 +01:00
dbeaf27cb7 Document that Item::setNamedTag() may cause NbtException to be thrown
if the NBT is bogus for some reason
in PM3, these kinds of bugs wouldn't show up until/unless the item NBT was actually used, but on PM4, we decode it ahead of time, so the errors always show up immediately.
2021-10-05 19:09:22 +01:00
2db79cf58d Fix build 2021-10-05 18:41:47 +01:00
7d06b76aaf PluginManager: account for possible invalid format of API version
we're seeing a lot of crashes because of this.
2021-10-05 18:36:00 +01:00
0ad663ff50 Merge remote-tracking branch 'origin/stable' 2021-10-05 01:17:59 +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
5b26abcb0e NetworkSession: fixed code copy pasta
these are not, in fact, equivalent.
2021-10-05 01:02:15 +01:00
f2d6059613 NetworkSession: Sync world spawn on world change 2021-10-04 22:51:31 +01:00
bb6ea8cbdc Do not call PlayerLoginEvent during the Player constructor
this closes a lot of loopholes in the login sequence that plugins were using to cause crashes.
2021-10-04 22:36:50 +01:00
356a49d225 NetworkSession: account for possibility of syncGameMode() being called before the player is ready to receive it
close #4323
2021-10-04 22:13:42 +01:00
6332af3e59 Require RakLib 0.14.2 minimum 2021-10-04 21:50:11 +01:00
fb570970a8 Localize gamemode command errors 2021-10-02 21:22:54 +01:00
30e10c38b6 Localize /help 2021-10-02 20:59:36 +01:00
05dc675d5b Replace commands.generic.notFound with a custom PM version
this also fixes #4379.
2021-10-02 20:42:59 +01:00
d63b9d1648 WorldManager: localize strings for world loading, generation and conversion 2021-10-02 20:33:32 +01:00
f9e6fd44bc Merge branch 'stable'
it looks like I goofed up the last merge and the changelog didn't get
merged into master.
2021-10-02 20:18:06 +01:00
0108888450 Process: silence taskkill complaining that it can't commit suicide
since taskkill is a subprocess of the server process, it gets included in taskkill's own attempted killing spree, but taskkill (wisely) won't kill itself.
2021-10-02 17:23:26 +01:00
dd0c2fed82 Process: add subprocess parameter to kill()
fix CommandReader subprocess lingering on a crash and fucking up the console
2021-10-02 16:56:24 +01:00
2566123e49 Remove unnecessary constant from PHPStan bootstrap 2021-10-02 16:34:38 +01:00
54174eefa0 Make sure COMPOSER_AUTOLOADER_PATH is always declared
Sacrifice dynamic composer autoloader path to do this, because we don't
need it anyway - it was a misconceived feature from the days when I used
the same workspace for PM3 and PM4 both.
2021-10-02 15:27:17 +01:00
f5266ec816 World: remove dead code leftover from 34f01a3ce3
fixes #4486
2021-10-02 12:33:46 +01:00
c6b2c63a9b Remove a couple more dead errors from PHPStan baseline 2021-10-02 00:52:47 +01:00
f26f063164 UPnP: catch InternetException when attempting portforward
we might fail to get the internal IP for some reason, which shouldn't crash the server.
2021-10-02 00:52:14 +01:00
81d5598e96 UPnP: Fixed server crash on failure to find UPnP device
https://crash.pmmp.io/view/5241010
2021-10-01 23:27:58 +01:00
c7e9138994 PopulationTask: reduce code duplication 2021-10-01 23:18:56 +01:00
88f799da2c more AssumptionFailedError hacks for PHPStan :(
the code in this class is really horrible
2021-10-01 23:05:48 +01:00
8de30e8162 FastChunkSerializer no longer serializes light by default
the core doesn't use this anywhere.
serializeWithoutLight() has been renamed to serializeTerrain() to more accurately describe what it does.
2021-10-01 22:57:22 +01:00
e6f6a036ef LightPopulationTask: do not copy existing light arrays
this task wipes out the light arrays and recalculates them from scratch, so it's pointless to copy any preexisting light arrays anyway.
2021-10-01 22:34:11 +01:00
32f8b8163e Clean out PHPStan l7 baseline 2021-10-01 22:19:36 +01:00
5b818827db Chunk: stop exposing SplFixedArray<SubChunk> to the API
this fixes a large number of PHPStan errors, and also brings us a step closer to negative-build-height readiness.
2021-10-01 22:17:28 +01:00
42bf9578ce Remove unused constants 2021-10-01 22:05:03 +01:00
aee4a00a50 Updated dependencies 2021-10-01 21:40:31 +01:00
2fdd8d039e RakLib 0.14.1 2021-10-01 21:39:26 +01:00
349f37b15f resource packs: manifest may also contain a list of dependencies
... which we should be verifying the presence of, as the server.
2021-10-01 21:14:28 +01:00
afa3349c04 Acknowledge the presence of capabilities field in resource pack manifest
closes #4485
2021-10-01 21:09:53 +01:00
d6dfcb11e8 BlockStateDeserializerR13: fixed some formatting issues 2021-09-30 17:32:06 +01:00
8a84f87879 Lever blockstate decoding
all implemented blocks are now supported; about 37 remain which are not implemented.
2021-09-29 00:59:53 +01:00
57341d8a1b Merge branch 'master' into r13-world-support 2021-09-29 00:22:11 +01:00
6a8280b1ba Lever: add block property APIs 2021-09-29 00:20:57 +01: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
40cf66a730 Checking in work so far on a 1.13 blockstate deserializer (incomplete, but have at it). 2021-09-28 20:35:05 +01:00
c931c52617 AsyncTask: added newline 2021-09-27 13:53:30 +01:00
b3e8314b9f PTHREADS_INHERIT_CONSTANTS is no longer needed for MainLogger to log exceptions
cleaned paths are now referenced from Filesystem instead of namespace constants.
2021-09-26 21:41:24 +01:00
f138004913 PlayerDeathEvent: fixed property type variance issue PHPStan complains about 2021-09-26 21:20:42 +01:00
8e2d06a880 ChunkSerializer: support writing 0 bpb palettes on the wire
these are now supported as of 1.17.30.
2021-09-25 01:17:32 +01:00
eb80515e99 Fixed incorrect parameter checking in BlockFactory::get() (#4476) 2021-09-24 15:47:11 +01:00
1cb540387c 4.0.0-BETA4 is next 2021-09-23 21:51:36 +01:00
9bc07a9cc0 Release 4.0.0-BETA3 2021-09-23 21:51:23 +01:00
5f1e66478b changelog: mention UPnP API changes 2021-09-22 23:12:56 +01:00
36b8217e68 Updated to RakLib 0.14.0 2021-09-22 23:05:24 +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
3813caf5ec Updated BedrockProtocol and BedrockData for 1.17.30 2021-09-22 00:36:21 +01:00
e472c117e0 Merge branch 'stable' 2021-09-22 00:33:49 +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
133398c69a changelog: add newline
[ci skip]
2021-09-19 22:57:22 +01:00
52b6952771 changelog: baseline for 4.0.0-BETA3
[ci skip]
2021-09-19 22:55:48 +01:00
1ce388ca0b Liquid: add getMinAdjacentSourcesToFormSource(), remove circular dependency between Liquid and Water
this unpleasantly-named method allows controlling the source-forming behaviour of liquids by changing the required number of adjacent sources that must be present in order for a new source to form. This allows stuff like non-infinite water.
2021-09-19 15:59:16 +01:00
971cbe3929 Liquid: restore mistakenly removed check 2021-09-19 15:42:17 +01:00
18de35ffc7 Liquid: use facing instead of hardcoded integers 2021-09-19 15:37:03 +01:00
576c33ee8f Liquid: make flow vector calculation less cancerous to read 2021-09-18 23:04:28 +01:00
6b2ab15ea1 MinimumCostFlowCalculator: fix bug caused by recent change 2021-09-18 16:20:01 +01:00
027f7e249b MinimumCostFlowCalculator: Use match statements where possible
coincidentally, this also fixes the build.
2021-09-18 16:17:08 +01:00
a9c4238c59 Liquid: Extract a big chunk of code to MinimumCostFlowCalculator 2021-09-18 16:13:38 +01:00
34e1b244fa Liquid: split canFlowInto() over multiple lines
the original version is very hard to read.
2021-09-18 15:53:54 +01:00
b047100719 Liquid: improve minimum cost calculation handling 2021-09-18 15:52:16 +01:00
1b5071e074 Liquid: make some code slightly less cancerous to read 2021-09-18 15:28:45 +01:00
3836a57ba6 Player: add getPlayerInfo(), closes #4450 2021-09-17 22:17:36 +01:00
87dc763d92 actions: test that generated code is consistent 2021-09-17 16:46:27 +01:00
43b2e1a0e8 tools/convert-world: improve error messages and exit codes
die with a string exits with zero? wtf?
2021-09-16 15:28:20 +01:00
05e2bef5ce ItemFactory: fix crash when checking if blockitem IDs are registered 2021-09-16 14:53:19 +01:00
6cf181b579 LevelDB: Use arrow functions for better readability 2021-09-16 14:44:56 +01:00
9490b78640 Move packet handler default implementations to BedrockProtocol
in many cases this will now require zero changes to PM at all to be compatible with a new protocol version.
2021-09-15 22:27:49 +01:00
59f3622f69 changelog: mention PluginLoadOrder changes (#4458)
[ci skip]
2021-09-15 17:18:53 +01:00
a1c82da2f2 Liquid: remove useless continue 2021-09-12 16:03:52 +01:00
84170ad3e1 Furnace: fixed deactivation after being reloaded from disk (regression from PM3)
closes #4430
2021-09-12 15:49:33 +01:00
ace8841d5d Explosion: allow the normal blockupdate mechanism to deal with explosions
in PM4, all blockupdates are buffered, so the old 7x performance penalty that used to be incurred by doing this is no longer a problem.
Also, this actually reduces the overhead of explosions themselves by moving the onNearbyBlockChange() burden off explodeB() and into the main world ticking function.
2021-09-12 15:45:02 +01:00
5ddd94b7e8 Remove redundant World->isChunkGenerated() calls
isChunkGenerated() merely checks if the chunk can be loaded from disk, if it's not in the runtime cache already.
This is pointless in all of these cases, because the check is prefaced by an isChunkLoaded() check, which already limits the possibility anyway. If the chunk is not generated, it'll also be considered not loaded.
2021-09-12 15:21:09 +01:00
f0fa561c2f World: use arrow functions in useBreakOn() 2021-09-12 15:16:55 +01:00
33a7c05425 Updated PHPStan baselines 2021-09-11 23:12:43 +01:00
273aa8ab42 Drop useless usage translation strings for commands with no parameters 2021-09-11 17:06:26 +01:00
3b7580688c Stop auto-translating string descriptions/usages for commands
Require usage of Translatable for translations.
2021-09-11 16:46:40 +01:00
b65e3c69b1 4.0.0-BETA3 is next 2021-09-10 17:18:32 +01:00
1589 changed files with 75479 additions and 30381 deletions

1
.gitattributes vendored
View File

@ -4,6 +4,7 @@
*.sh text eol=lf
*.txt text eol=lf
*.properties text eol=lf
*.neon text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf

View File

@ -34,7 +34,10 @@ Requires translations:
## Tests
<!--
Details should be provided of tests done. Simply saying "tested" or equivalent is not acceptable.
Attach scripts or actions to test this pull request, as well as the result
PRs which have not been tested MUST be marked as draft.
-->
I tested this PR by doing the following (tick all that apply):
- [ ] Writing PHPUnit tests (commit these in the `tests/phpunit` folder)
- [ ] Playtesting using a Minecraft client (provide screenshots or a video)
- [ ] Writing a test plugin (provide the code and sample output)
- [ ] Other (provide details)

View File

@ -3,6 +3,38 @@ updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
interval: weekly
time: "10:00"
open-pull-requests-limit: 10
ignore:
#only allow patch updates for locale-data - this has to be updated manually due to codegen
- dependency-name: pocketmine/locale-data
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"
groups:
production-patch-updates:
dependency-type: production
patterns:
- "*"
update-types:
- "patch"
development-patch-updates:
dependency-type: development
patterns:
- "*"
update-types:
- "patch"
phpstan:
patterns:
- "phpstan/*"
- package-ecosystem: gitsubmodule
directory: "/"
schedule:
interval: daily
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
.github/readme/legacy-pocketmine.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
.github/readme/pocketmine-dark-rgb.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

BIN
.github/readme/pocketmine-rgb.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

104
.github/workflows/build-docker-image.yml vendored Normal file
View File

@ -0,0 +1,104 @@
name: Update Docker Hub images
on:
release:
types:
- published
jobs:
build:
name: Update Docker Hub images
runs-on: ubuntu-20.04
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Clone pmmp/PocketMine-Docker repository
uses: actions/checkout@v4
with:
repository: pmmp/PocketMine-Docker
fetch-depth: 1
- name: Get tag names
id: tag-name
run: |
VERSION=$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{')
echo TAG_NAME=$VERSION >> $GITHUB_OUTPUT
echo MAJOR=$(echo $VERSION | cut -d. -f1) >> $GITHUB_OUTPUT
echo MINOR=$(echo $VERSION | cut -d. -f1-2) >> $GITHUB_OUTPUT
- 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 CHANNEL=$(jq -r '.channel' new_build_info.json) >> $GITHUB_OUTPUT
- name: Get name of Docker repository name
id: docker-repo-name
run: echo NAME=$(echo "${GITHUB_REPOSITORY,,}") >> $GITHUB_OUTPUT
- name: Build image for tag
uses: docker/build-push-action@v6.6.1
with:
push: true
context: ./pocketmine-mp
tags: |
${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.tag-name.outputs.TAG_NAME }}
ghcr.io/${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.tag-name.outputs.TAG_NAME }}
build-args: |
PMMP_TAG=${{ steps.tag-name.outputs.TAG_NAME }}
PMMP_REPO=${{ github.repository }}
- name: Build image for major tag
if: steps.channel.outputs.CHANNEL == 'stable'
uses: docker/build-push-action@v6.6.1
with:
push: true
context: ./pocketmine-mp
tags: |
${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.tag-name.outputs.MAJOR }}
ghcr.io/${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.tag-name.outputs.MAJOR }}
build-args: |
PMMP_TAG=${{ steps.tag-name.outputs.TAG_NAME }}
PMMP_REPO=${{ github.repository }}
- name: Build image for minor tag
if: steps.channel.outputs.CHANNEL == 'stable'
uses: docker/build-push-action@v6.6.1
with:
push: true
context: ./pocketmine-mp
tags: |
${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.tag-name.outputs.MINOR }}
ghcr.io/${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.tag-name.outputs.MINOR }}
build-args: |
PMMP_TAG=${{ steps.tag-name.outputs.TAG_NAME }}
PMMP_REPO=${{ github.repository }}
- name: Build image for latest tag
if: steps.channel.outputs.CHANNEL == 'stable'
uses: docker/build-push-action@v6.6.1
with:
push: true
context: ./pocketmine-mp
tags: |
${{ steps.docker-repo-name.outputs.NAME }}:latest
ghcr.io/${{ steps.docker-repo-name.outputs.NAME }}:latest
build-args: |
PMMP_TAG=${{ steps.tag-name.outputs.TAG_NAME }}
PMMP_REPO=${{ github.repository }}

View File

@ -0,0 +1,117 @@
<?php
declare(strict_types=1);
namespace pocketmine;
use pocketmine\utils\Internet;
use function dirname;
use function fwrite;
use function is_array;
use function json_decode;
use function json_encode;
use const JSON_THROW_ON_ERROR;
use const STDERR;
require dirname(__DIR__, 2) . '/vendor/autoload.php';
/**
* @phpstan-return array<string, mixed>
*/
function generateDiscordEmbed(string $version, string $channel, string $description, string $detailsUrl, string $sourceUrl, string $pharDownloadUrl, string $buildLogUrl, int $newsPingRoleId, ?string $phpDownloadUrl) : array{
if($phpDownloadUrl !== null){
$phpEmbedLink = " | [PHP Binaries]($phpDownloadUrl)";
}else{
$phpEmbedLink = "";
}
return [
"content" => "<@&$newsPingRoleId> New PocketMine-MP release: $version ($channel)",
"embeds" => [
[
"title" => "New PocketMine-MP release: $version ($channel)",
"description" => <<<DESCRIPTION
$description
[Details]($detailsUrl) | [Source Code]($sourceUrl) | [Build Log]($buildLogUrl) | [Download]($pharDownloadUrl)$phpEmbedLink
DESCRIPTION,
"url" => $detailsUrl,
"color" => $channel === "stable" ? 0x57ab5a : 0xc69026
]
]
];
}
if(count($argv) !== 6){
fwrite(STDERR, "Required arguments: github repo, version, API token, webhook URL, ping role ID\n");
exit(1);
}
[, $repo, $tagName, $token, $hookURL, $newsPingRoleId] = $argv;
$result = Internet::getURL('https://api.github.com/repos/' . $repo . '/releases/tags/' . $tagName, extraHeaders: [
'Authorization: token ' . $token
]);
if($result === null){
fwrite(STDERR, "failed to access GitHub API\n");
return;
}
if($result->getCode() !== 200){
fwrite(STDERR, "Error accessing GitHub API: " . $result->getCode() . "\n");
fwrite(STDERR, $result->getBody() . "\n");
exit(1);
}
$releaseInfoJson = json_decode($result->getBody(), true, JSON_THROW_ON_ERROR);
if(!is_array($releaseInfoJson)){
fwrite(STDERR, "Invalid release JSON returned from GitHub API\n");
exit(1);
}
$buildInfoPath = 'https://github.com/' . $repo . '/releases/download/' . $tagName . '/build_info.json';
$buildInfoResult = Internet::getURL($buildInfoPath, extraHeaders: [
'Authorization: token ' . $token
]);
if($buildInfoResult === null){
fwrite(STDERR, "missing build_info.json\n");
exit(1);
}
if($buildInfoResult->getCode() !== 200){
fwrite(STDERR, "error accessing build_info.json: " . $buildInfoResult->getCode() . "\n");
fwrite(STDERR, $buildInfoResult->getBody() . "\n");
exit(1);
}
$buildInfoJson = json_decode($buildInfoResult->getBody(), true, JSON_THROW_ON_ERROR);
if(!is_array($buildInfoJson)){
fwrite(STDERR, "invalid build_info.json\n");
exit(1);
}
$detailsUrl = $buildInfoJson["details_url"];
$sourceUrl = $buildInfoJson["source_url"];
$pharDownloadUrl = $buildInfoJson["download_url"];
$buildLogUrl = $buildInfoJson["build_log_url"];
$phpBinaryUrl = $buildInfoJson["php_download_url"] ?? null;
$description = $releaseInfoJson["body"];
$discordPayload = generateDiscordEmbed(
$buildInfoJson["base_version"],
$buildInfoJson["channel"],
$description,
$detailsUrl,
$sourceUrl,
$pharDownloadUrl,
$buildLogUrl,
(int) $newsPingRoleId,
$phpBinaryUrl
);
$response = Internet::postURL(
$hookURL,
json_encode($discordPayload, JSON_THROW_ON_ERROR),
extraHeaders: ['Content-Type: application/json']
);
if($response?->getCode() !== 204){
fwrite(STDERR, "failed to send Discord webhook\n");
fwrite(STDERR, $response?->getBody() ?? "no response body\n");
exit(1);
}

View File

@ -0,0 +1,38 @@
name: Notify Discord webhook of release
on:
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP and tools
uses: shivammathur/setup-php@2.31.1
with:
php-version: 8.2
- name: Restore Composer package cache
uses: actions/cache@v4
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: Get actual tag name
id: tag-name
run: echo TAG_NAME=$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{') >> $GITHUB_OUTPUT
- name: Run webhook post script
run: php .github/workflows/discord-release-embed.php ${{ github.repository }} ${{ steps.tag-name.outputs.TAG_NAME }} ${{ github.token }} ${{ secrets.DISCORD_RELEASE_WEBHOOK }} ${{ secrets.DISCORD_NEWS_PING_ROLE_ID }}

View File

@ -11,19 +11,21 @@ jobs:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php-version: [8.2]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup PHP
uses: shivammathur/setup-php@2.12.0
uses: shivammathur/setup-php@2.31.1
with:
php-version: 8.0
php-version: ${{ matrix.php-version }}
- name: Restore Composer package cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.cache/composer/files
@ -35,48 +37,71 @@ jobs:
- name: Install Composer dependencies
run: composer install --no-dev --prefer-dist --no-interaction --ignore-platform-reqs
- name: Patch VersionInfo
- name: Calculate build number
id: build-number
run: |
BUILD_NUMBER=2000+$GITHUB_RUN_NUMBER #to stay above jenkins
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/VersionInfo.php
echo BUILD_NUMBER=$BUILD_NUMBER >> $GITHUB_OUTPUT
- name: Minify BedrockData JSON files
run: php resources/vanilla/.minify_json.php
run: php vendor/pocketmine/bedrock-data/.minify_json.php
- name: Build PocketMine-MP.phar
run: php -dphar.readonly=0 build/server-phar.php --git ${{ github.sha }}
run: php -dphar.readonly=0 build/server-phar.php --git ${{ github.sha }} --build ${{ steps.build-number.outputs.BUILD_NUMBER }}
- 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\VersionInfo::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\VersionInfo::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\VersionInfo::BASE_VERSION);')
echo PM_VERSION=$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BASE_VERSION;') >> $GITHUB_OUTPUT
echo MCPE_VERSION=$(php -r 'require "vendor/autoload.php"; echo \pocketmine\network\mcpe\protocol\ProtocolInfo::MINECRAFT_VERSION_NETWORK;') >> $GITHUB_OUTPUT
echo PM_VERSION_SHORT=$(php -r 'require "vendor/autoload.php"; $v = explode(".", \pocketmine\VersionInfo::BASE_VERSION); array_pop($v); echo implode(".", $v);') >> $GITHUB_OUTPUT
echo PM_VERSION_MD=$(php -r 'require "vendor/autoload.php"; echo str_replace(".", "", \pocketmine\VersionInfo::BASE_VERSION);') >> $GITHUB_OUTPUT
echo CHANGELOG_SUFFIX=$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BUILD_CHANNEL === "stable" ? "" : "-" . \pocketmine\VersionInfo::BUILD_CHANNEL;') >> $GITHUB_OUTPUT
echo PRERELEASE=$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BUILD_CHANNEL === "stable" ? "false" : "true";') >> $GITHUB_OUTPUT
- name: Generate PHP binary download URL
id: php-binary-url
run: |
echo PHP_BINARY_URL="${{ github.server_url }}/${{ github.repository_owner }}/PHP-Binaries/releases/tag/php-${{ matrix.php-version }}-latest" >> $GITHUB_OUTPUT
- 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
run: |
php build/generate-build-info-json.php \
${{ github.sha }} \
${{ steps.get-pm-version.outputs.PM_VERSION }} \
${{ github.repository }} \
${{ steps.build-number.outputs.BUILD_NUMBER }} \
${{ github.run_id }} \
${{ steps.php-binary-url.outputs.PHP_BINARY_URL }} \
> build_info.json
- name: Generate core permission doc for doc.pmmp.io
run: php tools/generate-permission-doc.php rst
- name: Upload release artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: release_artifacts
path: |
${{ github.workspace }}/PocketMine-MP.phar
${{ github.workspace }}/start.*
${{ github.workspace }}/build_info.json
${{ github.workspace }}/core-permissions.rst
- name: Create draft release
uses: ncipollo/release-action@v1.8.6
uses: ncipollo/release-action@v1.14.0
with:
artifacts: ${{ github.workspace }}/PocketMine-MP.phar,${{ github.workspace }}/start.*,${{ github.workspace }}/build_info.json
artifacts: ${{ github.workspace }}/PocketMine-MP.phar,${{ github.workspace }}/start.*,${{ github.workspace }}/build_info.json,${{ github.workspace }}/core-permissions.rst
commit: ${{ github.sha }}
draft: true
prerelease: ${{ steps.get-pm-version.outputs.PRERELEASE }}
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.
Please see the [changelogs](${{ github.server_url }}/${{ github.repository }}/blob/${{ steps.get-pm-version.outputs.PM_VERSION }}/changelogs/${{ steps.get-pm-version.outputs.PM_VERSION_SHORT }}${{ steps.get-pm-version.outputs.CHANGELOG_SUFFIX }}.md#${{ steps.get-pm-version.outputs.PM_VERSION_MD }}) for details.
:information_source: Download the recommended PHP binary [here](${{ steps.php-binary-url.outputs.PHP_BINARY_URL }}).

156
.github/workflows/main-php-matrix.yml vendored Normal file
View File

@ -0,0 +1,156 @@
name: CI (all supported PHP versions)
on:
workflow_call:
inputs:
php:
description: 'PHP version in X.Y format'
required: true
type: string
#these are parameterized to ease updating
pm-version-major:
description: 'PocketMine-MP major version'
default: 5
type: number
image:
description: 'Runner image to use'
default: 'ubuntu-20.04'
type: string
jobs:
phpstan:
name: PHPStan analysis
runs-on: ${{ inputs.image }}
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: pmmp/setup-php-action@3.1.0
with:
php-version: ${{ inputs.php }}
install-path: "./bin"
pm-version-major: ${{ inputs.pm-version-major }}
- name: Restore Composer package cache
uses: actions/cache@v4
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-${{ inputs.php }}-${{ hashFiles('./composer.lock') }}"
restore-keys: |
composer-v2-cache-
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction
- name: Run PHPStan
run: ./vendor/bin/phpstan analyze --no-progress --memory-limit=2G
phpunit:
name: PHPUnit tests
runs-on: ${{ inputs.image }}
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: pmmp/setup-php-action@3.1.0
with:
php-version: ${{ inputs.php }}
install-path: "./bin"
pm-version-major: ${{ inputs.pm-version-major }}
- name: Restore Composer package cache
uses: actions/cache@v4
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-${{ inputs.php }}-${{ hashFiles('./composer.lock') }}"
restore-keys: |
composer-v2-cache-
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction
- name: Run PHPUnit tests
run: ./vendor/bin/phpunit --bootstrap vendor/autoload.php --fail-on-warning tests/phpunit
integration:
name: Integration tests
runs-on: ${{ inputs.image }}
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup PHP
uses: pmmp/setup-php-action@3.1.0
with:
php-version: ${{ inputs.php }}
install-path: "./bin"
pm-version-major: ${{ inputs.pm-version-major }}
- name: Restore Composer package cache
uses: actions/cache@v4
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-${{ inputs.php }}-${{ hashFiles('./composer.lock') }}"
restore-keys: |
composer-v2-cache-
- name: Install Composer dependencies
run: composer install --no-dev --prefer-dist --no-interaction
- name: Run integration tests
run: ./tests/travis.sh -t4
codegen:
name: Generated Code consistency checks
runs-on: ${{ inputs.image }}
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: pmmp/setup-php-action@3.1.0
with:
php-version: ${{ inputs.php }}
install-path: "./bin"
pm-version-major: ${{ inputs.pm-version-major }}
- name: Restore Composer package cache
uses: actions/cache@v4
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-${{ inputs.php }}-${{ hashFiles('./composer.lock') }}"
restore-keys: |
composer-v2-cache-
- name: Install Composer dependencies
run: composer install --no-dev --prefer-dist --no-interaction
- name: Update generated code
run: composer update-codegen
- name: Verify code is unchanged
run: |
git diff
git diff --quiet

View File

@ -6,182 +6,17 @@ on:
workflow_dispatch:
jobs:
build-php:
name: Prepare PHP
runs-on: ${{ matrix.image }}
strategy:
matrix:
image: [ubuntu-20.04]
php: [8.0.9]
steps:
- uses: actions/checkout@v2 #needed for build.sh
- name: Check for PHP build cache
id: php-build-cache
uses: actions/cache@v2
with:
path: "./bin"
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
- name: Compile PHP
if: steps.php-build-cache.outputs.cache-hit != 'true'
run: ./tests/gh-actions/build.sh "${{ matrix.php }}"
phpstan:
name: PHPStan analysis
needs: build-php
runs-on: ${{ matrix.image }}
all-php-versions:
name: PHP ${{ matrix.php }}
strategy:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.9]
php: ["8.1", "8.2", "8.3"]
steps:
- uses: actions/checkout@v2
- name: Restore PHP build cache
id: php-build-cache
uses: actions/cache@v2
with:
path: "./bin"
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
- name: Kill build on PHP build cache miss (should never happen)
if: steps.php-build-cache.outputs.cache-hit != 'true'
run: exit 1
- name: Install cached PHP's dependencies
if: steps.php-build-cache.outputs.cache-hit == 'true'
run: ./tests/gh-actions/install-dependencies.sh
- name: Prefix PHP to PATH
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php
- name: Restore Composer package cache
uses: actions/cache@v2
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
restore-keys: |
composer-v2-cache-
- name: Install Composer dependencies
run: php composer.phar install --prefer-dist --no-interaction
- name: Run PHPStan
run: ./vendor/bin/phpstan analyze --no-progress --memory-limit=2G
phpunit:
name: PHPUnit tests
needs: build-php
runs-on: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.9]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Restore PHP build cache
id: php-build-cache
uses: actions/cache@v2
with:
path: "./bin"
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
- name: Kill build on PHP build cache miss (should never happen)
if: steps.php-build-cache.outputs.cache-hit != 'true'
run: exit 1
- name: Install cached PHP's dependencies
if: steps.php-build-cache.outputs.cache-hit == 'true'
run: ./tests/gh-actions/install-dependencies.sh
- name: Prefix PHP to PATH
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php
- name: Restore Composer package cache
uses: actions/cache@v2
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
restore-keys: |
composer-v2-cache-
- name: Install Composer dependencies
run: php composer.phar install --prefer-dist --no-interaction
- name: Run PHPUnit tests
run: ./vendor/bin/phpunit --bootstrap vendor/autoload.php --fail-on-warning tests/phpunit
integration:
name: Integration tests
needs: build-php
runs-on: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.9]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Restore PHP build cache
id: php-build-cache
uses: actions/cache@v2
with:
path: "./bin"
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
- name: Kill build on PHP build cache miss (should never happen)
if: steps.php-build-cache.outputs.cache-hit != 'true'
run: exit 1
- name: Install cached PHP's dependencies
if: steps.php-build-cache.outputs.cache-hit == 'true'
run: ./tests/gh-actions/install-dependencies.sh
- name: Prefix PHP to PATH
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php
- name: Restore Composer package cache
uses: actions/cache@v2
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
restore-keys: |
composer-v2-cache-
- name: Install Composer dependencies
run: php composer.phar install --no-dev --prefer-dist --no-interaction
- name: Run integration tests
run: ./tests/travis.sh -t4
uses: ./.github/workflows/main-php-matrix.yml
with:
php: ${{ matrix.php }}
secrets: inherit
codestyle:
name: Code Style checks
@ -190,13 +25,15 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup PHP and tools
uses: shivammathur/setup-php@2.9.0
uses: shivammathur/setup-php@2.31.1
with:
php-version: 8.0
tools: php-cs-fixer
php-version: 8.2
tools: php-cs-fixer:3.49
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run PHP-CS-Fixer
run: php-cs-fixer fix --dry-run --diff
run: php-cs-fixer fix --dry-run --diff --ansi

View File

@ -8,12 +8,19 @@ jobs:
support:
runs-on: ubuntu-latest
steps:
- uses: dessant/support-requests@v2
- uses: dessant/support-requests@v4
with:
github-token: ${{ github.token }}
support-label: "Support request"
issue-comment: >
Thanks, but this issue tracker is not intended for support requests. Please read the guidelines on [submitting an issue](https://github.com/pmmp/PocketMine-MP/blob/master/CONTRIBUTING.md#creating-an-issue).
Hi, we only accept **bug reports** on this issue tracker, but this issue looks like a support request.
Instead of creating an issue, try the following:
- Check our [Documentation](https://doc.pmmp.io) to see if you can find answers there
- Ask the community on our [Discord server](https://discord.gg/bmSAZBG) or our [Forums](https://forums.pmmp.io)
[Docs](https://pmmp.rtfd.io) | [Discord](https://discord.gg/bmSAZBG) | [Forums](https://forums.pmmp.io)

View File

@ -1,51 +0,0 @@
<?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);
const VERSIONS = [
"7.3",
"7.4",
"8.0"
];
$workflowFile = file_get_contents(__DIR__ . '/main.yml');
$newWorkflowFile = $workflowFile;
foreach(VERSIONS as $v){
$releaseInfo = file_get_contents("https://secure.php.net/releases?json&version=$v");
if($releaseInfo === false){
throw new \RuntimeException("Failed to contact php.net API");
}
$data = json_decode($releaseInfo, true);
if(!is_array($data) || !isset($data["version"]) || !is_string($data["version"]) || preg_match('/^\d+\.\d+\.\d+(-[A-Za-z\d]+)?$/', $data["version"]) === 0){
throw new \RuntimeException("Invalid data returned by API");
}
$updated = preg_replace("/$v\.\d+/", $data["version"], $newWorkflowFile);
if($updated !== $newWorkflowFile){
echo "Updated $v revision to " . $data["version"] . "\n";
}
$newWorkflowFile = $updated;
}
if($workflowFile !== $newWorkflowFile){
echo "Writing modified workflow file\n";
file_put_contents(__DIR__ . '/main.yml', $newWorkflowFile);
}

View File

@ -8,30 +8,76 @@ on:
jobs:
build:
runs-on: ubuntu-latest
concurrency: update-updater-api # only one job can run at a time, to avoid git conflicts when updating the repository
steps:
- name: Install jq
run: sudo apt update && sudo apt install jq -y
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: pmmp/update.pmmp.io
repository: ${{ github.repository_owner }}/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/{{')
run: echo TAG_NAME=$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{') >> $GITHUB_OUTPUT
- 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
- name: Detect channels
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
CHANNEL=$(jq -r '.channel' new_build_info.json)
VERSION=${{ steps.tag-name.outputs.TAG_NAME }}
echo CHANNEL=$CHANNEL >> $GITHUB_OUTPUT
if [ "$CHANNEL" == "stable" ]; then
echo MAJOR=$(echo $VERSION | cut -d. -f1) >> $GITHUB_OUTPUT
echo MINOR=$(echo $VERSION | cut -d. -f1-2) >> $GITHUB_OUTPUT
else
echo MAJOR=$(echo $VERSION | cut -d. -f1)-$CHANNEL >> $GITHUB_OUTPUT
echo MINOR=$(echo $VERSION | cut -d. -f1-2)-$CHANNEL >> $GITHUB_OUTPUT
fi
- name: Update channel info
run: |
function version_id() {
major=$(echo $1 | cut -d. -f1)
minor=$(echo $1 | cut -d. -f2)
patch=$(echo $1 | cut -d. -f3)
echo $(((major * 1000000) + (minor * 1000) + patch))
}
function update_channel() {
local target_file_name="$1"
local new_file_name="$2"
local old_version_id
local new_version_id
if [ ! -f "$target_file_name" ]; then
echo "Creating channel file: $target_file_name"
cp "$new_file_name" "$target_file_name"
else
old_version_id=$(version_id "$(jq -r '.base_version' "$target_file_name")")
new_version_id=$(version_id "$(jq -r '.base_version' "$new_file_name")")
echo "Old version ID: $old_version_id"
echo "New version ID: $new_version_id"
if [ $new_version_id -ge $old_version_id ]; then #suffixed versions will have the same version ID - assume they'll always be newer
echo "Updating channel file: $target_file_name ($old_version_id -> $new_version_id)"
cp "$new_file_name" "$target_file_name"
else
echo "Version $new_version_id is less than $old_version_id, not updating channel file: $target_file_name"
fi
fi
}
update_channel "channels/${{ steps.channel.outputs.CHANNEL }}.json" "new_build_info.json"
update_channel "channels/${{ steps.channel.outputs.MAJOR }}.json" "new_build_info.json"
update_channel "channels/${{ steps.channel.outputs.MINOR }}.json" "new_build_info.json"
rm new_build_info.json
- name: Commit changes

3
.gitignore vendored
View File

@ -53,3 +53,6 @@ Documentation/*
# php-cs-fixer
/.php_cs.cache
/.php-cs-fixer.cache
# install-local-protocol.sh
/composer-local-protocol.*

6
.gitmodules vendored
View File

@ -1,12 +1,6 @@
[submodule "resources/locale"]
path = resources/locale
url = https://github.com/pmmp/Language.git
[submodule "tests/plugins/DevTools"]
path = tests/plugins/DevTools
url = https://github.com/pmmp/DevTools.git
[submodule "build/php"]
path = build/php
url = https://github.com/pmmp/php-build-scripts.git
[submodule "resources/vanilla"]
path = resources/vanilla
url = https://github.com/pmmp/BedrockData.git

View File

@ -30,6 +30,13 @@
<option name="USE_TAB_CHARACTER" value="true" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Markdown">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="PHP">
<option name="CLASS_BRACE_STYLE" value="1" />
<option name="METHOD_BRACE_STYLE" value="1" />
@ -62,6 +69,11 @@
<option name="USE_TAB_CHARACTER" value="true" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Shell Script">
<indentOptions>
<option name="USE_TAB_CHARACTER" value="true" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="neon">
<indentOptions>
<option name="USE_TAB_CHARACTER" value="true" />

View File

@ -16,6 +16,6 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);

View File

@ -18,6 +18,9 @@ return (new PhpCsFixer\Config)
'array_syntax' => [
'syntax' => 'short'
],
'binary_operator_spaces' => [
'default' => 'single_space'
],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
@ -33,16 +36,47 @@ return (new PhpCsFixer\Config)
],
'declare_strict_types' => true,
'elseif' => true,
'fully_qualified_strict_types' => true,
'global_namespace_import' => [
'import_constants' => true,
'import_functions' => true,
'import_classes' => null,
],
'header_comment' => [
'comment_type' => 'comment',
'header' => <<<BODY
____ _ _ __ __ _ __ __ ____
| _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
| |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
| __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
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/
BODY,
'location' => 'after_open'
],
'indentation_type' => true,
'logical_operators' => true,
'native_constant_invocation' => [
'scope' => 'namespaced'
],
'native_function_invocation' => [
'scope' => 'namespaced',
'include' => ['@all'],
],
'new_with_braces' => [
'named_class' => true,
'anonymous_class' => false,
],
'no_closing_tag' => true,
'no_empty_phpdoc' => true,
'no_extra_blank_lines' => true,
@ -61,10 +95,26 @@ return (new PhpCsFixer\Config)
],
'sort_algorithm' => 'alpha'
],
'phpdoc_align' => [
'align' => 'vertical',
'tags' => [
'param',
]
],
'phpdoc_line_span' => [
'property' => 'single',
'method' => null,
'const' => null
],
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'return_type_declaration' => [
'space_before' => 'one'
],
'single_blank_line_at_eof' => true,
'single_import_per_statement' => true,
'strict_param' => true,
'unary_operator_spaces' => true,
])
->setFinder($finder)
->setIndent("\t")

View File

@ -2,25 +2,24 @@
## Pre-requisites
- A bash shell (git bash is sufficient for Windows)
- [`git`](https://git-scm.com) available in your shell
- PHP 7.4 or newer available in your shell
- PHP 8.2 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://github.com/pmmp/PHP-Binaries/releases)
- [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`.
## Setting up environment
1. `git clone --recursive https://github.com/pmmp/PocketMine-MP.git`
1. `git clone https://github.com/pmmp/PocketMine-MP.git`
2. `composer install`
## Checking out a different branch to build
1. `git checkout <branch to checkout>`
2. `git submodule update --init`
3. Re-run `composer install` to synchronize dependencies.
2. Re-run `composer install` to synchronize dependencies.
## Optimizing for release builds
1. Add the flags `--no-dev --classmap-authoritative` to your `composer install` command. This will reduce build size and improve autoloading speed.
@ -30,11 +29,5 @@ Run `composer make-server` using your preferred PHP binary. It'll drop a `Pocket
You can also use the `--out` option to change the output filename.
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.
## Running PocketMine-MP from source code
Run `src/PocketMine.php` using your preferred PHP binary.

View File

@ -18,6 +18,59 @@ Larger contributions like feature additions should be preceded by a [Change Prop
## Other things you'll need
- [git](https://git-scm.com/)
## List of `pocketmine` namespaces which are in other repos
PocketMine-MP has several dependencies which are independent from the main server code. Most of them use the `pocketmine` namespace.
Some of these add extra classes to packages which already exist in PocketMine-MP.
Take a look at the table below if you can't find the class or function you're looking for.
| Source URL | Namespace, class or function |
|:----------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------|
| [pmmp/BedrockProtocol](https://github.com/pmmp/BedrockProtocol) | `pocketmine\network\mcpe\protocol` |
| [pmmp/BinaryUtils](https://github.com/pmmp/BinaryUtils) | `pocketmine\utils\BinaryDataException`</br>`pocketmine\utils\BinaryStream`</br>`pocketmine\utils\Binary` |
| [pmmp/Color](https://github.com/pmmp/Color) | `pocketmine\color` |
| [pmmp/ErrorHandler](https://github.com/pmmp/ErrorHandler) | `pocketmine\errorhandler` |
| [pmmp/Log](https://github.com/pmmp/Log) | `AttachableLogger`</br>`BufferedLogger`</br>`GlobalLogger`</br>`LogLevel`</br>`Logger`</br>`PrefixedLogger`</br>`SimpleLogger` |
| [pmmp/Math](https://github.com/pmmp/Math) | `pocketmine\math` |
| [pmmp/NBT](https://github.com/pmmp/NBT) | `pocketmine\nbt` |
| [pmmp/RakLibIpc](https://github.com/pmmp/RakLibIpc) | `raklib\server\ipc` |
| [pmmp/RakLib](https://github.com/pmmp/RakLib) | `raklib` |
| [pmmp/Snooze](https://github.com/pmmp/Snooze) | `pocketmine\snooze` |
| [pmmp/ext-chunkutils2](https://github.com/pmmp/ext-chunkutils2) | `pocketmine\world\format\LightArray`</br>`pocketmine\world\format\PalettedBlockArray`</br>`pocketmine\world\format\io\SubChunkConverter` |
| [pmmp/ext-morton](https://github.com/pmmp/ext-morton) | `morton2d_decode`</br>`morton2d_encode`</br>`morton3d_decode`</br>`morton3d_encode` |
| [pmmp/ext-libdeflate](https://github.com/pmmp/ext-libdeflate) | `libdeflate_deflate_compress`</br>`libdeflate_gzip_compress`</br>`libdeflate_zlib_compress` |
## Choosing a target branch
PocketMine-MP has three primary branches of development.
| Type of change | `stable` | `minor-next` | `major-next` |
|:--------------------------------------------------------------------------------------------|:--------:|:-------------------------------:|:------------:|
| Bug fixes | ✔️ | ✔️ | ✔️ |
| Improvements to API docs | ✔️ | ✔️ | ✔️ |
| Cleaning up code | ❌ | ✔️ | ✔️ |
| Changing code formatting or style | ❌ | ✔️ | ✔️ |
| Addition of new core features | ❌ | 🟡 Only if non-disruptive | ✔️ |
| Changing core behaviour (e.g. making something use threads) | ❌ | ✔️ | ✔️ |
| Addition of new configuration options | ❌ | 🟡 Only if optional | ✔️ |
| Addition of new API classes, methods or constants | ❌ | ✔️ | ✔️ |
| Deprecating API classes, methods or constants | ❌ | ✔️ | ✔️ |
| Adding optional parameters to an API method | ❌ | ✔️ | ✔️ |
| Changing API behaviour | ❌ | 🟡 Only if backwards-compatible | ✔️ |
| Removal of API | ❌ | ❌ | ✔️ |
| Backwards-incompatible API change (e.g. renaming a method) | ❌ | ❌ | ✔️ |
| Backwards-incompatible internals change (e.g. changing things in `pocketmine\network\mcpe`) | ❌ | ✔️ | ✔️ |
### Notes
- **Non-disruptive** means that usage should not be significantly altered by the change.
- Examples of **non-disruptive** changes include adding new commands, or gameplay features like blocks and items.
- Examples of **disruptive** changes include changing the way the server is run, world format changes (since those require downtime for the user to convert their world).
- **API** includes all public and protected classes, functions and constants (unless marked as `@internal`).
- Private members are not part of the API, **unless in a trait**.
- The `pocketmine\network\mcpe` package is considered implicitly `@internal` in its entirety (see its [README](src/network/mcpe/README.md) for more details).
- Minecraft's protocol changes are considered necessary internal changes, and are **not** subject to the same rules.
- Protocol changes must always be released in a new minor version, since they disrupt user experience by requiring a client update.
- BC-breaking changes to the internal network API are allowed, but only in new minor versions. This ensures that plugins which use the internal network API will not break (though they shouldn't use such API anyway).
## 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.
@ -35,45 +88,58 @@ Depending on the changes, maintainers might ask you to make changes to the PR to
### 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.
- **All code must be licensed under the [LGPLv3 license](LICENSE)** as per PocketMine-MP's own license, or a compatible 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 ONE thing**
- If you want to make multiple changes, those changes should each be contributed as separate pull requests. **DO NOT** mix unrelated changes.
- **Do not include unnecessary changes.** This makes the code diff larger and more noisy, making it harder to review.
- Don't change things that aren't related to the PR's objective
- Don't reformat or rearrange existing code without a good reason 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, unless that's the objective of the PR
- **Test code changes, and tell us what tests have been done.**
- 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 could lead to your PR being declined.
- **Code, 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.
- **Use `final` and `private` wherever possible**.
- Changing from `private` to `protected` or `final` to non-`final` doesn't break backwards compatibility, but the opposite does.
- `private` and `final` also enable certain performance optimizations which are otherwise not possible.
- `private` members can be freely changed, added and removed in the future, so it's ideal for internal functions. Abusing `protected` makes internal improvements inconvenient.
- "Let's leave it protected/public in case someone needs it for ... idk what" is **not a valid reason to expose things**. If there isn't a clear reason for something to be accessible from the outside, don't expose it.
- **This is a lesson learned through years of experience.** You may not like it, but it's for the best.
- **Immutable things are almost always preferred.**
- Do not add unnecessary setters or public writable properties to classes. As above, "Let's leave it in case someone needs it" is **not a valid reason to expose things**.
- Mutable classes and properties are unpredictable, since code has no way to know if the object it's working with might be randomly modified by another part of the code. This makes it harder to maintain code and debug issues.
- Most classes exist only to hold some data. These are called "data transfer objects" (DTOs). These types of classes should pretty much always be immutable.
- Make use of `final`, `private` and `readonly` modifiers.
### Recommendations
- **Be patient.** Reviewing pull requests takes a lot of time and energy, and maintainers are often unavailable or busy. Your PR might not receive attention for a while.
- Remember, PRs with small diffs are much easier to review. Small PRs are generally reviewed and merged much faster than large ones.
- **Start small.** Try fixing minor bugs or doing something isolated (e.g. adding a new block or item) before attempting larger changes.
- This helps you get familiar with the codebase, the contribution process, and the expectations of maintainers.
- Check out the [issues page]() for something that you could tackle without too much effort.
- **Do not copy-paste other people's code**. Many PRs involve discussion about the changes, and changes are often requested by reviewers. If you don't understand the code you're copy-pasting, your PR is likely to fail.
- **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.
- **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.
- **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.
- **Make your PR diff as small as possible.** Smaller PRs are **much more likely** to be accepted, as they are easier to review.
- Avoid moving code around in files if possible.
- Don't make random CS changes. This makes the diff noisier and harder to review.
- **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.
- **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.
- **Split unrelated changes into multiple commits.**
- An atomic style for commits is preferred - this means that changes included in a commit should be part of a single distinct change set.
- If you need to use "and" or "multiple changes" in your commit message, the commit probably needs to be split up. There are exceptions, but this is a good rule of thumb.
- See [this link](https://www.freshconsulting.com/atomic-commits/) for more information on atomic commits.
- See the [documentation on `git add -i` or `git add -p`](https://git-scm.com/docs/git-add) for information on how to split up local changes for committing.
**Thanks for contributing to PocketMine-MP!**

View File

@ -1,39 +1,80 @@
<p align="center">
<a href="https://pmmp.io"><img src="http://cdn.pocketmine.net/img/PocketMine-MP-h.png"></img></a><br>
<a href="https://pmmp.io">
<!--[if IE]>
<img src="https://github.com/pmmp/PocketMine-MP/blob/stable/.github/readme/pocketmine.png" alt="The PocketMine-MP logo" title="PocketMine" loading="eager" />
<![endif]-->
<picture>
<source srcset="https://raw.githubusercontent.com/pmmp/PocketMine-MP/stable/.github/readme/pocketmine-dark-rgb.gif" media="(prefers-color-scheme: dark)">
<img src="https://raw.githubusercontent.com/pmmp/PocketMine-MP/stable/.github/readme/pocketmine-rgb.gif" loading="eager" />
</picture>
</a><br>
<b>A highly customisable, open source server software for Minecraft: Bedrock Edition written in PHP</b>
</p>
<p align="center">
<img src="https://github.com/pmmp/PocketMine-MP/workflows/CI/badge.svg" alt="CI" />
<a href="https://github.com/pmmp/PocketMine-MP/releases"><img src="https://img.shields.io/github/v/tag/pmmp/PocketMine-MP?label=release&logo=github" alt="GitHub tag (latest semver)" /></a>
<a href="https://hub.docker.com/r/pmmp/pocketmine-mp"><img src="https://img.shields.io/docker/v/pmmp/pocketmine-mp?logo=docker&label=image" alt="Docker image version (latest semver)" /></a>
<a href="https://github.com/pmmp/PocketMine-MP/actions/workflows/main.yml"><img src="https://github.com/pmmp/PocketMine-MP/workflows/CI/badge.svg" alt="CI" /></a>
<a href="https://github.com/pmmp/PocketMine-MP/releases/latest"><img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/pmmp/PocketMine-MP?label=release&sort=semver"></a>
<a href="https://discord.gg/bmSAZBG"><img src="https://img.shields.io/discord/373199722573201408?label=discord&color=7289DA&logo=discord" alt="Discord" /></a>
<br>
<a href="https://github.com/pmmp/PocketMine-MP/releases"><img alt="GitHub all releases" src="https://img.shields.io/github/downloads/pmmp/PocketMine-MP/total?label=downloads%40total"></a>
<a href="https://github.com/pmmp/PocketMine-MP/releases/latest"><img alt="GitHub release (latest by SemVer)" src="https://img.shields.io/github/downloads/pmmp/PocketMine-MP/latest/total?sort=semver"></a>
</p>
## Getting started
## What is this?
PocketMine-MP is a highly customisable server software for Minecraft: Bedrock Edition, built from scratch in PHP, with over 10 years of history.
If you're looking to create a Minecraft: Bedrock server with **custom functionality**, look no further.
- 🧩 **Powerful plugin API** - extend and customise gameplay as you see fit
- 🗺️ **Rich ecosystem** and **large developer community** - find plugins easily and learn to develop your own
- 🌐 **Multi-world support** - offer a more varied game experience to players without transferring them to other server nodes
- 🏎️ **Performance** - get 100+ players onto one server (depending on hardware and plugins)
- ⤴️ **Continuously updated** - new Minecraft versions are usually supported within days
## :x: PocketMine-MP is NOT a vanilla Minecraft server software.
**It is poorly suited to hosting vanilla survival servers.**
It doesn't have many features from the vanilla game, such as vanilla world generation, redstone, mob AI, and various other things.
If you just want to play **vanilla survival multiplayer**, consider using the [official Minecraft: Bedrock server software](https://minecraft.net/download/server/bedrock) instead of PocketMine-MP.
If that's not an option for you, you may be able to add some of PocketMine-MP's missing features using plugins from [Poggit](https://poggit.pmmp.io/plugins), or write plugins to implement them yourself.
## Getting Started
- [Documentation](http://pmmp.readthedocs.org/)
- [Installation instructions](https://pmmp.readthedocs.io/en/rtfd/installation.html)
- [Docker image](https://hub.docker.com/r/pmmp/pocketmine-mp)
- [Docker image](https://github.com/pmmp/PocketMine-MP/pkgs/container/pocketmine-mp)
- [Plugin repository](https://poggit.pmmp.io/plugins)
## Discussion/Help
- [Forums](https://forums.pmmp.io/)
- [Discord](https://discord.gg/bmSAZBG)
- [StackOverflow](https://stackoverflow.com/tags/pocketmine)
## Community & Support
Join our [Discord](https://discord.gg/bmSAZBG) server to chat with other users and developers.
You can also post questions on [StackOverflow](https://stackoverflow.com/tags/pocketmine) under the tag `pocketmine`.
## Developing Plugins
If you want to write your own plugins, the following resources may be useful.
Don't forget you can always ask our community if you need help.
## For developers
* [Building and running from source](BUILDING.md)
* [Developer documentation](https://devdoc.pmmp.io) - General documentation for PocketMine-MP plugin developers
* [Latest API documentation](https://jenkins.pmmp.io/job/PocketMine-MP-doc/doxygen/) - Doxygen documentation generated from development
* [Latest release API documentation](https://apidoc.pmmp.io) - Doxygen API documentation generated for each release
* [Latest bleeding-edge API documentation](https://apidoc-dev.pmmp.io) - Doxygen API documentation generated weekly from `major-next` branch
* [DevTools](https://github.com/pmmp/DevTools/) - Development tools plugin for creating plugins
* [ExamplePlugin](https://github.com/pmmp/ExamplePlugin/) - Example plugin demonstrating some basic API features
## Contributing to PocketMine-MP
PocketMine-MP accepts community contributions! The following resources will be useful if you want to contribute to PocketMine-MP.
* [Building and running PocketMine-MP from source](BUILDING.md)
* [Contributing Guidelines](CONTRIBUTING.md)
## Donate
- Bitcoin Cash (BCH): `qq3r46hn6ljnhnqnfwxt5pg3g447eq9jhvw5ddfear`
PocketMine-MP is free, but it requires a lot of time and effort from unpaid volunteers to develop. Donations enable us to keep delivering support for new versions and adding features your players love.
You can support development using the following methods:
- [Patreon](https://www.patreon.com/pocketminemp)
- Bitcoin (BTC): `171u8K9e4FtU6j3e5sqNoxKUgEw9qWQdRV`
- Stellar Lumens (XLM): `GAAC5WZ33HCTE3BFJFZJXONMEIBNHFLBXM2HJVAZHXXPYA3HP5XPPS7T`
- [Patreon](https://www.patreon.com/pocketminemp)
Thanks for your support!
## Licensing information
This project is licensed under LGPL-3.0. Please see the [LICENSE](/LICENSE) file for details.

View File

@ -7,10 +7,11 @@ GitHub is public and anyone can see the issues you post on the issue tracker, in
**WARNING: You may put live servers at risk by reporting a vulnerability on the GitHub issue tracker.**
**Contact us** by sending an email to [**team@pmmp.io**](mailto:team@pmmp.io?subject=Security%20Vulnerability%20in%20PocketMine-MP). Include the following information:
**Contact us** by sending an email to [**security@pmmp.io**](mailto:security@pmmp.io). Include the following information:
- Version of PocketMine-MP
- Detailed description of the vulnerability (e.g. how to exploit it, what the effects are)
- Your GitHub username, if you wish to be credited for reporting the problem in the security advisory
Please note that we can't guarantee a reply to every email.

View File

@ -0,0 +1,128 @@
<?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\build\generate_bedrockdata_path_consts;
use Symfony\Component\Filesystem\Path;
use function dirname;
use function fclose;
use function fopen;
use function fwrite;
use function is_file;
use function scandir;
use function str_replace;
use function strtoupper;
use const PHP_EOL;
use const pocketmine\BEDROCK_DATA_PATH;
use const SCANDIR_SORT_ASCENDING;
use const STDERR;
require dirname(__DIR__) . '/vendor/autoload.php';
function constantify(string $permissionName) : string{
return strtoupper(str_replace([".", "-"], "_", $permissionName));
}
$files = scandir(BEDROCK_DATA_PATH, SCANDIR_SORT_ASCENDING);
if($files === false){
fwrite(STDERR, "Couldn't find any files in " . BEDROCK_DATA_PATH . PHP_EOL);
exit(1);
}
$consts = [];
foreach($files as $file){
if($file === '.' || $file === '..'){
continue;
}
if($file[0] === '.'){
continue;
}
$path = Path::join(BEDROCK_DATA_PATH, $file);
if(!is_file($path)){
continue;
}
foreach([
'README.md',
'LICENSE',
'composer.json',
] as $ignored){
if($file === $ignored){
continue 2;
}
}
$consts[] = $file;
}
$output = fopen(dirname(__DIR__) . '/src/data/bedrock/BedrockDataFiles.php', 'wb');
if($output === false){
fwrite(STDERR, "Couldn't open output file" . PHP_EOL);
exit(1);
}
fwrite($output, <<<'HEADER'
<?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\data\bedrock;
use const pocketmine\BEDROCK_DATA_PATH;
final class BedrockDataFiles{
private function __construct(){
//NOOP
}
HEADER
);
foreach($consts as $constName => $fileName){
fwrite($output, "\tpublic const " . constantify($fileName) . " = BEDROCK_DATA_PATH . '/$fileName';\n");
}
fwrite($output, "}\n");
fclose($output);
echo "Done. Don't forget to run CS fixup after generating code.\n";

View File

@ -0,0 +1,133 @@
<?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\build\generate_biome_ids;
use pocketmine\data\bedrock\BedrockDataFiles;
use pocketmine\utils\Filesystem;
use pocketmine\utils\Utils;
use function asort;
use function dirname;
use function fclose;
use function fopen;
use function fwrite;
use function is_array;
use function is_int;
use function is_string;
use function json_decode;
use function str_replace;
use function strtoupper;
use const SORT_NUMERIC;
require dirname(__DIR__) . '/vendor/autoload.php';
const HEADER = <<<'HEADER'
<?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);
HEADER;
/** @return resource */
function safe_fopen(string $file, string $flags){
$result = fopen($file, $flags);
if($result === false){
throw new \RuntimeException("Failed to open file");
}
return $result;
}
function make_const_name(string $name) : string{
return strtoupper(str_replace(['.', 'minecraft:'], ['_', ''], $name));
}
/**
* @param int[] $map
* @phpstan-param array<string, int> $map
*/
function generate(array $map, string $outputFile) : void{
$file = safe_fopen($outputFile, 'wb');
fwrite($file, HEADER);
fwrite($file, <<<'CLASSHEADER'
namespace pocketmine\data\bedrock;
final class BiomeIds{
private function __construct(){
//NOOP
}
CLASSHEADER
);
$list = $map;
asort($list, SORT_NUMERIC);
$lastId = -1;
foreach(Utils::stringifyKeys($list) as $name => $id){
if($name === ""){
continue;
}
if($id !== $lastId + 1){
fwrite($file, "\n");
}
$lastId = $id;
fwrite($file, "\tpublic const " . make_const_name($name) . ' = ' . $id . ';' . "\n");
}
fwrite($file, "}\n");
fclose($file);
}
$ids = json_decode(Filesystem::fileGetContents(BedrockDataFiles::BIOME_ID_MAP_JSON), true);
if(!is_array($ids)){
throw new \RuntimeException("Invalid biome ID map, expected array for root JSON object");
}
$cleanedIds = [];
foreach($ids as $name => $id){
if(!is_string($name) || !is_int($id)){
throw new \RuntimeException("Invalid biome ID map, expected string => int map");
}
$cleanedIds[$name] = $id;
}
generate($cleanedIds, dirname(__DIR__) . '/src/data/bedrock/BiomeIds.php');
echo "Done. Don't forget to run CS fixup after generating code.\n";

View File

@ -0,0 +1,217 @@
<?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\build\generate_block_serializer_consts;
use pocketmine\data\bedrock\block\BlockStateData;
use pocketmine\data\bedrock\block\BlockStateNames;
use pocketmine\data\bedrock\block\BlockStateStringValues;
use pocketmine\data\bedrock\block\BlockTypeNames;
use pocketmine\errorhandler\ErrorToExceptionHandler;
use pocketmine\nbt\NbtException;
use pocketmine\network\mcpe\convert\BlockStateDictionary;
use pocketmine\utils\AssumptionFailedError;
use pocketmine\utils\Utils;
use function array_values;
use function asort;
use function count;
use function dirname;
use function explode;
use function fclose;
use function file_get_contents;
use function fopen;
use function fwrite;
use function is_string;
use function ksort;
use function mb_strtoupper;
use function preg_replace;
use function sort;
use function strrpos;
use function strtoupper;
use function substr;
use const SORT_STRING;
use const STDERR;
require dirname(__DIR__) . '/vendor/autoload.php';
class BlockPaletteReport{
/**
* @var string[]
* @phpstan-var array<string, string>
*/
public array $seenTypes = [];
/**
* @var string[][]
* @phpstan-var array<string, array<mixed, mixed>>
*/
public array $seenStateValues = [];
}
/**
* @param BlockStateData[] $states
* @phpstan-param list<BlockStateData> $states
*/
function generateBlockPaletteReport(array $states) : BlockPaletteReport{
$result = new BlockPaletteReport();
foreach($states as $stateData){
$name = $stateData->getName();
$result->seenTypes[$name] = $name;
foreach(Utils::stringifyKeys($stateData->getStates()) as $k => $v){
$result->seenStateValues[$k][$v->getValue()] = $v->getValue();
asort($result->seenStateValues[$k]);
}
}
ksort($result->seenTypes, SORT_STRING);
ksort($result->seenStateValues, SORT_STRING);
return $result;
}
function constifyMcId(string $id) : string{
return strtoupper(explode(":", $id, 2)[1]);
}
function generateClassHeader(string $className) : string{
$backslashPos = strrpos($className, "\\");
if($backslashPos === false){
throw new AssumptionFailedError("Expected a namespaced class FQN");
}
$namespace = substr($className, 0, $backslashPos);
$shortName = substr($className, $backslashPos + 1);
return <<<HEADER
<?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 $namespace;
/**
* This class is generated automatically from the block palette for the current version. Do not edit it manually.
*/
final class $shortName{
private function __construct(){
//NOOP
}
HEADER;
}
/**
* @phpstan-param list<string> $seenIds
*/
function generateBlockIds(array $seenIds) : void{
$output = ErrorToExceptionHandler::trapAndRemoveFalse(fn() => fopen(dirname(__DIR__) . '/src/data/bedrock/block/BlockTypeNames.php', 'wb'));
fwrite($output, generateClassHeader(BlockTypeNames::class));
foreach($seenIds as $id){
fwrite($output, "\tpublic const " . constifyMcId($id) . " = \"" . $id . "\";\n");
}
fwrite($output, "}\n");
fclose($output);
}
function generateBlockStateNames(BlockPaletteReport $data) : void{
$output = ErrorToExceptionHandler::trapAndRemoveFalse(fn() => fopen(dirname(__DIR__) . '/src/data/bedrock/block/BlockStateNames.php', 'wb'));
fwrite($output, generateClassHeader(BlockStateNames::class));
foreach(Utils::stringifyKeys($data->seenStateValues) as $state => $values){
$constName = mb_strtoupper(preg_replace("/^minecraft:/", "mc_", $state) ?? throw new AssumptionFailedError("This regex is not invalid"), 'US-ASCII');
fwrite($output, "\tpublic const $constName = \"$state\";\n");
}
fwrite($output, "}\n");
fclose($output);
}
function generateBlockStringValues(BlockPaletteReport $data) : void{
$output = ErrorToExceptionHandler::trapAndRemoveFalse(fn() => fopen(dirname(__DIR__) . '/src/data/bedrock/block/BlockStateStringValues.php', 'wb'));
fwrite($output, generateClassHeader(BlockStateStringValues::class));
foreach(Utils::stringifyKeys($data->seenStateValues) as $stateName => $values){
$anyWritten = false;
sort($values, SORT_STRING);
foreach($values as $value){
if(!is_string($value)){
continue;
}
$anyWritten = true;
$constName = mb_strtoupper(preg_replace("/^minecraft:/", "mc_", $stateName) . "_" . $value, 'US-ASCII');
fwrite($output, "\tpublic const $constName = \"$value\";\n");
}
if($anyWritten){
fwrite($output, "\n");
}
}
fwrite($output, "}\n");
fclose($output);
}
if(count($argv) !== 2){
fwrite(STDERR, "This script regenerates BlockTypeNames, BlockStateNames and BlockStateStringValues from a given palette file\n");
fwrite(STDERR, "Required arguments: path to block palette file\n");
exit(1);
}
$palettePath = $argv[1];
$paletteRaw = file_get_contents($palettePath);
if($paletteRaw === false){
fwrite(STDERR, "Failed to read block palette file\n");
exit(1);
}
try{
$states = BlockStateDictionary::loadPaletteFromString($paletteRaw);
}catch(NbtException){
fwrite(STDERR, "Invalid block palette file $argv[1]\n");
exit(1);
}
$report = generateBlockPaletteReport($states);
generateBlockIds(array_values($report->seenTypes));
generateBlockStateNames($report);
generateBlockStringValues($report);
echo "Done. Don't forget to run CS fixup after generating code.\n";

View File

@ -17,27 +17,32 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
use pocketmine\network\mcpe\protocol\ProtocolInfo;
use pocketmine\VersionInfo;
require dirname(__DIR__) . '/vendor/autoload.php';
if(count($argv) !== 4){
fwrite(STDERR, "required args: <git hash> <tag name> <github repo (owner/name)>");
if(count($argv) !== 7){
fwrite(STDERR, "required args: <git hash> <tag name> <github repo (owner/name)> <build number> <github actions run ID> <PHP binary download URL>\n");
exit(1);
}
echo json_encode([
"php_version" => sprintf("%d.%d", PHP_MAJOR_VERSION, PHP_MINOR_VERSION),
"base_version" => \pocketmine\VersionInfo::BASE_VERSION,
"build" => \pocketmine\VersionInfo::BUILD_NUMBER,
"is_dev" => \pocketmine\VersionInfo::IS_DEVELOPMENT_BUILD,
"channel" => \pocketmine\VersionInfo::BUILD_CHANNEL,
"php_version" => sprintf("%d.%d", PHP_MAJOR_VERSION, PHP_MINOR_VERSION), //deprecated
"base_version" => VersionInfo::BASE_VERSION,
"build" => (int) $argv[4],
"is_dev" => VersionInfo::IS_DEVELOPMENT_BUILD,
"channel" => VersionInfo::BUILD_CHANNEL,
"git_commit" => $argv[1],
"mcpe_version" => \pocketmine\network\mcpe\protocol\ProtocolInfo::MINECRAFT_VERSION_NETWORK,
"mcpe_version" => 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";
"build_log_url" => "https://github.com/$argv[3]/actions/runs/$argv[5]",
"php_download_url" => $argv[6],
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR) . "\n";

View File

@ -0,0 +1,118 @@
<?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\build\generate_item_serializer_ids;
use pocketmine\data\bedrock\item\BlockItemIdMap;
use pocketmine\errorhandler\ErrorToExceptionHandler;
use pocketmine\network\mcpe\convert\ItemTypeDictionaryFromDataHelper;
use pocketmine\network\mcpe\protocol\serializer\ItemTypeDictionary;
use pocketmine\utils\Utils;
use function asort;
use function count;
use function dirname;
use function explode;
use function fclose;
use function file_get_contents;
use function fopen;
use function fwrite;
use function strtoupper;
use const SORT_STRING;
use const STDERR;
require dirname(__DIR__) . '/vendor/autoload.php';
function constifyMcId(string $id) : string{
return strtoupper(explode(":", $id, 2)[1]);
}
function generateItemIds(ItemTypeDictionary $dictionary, BlockItemIdMap $blockItemIdMap) : void{
$ids = [];
foreach($dictionary->getEntries() as $entry){
if($entry->getStringId() === "minecraft:air" || $blockItemIdMap->lookupBlockId($entry->getStringId()) !== null){ //blockitems are serialized via BlockStateSerializer
continue;
}
$ids[$entry->getStringId()] = $entry->getStringId();
}
asort($ids, SORT_STRING);
$file = ErrorToExceptionHandler::trapAndRemoveFalse(fn() => fopen(dirname(__DIR__) . '/src/data/bedrock/item/ItemTypeNames.php', 'wb'));
fwrite($file, <<<'HEADER'
<?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\data\bedrock\item;
/**
* This class is generated automatically from the item type dictionary for the current version. Do not edit it manually.
*/
final class ItemTypeNames{
HEADER
);
foreach(Utils::stringifyKeys($ids) as $id){
fwrite($file, "\tpublic const " . constifyMcId($id) . " = \"" . $id . "\";\n");
}
fwrite($file, "}\n");
fclose($file);
}
if(count($argv) !== 2){
fwrite(STDERR, "This script regenerates ItemTypeNames from a given item dictionary file\n");
fwrite(STDERR, "Required argument: path to item type dictionary file\n");
exit(1);
}
$raw = file_get_contents($argv[1]);
if($raw === false){
fwrite(STDERR, "Failed to read item type dictionary file\n");
exit(1);
}
$dictionary = ItemTypeDictionaryFromDataHelper::loadFromString($raw);
$blockItemIdMap = BlockItemIdMap::getInstance();
generateItemIds($dictionary, $blockItemIdMap);
echo "Done. Don't forget to run CS fixup after generating code.\n";

View File

@ -17,14 +17,15 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
namespace pocketmine\build\generate_known_translation_apis;
use pocketmine\lang\Translatable;
use Webmozart\PathUtil\Path;
use pocketmine\utils\Utils;
use Symfony\Component\Filesystem\Path;
use function array_map;
use function count;
use function dirname;
@ -40,6 +41,7 @@ use function preg_match_all;
use function str_replace;
use function strtoupper;
use const INI_SCANNER_RAW;
use const SORT_NUMERIC;
use const SORT_STRING;
use const STDERR;
@ -73,7 +75,7 @@ const SHARED_HEADER = <<<'HEADER'
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -94,13 +96,15 @@ function generate_known_translation_keys(array $languageDefinitions) : void{
/**
* This class contains constants for all the translations known to PocketMine-MP as per the used version of pmmp/Language.
* This class is generated automatically, do NOT modify it by hand.
*
* @internal
*/
final class KnownTranslationKeys{
HEADER;
ksort($languageDefinitions, SORT_STRING);
foreach($languageDefinitions as $k => $_){
foreach(Utils::stringifyKeys($languageDefinitions) as $k => $_){
echo "\tpublic const ";
echo constantify($k);
echo " = \"" . $k . "\";\n";
@ -126,6 +130,8 @@ function generate_known_translation_factory(array $languageDefinitions) : void{
* This class contains factory methods for all the translations known to PocketMine-MP as per the used version of
* pmmp/Language.
* This class is generated automatically, do NOT modify it by hand.
*
* @internal
*/
final class KnownTranslationFactory{
@ -135,17 +141,22 @@ HEADER;
$parameterRegex = '/{%(.+?)}/';
$translationContainerClass = (new \ReflectionClass(Translatable::class))->getShortName();
foreach($languageDefinitions as $key => $value){
foreach(Utils::stringifyKeys($languageDefinitions) as $key => $value){
$parameters = [];
$allParametersPositional = true;
if(preg_match_all($parameterRegex, $value, $matches) > 0){
foreach($matches[1] as $parameterName){
if(is_numeric($parameterName)){
$parameters[$parameterName] = "param$parameterName";
}else{
$parameters[$parameterName] = $parameterName;
$allParametersPositional = false;
}
}
}
if($allParametersPositional){
ksort($parameters, SORT_NUMERIC);
}
echo "\tpublic static function " .
functionify($key) .
"(" . implode(", ", array_map(fn(string $paramName) => "$translationContainerClass|string \$$paramName", $parameters)) . ") : $translationContainerClass{\n";
@ -172,7 +183,7 @@ HEADER;
echo "Done generating KnownTranslationFactory.\n";
}
$lang = parse_ini_file(Path::join(\pocketmine\RESOURCE_PATH, "locale", "eng.ini"), false, INI_SCANNER_RAW);
$lang = parse_ini_file(Path::join(\pocketmine\LOCALE_DATA_PATH, "eng.ini"), false, INI_SCANNER_RAW);
if($lang === false){
fwrite(STDERR, "Missing language files!\n");
exit(1);

View File

@ -0,0 +1,120 @@
<?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);
use pocketmine\utils\Filesystem;
use pocketmine\utils\Utils;
require dirname(__DIR__) . '/vendor/autoload.php';
$defaultConfig = yaml_parse(Filesystem::fileGetContents(dirname(__DIR__) . '/resources/pocketmine.yml'));
if(!is_array($defaultConfig)){
fwrite(STDERR, "Invalid default pocketmine.yml\n");
exit(1);
}
$constants = [];
/**
* @param mixed[] $properties
* @param string[] $constants
* @phpstan-param array<string, string> $constants
* @phpstan-param-out array<string, string> $constants
*/
function collectProperties(string $prefix, array $properties, array &$constants) : void{
foreach($properties as $propertyName => $property){
$fullPropertyName = ($prefix !== "" ? $prefix . "." : "") . $propertyName;
$constName = str_replace([".", "-"], "_", strtoupper($fullPropertyName));
$constants[$constName] = $fullPropertyName;
if(is_array($property)){
collectProperties($fullPropertyName, $property, $constants);
}
}
}
collectProperties("", $defaultConfig, $constants);
ksort($constants, SORT_STRING);
$file = fopen(dirname(__DIR__) . '/src/YmlServerProperties.php', 'wb');
if($file === false){
fwrite(STDERR, "Failed to open output file\n");
exit(1);
}
fwrite($file, "<?php\n");
fwrite($file, <<<'HEADER'
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* 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/
*
*
*/
HEADER
);
fwrite($file, "declare(strict_types=1);\n\n");
fwrite($file, "namespace pocketmine;\n\n");
fwrite($file, <<<'DOC'
/**
* @internal
* Constants for all properties available in pocketmine.yml.
* This is generated by build/generate-pocketmine-yml-property-consts.php.
* Do not edit this file manually.
*/
DOC
);
fwrite($file, "final class YmlServerProperties{\n");
fwrite($file, <<<'CONSTRUCTOR'
private function __construct(){
//NOOP
}
CONSTRUCTOR
);
foreach(Utils::stringifyKeys($constants) as $constName => $propertyName){
fwrite($file, "\tpublic const $constName = '$propertyName';\n");
}
fwrite($file, "}\n");
fclose($file);
echo "Done. Don't forget to run CS fixup after generating code.\n";

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -29,17 +29,21 @@ use function count;
use function dirname;
use function file_get_contents;
use function file_put_contents;
use function fwrite;
use function implode;
use function is_dir;
use function ksort;
use function mb_strtoupper;
use function preg_match;
use function sprintf;
use function str_ends_with;
use function str_replace;
use function substr;
use const SORT_STRING;
use const STDERR;
if(count($argv) !== 2){
die("Provide a path to process");
fwrite(STDERR, "Provide a path to process\n");
exit(1);
}
/**
@ -58,7 +62,7 @@ function generateMethodAnnotations(string $namespaceName, array $members) : stri
$memberLines = [];
foreach($members as $name => $member){
$reflect = new \ReflectionClass($member);
while($reflect !== false and $reflect->isAnonymous()){
while($reflect !== false && $reflect->isAnonymous()){
$reflect = $reflect->getParentClass();
}
if($reflect === false){
@ -80,29 +84,24 @@ function generateMethodAnnotations(string $namespaceName, array $members) : stri
return implode("\n", $lines);
}
require dirname(__DIR__) . '/vendor/autoload.php';
foreach(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($argv[1], \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::CURRENT_AS_PATHNAME)) as $file){
if(substr($file, -4) !== ".php"){
continue;
}
function processFile(string $file) : void{
$contents = file_get_contents($file);
if($contents === false){
throw new \RuntimeException("Failed to get contents of $file");
}
if(preg_match("/^namespace (.+);$/m", $contents, $matches) !== 1 || preg_match('/^((final|abstract)\s+)?class /m', $contents) !== 1){
continue;
if(preg_match("/(*ANYCRLF)^namespace (.+);$/m", $contents, $matches) !== 1 || preg_match('/(*ANYCRLF)^((final|abstract)\s+)?class /m', $contents) !== 1){
return;
}
$shortClassName = basename($file, ".php");
$className = $matches[1] . "\\" . $shortClassName;
if(!class_exists($className)){
continue;
return;
}
$reflect = new \ReflectionClass($className);
$docComment = $reflect->getDocComment();
if($docComment === false || preg_match("/^\s*\*\s*@generate-registry-docblock$/m", $docComment) !== 1){
continue;
if($docComment === false || preg_match("/(*ANYCRLF)^\s*\*\s*@generate-registry-docblock$/m", $docComment) !== 1){
return;
}
echo "Found registry in $file\n";
@ -117,3 +116,17 @@ foreach(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($argv[1],
}
}
require dirname(__DIR__) . '/vendor/autoload.php';
if(is_dir($argv[1])){
/** @var string $file */
foreach(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($argv[1], \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::CURRENT_AS_PATHNAME)) as $file){
if(!str_ends_with($file, ".php")){
continue;
}
processFile($file);
}
}else{
processFile($argv[1]);
}

View File

@ -17,31 +17,41 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
namespace pocketmine\build\make_release;
use pocketmine\utils\Filesystem;
use pocketmine\utils\Utils;
use pocketmine\utils\VersionString;
use pocketmine\VersionInfo;
use function count;
use function array_keys;
use function array_map;
use function dirname;
use function fgets;
use function file_get_contents;
use function file_put_contents;
use function fwrite;
use function getopt;
use function is_string;
use function max;
use function preg_match;
use function preg_replace;
use function sleep;
use function sprintf;
use function str_pad;
use function strlen;
use function strtolower;
use function system;
use const STDERR;
use const STDIN;
use const STDOUT;
use const STR_PAD_LEFT;
require_once dirname(__DIR__) . '/vendor/autoload.php';
function replaceVersion(string $versionInfoPath, string $newVersion, bool $isDev, string $channel) : void{
$versionInfo = file_get_contents($versionInfoPath);
$versionInfo = Filesystem::fileGetContents($versionInfoPath);
$versionInfo = preg_replace(
$pattern = '/^([\t ]*public )?const BASE_VERSION = "(\d+)\.(\d+)\.(\d+)(?:-(.*))?";$/m',
'$1const BASE_VERSION = "' . $newVersion . '";',
@ -60,50 +70,95 @@ function replaceVersion(string $versionInfoPath, string $newVersion, bool $isDev
file_put_contents($versionInfoPath, $versionInfo);
}
/**
* @param string[] $argv
* @phpstan-param list<string> $argv
*/
function main(array $argv) : void{
if(count($argv) < 2){
fwrite(STDERR, "Arguments: <channel> [release version] [next version]\n");
const ACCEPTED_OPTS = [
"current" => "Version to insert and tag",
"next" => "Version to put in the file after tagging",
"channel" => "Release channel to post this build into"
];
function systemWrapper(string $command, string $errorMessage) : void{
system($command, $result);
if($result !== 0){
echo "error: $errorMessage; aborting\n";
exit(1);
}
if(isset($argv[2])){
$currentVer = new VersionString($argv[2]);
}else{
$currentVer = VersionInfo::VERSION();
}
function main() : void{
$filteredOpts = [];
foreach(Utils::stringifyKeys(getopt("", ["current:", "next:", "channel:", "help"])) as $optName => $optValue){
if($optName === "help"){
fwrite(STDOUT, "Options:\n");
$maxLength = max(array_map(fn(string $str) => strlen($str), array_keys(ACCEPTED_OPTS)));
foreach(ACCEPTED_OPTS as $acceptedName => $description){
fwrite(STDOUT, str_pad("--$acceptedName", $maxLength + 4, " ", STR_PAD_LEFT) . ": $description\n");
}
exit(0);
}
if(!is_string($optValue)){
fwrite(STDERR, "--$optName expects exactly 1 value\n");
exit(1);
}
$filteredOpts[$optName] = $optValue;
}
if(isset($argv[3])){
$nextVer = new VersionString($argv[3]);
$channel = $filteredOpts["channel"] ?? null;
if(isset($filteredOpts["current"])){
$currentVer = new VersionString($filteredOpts["current"]);
}else{
$nextVer = new VersionString(sprintf(
$currentVer = new VersionString(VersionInfo::BASE_VERSION);
}
$nextVer = isset($filteredOpts["next"]) ? new VersionString($filteredOpts["next"]) : null;
$suffix = $currentVer->getSuffix();
if($suffix !== ""){
if($channel === "stable"){
fwrite(STDERR, "error: cannot release a suffixed build into the stable channel\n");
exit(1);
}
if(preg_match('/^([A-Za-z]+)(\d+)$/', $suffix, $matches) !== 1){
echo "error: invalid current version suffix \"$suffix\"; aborting\n";
exit(1);
}
$nextVer ??= new VersionString(sprintf(
"%u.%u.%u-%s%u",
$currentVer->getMajor(),
$currentVer->getMinor(),
$currentVer->getPatch(),
$matches[1],
((int) $matches[2]) + 1
));
$channel ??= strtolower($matches[1]);
}else{
$nextVer ??= new VersionString(sprintf(
"%u.%u.%u",
$currentVer->getMajor(),
$currentVer->getMinor(),
$currentVer->getPatch() + 1
));
$channel ??= "stable";
}
echo "About to tag version $currentVer. Next version will be $nextVer.\n";
echo "$currentVer will be published on release channel \"$channel\".\n";
echo "please add appropriate notes to the changelog and press enter...";
fgets(STDIN);
system('git add "' . dirname(__DIR__) . '/changelogs"');
systemWrapper('git add "' . dirname(__DIR__) . '/changelogs"', "failed to stage changelog changes");
system('git diff --cached --quiet "' . dirname(__DIR__) . '/changelogs"', $result);
if($result === 0){
echo "error: no changelog changes detected; aborting\n";
exit(1);
}
$versionInfoPath = dirname(__DIR__) . '/src/VersionInfo.php';
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, "");
system('git add "' . $versionInfoPath . '"');
system('git commit -m "' . $nextVer->getBaseVersion() . ' is next" --include "' . $versionInfoPath . '"');
echo "pushing changes in 5 seconds\n";
sleep(5);
system('git push origin HEAD ' . $currentVer->getBaseVersion());
replaceVersion($versionInfoPath, $currentVer->getBaseVersion(), false, $channel);
systemWrapper('git commit -m "Release ' . $currentVer->getBaseVersion() . '" --include "' . $versionInfoPath . '"', "failed to create release commit");
systemWrapper('git tag ' . $currentVer->getBaseVersion(), "failed to create release tag");
replaceVersion($versionInfoPath, $nextVer->getBaseVersion(), true, $channel);
systemWrapper('git add "' . $versionInfoPath . '"', "failed to stage changes for post-release commit");
systemWrapper('git commit -m "' . $nextVer->getBaseVersion() . ' is next" --include "' . $versionInfoPath . '"', "failed to create post-release commit");
}
main($argv);
main();

168
build/server-phar-stub.php Normal file
View File

@ -0,0 +1,168 @@
<?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\server_phar_stub;
use function clearstatcache;
use function copy;
use function fclose;
use function fflush;
use function flock;
use function fopen;
use function fwrite;
use function getmypid;
use function hrtime;
use function is_dir;
use function is_file;
use function mkdir;
use function number_format;
use function str_replace;
use function stream_get_contents;
use function sys_get_temp_dir;
use function tempnam;
use function unlink;
use const DIRECTORY_SEPARATOR;
use const LOCK_EX;
use const LOCK_NB;
use const LOCK_UN;
/**
* Finds the appropriate tmp directory to store the decompressed phar cache, accounting for potential file name
* collisions.
*/
function preparePharCacheDirectory() : string{
clearstatcache();
$i = 0;
do{
$tmpPath = sys_get_temp_dir() . '/PocketMine-MP-phar-cache.' . $i;
$i++;
}while(is_file($tmpPath));
if(!@mkdir($tmpPath) && !is_dir($tmpPath)){
throw new \RuntimeException("Failed to create temporary directory $tmpPath. Please ensure the disk has enough space and that the current user has permission to write to this location.");
}
return $tmpPath;
}
/**
* Deletes caches left behind by previous server instances.
* This ensures that the tmp directory doesn't get flooded by servers crashing in restart loops.
*/
function cleanupPharCache(string $tmpPath) : void{
clearstatcache();
/** @var string[] $matches */
foreach(new \RegexIterator(
new \FilesystemIterator(
$tmpPath,
\FilesystemIterator::CURRENT_AS_PATHNAME | \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS
),
'/(.+)\.lock$/',
\RegexIterator::GET_MATCH
) as $matches){
$lockFilePath = $matches[0];
$baseTmpPath = $matches[1];
$file = @fopen($lockFilePath, "rb");
if($file === false){
//another process probably deleted the lock file already
continue;
}
if(flock($file, LOCK_EX | LOCK_NB)){
//this tmpfile is no longer in use
flock($file, LOCK_UN);
fclose($file);
unlink($lockFilePath);
unlink($baseTmpPath . ".tar");
unlink($baseTmpPath);
echo "Deleted stale phar cache at $baseTmpPath\n";
}else{
$pid = stream_get_contents($file);
fclose($file);
echo "Phar cache at $baseTmpPath is still in use by PID $pid\n";
}
}
}
function convertPharToTar(string $tmpName, string $pharPath) : string{
$tmpPharPath = $tmpName . ".phar";
copy($pharPath, $tmpPharPath);
$phar = new \Phar($tmpPharPath);
//phar requires phar.readonly=0, and zip doesn't support disabling compression - tar is the only viable option
//we don't need phar anyway since we don't need to directly execute the file, only require files from inside it
$phar->convertToData(\Phar::TAR, \Phar::NONE);
unset($phar);
\Phar::unlinkArchive($tmpPharPath);
return $tmpName . ".tar";
}
/**
* Locks a phar tmp cache to prevent it from being deleted by other server instances.
* This code looks similar to Filesystem::createLockFile(), but we can't use that because it's inside the compressed
* phar.
*/
function lockPharCache(string $lockFilePath) : void{
//this static variable will keep the file(s) locked until the process ends
static $lockFiles = [];
$lockFile = fopen($lockFilePath, "wb");
if($lockFile === false){
throw new \RuntimeException("Failed to open temporary file");
}
flock($lockFile, LOCK_EX); //this tells other server instances not to delete this cache file
fwrite($lockFile, (string) getmypid()); //maybe useful for debugging
fflush($lockFile);
$lockFiles[$lockFilePath] = $lockFile;
}
/**
* Prepares a decompressed .tar of PocketMine-MP.phar in the system temp directory for loading code from.
*
* @return string path to the temporary decompressed phar (actually a .tar)
*/
function preparePharCache(string $tmpPath, string $pharPath) : string{
clearstatcache();
$tmpName = tempnam($tmpPath, "PMMP");
if($tmpName === false){
throw new \RuntimeException("Failed to create temporary file");
}
lockPharCache($tmpName . ".lock");
return convertPharToTar($tmpName, $pharPath);
}
$tmpDir = preparePharCacheDirectory();
cleanupPharCache($tmpDir);
echo "Preparing PocketMine-MP.phar decompressed cache...\n";
$start = hrtime(true);
$cacheName = preparePharCache($tmpDir, __FILE__);
echo "Cache ready at $cacheName in " . number_format((hrtime(true) - $start) / 1e9, 2) . "s\n";
require 'phar://' . str_replace(DIRECTORY_SEPARATOR, '/', $cacheName) . '/src/PocketMine.php';

View File

@ -17,13 +17,15 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
namespace pocketmine\build\server_phar;
use pocketmine\utils\Filesystem;
use pocketmine\utils\Git;
use Symfony\Component\Filesystem\Path;
use function array_map;
use function count;
use function dirname;
@ -32,6 +34,7 @@ use function getcwd;
use function getopt;
use function implode;
use function ini_get;
use function is_string;
use function microtime;
use function preg_quote;
use function realpath;
@ -40,12 +43,13 @@ use function rtrim;
use function sprintf;
use function str_replace;
use function unlink;
use const DIRECTORY_SEPARATOR;
use const PHP_EOL;
require dirname(__DIR__) . '/vendor/autoload.php';
/**
* @param string[] $strings
* @param string[] $strings
*
* @return string[]
*/
@ -134,15 +138,29 @@ function main() : void{
exit(1);
}
$opts = getopt("", ["out:", "git:"]);
$opts = getopt("", ["out:", "git:", "build:"]);
if(isset($opts["git"])){
$gitHash = $opts["git"];
}else{
$gitHash = Git::getRepositoryStatePretty(dirname(__DIR__));
echo "Git hash detected as $gitHash" . PHP_EOL;
}
if(isset($opts["build"])){
$build = (int) $opts["build"];
}else{
$build = 0;
}
if(isset($opts["out"])){
if(!is_string($opts["out"])){
echo "--out cannot be specified multiple times" . PHP_EOL;
exit(1);
}
$pharPath = $opts["out"];
}else{
$pharPath = getcwd() . DIRECTORY_SEPARATOR . "PocketMine-MP.phar";
}
foreach(buildPhar(
$opts["out"] ?? getcwd() . DIRECTORY_SEPARATOR . "PocketMine-MP.phar",
$pharPath,
dirname(__DIR__) . DIRECTORY_SEPARATOR,
[
'resources',
@ -150,23 +168,10 @@ function main() : void{
'vendor'
],
[
'git' => $gitHash
'git' => $gitHash,
'build' => $build
],
<<<'STUB'
<?php
$tmpDir = sys_get_temp_dir();
if(!is_readable($tmpDir) or !is_writable($tmpDir)){
echo "ERROR: tmpdir $tmpDir is not accessible." . PHP_EOL;
echo "Check that the directory exists, and that the current user has read/write permissions for it." . PHP_EOL;
echo "Alternatively, set 'sys_temp_dir' to a different directory in your php.ini file." . PHP_EOL;
exit(1);
}
require("phar://" . __FILE__ . "/src/PocketMine.php");
__HALT_COMPILER();
STUB
,
Filesystem::fileGetContents(Path::join(__DIR__, 'server-phar-stub.php')) . "\n__HALT_COMPILER();",
\Phar::SHA1,
\Phar::GZ
) as $line){

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.

38
changelogs/3.25.md Normal file
View File

@ -0,0 +1,38 @@
**For Minecraft: Bedrock Edition 1.17.40**
### 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.25.0
- Added support for Minecraft: Bedrock Edition 1.17.40.
- Removed compatibility with earlier versions.
# 3.25.1
- Fixed autosave bug that caused unmodified chunks to be saved at least once (during the first autosave after they were loaded).
- `Entity->spawnTo()` now has an additional sanity check for matching worlds (might expose a few new errors in plugins).
- Fixed a missing field in `CraftRecipeAuto` item stack request type.
# 3.25.2
- Now analysed using level 9 on PHPStan 1.0.0.
- `ext-pthreads` v4.0.0 or newer is now required.
- Fixed crash in `Player->showPlayer()` when the target is not in the same world.
- `Human->setLifetimeTotalXp()` now limits the maximum value to 2^31.
- Fixed players, who died in hardcore mode and were unbanned, getting re-banned on next server join.
# 3.25.3
- Fixed crash when players try to pickup XP while already having max XP.
- Added a sanity check to `Human->setCurrentTotalXp()` to try and catch an elusive bug that's been appearing in the wild - please get in touch if you know how to reproduce it!
# 3.25.4
- Fixed a long-standing issue with `Player->removeWindow()` breaking inventory UIs on the client.
# 3.25.5
- Protocol: Fixed incorrect encoding in `StructureSettings`
- Fixed reading tags from non-docblock comments in script plugins.
- Build number is now defined in phar metadata instead of being patched into the source code directly.
# 3.25.6
- Fixed borked build number in release build of 3.25.5.

32
changelogs/3.26.md Normal file
View File

@ -0,0 +1,32 @@
**For Minecraft: Bedrock Edition 1.18.0**
### 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.26.0
- Added support for Minecraft: Bedrock Edition 1.18.0.
- Removed compatibility with earlier versions.
# 3.26.1
- Fixed a bug in chunk sending that caused double chests to not be paired, signs to be blank, and various other issues.
# 3.26.2
- Improved error messages shown by `start.cmd`, `start.sh` and `start.ps1` when the PHP binary was not found.
- The value of PHPRC is now shown when erroring out due to unsatisfied PHP requirements.
- Removed restriction on the range of valid channels for `auto-updater.channel` in `pocketmine.yml`.
# 3.26.3
- `PlayerExperienceChangeEvent->setNewProgress()` now performs range checks. This fixes the root of a very old and confusing crash bug which took several years to identify the cause of.
- Note that the defective plugin(s) which caused this problem will still cause a server crash, but the plugin responsible will now get blamed correctly.
# 3.26.4
- Fixed skins appearing black when using RTX resource packs.
- Fixed chunks containing furnaces in old worlds (pre-2017) being discarded as corrupted.
- This was caused by a strict corruption check detecting bad data created by a bug in PocketMine-MP that was fixed in 2017.
# 3.26.5
- Fixed several denial-of-service attack vectors related to writable book text length and encoding.
- Fixed several denial-of-service attack vectors related to skin data field lengths.

15
changelogs/3.27.md Normal file
View File

@ -0,0 +1,15 @@
**For Minecraft: Bedrock Edition 1.18.0**
### 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.27.0
- Introduced support for protocol encryption.
- Encryption is enabled by default.
- Fixes login replay attacks.
- This may cause some performance degradation.
- Encryption can be disabled by setting `network.enable-encryption` to `false` in `pocketmine.yml`. DO NOT do this unless you understand the risks involved.
- An obsoletion notice has been added to the console during server startup.

1767
changelogs/4.0-beta.md Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

166
changelogs/4.1-beta.md Normal file
View File

@ -0,0 +1,166 @@
**For Minecraft: Bedrock Edition 1.18.0**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.1.0-BETA1
Released 22nd January 2022.
## General
- Game mode names (e.g. `survival`, `creative`) may now be used for the `gamemode` property in `server.properties`.
- Increased default maximum render distance to 16 chunks. Players with a render distance smaller than this will notice no difference.
- The setup wizard now prompts for a maximum render distance value.
- The setup wizard now prompts for an IPv6 port selection. Previously it would always use 19133.
- `chunk-ticking.disable-block-ticking` now accepts block names like those used in the `/give` command.
- The `/clear` command now behaves more like vanilla:
- The order of inventories is now the same as Bedrock.
- The cursor and offhand inventories are now cleared if necessary.
## Technical
- `PlayerAuthInputPacket` is now used instead of `MovePlayerPacket` for processing movements. This improves position and rotation accuracy.
- `&&` and `||` are now always used instead of `and` and `or`.
- New version of `pocketmine/errorhandler` is used by this version, adding support for `ErrorToExceptionHandler::trap()`. This enables reliably capturing `E_WARNING` and `E_NOTICE` from functions such as `yaml_parse()` and friends.
- New dependency versions are required by this version:
- `pocketmine/bedrock-protocol` has been updated from 7.1.0 to [7.3.0](https://github.com/pmmp/BedrockProtocol/releases/tag/7.3.0%2Bbedrock-1.18.0).
- `pocketmine/errorhandler` has been updated from 0.3.0 to [0.6.0](https://github.com/pmmp/ErrorHandler/releases/tag/0.6.0).
## API
### Block
- The following classes have been added:
- `Lectern`
- `Pumpkin`
- The following public API methods have been added:
- `Block->getTypeId() : int` - returns an integer which uniquely identifies the block type, ignoring things like facing, colour etc.
- `VanillaBlocks::LECTERN()`
### Entity
- The following classes have been added:
- `animation\ItemEntityStackSizeChangeAnimation`
- The following public API methods have been added:
- `object\ItemEntity->isMergeable(object\ItemEntity $other) : bool`
- `object\ItemEntity->setStackSize(int $size) : void`
- `object\ItemEntity->tryMergeInto(object\ItemEntity $other) : bool`
- `ExperienceManager->canAttractXpOrbs() : bool`
- `ExperienceManager->setCanAttractXpOrbs(bool $v = true) : void`
- `Entity->getSize() : EntitySizeInfo`
- `Living->isGliding() : bool`
- `Living->isSwimming() : bool`
- `Living->setGliding(bool $value = true) : void`
- `Living->setSwimming(bool $value = true) : void`
- The following protected API methods have been added:
- `Entity->getBlocksIntersected(float $inset) : \Generator<int, Block, void, void>`
### Event
- `BlockSpreadEvent` is now called when fire spreads to the positions of blocks it burns away.
- `BlockFormEvent` is now called when concrete powder turns into concrete due to contact with water.
- The following classes have been added:
- `BlockMeltEvent` - called when ice or snow melts
- `ChestPairEvent` - called when two chests try to form a pair
- `PlayerToggleGlideEvent` - called when a player starts or stops gliding
- `PlayerToggleSwimEvent` - called when a player starts or stops swimming
### Item
- The following public API methods have been added:
- `SplashPotion->getType() : PotionType`
- `VanillaItems::AIR()`
- The following API methods have been deprecated:
- `ItemFactory::air()` - use `VanillaItems::AIR()` instead
### Player
- The following public API methods have been added:
- `Player->hasBlockCollision() : bool`
- `Player->setHasBlockCollision(bool $value)` - allows controlling spectator-like no-clip behaviour without changing game mode
- `Player->toggleSwim(bool $swim) : bool` - called by the network system when the client tries to start/stop swimming
- `Player->toggleGlide(bool $glide) : bool` - called by the network system when the client tries to start/stop gliding
### Server
- The following public API constants have been added:
- `Server::DEFAULT_SERVER_NAME`
- `Server::DEFAULT_MAX_PLAYERS`
- `Server::DEFAULT_PORT_IPV4`
- `Server::DEFAULT_PORT_IPV6`
- `Server::DEFAULT_MAX_VIEW_DISTANCE`
### Utils
- Config parsing errors are now always represented by `ConfigLoadException` and include the path to the file in the message.
- Added `TextFormat::MINECOIN_GOLD`, and support for it to the various `TextFormat` methods.
- The following public API methods have been added:
- `Utils::assumeNotFalse()` - static analysis crutch to silence PHPStan errors without using `ignoreErrors` or `@phpstan-ignore-line`, which are both too coarse.
- The following public API properties have been added:
- `Terminal::$COLOR_MINECOIN_GOLD`
- The following classes have been added:
- `ConfigLoadException`
- Fixed `Random->nextSignedInt()` to actually return a signed int. Previously it would return any integer value between 0 and 4,294,957,295.
- Fixed `Random->nextSignedFloat()` to return a float between `-1.0` and `1.0`. Previously it would return any value between `0.0` and `2.0`.
- `VersionString->getNumber()` output is now structured differently to fix overflow issues caused by the old format.
### World
- The following classes have been added:
- `sound\ItemUseOnBlockSound`
- `sound\LecternPlaceBookSound`
## Gameplay
### Blocks
- Fire now spreads.
- Implemented lectern blocks.
- Added missing sounds for hoeing grass and dirt.
- Added missing sounds for using a shovel on grass to create grass path.
- Pumpkins can now be carved using shears.
### Items
- Dropped items of the same type now merge with each other.
### Misc
- Implemented player swimming.
# 4.1.0-BETA2
Released 27th January 2022.
## API
### Block
- The following API methods have been added:
- `utils\BrewingStandSlot->getSlotNumber() : int`
- `utils\FurnaceType->getCookSound() : Sound`
- The following API constants have been added:
- `tile\BrewingStand::BREW_TIME_TICKS`
### Crafting
- The following API methods have been added:
- `CraftingManager->getPotionContainerChangeRecipes() : array<int, array<string, PotionContainerChangeRecipe>>`
- `CraftingManager->getPotionTypeRecipes() : array<string, array<string, PotionTypeRecipe>>`
- `CraftingManager->registerPotionContainerChangeRecipe(PotionContainerChangeRecipe $recipe) : void`
- `CraftingManager->registerPotionTypeRecipe(PotionTypeRecipe $recipe) : void`
- The following classes have been added:
- `BrewingRecipe`
- `PotionContainerChangeRecipe`
- `PotionTypeRecipe`
### Event
- The following classes have been added:
- `BrewItemEvent` - called when a brewing stand finishes brewing potions; this is called up to 3 times (once for each brewing slot, as needed)
- `BrewingFuelUseEvent` - called when a brewing stand consumes blaze powder
- `PlayerViewDistanceChangeEvent` - called whenever a player alters their render distance or requests one for the first time when connecting
### World
#### Sound
- The following classes have been added:
- `BlastFurnaceSound` - the sound made by a blast furnace during smelting
- `FurnaceSound` - the sound made by a regular furnace during cooking or smelting
- `PotionFinishBrewingSound` - the sound made by a brewing stand when a potion finishes being brewed
- `SmokerSound` - the sound made by a smoker during cooking
## Gameplay
### Blocks
- Brewing stands can now be used for brewing potions.
- The visual appearance of a brewing stand now updates correctly when the contents of its inventory changes (adding/removing potions).
- Added missing sounds for furnace, blast furnace and smoker.
- Fixed ender chest not dropping itself when mined with a Silk Touch pickaxe.
- Cobwebs now drop themselves when mined using shears.
- The correct amount of fall damage is now taken when falling from a height onto hay bales.
- Fixed block updating bug introduced by beta1 which caused crops and other plants to never grow.
### Misc
- Added a workaround for client hitbox size bug after swimming which caused the player to be able to fit into one-block-tall gaps.

142
changelogs/4.1.md Normal file
View File

@ -0,0 +1,142 @@
**For Minecraft: Bedrock Edition 1.18.0**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.1.0
Released 7th February 2022.
## General
- Game mode names (e.g. `survival`, `creative`) may now be used for the `gamemode` property in `server.properties`.
- Increased default maximum render distance to 16 chunks. Players with a render distance smaller than this will notice no difference.
- The setup wizard now prompts for a maximum render distance value.
- The setup wizard now prompts for an IPv6 port selection. Previously it would always use 19133.
- `chunk-ticking.disable-block-ticking` now accepts block names like those used in the `/give` command.
- The `/clear` command now behaves more like vanilla:
- The order of inventories is now the same as Bedrock.
- The cursor and offhand inventories are now cleared if necessary.
## Technical
- `PlayerAuthInputPacket` is now used instead of `MovePlayerPacket` for processing movements. This improves position and rotation accuracy.
- `&&` and `||` are now always used instead of `and` and `or`.
- New version of `pocketmine/errorhandler` is used by this version, adding support for `ErrorToExceptionHandler::trap()`. This enables reliably capturing `E_WARNING` and `E_NOTICE` from functions such as `yaml_parse()` and friends.
- New dependency versions are required by this version:
- `pocketmine/bedrock-protocol` has been updated from 7.1.0 to [7.3.0](https://github.com/pmmp/BedrockProtocol/releases/tag/7.3.0%2Bbedrock-1.18.0).
- `pocketmine/errorhandler` has been updated from 0.3.0 to [0.6.0](https://github.com/pmmp/ErrorHandler/releases/tag/0.6.0).
## API
### Block
- The following classes have been added:
- `Lectern`
- `Pumpkin`
- The following public API methods have been added:
- `Block->getTypeId() : int` - returns an integer which uniquely identifies the block type, ignoring things like facing, colour etc.
- `VanillaBlocks::LECTERN()`
- `utils\BrewingStandSlot->getSlotNumber() : int`
- `utils\FurnaceType->getCookSound() : Sound`
- The following API constants have been added:
- `tile\BrewingStand::BREW_TIME_TICKS`
### Crafting
- The following API methods have been added:
- `CraftingManager->getPotionContainerChangeRecipes() : array<int, array<string, PotionContainerChangeRecipe>>`
- `CraftingManager->getPotionTypeRecipes() : array<string, array<string, PotionTypeRecipe>>`
- `CraftingManager->registerPotionContainerChangeRecipe(PotionContainerChangeRecipe $recipe) : void`
- `CraftingManager->registerPotionTypeRecipe(PotionTypeRecipe $recipe) : void`
- The following classes have been added:
- `BrewingRecipe`
- `PotionContainerChangeRecipe`
- `PotionTypeRecipe`
### Entity
- The following classes have been added:
- `animation\ItemEntityStackSizeChangeAnimation`
- The following public API methods have been added:
- `object\ItemEntity->isMergeable(object\ItemEntity $other) : bool`
- `object\ItemEntity->setStackSize(int $size) : void`
- `object\ItemEntity->tryMergeInto(object\ItemEntity $other) : bool`
- `ExperienceManager->canAttractXpOrbs() : bool`
- `ExperienceManager->setCanAttractXpOrbs(bool $v = true) : void`
- `Entity->getSize() : EntitySizeInfo`
- `Living->isGliding() : bool`
- `Living->isSwimming() : bool`
- `Living->setGliding(bool $value = true) : void`
- `Living->setSwimming(bool $value = true) : void`
- The following protected API methods have been added:
- `Entity->getBlocksIntersected(float $inset) : \Generator<int, Block, void, void>`
### Event
- `BlockSpreadEvent` is now called when fire spreads to the positions of blocks it burns away.
- `BlockFormEvent` is now called when concrete powder turns into concrete due to contact with water.
- The following classes have been added:
- `BlockMeltEvent` - called when ice or snow melts
- `BrewItemEvent` - called when a brewing stand finishes brewing potions; this is called up to 3 times (once for each brewing slot, as needed)
- `BrewingFuelUseEvent` - called when a brewing stand consumes blaze powder
- `ChestPairEvent` - called when two chests try to form a pair
- `PlayerToggleGlideEvent` - called when a player starts or stops gliding
- `PlayerToggleSwimEvent` - called when a player starts or stops swimming
- `PlayerViewDistanceChangeEvent` - called whenever a player alters their render distance or requests one for the first time when connecting
### Item
- The following public API methods have been added:
- `SplashPotion->getType() : PotionType`
- `VanillaItems::AIR()`
- The following API methods have been deprecated:
- `ItemFactory::air()` - use `VanillaItems::AIR()` instead
### Player
- The following public API methods have been added:
- `Player->hasBlockCollision() : bool`
- `Player->setHasBlockCollision(bool $value)` - allows controlling spectator-like no-clip behaviour without changing game mode
- `Player->toggleSwim(bool $swim) : bool` - called by the network system when the client tries to start/stop swimming
- `Player->toggleGlide(bool $glide) : bool` - called by the network system when the client tries to start/stop gliding
### Server
- The following public API constants have been added:
- `Server::DEFAULT_SERVER_NAME`
- `Server::DEFAULT_MAX_PLAYERS`
- `Server::DEFAULT_PORT_IPV4`
- `Server::DEFAULT_PORT_IPV6`
- `Server::DEFAULT_MAX_VIEW_DISTANCE`
### Utils
- Config parsing errors are now always represented by `ConfigLoadException` and include the path to the file in the message.
- Added `TextFormat::MINECOIN_GOLD`, and support for it to the various `TextFormat` methods.
- The following public API methods have been added:
- `Utils::assumeNotFalse()` - static analysis crutch to silence PHPStan errors without using `ignoreErrors` or `@phpstan-ignore-line`, which are both too coarse.
- The following public API properties have been added:
- `Terminal::$COLOR_MINECOIN_GOLD`
- The following classes have been added:
- `ConfigLoadException`
- Fixed `Random->nextSignedInt()` to actually return a signed int. Previously it would return any integer value between 0 and 4,294,957,295.
- Fixed `Random->nextSignedFloat()` to return a float between `-1.0` and `1.0`. Previously it would return any value between `0.0` and `2.0`.
- `VersionString->getNumber()` output is now structured differently to fix overflow issues caused by the old format.
### World
- The following classes have been added:
- `sound\BlastFurnaceSound` - the sound made by a blast furnace during smelting
- `sound\FurnaceSound` - the sound made by a regular furnace during cooking or smelting
- `sound\ItemUseOnBlockSound`
- `sound\LecternPlaceBookSound`
- `sound\PotionFinishBrewingSound` - the sound made by a brewing stand when a potion finishes being brewed
- `sound\SmokerSound` - the sound made by a smoker during cooking
## Gameplay
### Blocks
- Fire now spreads.
- Implemented lectern blocks.
- Added missing sounds for hoeing grass and dirt.
- Added missing sounds for using a shovel on grass to create grass path.
- Pumpkins can now be carved using shears.
- Brewing stands can now be used for brewing potions.
- The visual appearance of a brewing stand now updates correctly when the contents of its inventory changes (adding/removing potions).
- Added missing sounds for furnace, blast furnace and smoker.
- Fixed ender chest not dropping itself when mined with a Silk Touch pickaxe.
- Cobwebs now drop themselves when mined using shears.
- The correct amount of fall damage is now taken when falling from a height onto hay bales.
### Items
- Dropped items of the same type now merge with each other.

53
changelogs/4.10.md Normal file
View File

@ -0,0 +1,53 @@
**For Minecraft: Bedrock Edition 1.19.40**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.10.0
Released 26th October 2022.
## General
- Added support for Minecraft: Bedrock Edition 1.19.40.
- Removed support for older versions.
## Fixes
- Fixed incorrect command descriptions showing in `/help` when multiple commands use the same name. Previously, the most recently registered command would show, even though it wouldn't actually be invoked.
- Fixed splash potions affecting players in spectator mode.
- Fixed `World->addParticle()` sending particles to players who couldn't possibly see them when a list of targets was used.
- Fixed `World->addSound()` sending sounds to players who couldn't possibly hear them when a list of targets was used.
## Documentation
- Improved type information available for various API methods in `World`.
# 4.10.1
Released 7th November 2022.
## Fixes
- Fixed spawning in the void if spawn terrain in a world is solid at the default spawn position.
- Fixed totems of undying activating when the player has 1 HP remaining.
- Fixed durable items such as tools becoming unbreakable when in stacks larger than 1. Now, the durability correctly resets when the tool breaks.
- TPS below 12 now correctly shows as red in `/status`. Previously, it showed as orange due to a condition ordering bug.
- Improved handling of missing arguments in user-defined `pocketmine.yml` command aliases. Previously, missing arguments would be filled with an empty string, which caused a variety of unexpected behaviour.
## Internals
- Added validation for the array given to `BaseInventory->setContents()` to ensure that it contains only `Item` instances.
- Silenced `PlayerAuthInputPacket` spam when the session is in the "spawn response" state.
- Updated to PHPStan 1.9.
# 4.10.2
Released 25th November 2022.
## Fixes
- Fixed crashes on macOS and Linux when using console colours without the `TERM` environment variable set.
- Fixed crashdumps not being generated when error messages contained invalid UTF-8 characters.
## Documentation
- Clarified documentation of caching behaviour for `Internet::getIP()`.
- Added and improved documentation for many `Inventory` methods.
- Rewritten documentation for `PlayerCreationEvent` with warnings and more detail.
## Internals
- Non-arrow projectile damage is now unscaled. Scaling according to velocity is only applied to arrows. This currently doesn't cause any observable change in behaviour, but is required for future additions.

92
changelogs/4.11-beta.md Normal file
View File

@ -0,0 +1,92 @@
**For Minecraft: Bedrock Edition 1.19.40**
This is a minor feature release for PocketMine-MP, introducing some new features and improvements.
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.11.0-BETA1
Released 7th November 2022.
## General
- Packet receive timings have now been split into two subcategories - Decode and Handle.
- Console command entry can now be disabled via the `console.enable-input` setting in `pocketmine.yml`.
- Best suited for headless servers (e.g. in a Docker container) where the console will never be used anyway.
- Disabling the console reader slightly reduces memory usage, because console reading currently requires an additional subprocess.
- Console command output now appears on the terminal only, and is not written to the log file.
- The output from console commands now appears with a `Command output |` prefix, instead of as a log message.
- Introduced validation for the `--data` and `--plugins` command line options.
- Encrypted resource packs are now supported, by means of adding a `.key` file alongside the pack in the `resource_packs` folder.
- e.g. `MyEncryptedPack.zip` -> `MyEncryptedPack.zip.key`
## Gameplay
- Fixed supporting blocks of dead bush to be in line with vanilla.
- Sugarcane can now be grown using bonemeal on any part of the sugarcane. Previously, it only worked when used on the bottom block.
- Fixed modifier values for Instant Damage and Regeneration effects.
## API
### General
- Plugins are now always disabled before their dependencies, to ensure that they are able to shutdown properly (e.g. a core plugin depending on a database plugin may want to save data to a DB during `onDisable()`).
- [`webmozart/path-util`](https://packagist.org/packages/webmozart/path-util) has been deprecated, and will be dropped in favour of [`symfony/filesystem`](https://packagist.org/packages/symfony/filesystem) in PM5.
- To prepare for this change, simply replace any usage of `Webmozart\PathUtil\Path` with `Symfony\Component\Filesystem\Path`, which is available as a dependency in this release.
### `pocketmine`
- The following API methods are now deprecated:
- `Server->getPlayerByPrefix()`
### `pocketmine\entity`
- `EntitySpawnEvent` and `ItemSpawnEvent` are now fired on the first tick after the entity is added to the world. Previously, these events were called directly from the entity constructor, making it impossible to get properties like velocity which are often set after the entity is created.
- The following API methods are now deprecated:
- `Living->hasLineOfSight()`
### `pocketmine\item`
- The following new API methods have been added:
- `public Armor->clearCustomColor() : $this`
### `pocketmine\inventory\transaction`
- Introduced a `TransactionBuilder` class. This makes it less of a hassle to build an `InventoryTransaction` server-side, since the regular `Inventory` API methods can be used, rather than having to manually create `SlotChangeAction`s.
### `pocketmine\player`
- The following new API methods have been added:
- `public Player->sendToastNotification(string $title, string $body) : void` - makes a grey box appear at the top of the player's screen containing the specified message
### `pocketmine\utils`
- The following new API methods have been added:
- `public static TextFormat::addBase(string $baseFormat, string $string) : string` - used for coloured log messages, changes the base formatting of a string by inserting the given formatting codes after every RESET code
## Internals
- Improved performance of `ContainerTrait` dropping items on block destroy. (24e72ec109c1442b09558df89b6833cf2f2e0ec7)
- Avoid repeated calls to `Position->getWorld()` (use local variables). (2940547026db40ce76deb46e992870de3ead79ad)
- Revamped the way `InventoryManager` handles fake inventory slot mappings for stuff like crafting tables. (e90abecf38d9c57635fa0497514bba7e546a2469)
- Console polling is now done on the main thread (no longer a performance concern).
- Console reader subprocess should now automatically die if the server main process is killed, instead of persisting as a zombie.
- `ConsoleCommandSender` is no longer responsible for relaying broadcast messages to `MainLogger`. A new `BroadcastLoggerForwarder` has been added, which is subscribed to the appropriate server broadcast channels in order to relay messages. This ensures that chat messages and command audit messages are logged.
- `DelegateInventory` now uses `WeakReference` to track its inventory listener. This allows the delegate to be reused.
# 4.11.0-BETA2
Released 13th November 2022.
## Configuration
- The `chunk-ticking.per-tick` setting is now deprecated, and will be removed in a future release.
- The functionality of this setting has been removed, since it caused more problems than it solved.
- Setting it to zero will still disable chunk ticking (for now), but this should now be done by setting `chunk-ticking.tick-radius` to `0` instead.
## Gameplay
- Improved chunk random ticking:
- Removed the limit on chunks ticked per tick, and its associated config option is no longer respected.
- This change significantly improves crop and plant growth with large numbers of players, but may cause higher CPU usage.
- This limit was causing a linear decrease in chunk ticking speed with larger numbers of players, leading to worsened gameplay experience.
- Every chunk within the configured tick radius of a player will be ticked. Previously, chunks were randomly selected from the radius.
- Implemented Darkness effect.
## API
### `pocketmine\world`
- The following new API methods have been added:
- `public World->getChunkTickRadius() : int` - returns the world's simulation radius
- `public World->setChunkTickRadius(int $radius) : void` - sets the world's simulation radius
## Internals
- Non-arrow projectile damage is now unscaled. Scaling according to velocity is only applied to arrows. This currently doesn't cause any observable change in behaviour, but is required for future additions.

106
changelogs/4.11.md Normal file
View File

@ -0,0 +1,106 @@
**For Minecraft: Bedrock Edition 1.19.40**
This is a minor feature release for PocketMine-MP, introducing some new features and improvements.
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.11.0
Released 25th November 2022.
## General
- Packet receive timings have now been split into two subcategories - Decode and Handle.
- Console command entry can now be disabled via the `console.enable-input` setting in `pocketmine.yml`.
- Best suited for headless servers (e.g. in a Docker container) where the console will never be used anyway.
- Disabling the console reader slightly reduces memory usage, because console reading currently requires an additional subprocess.
- Console command output now appears on the terminal only, and is not written to the log file.
- The output from console commands now appears with a `Command output |` prefix, instead of as a log message.
- User-defined `pocketmine.yml` custom commands now use a generic description which makes clear the command is config-defined.
- Introduced validation for the `--data` and `--plugins` command line options.
- Encrypted resource packs are now supported, by means of adding a `.key` file alongside the pack in the `resource_packs` folder.
- e.g. `MyEncryptedPack.zip` -> `MyEncryptedPack.zip.key`
- The file must contain the raw key bytes, and must not end with a newline.
## Configuration
- The `chunk-ticking.per-tick` setting is now deprecated, and will be removed in a future release.
- The functionality of this setting has been removed, since it caused more problems than it solved.
- Setting it to zero will still disable chunk ticking (for now), but this should now be done by setting `chunk-ticking.tick-radius` to `0` instead.
## Gameplay
- Fixed supporting blocks of dead bush to be in line with vanilla.
- Sugarcane can now be grown using bonemeal on any part of the sugarcane. Previously, it only worked when used on the bottom block.
- Fixed missing sounds when adding, rotating, or removing items in item frames.
- Fixed modifier values for Instant Damage and Regeneration effects.
- Implemented Darkness effect.
- Improved chunk random ticking:
- Removed the limit on chunks ticked per tick, and its associated config option is no longer respected.
- This change significantly improves crop and plant growth with large numbers of players.
- This limit was causing a linear decrease in chunk ticking speed with larger numbers of players, leading to worsened gameplay experience.
- **Warning: This change will result in increased CPU usage if players are spread over a very large area.**
- Every chunk within the configured tick radius of a player will be ticked. Previously, chunks were randomly selected from the radius.
## API
### General
- Plugins are now always disabled before their dependencies, to ensure that they are able to shutdown properly (e.g. a core plugin depending on a database plugin may want to save data to a DB during `onDisable()`).
- [`webmozart/path-util`](https://packagist.org/packages/webmozart/path-util) has been deprecated, and will be dropped in favour of [`symfony/filesystem`](https://packagist.org/packages/symfony/filesystem) in PM5.
- To prepare for this change, simply replace any usage of `Webmozart\PathUtil\Path` with `Symfony\Component\Filesystem\Path`, which is available as a dependency in this release.
### `pocketmine`
- The following API methods are now deprecated:
- `Server->getPlayerByPrefix()`
### `pocketmine\entity`
- `EntitySpawnEvent` and `ItemSpawnEvent` are now fired on the first tick after the entity is added to the world. Previously, these events were called directly from the entity constructor, making it impossible to get properties like velocity which are often set after the entity is created.
- The following API methods are now deprecated:
- `Living->hasLineOfSight()`
### `pocketmine\event\block`
- The following new classes have been added:
- `BlockDeathEvent` - event called when coral or coral blocks die due to lack of water
### `pocketmine\item`
- The following new API methods have been added:
- `public Armor->clearCustomColor() : $this`
### `pocketmine\inventory\transaction`
- Introduced a `TransactionBuilder` class. This makes it less of a hassle to build an `InventoryTransaction` server-side, since the regular `Inventory` API methods can be used, rather than having to manually create `SlotChangeAction`s.
### `pocketmine\lang`
- The following new API methods have been added:
- `public Language->getAll() : array<string, string>`
### `pocketmine\player`
- The following new API methods have been added:
- `public Player->sendToastNotification(string $title, string $body) : void` - makes a grey box appear at the top of the player's screen containing the specified message
### `pocketmine\utils`
- The following new API methods have been added:
- `public static TextFormat::addBase(string $baseFormat, string $string) : string` - used for coloured log messages, changes the base formatting of a string by inserting the given formatting codes after every RESET code
### `pocketmine\world`
- The following new API methods have been added:
- `public World->getChunkTickRadius() : int` - returns the world's simulation radius
- `public World->setChunkTickRadius(int $radius) : void` - sets the world's simulation radius
### `pocketmine\world\sound`
- The following new classes have been added:
- `ItemFrameAddItemSound`
- `ItemFrameRemoveItemSound`
- `ItemFrameRotateItemSound`
## Internals
- Improved performance of `ContainerTrait` dropping items on block destroy. ([link](https://github.com/pmmp/PocketMine-MP/commits/24e72ec109c1442b09558df89b6833cf2f2e0ec7))
- Avoid repeated calls to `Position->getWorld()` (use local variables). ([link](https://github.com/pmmp/PocketMine-MP/commit/2940547026db40ce76deb46e992870de3ead79ad))
- Revamped the way `InventoryManager` handles fake inventory slot mappings for stuff like crafting tables. ([link](https://github.com/pmmp/PocketMine-MP/commit/e90abecf38d9c57635fa0497514bba7e546a2469))
- Inventories are now mapped on a per-slot basis. This means that more than one inventory can be mapped to the same window ID, which is necessary for correctly handling "UI" inventories like crafting tables.
- `InventoryManager->getWindow(int $windowId) : ?Inventory` is replaced by `locateWindowAndSlot` (see below).
- Added `InventoryManager->locateWindowAndSlot(int $windowId, int $netSlotId) : array{Inventory, int}` - accepts a window ID and absolute slot ID, and returns the associated inventory and the slot relative to the inventory's own start (for use with `getItem()` etc.).
- Slot offset mapping for "UI" inventories is now handled in `InventoryManager->createComplexSlotMapping()` instead of in `TypeConverter`.
- Console polling is now done on the main thread (no longer a performance concern). ([link](https://github.com/pmmp/PocketMine-MP/commit/b3f03d7ae645de67a54b7300c09b94eeca16298e))
- Console reader subprocess should now automatically die if the server main process is killed, instead of persisting as a zombie. ([link](https://github.com/pmmp/PocketMine-MP/commit/2585160ca2c4df5758b8b980331307402ff9f0fb))
- `ConsoleCommandSender` is no longer responsible for relaying broadcast messages to `MainLogger`. A new `BroadcastLoggerForwarder` has been added, which is subscribed to the appropriate server broadcast channels in order to relay messages. This ensures that chat messages and command audit messages are logged. ([link](https://github.com/pmmp/PocketMine-MP/commit/83e5b0adb6fa0dddec377182bb1c7945ac8f7820))
- `DelegateInventory` now uses `WeakReference` to track its inventory listener. This allows the delegate to be reused. ([link](https://github.com/pmmp/PocketMine-MP/commit/3feaa18f6c10c3a99c0deca75f57ec2d74b92ab4))
- Non-arrow projectile damage is now unscaled. Scaling according to velocity is only applied to arrows. This currently doesn't cause any observable change in behaviour, but is required for future additions.

119
changelogs/4.12.md Normal file
View File

@ -0,0 +1,119 @@
**For Minecraft: Bedrock Edition 1.19.50**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.12.0
Released 30th November 2022.
## General
- Added support for Minecraft: Bedrock Edition 1.19.50.
- Removed support for older versions.
# 4.12.1
Released 4th December 2022.
## Fixes
- Fixed items glitching when dragging a stack of items across the crafting grid (desync issues).
# 4.12.2
Released 15th December 2022.
## Fixes
- Folder used for plugins (optionally specified by `--plugins`) is no longer required to be writable.
- Fixed broken writable check for server data folder (`is_writable()` broken on NFS and similar filesystems).
- `Filesystem::createLockFile()` exceptions now include more information about why the lock file could not be created.
- Fixed client-side item predictions not being rolled back when cancelling events such as `PlayerItemUseEvent`.
## Dependencies
- Updated BedrockProtocol to [17.1.0](https://github.com/pmmp/BedrockProtocol/releases/tag/17.1.0+bedrock-1.19.50). This adds some missing `LevelSoundEvent` constants and fixes the values for `ContainerUIIds`.
# 4.12.3
Released 28th December 2022.
## Fixes
- Fixed unauthenticated connections taking up player count slots, preventing players from joining.
- Fixed a possible crash in `World->tickChunk()` when plugins unload chunks during some events.
- `/gamemode` will now report a failure to change game mode if the player is already in the requested game mode.
# 4.12.4
Released 3rd January 2023.
## Fixes
- Added workarounds for an active exploit being used to deny service to servers.
# 4.12.5
Released 6th January 2023.
## Fixes
- Removed a workaround for an old client bug in custom form responses. The code contained a denial-of-service vulnerability.
# 4.12.6
Released 7th January 2023.
## Changes
- Added a new security measure to `NetworkSession` to detect and ban players who flood the server with packets.
# 4.12.7
Released 8th January 2023.
## Fixes
- Fixed players getting kicked when the server lags for too long.
- Fixed players getting kicked when a debugging session is active and a breakpoint is hit.
# 4.12.8
Released 9th January 2023.
## Fixes
- Fixed players getting kicked during PvP.
- Fixed players randomly getting kicked on Windows (improper rate limit handling wrt. 15ms timer resolution).
# 4.12.9
Released 16th January 2023.
## Improvements
### Timings
- Added new timers:
- `Server Mid-Tick Processing` - time spent processing Snooze interrupts between ticks (e.g. incoming network packets)
- `Server Tick Update Cycle` - time spent processing regular per-tick updates (e.g. entity movement, world updates, etc.) (`Server->tick()`)
- `Full Server Tick` timer now counts the total of `Server Mid-Tick Processing` and `Server Tick Update Cycle`, which generates more accurate performance metrics.
- Previously, this timer only counted the time spent during regular per-tick updates, and the time recorded by `Server Mid-Tick Processing` was not included in the report at all.
## Fixes
- Fixed blocks such as pressure plates being able to be placed without the correct supporting blocks if the clicked block was solid.
- Pressure plates now self-destruct when the block below them is removed.
- Fixed being unable to place blocks by clicking on the side of a bell (when the click doesn't result in ringing the bell).
- Fixed various rotation-aware blocks (e.g. stairs) behaving incorrectly when placed by clicking on the side of a replaceable block (e.g. tall grass).
- Fixed banners being able to be placed on top of blocks such as skulls.
- Fixed server-side collision boxes of walls and glass (which should connect, but didn't). Note that wall connections still don't show client side - this just fixes the collision boxes.
- Fixed `PlayerInteractEvent` with `LEFT_CLICK` sometimes firing before `BlockBreakEvent` when breaking blocks.
## Other changes
- Increased packet batch budget for player sessions.
# 4.12.10
Released 18th January 2023.
## Fixes
- Fixed reported server load not including the time spent processing Snooze interrupts between ticks (e.g. incoming network packets).
- Fixed `Connection Handler` entry in timings report not including time spent receiving packets.
## Note about server load & performance
This version will report higher apparent server load than previous versions. The actual performance of the server is unchanged; the previous reported load was inaccurate.
These bugs have been present for nearly 5 years (ever since the first introduction of Snooze in 3.0.0).
# 4.12.11
Released 22nd January 2023.
## General
- Code is now tested and analysed using PHP 8.2 in addition to 8.1 and 8.0.
## Fixes
- Fixed pthreads 5.0.0 incorrectly being treated as compatible.
- Fixed deprecation errors on PHP 8.2.
## Documentation
- Updated documentation in `PlayerPreLoginEvent`.

94
changelogs/4.13-beta.md Normal file
View File

@ -0,0 +1,94 @@
**For Minecraft: Bedrock Edition 1.19.50**
This is a minor feature release for PocketMine-MP, introducing some new features and improvements.
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.13.0-BETA1
Released 18th January 2023.
## Gameplay
- Death message is now shown on the death screen when a player dies.
- Armour damage is now only increased if the armour reduced the damage taken.
- Implemented Swift Sneak enchantment.
- Fixed incorrect collision box calculation of walls and glass/bars when connected. Note: Client-side, wall connections are still broken; this only fixes projectile flight server-side.
## Performance
- Improved performance of chunk selection for chunk random ticking using a cache. This improves performance of chunk random ticking by 10-20%.
## Localization
- Added localized description for the `/dumpmemory` command.
## Permissions
- Added the following new core permissions:
- `pocketmine.command.effect.other` - allows the player to use the `/effect` command on other players (default operator only)
- `pocketmine.command.effect.self` - allows the player to use the `/effect` command on themselves (default operator only)
- `pocketmine.command.enchant.other` - allows the player to use the `/enchant` command on other players (default operator only)
- `pocketmine.command.enchant.self` - allows the player to use the `/enchant` command on themselves (default operator only)
- `pocketmine.command.gamemode.other` - allows the player to use the `/gamemode` command on other players (default operator only)
- `pocketmine.command.gamemode.self` - allows the player to use the `/gamemode` command on themselves (default operator only)
- `pocketmine.command.give.other` - allows the player to use the `/give` command on other players (default operator only)
- `pocketmine.command.give.self` - allows the player to use the `/give` command on themselves (default operator only)
- `pocketmine.command.spawnpoint.other` - allows the player to use the `/spawnpoint` command on other players (default operator only)
- `pocketmine.command.spawnpoint.self` - allows the player to use the `/spawnpoint` command on themselves (default operator only)
- `pocketmine.command.teleport.other` - allows the player to use the `/teleport` command on other players (default operator only)
- `pocketmine.command.teleport.self` - allows the player to use the `/teleport` command on themselves (default operator only)
- `pocketmine.command.title.other` - allows the player to use the `/title` command on other players (default operator only)
- `pocketmine.command.title.self` - allows the player to use the `/title` command on themselves (default operator only)
## Internals
- Decoupled `Player->sendMessage()` and `Player->sendTranslation()`.
- Refactored resource pack loading in `ResourcePackManager` to make it easier to understand.
- Client-aware translation processing has been moved to `NetworkSession` due to being client-specific.
- Replaced hardcoded strings with constants in various places.
- `NetworkSession` destructive cleanup is now deferred to the next session tick. This fixes various `InventoryManager` crashes when kicking players during events.
- Updated code using `strpos()` to use `str_starts_with()`, `str_ends_with()` and `str_contains()` where appropriate.
- Added documentation for some internal methods.
## API
### `pocketmine\command`
- The following new API methods have been added:
- `protected VanillaCommand->fetchPermittedPlayerTarget(...) : ?Player` - fetches a player target according to the given sender permissions, or null if not found or not permitted
### `pocketmine\entity`
- The following new API methods have been added:
- `public Living->getDisplayName() : string` - the name of the entity to be shown in death messages, commands etc.
### `pocketmine\event\world`
- The following new classes have been added:
- `WorldSoundEvent` - called when a sound is played in a world
- `WorldParticleEvent` - called when a particle is spawned in a world
### `pocketmine\item`
- The following new API methods have been added:
- `public Item->onInteractEntity(Player $player, Entity $entity, Vector3 $clickVector) : bool` - called when a player interacts with an entity with this item in hand
### `pocketmine\lang`
- `Language->translate()` and `Language->translateString()` no longer parse nested translation in the "base text". This was never intended behaviour, and didn't work beyond the first level anyway.
### `pocketmine\player`
- The following new interfaces have been added:
- `PlayerDataProvider` - implemented by classes which want to offer storage for player data
- The following new classes have been added:
- `DatFilePlayerDataProvider` - the default player data provider, which stores `.dat` files in the `players` folder
- `PlayerDataLoadException` - thrown when an error occurs while loading player data
- `PlayerDataSaveException` - thrown when an error occurs while saving player data
- The following API methods have been deprecated:
- `Player->sendTranslation()` - use `Player->sendMessage()` instead with a `Translatable` message
### `pocketmine\resourcepacks`
- The following new API methods have been added:
- `public ResourcePackManager->setResourceStack(list<ResourcePack> $resourceStack) : void` - sets the list of resource packs to be applied by players
- `public ResourcePackManager->setPackEncryptionKey(string $id, ?string $key) : void` - sets the encryption key to be used for a resource pack
### `pocketmine\utils`
- The following new API methods have been added:
- `public static Filesystem::fileGetContents(...) : string` - a wrapper around `file_get_contents()` which throws an exception on failure
### `pocketmine\world`
- The following new API methods have been added:
- `public World->requestSafeSpawn(?Vector3 $spawn = null) : Promise<Position>` - an async version of `getSafeSpawn()` which generates all the needed chunks before returning

94
changelogs/4.13.md Normal file
View File

@ -0,0 +1,94 @@
**For Minecraft: Bedrock Edition 1.19.50**
This is a minor feature release for PocketMine-MP, introducing some new features and improvements.
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.13.0
Released 30th January 2023.
## Gameplay
- Death message is now shown on the death screen when a player dies.
- Armour damage is now only increased if the armour reduced the damage taken.
- Implemented Swift Sneak enchantment.
- Fixed incorrect collision box calculation of walls and glass/bars when connected. Note: Client-side, wall connections are still broken; this only fixes projectile flight server-side.
## Performance
- Improved performance of chunk selection for chunk random ticking using a cache. This improves performance of chunk random ticking by 10-20%.
## Localization
- Added localized description for the `/dumpmemory` command.
## Permissions
- Added the following new core permissions:
- `pocketmine.command.effect.other` - allows the player to use the `/effect` command on other players (default operator only)
- `pocketmine.command.effect.self` - allows the player to use the `/effect` command on themselves (default operator only)
- `pocketmine.command.enchant.other` - allows the player to use the `/enchant` command on other players (default operator only)
- `pocketmine.command.enchant.self` - allows the player to use the `/enchant` command on themselves (default operator only)
- `pocketmine.command.gamemode.other` - allows the player to use the `/gamemode` command on other players (default operator only)
- `pocketmine.command.gamemode.self` - allows the player to use the `/gamemode` command on themselves (default operator only)
- `pocketmine.command.give.other` - allows the player to use the `/give` command on other players (default operator only)
- `pocketmine.command.give.self` - allows the player to use the `/give` command on themselves (default operator only)
- `pocketmine.command.spawnpoint.other` - allows the player to use the `/spawnpoint` command on other players (default operator only)
- `pocketmine.command.spawnpoint.self` - allows the player to use the `/spawnpoint` command on themselves (default operator only)
- `pocketmine.command.teleport.other` - allows the player to use the `/teleport` command on other players (default operator only)
- `pocketmine.command.teleport.self` - allows the player to use the `/teleport` command on themselves (default operator only)
- `pocketmine.command.title.other` - allows the player to use the `/title` command on other players (default operator only)
- `pocketmine.command.title.self` - allows the player to use the `/title` command on themselves (default operator only)
## Internals
- Decoupled `Player->sendMessage()` and `Player->sendTranslation()`.
- Refactored resource pack loading in `ResourcePackManager` to make it easier to understand.
- Client-aware translation processing has been moved to `NetworkSession` due to being client-specific.
- Replaced hardcoded strings with constants in various places.
- `NetworkSession` destructive cleanup is now deferred to the next session tick. This fixes various `InventoryManager` crashes when kicking players during events.
- Updated code using `strpos()` to use `str_starts_with()`, `str_ends_with()` and `str_contains()` where appropriate.
- Added documentation for some internal methods.
## API
### `pocketmine\command`
- The following new API methods have been added:
- `protected VanillaCommand->fetchPermittedPlayerTarget(...) : ?Player` - fetches a player target according to the given sender permissions, or null if not found or not permitted
### `pocketmine\entity`
- The following new API methods have been added:
- `public Living->getDisplayName() : string` - the name of the entity to be shown in death messages, commands etc.
### `pocketmine\event\world`
- The following new classes have been added:
- `WorldSoundEvent` - called when a sound is played in a world
- `WorldParticleEvent` - called when a particle is spawned in a world
### `pocketmine\item`
- The following new API methods have been added:
- `public Item->onInteractEntity(Player $player, Entity $entity, Vector3 $clickVector) : bool` - called when a player interacts with an entity with this item in hand
### `pocketmine\lang`
- `Language->translate()` and `Language->translateString()` no longer parse nested translation in the "base text". This was never intended behaviour, and didn't work beyond the first level anyway.
### `pocketmine\player`
- The following new interfaces have been added:
- `PlayerDataProvider` - implemented by classes which want to offer storage for player data
- The following new classes have been added:
- `DatFilePlayerDataProvider` - the default player data provider, which stores `.dat` files in the `players` folder
- `PlayerDataLoadException` - thrown when an error occurs while loading player data
- `PlayerDataSaveException` - thrown when an error occurs while saving player data
- The following API methods have been deprecated:
- `Player->sendTranslation()` - use `Player->sendMessage()` instead with a `Translatable` message
### `pocketmine\resourcepacks`
- The following new API methods have been added:
- `public ResourcePackManager->setResourceStack(list<ResourcePack> $resourceStack) : void` - sets the list of resource packs to be applied by players
- `public ResourcePackManager->setPackEncryptionKey(string $id, ?string $key) : void` - sets the encryption key to be used for a resource pack
### `pocketmine\utils`
- The following new API methods have been added:
- `public static Filesystem::fileGetContents(...) : string` - a wrapper around `file_get_contents()` which throws an exception on failure
### `pocketmine\world`
- The following new API methods have been added:
- `public World->requestSafeSpawn(?Vector3 $spawn = null) : Promise<Position>` - an async version of `getSafeSpawn()` which generates all the needed chunks before returning

21
changelogs/4.14.md Normal file
View File

@ -0,0 +1,21 @@
**For Minecraft: Bedrock Edition 1.19.60**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.14.0
Released 8th February 2023.
## General
- Added support for Minecraft: Bedrock Edition 1.19.60.
- Removed support for older versions.
# 4.14.1
Released 15th February 2023.
## Fixes
- Fixed all players getting kicked with `Receiving packets too fast` if a server tick takes longer than 5 seconds (e.g. because of autosave or GC).
- Fixed players getting kicked when linking with entities.

38
changelogs/4.15.md Normal file
View File

@ -0,0 +1,38 @@
**For Minecraft: Bedrock Edition 1.19.62**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.15.0
Released 17th February 2023.
## General
- Added support for Minecraft: Bedrock Edition 1.19.62.
- Removed support for older versions.
# 4.15.1
Released 21st February 2023.
## Fixes
- Fixed dropped items not despawning when in non-ticking chunks.
- Fixed dropped items not despawning if an infinite pickup delay is set.
- Fixed infinite despawn delay (never despawn) being ignored for dropped items.
# 4.15.2
Released 24th February 2023.
## General
- Accept Minecraft: Bedrock Edition 1.19.63 (identical protocol to 1.19.62, but different version due to Mojang mixup).
## Fixes
- Fixed `World Population` timer sometimes not being stopped, causing strange results in timings reports.
# 4.15.3
Released 7th March 2023.
## Fixes
- Fixed `/dumpmemory` crash when any object contained an `INF` or `NaN` float value.
- Updated RakLib for security fixes.

45
changelogs/4.16-beta.md Normal file
View File

@ -0,0 +1,45 @@
**For Minecraft: Bedrock Edition 1.19.62**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.16.0-BETA1
Released 4th March 2023.
## General
- Added granular timings for packet encode, similar to the existing timings for packet decode.
- Timings now covers several areas of the network system which were previously not counted by network timings, but were counted by total timings. This provides a better insight into the performance of the network system.
## Performance
- Improved performance of packet batch handling by avoiding unnecessary object allocations.
- Improved performance of packet broadcasting when the broadcast size is below the batch threshold. Previously, the packets would be encoded once by every recipient, but now they are encoded once and then added to the send buffer of each session in their raw form.
- This change mostly affects servers with larger maps, where players are more widely distributed.
## Build system
- Added a new script `build/generate-bedrockdata-path-consts.php`, which must be run whenever BedrockData is updated. This script generates a class of constants with the file paths of all BedrockData files.
## API
### `pocketmine\entity`
- The following new API methods have been added:
- `public Entity->getGravity() : float` - returns the entity's gravity acceleration in blocks/tick^2
- `public Entity->setGravity(float $gravity) : void` - sets the entity's gravity acceleration in blocks/tick^2
## Internals
- Now uses [`pocketmine/bedrock-data` 2.0.0](https://github.com/pmmp/BedrockData/releases/tag/2.0.0+bedrock-1.19.60).
- This version is now used by both PM4 and PM5, reducing maintenance burden.
- Now uses [`pocketmine/bedrock-protocol` 19.3.0](https://github.com/pmmp/BedrockProtocol/releases/tag/19.3.0+bedrock-1.19.62).
- This version provides new APIs for handling packet batches which enabled improving performance and adding new features, such as detailed packet encode timings.
- Crafting recipes and creative inventory data are now loaded from `recipes/legacy_recipes.json` and `recipes/legacy_creativeitems.json` respectively. Previously, these were loaded from BedrockData directly, but BedrockData 2.0 now uses a format which can't be supported in 4.x without BC breaks.
- Added dependencies on [`pocketmine/bedrock-block-upgrade-schema`](https://github.com/pmmp/BedrockBlockUpgradeSchema) and [`pocketmine/bedrock-item-upgrade-schema`](https://github.com/pmmp/BedrockItemUpgradeSchema). These provide mapping files no longer present in BedrockData 2.0.
- Reduced and/or eliminated most usages of `PacketBatch`, since it only appeared as a throwaway object and was therefore wasting performance.
- `Compressor` now exposes `getCompressionThreshold()` instead of `willCompress()`, which allows determining whether a batch will be compressed without allocating it.
- Added `pocketmine\data\bedrock\BedrockDataFiles`, an auto-generated class of constants with the file paths of all BedrockData files. This makes it easier to locate usages, detect unused files and avoid typos.
# 4.16.0-BETA2
Released 4th March 2023.
## General
- Fixed incorrect release channel for 4.16.0-BETA1.

41
changelogs/4.16.md Normal file
View File

@ -0,0 +1,41 @@
**For Minecraft: Bedrock Edition 1.19.62**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.16.0
Released 7th March 2023.
## General
- Added granular timings for packet encode, similar to the existing timings for packet decode.
- Split `Player Network Send - Compression` timings into two timers, one for `Session Buffer` compression and one for `Broadcast` compression.
- Timings now covers several areas of the network system which were previously not counted by network timings, but were counted by total timings. This provides a better insight into the performance of the network system.
## Performance
- Improved performance of packet batch handling by avoiding unnecessary object allocations.
- Improved performance of packet broadcasting when the broadcast size is below the batch threshold. Previously, the packets would be encoded once by every recipient, but now they are encoded once and then added to the send buffer of each session in their raw form.
- This change mostly affects servers with larger maps, where players are more widely distributed.
- Improved performance of packet broadcasting when the broadcast has only one recipient (allow the session to compress the packet with the rest of its buffer).
## Build system
- Added a new script `build/generate-bedrockdata-path-consts.php`, which must be run whenever BedrockData is updated. This script generates a class of constants with the file paths of all BedrockData files.
## API
### `pocketmine\entity`
- The following new API methods have been added:
- `public Entity->getGravity() : float` - returns the entity's gravity acceleration in blocks/tick^2
- `public Entity->setGravity(float $gravity) : void` - sets the entity's gravity acceleration in blocks/tick^2
## Internals
- Now uses [`pocketmine/bedrock-data` 2.0.0](https://github.com/pmmp/BedrockData/releases/tag/2.0.0+bedrock-1.19.60).
- This version is now used by both PM4 and PM5, reducing maintenance burden.
- Now uses [`pocketmine/bedrock-protocol` 19.3.0](https://github.com/pmmp/BedrockProtocol/releases/tag/19.3.0+bedrock-1.19.62).
- This version provides new APIs for handling packet batches which enabled improving performance and adding new features, such as detailed packet encode timings.
- Crafting recipes and creative inventory data are now loaded from `recipes/legacy_recipes.json` and `recipes/legacy_creativeitems.json` respectively. Previously, these were loaded from BedrockData directly, but BedrockData 2.0 now uses a format which can't be supported in 4.x without BC breaks.
- Added dependencies on [`pocketmine/bedrock-block-upgrade-schema`](https://github.com/pmmp/BedrockBlockUpgradeSchema) and [`pocketmine/bedrock-item-upgrade-schema`](https://github.com/pmmp/BedrockItemUpgradeSchema). These provide mapping files no longer present in BedrockData 2.0.
- Reduced and/or eliminated most usages of `PacketBatch`, since it only appeared as a throwaway object and was therefore wasting performance.
- `Compressor` now exposes `getCompressionThreshold()` instead of `willCompress()`, which allows determining whether a batch will be compressed without allocating it.
- Added `pocketmine\data\bedrock\BedrockDataFiles`, an auto-generated class of constants with the file paths of all BedrockData files. This makes it easier to locate usages, detect unused files and avoid typos.

39
changelogs/4.17.md Normal file
View File

@ -0,0 +1,39 @@
**For Minecraft: Bedrock Edition 1.19.70**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.17.0
Released 14th March 2023.
## General
- Added support for Minecraft: Bedrock Edition 1.19.70.
- Removed support for older versions.
# 4.17.1
Released 22nd March 2023.
## General
- Docker images for PocketMine-MP are now published on [GitHub Container Registry](https://github.com/pmmp/PocketMine-MP/pkgs/container/pocketmine-mp). The Docker Hub images will stop being maintained in the future.
- Updated translations.
## Fixes
- Fixed server crash on empty packets in certain cases.
- Fixed mushroom blocks dropping the wrong items when broken with a silk-touch tool.
- Fixed mushroom blocks giving the wrong items when block-picked.
- Fixed missing ability flag `PRIVILEGED_BUILDER`.
## Internals
- `update-updater-api.yml` workflow now uses `github.repository_owner` to make it easier to test the workflow on forks.
- Added version-specific channels to `update.pmmp.io`, such as `4`, `4.18-beta`, `4.17`, etc.
- Replaced deprecated `::set-output` commands in GitHub Actions workflows.
- `build/make-release.php` no longer automatically pushes changes, to avoid accidents when testing release workflows on forks.
# 4.17.2
Released 29th March 2023.
## Fixes
- Fixed players being unable to join due to the appearance of a new `x5t` field in the JWT header of Xbox Live authentication tokens.

91
changelogs/4.18-alpha.md Normal file
View File

@ -0,0 +1,91 @@
**For Minecraft: Bedrock Edition 1.19.70**
### Note about API versions
Plugins which don't touch the `pocketmine\network\mcpe` namespace are compatible with any previous 4.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 `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
### Alpha release warning
Alpha releases are **experimental**. Features introduced in these releases are subject to change or removal.
APIs which existed **prior** to this version will continue to work as normal, so plugins which use them will continue to work.
### Highlights
This version makes changes to the internal network system to improve server performance and reduce memory usage.
While these changes don't affect non-internal API, they are still significant enough to warrant a new minor version, as they may break plugins which use the internal network API (not recommended).
# 4.18.0-ALPHA1
Released 16th March 2023.
## General
- Improved server performance in congested areas of the world (lots of players and/or entities in the same area).
## API
### `pocketmine\event\server`
- The following new classes have been added:
- `DataPacketDecodeEvent` - called before a packet is decoded by a `NetworkSession`; useful to mitigate DoS attacks if PocketMine-MP hasn't been patched against new bugs yet
## Internals
- Introduced new system for broadcasting entity events to network sessions.
- This change improves performance when lots of players and/or entities are in the same area.
- New interface `EntityEventBroadcaster` and class `StandardEntityEventBroadcaster` have been added to implement this.
- All entity-specific `on*()` and `sync*()` methods have been removed from `NetworkSession` (BC break).
- `NetworkSession` now accepts an `EntityEventBroadcaster` instance in its constructor.
- `NetworkBroadcastUtils::broadcastEntityEvent()` can be used to efficiently broadcast events to unique broadcasters shared by several network sessions.
- All network sessions now share the same `PacketSerializerContext` and `PacketBroadcaster` by default.
- Previously, every session had its own context, meaning that broadcast optimisations were not used, causing significant performance losses compared to 3.x.
- This change improves performance in congested areas by allowing reuse of previously encoded packet buffers for all sessions sharing the same context.
- Packet broadcasts are automatically encoded separately per unique `PacketSerializerContext` instance. This allows, for example, a multi-version fork to have a separate context for each protocol version, to ensure maximum broadcast efficiency while encoding different packets for different versions.
- `PacketSerializerContext` is now passed in `NetworkSession::__construct()`, instead of being created by the session.
- `StandardPacketBroadcaster` is now locked to a single `PacketSerializer` context, reducing complexity.
- Introduced `NetworkBroadcastUtils::broadcastPackets()`, replacing `Server->broadcastPackets()`.
- `Server->broadcastPackets()` has been deprecated. It will be removed in a future version.
# 4.18.0-ALPHA2
Released 21st March 2023.
## General
- Included more sections of the network system in Player Network Send timings.
- Changed the names of some timings to make them more user-friendly.
- Removed packet IDs from `receivePacket` and `sendPacket` timings, as they were not very useful.
- Added new specialized timers for the following:
- Item entity base ticking (merging)
- Player movement processing
- Entity movement processing (collision checking section)
- Projectile movement (all)
- Projectile movement processing (ray tracing section)
## API
### `pocketmine\crafting`
- The following new API methods have been added:
- `CraftingManager->getCraftingRecipeIndex() : array<int, CraftingRecipe>` - returns a list of all crafting recipes
- `CraftingManager->getCraftingRecipeFromIndex(int $index) : ?CraftingRecipe` - returns the crafting recipe at the given index, or null if it doesn't exist
### `pocketmine\inventory\transaction`
- The following API methods have changed signatures:
- `CraftingTransaction->__construct()` now accepts additional arguments `?CraftingRecipe $recipe = null, ?int $repetitions = null`
- The following new API methods have been added:
- `TransactionBuilderInventory->getActualInventory() : Inventory` - returns the actual inventory that this inventory is a proxy for
## Internals
### Network
- Introduced support for the `ItemStackRequest` Minecraft: Bedrock network protocol.
- This fixes a large number of inventory- and crafting-related bugs.
- This also improves server security by closing off many code pathways that might have been used for exploits. `TypeConverter->netItemStackToCore()` is no longer used in server code, and remains for tool usage only.
- This system is also significantly more bandwidth-efficient and has lower overhead than the legacy system.
- This now opens the gateway to easily implement lots of gameplay features which have been missing for a long time, such as enchanting, anvils, looms, and more.
- Significant changes have been made to `pocketmine\network\mcpe\InventoryManager` internals. These shouldn't affect plugins, but may affect plugins which use internal network API.
- **No changes have been made to the plugin `InventoryTransaction` API**.
- This system has been implemented as a shim for the existing PocketMine-MP transaction system to preserve plugin compatibility. Plugins using `InventoryTransactionEvent` should continue to work seamlessly.
- The `InventoryTransaction` API will be redesigned in a future major version to make use of the new information provided by the `ItemStackRequest` system.
- `InventoryTransactionPacket` is no longer sent by the client for "regular" inventory actions. However, it is still sent when dropping items, interacting with blocks, and using items.
- Inventory slot and content syncing is now buffered until the end of the tick. This reduces outbound network usage when the client performs multiple transactions in a single tick (e.g. crafting a stack of items).
- Renamed some `InventoryManager` internal properties to make them easier to understand.
- `TypeConverter->createInventoryAction()` has been removed.
- Packet batch limit has been lowered to `100` packets. With the introduction of `ItemStackRequest`, this is more than sufficient for normal gameplay.
### Other
- Use `Vector3::zero()` instead of `new Vector3()` in some places.

123
changelogs/4.18.md Normal file
View File

@ -0,0 +1,123 @@
**For Minecraft: Bedrock Edition 1.19.70**
### Note about API versions
Plugins which don't touch the `pocketmine\network\mcpe` namespace are compatible with any previous 4.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 `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
### Highlights
This version significantly improves server performance with many players and/or entities by making changes to the internal network system.
It also introduces support for the newer `ItemStackRequest` protocol, which fixes many bugs and improves server security.
While these changes don't affect non-internal API, they are still significant enough to warrant a new minor version, as they may break plugins which use the internal network API (not recommended).
# 4.18.0
Released 25th March 2023.
## General
- Significantly improved server performance in congested areas of the world (lots of players and/or entities in the same area).
- Included more sections of the network system in `Player Network Send` performance timings.
- Changed the names of some performance timings to make them more user-friendly.
- Removed packet IDs from `receivePacket` and `sendPacket` performance timings, as they were not very useful.
- Added new specialized performance timings for the following:
- Item entity base ticking (merging)
- Player movement processing
- Entity movement processing (collision checking section)
- Projectile movement (all)
- Projectile movement processing (ray tracing section)
## API
### `pocketmine\crafting`
- The following new API methods have been added:
- `CraftingManager->getCraftingRecipeIndex() : array<int, CraftingRecipe>` - returns a list of all crafting recipes
- `CraftingManager->getCraftingRecipeFromIndex(int $index) : ?CraftingRecipe` - returns the crafting recipe at the given index, or null if it doesn't exist
### `pocketmine\event\server`
- The following new classes have been added:
- `DataPacketDecodeEvent` - called before a packet is decoded by a `NetworkSession`; useful to mitigate DoS attacks if PocketMine-MP hasn't been patched against new bugs yet
### `pocketmine\inventory\transaction`
- The following API methods have changed signatures:
- `CraftingTransaction->__construct()` now accepts additional arguments `?CraftingRecipe $recipe = null, ?int $repetitions = null`
- The following new API methods have been added:
- `TransactionBuilderInventory->getActualInventory() : Inventory` - returns the actual inventory that this inventory is a proxy for
## Internals
### Network
- Introduced new system for broadcasting entity events to network sessions.
- This change improves performance when lots of players and/or entities are in the same area.
- New interface `EntityEventBroadcaster` and class `StandardEntityEventBroadcaster` have been added to implement this.
- All entity-specific `on*()` and `sync*()` methods have been removed from `NetworkSession` (internals backwards compatibility break, not covered by API version guarantee).
- `NetworkSession` now accepts an `EntityEventBroadcaster` instance in its constructor.
- `NetworkBroadcastUtils::broadcastEntityEvent()` can be used to efficiently broadcast events to unique broadcasters shared by several network sessions.
- All network sessions now share the same `PacketSerializerContext` and `PacketBroadcaster` by default.
- Previously, every session had its own context, meaning that broadcast optimisations were not used, causing significant performance losses compared to 3.x.
- This change improves performance in congested areas by allowing reuse of previously encoded packet buffers for all sessions sharing the same context.
- Packet broadcasts are automatically encoded separately per unique `PacketSerializerContext` instance. This allows, for example, a multi-version fork to have a separate context for each protocol version, to ensure maximum broadcast efficiency while encoding different packets for different versions.
- `PacketSerializerContext` is now passed in `NetworkSession::__construct()`, instead of being created by the session.
- `StandardPacketBroadcaster` is now locked to a single `PacketSerializer` context, reducing complexity.
- Introduced `NetworkBroadcastUtils::broadcastPackets()`, replacing `Server->broadcastPackets()`.
- `Server->broadcastPackets()` has been deprecated. It will be removed in a future version.
- Introduced support for the `ItemStackRequest` Minecraft: Bedrock network protocol.
- This fixes a large number of inventory- and crafting-related bugs.
- This also improves server security by closing off many code pathways that might have been used for exploits. `TypeConverter->netItemStackToCore()` is no longer used in server code, and remains for tool usage only.
- This system is also significantly more bandwidth-efficient and has lower overhead than the legacy system.
- This now opens the gateway to easily implement lots of gameplay features which have been missing for a long time, such as enchanting, anvils, looms, and more.
- Significant changes have been made to `pocketmine\network\mcpe\InventoryManager` internals. These shouldn't affect plugins, but may affect plugins which use internal network API.
- **No changes have been made to the plugin `InventoryTransaction` API**.
- This system has been implemented as a shim for the existing PocketMine-MP transaction system to preserve plugin compatibility. Plugins using `InventoryTransactionEvent` should continue to work seamlessly.
- The `InventoryTransaction` API will be redesigned in a future major version to make use of the new information provided by the `ItemStackRequest` system.
- `InventoryTransactionPacket` is no longer sent by the client for "regular" inventory actions. However, it is still sent when dropping items, interacting with blocks, and using items.
- Inventory slot and content syncing is now buffered until the end of the tick. This reduces outbound network usage when the client performs multiple transactions in a single tick (e.g. crafting a stack of items).
- Renamed some `InventoryManager` internal properties to make them easier to understand.
- `TypeConverter->createInventoryAction()` has been removed.
- Packet batch limit has been lowered to `100` packets. With the introduction of `ItemStackRequest`, this is more than sufficient for normal gameplay.
### Other
- Use `Vector3::zero()` instead of `new Vector3()` in some places.
# 4.18.1
Released 27th March 2023.
## General
- `RakLibInterface` now logs the name of the currently active session if a crash occurs when processing a packet. This makes it easier to reproduce bugs, which is important to be able to fix them.
- Added more detailed debugging information to `InventoryManager->syncSelectedHotbarSlot()`.
## Fixes
- Fixed server crash when attempting to drop more of an item from a stack than available in the inventory.
- Fixed packet processing errors when editing writable books.
- Fixed packet processing errors when shift-clicking on the recipe book to craft recipes which draw from a large number of inventory slots.
# 4.18.2
Released 29th March 2023.
## Fixes
- Fixed players being unable to join due to the appearance of a new `x5t` field in the JWT header of Xbox Live authentication tokens.
- Fixed items' durability appearing to reset when moving them around in the inventory.
# 4.18.3
Released 5th April 2023.
## Fixes
- Fixed Average Players not being shown on timings reports when custom player classes are used.
- Fixed incorrect tick violation calculation in timings reports.
- Fixed not being able to add or remove items from the offhand slot.
- Fixed creative inventory item count corruption when taking items (some players would see 64x items in the creative inventory after rejoining or changing gamemode).
- Fixed not being able to drop items directly from the creative inventory on mobile.
- Fixed `DataPacketReceiveEvent` not being called for packets sent by `EntityEventBroadcaster`.
- `CreativeInventory::getItem()` and `CreativeInventory::getAll()` now return cloned itemstacks, to prevent accidental modification of the creative inventory.
# 4.18.4
Released 10th April 2023.
## Fixes
- Fixed movement becoming broken when the player moves at high speed (e.g. due to high levels of the Speed effect).
- Updated dependencies to get fixes in `pocketmine/nbt` and `pocketmine/bedrock-protocol`.
## Internals
### Network
- Game packets are now rate-limited in a similar manner to packet batches. This helps to more effectively mitigate certain types of DoS attacks.
- Added a new class `PacketRateLimiter`, implementing functionality previously baked directly into `NetworkSession` in a more generic way to allow reuse.

111
changelogs/4.19.md Normal file
View File

@ -0,0 +1,111 @@
**For Minecraft: Bedrock Edition 1.19.70**
### Note about API versions
Plugins which don't touch the `pocketmine\network\mcpe` namespace are compatible with any previous 4.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 `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
### Highlights
This version introduces support for a new, more advanced version of Timings.
This improved system provides more detail than the old system, and supports being displayed in a tree view, making it much easier to see which timers contribute to which other timers.
In addition, some minor performance improvements have been made, along with a couple of minor API additions.
# 4.19.0
Released 11th April 2023.
## General
- Updated the Timings system.
- Timings records now include parent information, allowing them to be displayed in a tree view (e.g. https://timings.pmmp.io/?id=303556).
- Timings records now include additional information, such as Peak (max time spent on any single tick), and Ticks (number of ticks the timer was active on).
- New timings have been added for every event.
- A new timer `Player Network Send - Pre-Spawn Game Data` has been added, and covers most of the time spent handling `ResourcePackClientResponsePacket`, giving a clearer picture of what's happening.
- Improved performance of the plugin event system.
- By introducing some caching, the event system now has 90% less overhead than in previous versions.
- Improved performance of the random chunk ticking system.
- The selection of ticked random chunks, and their validation for ticking, is now cached. This significantly reduces the overhead of chunk selection.
- Factions servers and other game modes with big maps and sparsely populated areas will see the most benefit from this change.
- Real-world performance benefit of this change is anywhere from 0-20%, depending on server type and configuration.
- The `timings paste` command now logs a debug message with the server response on failure to paste a timings report.
## API
### `pocketmine\entity\object`
- The following API constants have been added:
- `ExperienceOrb::DEFAULT_DESPAWN_DELAY` - the default delay in ticks before an experience orb despawns
- `ExperienceOrb::NEVER_DESPAWN` - magic value for `setDespawnDelay()` to make an experience orb never despawn
- `ExperienceOrb::MAX_DESPAWN_DELAY` - the maximum delay in ticks before an experience orb despawns
- The following API methods have been added:
- `public ExperienceOrb->getDespawnDelay() : int` - returns the delay in ticks before this experience orb despawns
- `public ExperienceOrb->setDespawnDelay(int $despawnDelay) : void` - sets the delay in ticks before this experience orb despawns
- The following properties have been deprecated
- `ExperienceOrb->age` - superseded by despawn delay methods
### `pocketmine\event`
- The following API methods have been added:
- `public HandlerList->getListenerList() : list<RegisteredListener>` - returns an ordered list of handlers to be called for the event
### `pocketmine\player`
- The following API methods have behavioural changes:
- `ChunkSelector->selectChunks()` now yields the distance in chunks from the center as the key, instead of an incrementing integer.
- The following classes have been deprecated:
- `PlayerChunkLoader` (this was technically internal, but never marked as such)
### `pocketmine\timings`
- The following API constants have been deprecated:
- `Timings::INCLUDED_BY_OTHER_TIMINGS_PREFIX` - this is superseded by timings group support (see `Timings::GROUP_BREAKDOWN`)
- The following API constants have been added:
- `Timings::GROUP_BREAKDOWN` - this group makes a timer appear in the `Minecraft - Breakdown` section of a timings report
- The following API methods have been added:
- `public TimingsHandler->getGroup() : string` - returns the name of the table in which this timer will appear in a timings report
- The following API methods have changed signatures:
- `TimingsHandler->__construct()` now accepts an additional, optional `string $group` parameter, which defaults to `Minecraft`.
### `pocketmine\world`
#### Highlights
Ticking chunks is now done using the `ChunkTicker` system, which has a much more fine-grained API than the old `TickingChunkLoader` system, as well as better performance.
It works similarly to the `ChunkLoader` system, in that chunks will be ticked as long as at least one `ChunkTicker` is registered for them.
#### API changes
- The following classes have been deprecated:
- `TickingChunkLoader` - this has been superseded by the more powerful and performant `ChunkTicker` APIs
- The following classes have been added:
- `ChunkTicker` - an opaque object used for `registerTickingChunk()` to instruct the `World` that we want a chunk to be ticked
- The following API methods have been added:
- `public World->registerTickingChunk(ChunkTicker $ticker, int $chunkX, int $chunkZ) : void` - registers a chunk to be ticked by the given `ChunkTicker`
- `public World->unregisterTickingChunk(ChunkTicker $ticker, int $chunkX, int $chunkZ) : void` - unregisters a chunk from being ticked by the given `ChunkTicker`
# 4.19.1
Released 14th April 2023.
## Fixes
- Fixed inventory rollbacks when spreading items in ender chests.
- Fixed inventory rollbacks when shift-clicking to craft and the outputs would have been split across multiple inventory slots.
- Fixed incorrect spawn terrain generation for newly created worlds.
- Fixed `chunk-ticking.tick-radius` not disabling chunk ticking when set to `0`.
- Fixed chunks not being ticked if they previously left a player's simulation distance without leaving their view distance.
- Fixed height of collision boxes for Grass Path and Farmland blocks.
# 4.19.2
Released 14th April 2023.
## Fixes
- Fixed player timings duplication leading to extremely large timings reports when timings runs for a long time with many players.
- Packet timings are now indexed by class FQN instead of packet ID. This prevents erroneous timer reuse on packet ID reuse (e.g. multi version servers).
- Fixed entity timings being shared by different classes with the same short name. This led to incorrect timings being reported for some entities when custom entities were used.
# 4.19.3
Released 21st April 2023.
## General
- Error IDs for `Packet processing error` disconnects are now split into 4-character chunks to make them easier to type (since they can't be copied from the disconnection screen of a client).
## Fixes
- Fixed entity-block intersections being checked twice per tick. Besides wasting CPU time, this may have caused unexpected behaviour during entity-block interactions with blocks like water or cacti.
- Fixed performance issue in network inventory synchronization due item NBT being prepared twice.
- Fixed `tools/simulate-chunk-selector.php` argument parsing being completely broken (weird behaviour of PHP `getopt()`).
## Internals
- `TimingsHandler->stopTiming()` now logs an error message if a subtimer wasn't stopped, rather than throwing an exception.
- Due to interactions between `try...finally` and unexpected errors, throwing exceptions made it difficult for plugin developers to debug errors in their plugins, since it obscured the original error.

121
changelogs/4.2.md Normal file
View File

@ -0,0 +1,121 @@
**For Minecraft: Bedrock Edition 1.18.10**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.2.0
- Added support for Minecraft: Bedrock Edition 1.18.10.
# 4.2.1
Released 19th February 2022.
## General
- Improved performance of `Item::nbtSerialize()` - this will improve performance during world saves.
- Added more missing changes to the 4.0.0 changelog.
## Fixes
- Fixed multiple players being able to sleep in the same bed.
- Fixed hitbox not resetting properly after swimming or gliding.
# 4.2.2
Released 2nd March 2022.
## Fixes
- Fixed crash in `/dumpmemory` due to usage of non-printable string keys in `CraftingManager`. Array contents in memory dumps are now rendered as prettified key-value pairs.
- Fixed output directory for `/dumpmemory`.
- `PlayerInventory->isHotbarSlot()` now correctly returns `false` when given `9`.
- Fixed ghost items left in the inventory when dropping tools while mining.
# 4.2.3
Released 9th March 2022.
## Technical
- Now analysed using PHPStan 1.4.8.
- Now using `pocketmine/bedrock-protocol` [`8.0.1`](https://github.com/pmmp/BedrockProtocol/releases/tag/8.0.1%2Bbedrock-1.18.10).
## Fixes
### Core
- Fixed a memory leak and other bugs related to plugins disabling themselves during `onEnable()`.
### Gameplay
- Sweet berry bushes now absorb fall damage.
- Fixed mycelium spreading onto coarse dirt.
- Fixed blocks placed during `Block->onIncinerate()` getting overwritten.
- Fixed shulker boxes being unopenable when underwater.
- Fixed invisible fire on top of transparent non-flammable blocks.
### API
- Various APIs accepting `Vector3`, `Position` or `Location` no longer accept objects containing `INF` or `NaN` in any component. Previously, this was allowed, but would cause lots of obscure crashes later on.
- `Entity->setRotation()` no longer accepts `INF` or `NaN`.
- Fixed missing bounds check for `ItemFrame->setItemDropChance()`.
# 4.2.4
Released 18th March 2022.
## Fixes
- Fixed a crash when handling out-of-bounds meta values on the network.
# 4.2.5
Released 28th March 2022.
## General
- The layout of the human-readable part of crashdumps has been changed in an effort to improve the useful information density. It is hoped that this change will cause more useful information to be provided when people paste crash traces on Discord, since all the most important information is now at the top of the file.
- Version, git hash, PHP version and OS have been moved to the top of the crashdump.
- Backtrace has been moved above code sample.
- Docker images are now built by GitHub Actions (first live test).
## Technical
- The methods of `Inventory` and `BaseInventory` have been rearranged to improve coherency.
## Fixes
### API
- Enum members of enums created using `EnumTrait` are now able to have single-character names.
- Registry members of registries created using `RegistryTrait` or `CloningRegistryTrait` now have their names checked for invalid characters.
- `Entity::__construct()` now uses a guard variable to prevent it from being called multiple times unintentionally. This is necessary because `Entity::__construct()` has side effects.
- Fixed `PlayerItemHeldEvent` not being called when the content of the held slot was changed (e.g. replacing the held item via inventory menu).
### Gameplay
- Reduced the appearance of ghost items in unsupported gameplay scenarios using client prediction information. This fixes, for example, the appearance of ghost items when right-clicking on a filled flower pot.
# 4.2.6
Released 1st April 2022.
## Fixes
- Fixed buffer length underflow crash in `LoginPacket` handling.
# 4.2.7
Released 15th April 2022.
## General
- Added lots more documentation (in comments) about the `aliases` section in `pocketmine.yml`. You can read about this feature in the `aliases` section of the [updated `pocketmine.yml` template](/resources/pocketmine.yml).
- Improved wording of documentation of `PlayerPreLoginEvent`.
## Fixes
- Fixed core server crash when a plugin causes another plugin to be disabled during a scheduled task.
- Fixed core server crash when loading a plugin with an abstract main class.
- Fixed ghost items in many interaction situations (most notably, using projectiles while looking at an entity or block).
- Implemented a workaround for a client teleport bug which led to player positions not updating properly when using ender pearls.
- Fixed buggy movement when teleporting the player during `PlayerToggleSneakEvent`, `PlayerToggleSprintEvent`, `PlayerToggleSwimEvent` and `PlayerToggleGlideEvent`.
# 4.2.8
Released 17th April 2022.
## Fixes
- Fixed a memory leak in RakLib which could result in a server crash when players stay online for a long time.
- Fixed server crash when attempting to load a corrupted empty resource pack.
- Fixed users with the same name with differerently cased letters being able to duplicate items (userdata is matched by case-insensitive name).
# 4.2.9
Released 19th April 2022.
## Fixes
- Fixed several potential crashes when deserializing item NBT (due to insufficient validation of input data).
# 4.2.10
Released 20th April 2022.
## Fixes
- Fixed performance issue when chat messages received from the client contain many newlines. This security vulnerability was disclosed publicly necessitating a priority fix.

79
changelogs/4.20.md Normal file
View File

@ -0,0 +1,79 @@
**For Minecraft: Bedrock Edition 1.19.80**
### Note about API versions
Plugins which don't touch the `pocketmine\network\mcpe` namespace are compatible with any previous 4.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 `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
### Interim releases
If you're upgrading from 4.17.x directly to 4.20.x, please also read the following changelogs, as the interim releases contain important changes:
- [4.18.0](https://github.com/pmmp/PocketMine-MP/blob/4.20.0/changelogs/4.18.md#4180) - major performance improvements, internal network changes, minor API additions
- [4.19.0](https://github.com/pmmp/PocketMine-MP/blob/4.20.0/changelogs/4.19.md#4190) - minor performance improvements, improved timings system, minor API additions
# 4.20.0
Released 26th April 2023.
## General
- Added support for Minecraft: Bedrock Edition 1.19.80.
- Removed support for older versions.
## Fixes
- Fixed packet processing error when attempting to use a stonecutter.
- Fixed armor slots containing ghost items when cancelling right-click to equip armor.
- Fixed crash in `HandlerList->getListenersByPriority()` when no listeners are registered at the given priority.
## API
### `pocketmine\block`
- The following API methods have been added:
- `public BaseSign->getEditorEntityRuntimeId() : int` - returns the entity runtime ID of the player currently editing this sign, or `null` if none
- `public BaseSign->setEditorEntityRuntimeId(?int $editorEntityRuntimeId) : $this` - sets the entity runtime ID of the player currently editing this sign
### `pocketmine\player`
- The following API methods have been added:
- `public Player->openSignEditor(Vector3 $position) : void` - opens the client-side sign editor GUI for the given position
# 4.20.1
Released 27th April 2023.
## Fixes
- Fixed server crash when firing a bow while holding arrows in the offhand slot.
## Internals
- `ItemStackContainerIdTranslator::translate()` now requires an additional `int $slotId` parameter and returns `array{int, int}` (translated window ID, translated slot ID) to be used with `InventoryManager->locateWindowAndSlot()`.
- `InventoryManager->locateWindowAndSlot()` now checks if the translated slot actually exists in the requested inventory, and returns `null` if not. Previously, it would return potentially invalid slot IDs without checking them, potentially leading to crashes.
# 4.20.2
Released 4th May 2023.
## Fixes
- Fixed all types of wooden logs appearing as oak in the inventory.
- Fixed a performance issue in `BaseInventory->canAddItem()` (missing `continue` causing useless logic to run).
# 4.20.3
Released 6th May 2023.
## Improvements
- Reduced memory usage of `RuntimeBlockMapping` from 25 MB to 9 MB. Since every thread has its own copy of the block map, this saves a substantial amount of memory.
## Fixes
- Fixed players falling through blocks in spectator mode.
- Fixed timings reports getting bloated by prolific usage of `PluginManager->registerEvent()`.
- This was caused by creating a new timings handler for each call, regardless of whether a timer already existed for the given event and callback.
- Fixed `Full Server Tick` and other records being missing from timings reports.
- This was caused by timings handler depth not getting reset when timings was disabled and later re-enabled.
# 4.20.4
Released 6th May 2023.
## Fixes
- Fixed players being forced into flight mode in every game mode.
- Moral of the story: do not assume anything in Mojang internals does what its name suggests...
# 4.20.5
Released 30th May 2023.
## Fixes
- Fixed server crash due to a bug in upstream dependency [`netresearch/jsonmapper`](https://github.com/cweiske/JsonMapper).

77
changelogs/4.21.md Normal file
View File

@ -0,0 +1,77 @@
**For Minecraft: Bedrock Edition 1.19.80**
### Note about API versions
Plugins which don't touch the `pocketmine\network\mcpe` namespace, and don't use reflection or any internal methods,
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 `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
# 4.21.0
Released 17th May 2023.
## General
- PHP 8.1 is now required. Most plugins should run without changes, but some might need to be updated due to language-level deprecations.
- Ticking chunk count is now shown separately from loaded chunk count in the `/status` command, providing useful performance information.
- Further improved performance of ticking chunk selection.
- Improved performance of some inventory functions.
- Reduced server memory footprint in most cases by ~9 MB per thread.
- Due to large overhead, async network compression is now only used for packets larger than 10 KB by default.
## Configuration
- Added the following new `pocketmine.yml` configuration options:
- `network.async-compression-threshold` - minimum size of packet which will be compressed using `AsyncTask`
- Default is 10 KB, which means that very few packets will use async compression in practice. This is because the overhead of compressing async is currently so high that it's not worth it for smaller packets.
## Timings
- Timings reports no longer include the unused metadata fields `Entities` and `LivingEntities`.
- Timings reports now correctly calculate the peak time of a timer.
- Previously it was incorrectly recorded as the longest time spent in a single tick, rather than the longest time spent in a single activation.
- Timings report version has been bumped to `2` to reflect this change.
- All world-specific timers now have generic aggregate timings, making it much easier to locate performance patterns across all worlds.
## Gameplay
- Players in spectator mode are no longer able to pick blocks, and now have finite resources similar to survival mode.
## API
### `pocketmine\world`
- The following API methods have been added:
- `public World->getTickingChunks() : list<int>` - returns a list of chunk position hashes (a la `World::chunkHash()`) which are currently valid for random ticking
### `pocketmine\inventory`
- The following API methods have been added:
- `protected BaseInventory->getMatchingItemCount(int $slot, Item $test, bool $checkDamage, bool $checkTags) : int` - returns the number of items in the given stack if the content of the slot matches the test item, or zero otherwise
- This should be overridden if directly extending `BaseInventory` to provide a performance-optimised version. A slow default implementation is provided, but it will be removed in the future.
## Internals
### Entity
- Unused `NameTag` tag is no longer saved for `Human` entities.
### Inventory
- `BaseInventory` now uses a new internal method `getMatchingItemCount()` to locate items in the inventory without useless cloning. This improves performance of various API methods, such as `addItem()`, `contains()`, and more.
- Specialization of `Inventory->isSlotEmpty()` in `BaseInventory` subclasses has been added to improve performance of some API methods.
### Network
- `RuntimeBlockMapping` no longer keeps all block palette NBT data in memory.
- This significantly reduces server idle memory footprint.
- For multi-version implementations, this will have a significant impact on memory usage, since a different block palette is often required to support each version.
- NBT will be lazy-loaded into memory and cached if `getBedrockKnownStates()` is called. However, this is not used by PocketMine-MP under normal circumstances.
- Removed unnecessary usage of `Utils::validateCallableSignature()` from some internal network pathways, improving performance.
### Scheduler
- `AsyncPool` no longer double-checks progress updates on completed tasks.
### World
- Ticking chunks are now tracked in `World->validTickingChunks` and `World->recheckTickingChunks`.
- This allows avoiding rechecking every ticking chunk for validity during ticking chunk selection, improving performance.
- In some cases, this allows bypassing chunk selection entirely, reducing selection cost to zero.
- Registered but ineligible ticking chunks are no longer rechecked every tick.
- This was causing wasted cycles during async worker backlog.
- The internal system must call `markTickingChunkForRecheck()` whenever a ticking chunk's eligibility for ticking has potentially changed, rather than just when it has changed from a yes to a no.
# 4.21.1
Released 30th May 2023.
## Fixes
- Fixed server crash due to a bug in upstream dependency [`netresearch/jsonmapper`](https://github.com/cweiske/JsonMapper).

58
changelogs/4.22.md Normal file
View File

@ -0,0 +1,58 @@
# 4.22.0
Released 7th June 2023.
**For Minecraft: Bedrock Edition 1.20.0**
This is a support release for Minecraft: Bedrock Edition 1.20.0.
**Plugin compatibility:** Plugins for previous 4.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## Interim releases
If you're upgrading from 4.20.x directly to 4.22.x, please also read the following changelogs, as the interim releases contain important changes:
- [4.21.0](https://github.com/pmmp/PocketMine-MP/blob/4.22.0/changelogs/4.21.md#4210) - PHP 8.1 minimum version, minor performance improvements
## General
- Added support for Minecraft: Bedrock Edition 1.20.0.
- Removed support for older versions.
## Fixes
- Removed deprecated `ReflectionProperty::setAccessible()` calls.
- Fixed jukebox music not stopping when destroyed by an explosion.
# 4.22.1
Released 9th June 2023.
## Fixes
- Replaced workaround for an old teleporting client bug:
- This workaround broke due to an additional client bug introduced by 1.20, causing players to become frozen to observers when teleported.
- The original client bug has still not been fixed, meaning a new workaround was needed, but no perfect solution could be found.
- The new workaround involves broadcasting teleport movements as regular movements, which causes unwanted interpolation between the old and new positions, but otherwise works correctly. This solution is not ideal, but it is the best we can do for now.
- See issues [#4394](https://github.com/pmmp/PocketMine-MP/issues/4394) and [#5810](https://github.com/pmmp/PocketMine-MP/issues/5810) for more details.
# 4.22.2
Released 1st July 2023.
## Changes
- Added obsoletion warnings to the server log at the end of the startup sequence.
## Fixes
- Fixed players being disconnected en masse with "Not authenticated" messages.
- This occurred due to a check intended to disable the old authentication key after July 1st.
- We expected that the new key would have been deployed by Mojang by now, but it seems like that has not yet happened.
- Due to the lack of a hard date for the key changeover, we guessed that July 1st would be a safe bet, but this appears to have backfired.
- This version will accept both old and new keys indefinitely.
- A security release will be published to remove the old key after the transition occurs.
# 4.22.3
Released 11th July 2023.
## Fixes
- Fixed mishandling of NBT leading to a server crash when editing signs.
- Fixed an edge case crash that could occur in `AsyncTask->__destruct()` when thread-local storage referenced other `AsyncTask` objects.
## Internals
- Added a concurrency lock to prevent the `update-updater-api` GitHub Action from running for multiple releases at the same time (which would have caused one of them to fail due to git conflicts).

68
changelogs/4.23.md Normal file
View File

@ -0,0 +1,68 @@
# 4.23.0
Released 12th July 2023.
**For Minecraft: Bedrock Edition 1.20.10**
This is a support release for Minecraft: Bedrock Edition 1.20.10.
**Plugin compatibility:** Plugins for previous 4.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.20.10.
- Removed support for older versions.
## Fixes
- Fixed Docker image build failure due to outdated `build/php` submodule.
# 4.23.1
Released 14th July 2023.
## Fixes
- Hardened validation of JWT signing keys in `LoginPacket`.
- Fixed server crash due to a bug in upstream dependency [`netresearch/jsonmapper`](https://github.com/cweiske/JsonMapper).
# 4.23.2
Released 18th July 2023.
## Fixes
- Fixed login errors due to a new `sandboxId` field appearing in the Xbox Live authentication data in `LoginPacket`. All clients, regardless of version, are affected by this change.
# 4.23.3
Released 24th July 2023.
## Documentation
- Fixed typo in `ChunkSelector::selectChunks()` documentation.
## Fixes
- Fixed the server not stopping properly during crash conditions on *nix platforms.
- Fixed `HORSE_EQUIP` and `SMITHING_TABLE_TEMPLATE` container UI types not being handled by `ItemStackContainerIdTranslator`. This bug prevented plugins from implementing missing inventory types.
- Player emotes no longer broadcast messages to other players. This was unintended behaviour caused by a client-side behavioural change.
- Shulker boxes no longer support the placement of torches or other similar blocks.
- Fire can now be placed on upper slabs and the top of upside-down stairs.
# 4.23.4
Released 1st August 2023.
## Fixes
- Fixed exponentially increasing lag when many hundreds of non-mergeable dropped items occupied the same space. This disproportionately affected SkyBlock servers due to large cactus farms using water to collect items together.
# 4.23.5
Released 9th August 2023.
## General
- Updated translation data to [pmmp/Language 2.19.6](https://github.com/pmmp/Language/releases/tag/2.19.6).
## Fixes
- Fixed `PluginBase->saveResource()` leaking file resources when the data file already exists in the plugin's data folder. This bug existed since 2014 and was only discovered recently.
- Fixed coral blocks becoming dead after calling `getDropsForCompatibleTool()` on them.
- Fixed `BlockDeathEvent->getOldState()` returning a block which is already dead.
# 4.23.6
Released 21st August 2023.
## Fixes
- Added a workaround for armor and other inventories not working correctly after inventory sync. This is caused by a client bug.

17
changelogs/4.24.md Normal file
View File

@ -0,0 +1,17 @@
# 4.24.0
Released 20th September 2023.
**For Minecraft: Bedrock Edition 1.20.30**
This is a support release for Minecraft: Bedrock Edition 1.20.30.
**Plugin compatibility:** Plugins for previous 4.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.20.30.
- Removed support for older versions.
- Updated 4.x obsoletion message.

16
changelogs/4.25.md Normal file
View File

@ -0,0 +1,16 @@
# 4.25.0
Released 26th October 2023.
**For Minecraft: Bedrock Edition 1.20.40**
This is a support release for Minecraft: Bedrock Edition 1.20.40.
**Plugin compatibility:** Plugins for previous 4.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.20.40.
- Removed support for older versions.

16
changelogs/4.26.md Normal file
View File

@ -0,0 +1,16 @@
# 4.26.0
Released 6th December 2023.
**For Minecraft: Bedrock Edition 1.20.50**
This is a support release for Minecraft: Bedrock Edition 1.20.50.
**Plugin compatibility:** Plugins for previous 4.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.20.50.
- Removed support for older versions.

77
changelogs/4.3.md Normal file
View File

@ -0,0 +1,77 @@
**For Minecraft: Bedrock Edition 1.18.30**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.3.0
Released 20th April 2022.
## General
- Added support for Minecraft: Bedrock Edition 1.18.30.
- Removed support for older versions.
# 4.3.1
Released 23rd April 2022.
## Fixes
- Updated BedrockProtocol dependency to fix incorrect command argument types.
- Creative players no longer die in the void.
# 4.3.2
Released 10th May 2022.
## Fixes
- Fixed an assertion failure in certain edge cases during world generation.
- Fixed `Entity::setNameTagVisible()` not immediately showing results to players already online.
## Documentation
- Added more documentation in the template `pocketmine.yml` for the `aliases` config section.
- Removed useless doc comment in `PlayerChangeSkinEvent`.
# 4.3.3
Released 16th May 2022.
## General
- Improved display of parameters in exception stack trace logs.
- Exception stack traces now include names for dynamic named arguments (i.e. arguments that don't match any parameter of the function), if any were given.
- Note: Named arguments which do match parameters are not shown this way, since PHP reduces them to positional arguments for performance reasons.
## Fixes
- Fixed server crash when chunks are unloaded during chunk generation callbacks
- Fixed dead coral fan items placing coral fans in the wrong orientation.
- Fixed max stack size of boat items.
# 4.3.4
Released 22nd May 2022.
## Fixes
- Fixed `difficulty` in `server.properties` having no effect - it's now applied to newly generated worlds.
- Note: this setting still doesn't behave the same way as vanilla due to potential disruption to existing servers.
- Fixed paintings not working in newly generated worlds and some other cases.
- Fixed inventory window switching breaking the inventory UI in some cases (e.g. pressing E while clicking a chest).
- Fixed minecart items incorrectly stacking.
- Fixed incorrect light levels in translucent blocks at the top of the world.
- Fixed teleporting sleeping players causing broken behaviour on the sleeping player's client.
- Fixed `EntityExplodeEvent->setYield()` accepting values outside the range 0-100.
- Fixed `ExplosionPrimeEvent->setForce()` accepting negative values (later resulting in crashes).
## Documentation
- Updated documentation for the following events:
- `CommandEvent`
- `EntityDespawnEvent`
- `EntityExplodeEvent`
- `EntitySpawnEvent`
- `ExplosionPrimeEvent`
- `InventoryTransactionEvent`
- `ItemDespawnEvent`
- `ItemSpawnEvent`
- `PlayerCommandPreprocessEvent`
- `PlayerDropItemEvent`
- `PlayerItemHeldEvent`
- `PlayerKickEvent`
- `PlayerQuitEvent`
- `PlayerTransferEvent`
- `UpdateNotifyEvent`

77
changelogs/4.4-beta.md Normal file
View File

@ -0,0 +1,77 @@
**For Minecraft: Bedrock Edition 1.18.30**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.4.0-BETA1
Released 25th May 2022.
## General
- The server will now shut itself down if any of the following errors occur during startup:
- Any plugin fails to load or enable (plugins loaded by other plugins post-startup are **not** affected by this change) (**PR [#4951](https://github.com/pmmp/PocketMine-MP/pull/4951)**)
- The motivation for this change is to prevent situations where plugins failing to load could result in adverse outcomes, such as a world protection plugin leaving a lobby unprotected from griefing.
- If you encounter this problem, remove the offending plugin(s) or prevent it from loading using `plugin_list.yml`.
- See **PR [#4951](https://github.com/pmmp/PocketMine-MP/pull/4951)** for more detail on this change.
- Any world mentioned in `server.properties` or `pocketmine.yml` fails to load (worlds loaded by plugins are **not** affected by this change)
- Any world mentioned in `server.properties` or `pocketmine.yml` fails to generate (e.g. due to invalid generator settings)
- Enabling the server whitelist while the server is running (e.g. using `/whitelist on`) will now kick any non-whitelisted players currently on the server (**PR [#4774](https://github.com/pmmp/PocketMine-MP/pull/4774)**).
- Help for commands (`/help <name of command>`) now displays a list of aliases of that command.
- A CRITICAL log message is now generated if a plugin disables itself when enabling, in case the plugin doesn't emit any error of its own.
- The `/give` command now shows the alias used to find the given item in the success message, instead of the item ID/meta.
## Fixes
- Block placement has been fixed in many places where it previously didn't work correctly (**PR [#4886](https://github.com/pmmp/PocketMine-MP/pull/4886)**):
- torches on top of slabs, upside-down stairs
- torches on the back face of stairs
- flower pots on top of fences
- the list goes on and on ...
- Fixed backslash escapes not getting properly removed from commands in some cases.
- Fixed aliases defined in the `aliases` section of `pocketmine.yml` not being treated as quote-aware.
## Gameplay
- Plants in flower pots can now be removed by right-clicking on the flower pot.
- Leaves now have a 2% chance of dropping sticks when destroyed by hand (**PR [#5019](https://github.com/pmmp/PocketMine-MP/pull/5019)**).
- Food exhaustion now matches Bedrock 1.18.30 (**PR [#5034](https://github.com/pmmp/PocketMine-MP/pull/5034)**).
- Implemented Stonecutter block (**PR [#4732](https://github.com/pmmp/PocketMine-MP/pull/4732)**).
## API
### Block
- Added `Block->getSupportType(Facing) : SupportType` (**PR [#4886](https://github.com/pmmp/PocketMine-MP/pull/4886)**).
- This is used to determine the kind of support a block face can provide to a block (e.g. a torch) placed on it.
- Added `utils\SupportType` enum (**PR [#4886](https://github.com/pmmp/PocketMine-MP/pull/4886)**).
- `tile\Spawnable->isDirty()` and `tile\Spawnable->setDirty()` are now `@deprecated`.
### Command
- Added `CommandStringHelper::parseQuoteAware()`. This static method contains the code used by `SimpleCommandMap` used to parse quoted command arguments.
### Entity
- Added `Human::emote()` (**PR [#4610](https://github.com/pmmp/PocketMine-MP/pull/4610)**)
### Event
- `PlayerCommandPreprocessEvent` is now `@deprecated`, since its functionality is entirely replaced by other, general-purpose events.
- Use `CommandEvent` to intercept commands.
- Use `PlayerChatEvent` to intercept chat messages.
- To convert a chat message into a command, pass it directly to `Server->dispatchCommand()` with the player as sender.
- Added `PlayerPostChunkSendEvent` (**PR [#4937](https://github.com/pmmp/PocketMine-MP/pull/4937)**).
- Added `PlayerDeathEvent->setKeepXp()` (**PR [#4015](https://github.com/pmmp/PocketMine-MP/pull/4015)**).
- `InventoryCloseEvent` is now called **after** the target window has been removed. This fixes various feedback loops caused by trying to open new windows to a player while there was one still active.
- As a side effect, this now means that `Player->getCurrentWindow()` will return `null` during `InventoryCloseEvent`. Use `InventoryCloseEvent->getInventory()` instead.
### Item
- `StringToItemParser` now recognizes `cod`, `raw_cod` and `cooked_cod` aliases.
### Plugin
- `DisablePluginException` may now be thrown from `Plugin::onEnable()` to make the server gracefully disable the plugin (without crashing) (**PR [#4780](https://github.com/pmmp/PocketMine-MP/pull/4780)**).
- `PluginManager->registerEvent()` now returns the `RegisteredListener` created for the handler, to permit unregistering it later.
## Internals
- Private property declarations now use typed properties (PHP 7.4) and promoted constructor properties (PHP 8.0) wherever possible.
- Protected and public properties remain unchanged, since they can't be changed without breaking subclasses.
- Promoted constructor properties are only used when it's consistently possible to promote most or all properties in a class.
- Simplified and improved legibility of `FormattedCommandAlias`.
- Added unit tests for the quote-aware command parser used by `SimpleCommandMap`.
- Various hardcoded values in `block` package classes have been moved to private constants to improve readability.
- Added various constants used in the `LevelDB` world provider.

97
changelogs/4.4.md Normal file
View File

@ -0,0 +1,97 @@
**For Minecraft: Bedrock Edition 1.18.30**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.4.0
Released 1st June 2022.
## General
- The server will now shut itself down if any of the following errors occur during startup:
- Any plugin fails to load or enable (plugins loaded by other plugins post-startup are **not** affected by this change) (**PR [#4951](https://github.com/pmmp/PocketMine-MP/pull/4951)**)
- The motivation for this change is to prevent situations where plugins failing to load could result in adverse outcomes, such as a world protection plugin leaving a lobby unprotected from griefing.
- If you encounter this problem, remove the offending plugin(s) or prevent it from loading using `plugin_list.yml`.
- See **PR [#4951](https://github.com/pmmp/PocketMine-MP/pull/4951)** for more detail on this change.
- Any world mentioned in `server.properties` or `pocketmine.yml` fails to load (worlds loaded by plugins are **not** affected by this change)
- Any world mentioned in `server.properties` or `pocketmine.yml` fails to generate (e.g. due to invalid generator settings)
- Enabling the server whitelist while the server is running (e.g. using `/whitelist on`) will now kick any non-whitelisted players currently on the server (**PR [#4774](https://github.com/pmmp/PocketMine-MP/pull/4774)**).
- Help for commands (`/help <name of command>`) now displays a list of aliases of that command.
- A CRITICAL log message is now generated if a plugin disables itself when enabling, in case the plugin doesn't emit any error of its own.
- The `/give` command now shows the alias used to find the given item in the success message, instead of the item ID/meta.
## Fixes
- Block placement has been fixed in many places where it previously didn't work correctly (**PR [#4886](https://github.com/pmmp/PocketMine-MP/pull/4886)**):
- torches on top of slabs, upside-down stairs
- torches on the back face of stairs
- flower pots on top of fences
- the list goes on and on ...
- Fixed backslash escapes not getting properly removed from commands in some cases.
- Fixed aliases defined in the `aliases` section of `pocketmine.yml` not being treated as quote-aware.
## Gameplay
- Plants in flower pots can now be removed by right-clicking on the flower pot.
- Leaves now have a 2% chance of dropping sticks when destroyed by hand (**PR [#5019](https://github.com/pmmp/PocketMine-MP/pull/5019)**).
- Food exhaustion now matches Bedrock 1.18.30 (**PR [#5034](https://github.com/pmmp/PocketMine-MP/pull/5034)**).
- Implemented Stonecutter block (**PR [#4732](https://github.com/pmmp/PocketMine-MP/pull/4732)**).
## API
### Block
- Added `Block->getSupportType(Facing) : SupportType` (**PR [#4886](https://github.com/pmmp/PocketMine-MP/pull/4886)**).
- This is used to determine the kind of support a block face can provide to a block (e.g. a torch) placed on it.
- Added `utils\SupportType` enum (**PR [#4886](https://github.com/pmmp/PocketMine-MP/pull/4886)**).
- `tile\Spawnable->isDirty()` and `tile\Spawnable->setDirty()` are now `@deprecated`.
### Command
- Added `CommandStringHelper::parseQuoteAware()`. This static method contains the code used by `SimpleCommandMap` used to parse quoted command arguments.
### Entity
- Added `Human::emote()` (**PR [#4610](https://github.com/pmmp/PocketMine-MP/pull/4610)**)
### Event
- `PlayerCommandPreprocessEvent` is now `@deprecated`, since its functionality is entirely replaced by other, general-purpose events.
- Use `CommandEvent` to intercept commands.
- Use `PlayerChatEvent` to intercept chat messages.
- To convert a chat message into a command, pass it directly to `Server->dispatchCommand()` with the player as sender.
- Added `PlayerPostChunkSendEvent` (**PR [#4937](https://github.com/pmmp/PocketMine-MP/pull/4937)**).
- Added `PlayerDeathEvent->setKeepXp()` (**PR [#4015](https://github.com/pmmp/PocketMine-MP/pull/4015)**).
- `InventoryCloseEvent` is now called **after** the target window has been removed. This fixes various feedback loops caused by trying to open new windows to a player while there was one still active.
- As a side effect, this now means that `Player->getCurrentWindow()` will return `null` during `InventoryCloseEvent`. Use `InventoryCloseEvent->getInventory()` instead.
### Item
- `StringToItemParser` now recognizes `cod`, `raw_cod` and `cooked_cod` aliases.
### Plugin
- `DisablePluginException` may now be thrown from `Plugin::onEnable()` to make the server gracefully disable the plugin (without crashing) (**PR [#4780](https://github.com/pmmp/PocketMine-MP/pull/4780)**).
- `PluginManager->registerEvent()` now returns the `RegisteredListener` created for the handler, to permit unregistering it later.
## Internals
- Private property declarations now use typed properties (PHP 7.4) and promoted constructor properties (PHP 8.0) wherever possible.
- Protected and public properties remain unchanged, since they can't be changed without breaking subclasses.
- Promoted constructor properties are only used when it's consistently possible to promote most or all properties in a class.
- Simplified and improved legibility of `FormattedCommandAlias`.
- Added unit tests for the quote-aware command parser used by `SimpleCommandMap`.
- Various hardcoded values in `block` package classes have been moved to private constants to improve readability.
- Added various constants used in the `LevelDB` world provider.
# 4.4.1
Released 5th June 2022.
## General
- The server process will now exit with an error code if plugins, worlds or network interfaces failed to start.
## Fixes
- Fixed graylisted plugins preventing the server from starting.
- Fixed `composer make-devtools` command.
- Fixed the `Maximum memory (manager)` units being incorrectly displayed in `/status`.
- Fixed `Player->removeCurrentWindow()` breaking inventory windows.
# 4.4.2
Released 7th June 2022.
## Fixes
- Fixed a crash when arbitrary item IDs appeared in network items in some cases.
- Fixed saved paintings being deleted when loaded from disk (regression from 4.3.4).
- Fixed max stack size of fishing rods.

28
changelogs/4.5.md Normal file
View File

@ -0,0 +1,28 @@
**For Minecraft: Bedrock Edition 1.19.0**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.5.0
Released 7th June 2022.
## General
- Added support for Minecraft: Bedrock Edition 1.19.0.
- Removed support for older versions.
# 4.5.1
Released 8th June 2022.
## Fixes
- Fixed commands defined in `pocketmine.yml` `aliases` not passing the correct arguments.
- Updated BedrockProtocol to fix command argument types displayed on client-side command suggestions.
# 4.5.2
Released 29th June 2022.
## Fixes
- Fixed terrain getting redrawn when flying in spectator mode (or when using `Player->setHasBlockCollision(false)`).
- Fixed skulls with the `noDrops` flag set being treated as unknown blocks.

42
changelogs/4.6.md Normal file
View File

@ -0,0 +1,42 @@
**For Minecraft: Bedrock Edition 1.19.10**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.6.0
Released 13th July 2022.
## General
- Added support for Minecraft: Bedrock Edition 1.19.10.
- Removed support for older versions.
# 4.6.1
Released 22nd July 2022.
## Tools
- `build/generate-registry-annotations.php` now supports processing single files (useful for PhpStorm file watchers).
## API
- Updated documentation for `AsyncTask`.
## Fixes
- Fixed incorrect items being displayed in item frames.
- Fixed books not showing in lecterns.
- Fixed incorrect damage interval of Wither status effect.
- Fixed incorrect fire ticks when being set on fire by lava (8 seconds in Bedrock instead of 15).
- `Entity->attack()` now cancels damage from `FIRE` and `FIRE_TICK` damage causes if the entity is fireproof.
- Fixed inventory windows getting force-closed when the client attempts to use an enchanting table or anvil.
# 4.6.2
Released 6th August 2022.
## Core
- Improved server-side performance of `PlayerAuthInputPacket` handler.
- Improved client-side performance of `FloatingTextParticle` by using an invisible falling block entity. This offered a roughly 5x performance improvement over using tiny invisible players in local testing.
## Fixes
- Fixed assert failures and debug spam on debug Minecraft clients related to abilities in `AddPlayerPacket`.
- Fixed crash in `ReversePriorityQueue` on PHP 8.1 by adding `#[ReturnTypeWillChange]` attribute.

46
changelogs/4.7.md Normal file
View File

@ -0,0 +1,46 @@
**For Minecraft: Bedrock Edition 1.19.20**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.7.0
Released 9th August 2022.
## General
- Added support for Minecraft: Bedrock Edition 1.19.20.
- Removed support for older versions.
# 4.7.1
Released 14th August 2022.
## Fixes
- Fixed server crash when loading items from disk which have negative meta values.
- Fixed Turtle Master potions not giving any effects.
- Unimplemented items are no longer craftable.
- Fixed incorrect items appearing in item frames (due to an obsolete workaround for 1.19.10).
# 4.7.2
Released 16th August 2022.
## Fixes
- Fixed crash when processing player skins with invalid geometry data.
- Fixed spectator players being able to pick blocks using mousewheel click.
- Improved supporting requirements for sugarcane.
# 4.7.3
Released 22nd August 2022.
## General
- Added complete translations for Spanish and Vietnamese.
- All continuous integration (static analysis, unit tests, integration tests) are now performed on PHP 8.1 as well as 8.0.
- InventoryTransaction now verifies that stack sizes of items after the transaction don't exceed the maximum stack size of the item type or the containing inventory.
## Fixes
- Fixed Normal generator crash on PHP 8.1.
- Fixed a race condition during async worker shutdown that could lead to tasks executing in the wrong order. This (very rarely) led to a crash in `PopulationTask` due to its preceding `GeneratorRegisterTask` not being executed.
- Fixed `/give` accepting negative amounts or amounts larger than 32767 (vanilla max).
- Fixed placement conditions for vines (no longer able to be placed on the side of cacti).
- Fixed incorrect documentation of `SignText::__construct()`.

23
changelogs/4.8.md Normal file
View File

@ -0,0 +1,23 @@
**For Minecraft: Bedrock Edition 1.19.21**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.8.0
Released 24th August 2022.
## General
- Added support for Minecraft: Bedrock Edition 1.19.21.
- Removed support for older versions.
# 4.8.1
Released 26th August 2022.
## General
- Crashdumps now include JIT mode information for use by the Crash Archive.
## Fixes
- Fixed uninitialized offset error in `DyeColorIdMap` when given invalid dye color IDs.

36
changelogs/4.9.md Normal file
View File

@ -0,0 +1,36 @@
**For Minecraft: Bedrock Edition 1.19.30**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.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.
# 4.9.0
Released 20th September 2022.
## General
- Added support for Minecraft: Bedrock Edition 1.19.30.
- Removed support for older versions.
# 4.9.1
Released 11th October 2022.
## Documentation
- Added and improved documentation for many API methods in `Player` and `Block`.
- Added missing `@internal` tag for `TaskHandler->setNextRun()`, `TaskHandler->remove()` and `TaskHandler->run()`.
## Fixes
- Flight state is now locked by the server in spectator mode. This prevents any attempt by the client to toggle flight mode.
- Fixed entity health exceeding its max health after the expiry of Health Boost effect.
- Fixed burp sound not being played when a player eats food.
- Fixed placement conditions for mushrooms - they can now only be placed when the light level at the target is <= 12, or on podzol or mycelium.
- Fixed sign text appearing to change colour and/or glow when using dye on a sign - since this feature is not yet implemented, no change should occur.
- Fixed players drowning when sprint-swimming on the surface of water.
## Internals
- Added more detailed debug logging during the player login sequence.
- Silenced debug spam during `PreSpawnPacketHandler`, considerably reducing debug noise when players join.
- Fixed an edge case in `InventoryManager->removeWindow()`. This bug didn't have any effect on stable versions, but caused a `next-minor` development version to crash.
- `Item`s returned by event getters are now cloned if modifying the result will have no useful side effects.
- Updated `pocketmine/bedrock-data` to [`1.11.1`](https://github.com/pmmp/BedrockData/tree/1.11.1%2Bbedrock-1.19.30), which reduces bandwidth consumption during logins by not sending useless biome generation data.

1038
changelogs/5.0-alpha.md Normal file

File diff suppressed because it is too large Load Diff

215
changelogs/5.0-beta.md Normal file
View File

@ -0,0 +1,215 @@
**For Minecraft: Bedrock Edition 1.19.62**
5.0.0 is a major update to PocketMine-MP, including many new features and API changes. It is **not** compatible with plugins written for previous versions of PocketMine-MP.
**During the beta phase, no new features will be added.**
This stage of development is focused on stability and cleaning up any major issues introduced during the alpha stage.
## WARNING
**This is a BETA release.** This means that it may be unstable, and is not yet ready for production use.
Since this version has undergone substantial changes compared to 4.x, plugins written for 4.x will need to be updated to work on this version.
Breaking API changes may still occur during the beta phase, but only if they are strictly necessary to fix a problem prior to full release.
**BACK UP your data before testing this.** This version will work with worlds and player data from 4.x,
BUT any world or player data loaded in 5.0.0 will not work in 4.x due to backwards-incompatible storage format changes.
# 5.0.0-BETA1
Released 7th March 2023.
**This release includes changes from the following releases:**
- [All 5.0.0 alpha releases](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA1/changelogs/5.0-alpha.md)
- [4.15.2](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA1/changelogs/4.15.md#4152)
- [4.15.3](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA1/changelogs/4.15.md#4153)
- [4.16.0](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA1/changelogs/4.16.md#4160)
## API
### `pocketmine\block`
- Improved documentation for the following methods:
- `Block->getTypeId()`
- `Block->getStateId()`
- `Block->describeType()`
- `Block->describeState()`
### `pocketmine\command`
- The following API methods have been renamed:
- `Command->getPermission()` -> `Command->getPermissions()`
## Internals
- The following methods have been renamed:
- `Block->computeStateData()` -> `Block->computeTypeAndStateData()`
- `Block->decodeStateData()` -> `Block->decodeTypeAndStateData()`
- Wall state data now packs connections into 7 bits instead of 8.
# 5.0.0-BETA2
Released 11th April 2023.
**This release includes changes from the following releases:**
- [4.17.0](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.17.md#4170)
- [4.17.1](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.17.md#4171)
- [4.17.2](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.17.md#4172)
- [4.18.0](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.18.md#4180)
- [4.18.1](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.18.md#4181)
- [4.18.2](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.18.md#4182)
- [4.18.3](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.18.md#4183)
- [4.18.4](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.18.md#4184)
- [4.19.0](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.19.md#4190)
## Tools
- Added script `tools/generate-bedrock-data-from-packets.php`. This tool accepts a txt file containing base64-encoded packet dumps.
- This script has been used to generate data for [BedrockData](https://github.com/pmmp/BedrockData) for several years, but has only now been open-sourced.
- It's used to generate data such as crafting recipes, creative inventory data, and various other blobs of data needed to support the current version of Minecraft: Bedrock Edition.
## Gameplay
- Anvils now damage entities when they fall on top of them.
## API
### `pocketmine\block\utils`
- The following API interface requirements have been added (BC breaking):
- `public Fallable->getFallDamagePerBlock() : float` (default implementation provided by `FallableTrait`)
- `public Fallable->getMaxFallDamage() : float` (default implementation provided by `FallableTrait`)
### `pocketmine\data\bedrock\block`
- The following new API methods have been added:
- `public BlockStateData->getVersionAsString() : string`
#### `pocketmine\data\bedrock\block\upgrade\model`
- `BlockStateUpgradeSchemaModelBlockRemap` now accepts `null` for `oldState` and `newState`. This makes it easier to generate portable schemas for other languages to read.
### `pocketmine\event\entity`
- The following new API constants have been added:
- `EntityDamageEvent::CAUSE_FALLING_BLOCK`
- `EntityDamageEvent::MODIFIER_ARMOR_HELMET`
### `pocketmine\item`
- The following API methods have signature changes:
- `ItemTypeIds::toBlockTypeId()` may now return `null` if the item type ID is not a block.
### `pocketmine\player`
- The following classes have been removed:
- `PlayerChunkLoader` - deprecated in 4.19.0 (this was technically internal, but never marked as such)
## Internals
- Make use of `Item->canStackWith()` instead of `Item->equals()` wherever possible, to make the code more readable.
# 5.0.0-BETA3
Released 17th May 2023.
**This release includes changes from the following releases:**
- [4.19.1](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.19.md#4191)
- [4.19.2](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.19.md#4192)
- [4.19.3](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.19.md#4193)
- [4.20.0](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.20.md#4200)
- [4.20.1](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.20.md#4201)
- [4.20.2](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.20.md#4202)
- [4.20.3](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.20.md#4203)
- [4.20.4](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.20.md#4204)
- [4.21.0](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.21.md#4210)
## General
- Improved light propagation performance by 10-15%.
## Fixes
- Fixed late initialization of coral type in `BaseCoral`.
## Tools
- `tools/generate-blockstate-upgrade-schema.php` has the following improvements:
- Now generates better errors when inconsistent blockstate versions are encountered.
- Now generates more stable outputs when re-run on the same input.
- Output now uses `copiedState` in `remappedStates` where possible. This significantly reduces the size of the output for blocks with partially flattened states.
## Gameplay
- The following blocks have been added:
- Cave Vines
- The following items have been added:
- Glow Berries
- Mangrove Boat (incomplete)
- Fixed flower pots being able to be placed inside flower pots.
## API
### `pocketmine\block`
- The following API methods have been renamed:
- `Block->isSameType()` -> `Block->hasSameTypeId()`
- `Block->describeType()` -> `Block->describeBlockItemState()`
- `Block->describeState()` -> `Block->describeBlockOnlyState()`
- The following API methods have been removed:
- `Block->getRequiredTypeDataBits()`
- `Block->getRequiredStateDataBits()`
- The following API methods have been added:
- `public Block->generateStatePermutations() : \Generator<int, Block, void, void>` - yields all possible states this block type can be in (used for `RuntimeBlockStateRegistry`)
- The following API methods have signature changes:
- `Sapling::__construct()` now accepts `SaplingType $saplingType` instead of `TreeType $treeType`
- `RuntimeBlockStateRegistry->register()` no longer accepts an `$override` parameter.
- The following classes have been added:
- `utils\SaplingType` - enum of all sapling types
- `utils\TreeType` has been moved to `pocketmine\world\generator\object` namespace.
### `pocketmine\data\bedrock\item\upgrade`
- The following API methods have been added:
- `public ItemIdMetaUpgrader->getSchemas() : array<int, BlockStateUpgradeSchema>` - returns a list of loaded schemas indexed by schema ID
- `public ItemIdMetaUpgradeSchema->getRenamedIds() : array<string, string>` - returns a map of old ID -> new ID
- `public ItemIdMetaUpgradeSchema->getRemappedMetas() : array<string, array<int, string>>` - returns a map of old ID -> list of old meta -> new ID
### `pocketmine\event\block`
- The following API methods have been added:
- `public BlockGrowEvent->getPlayer() : ?Player` - returns the player that triggered the block growth, or `null` if it was not triggered by a player
- The following API methods have signature changes:
- `BlockGrowEvent::__construct()` now accepts an optional `?Player $player` parameter.
### `pocketmine\event\world`
- The following classes have been added:
- `WorldDisplayNameChangeEvent` - called when a world's display name is changed
### `pocketmine\item`
- `Boat` now uses a new `BoatType` enum instead of `TreeType`. This is because not all tree types have an associated boat type, and some boat types are not made from tree materials (e.g. bamboo raft).
- The following API methods have been removed:
- `Boat->getWoodType()`
- The following API methods have been added:
- `public Boat->getType() : BoatType`
- `public Item->getStateId() : int` - returns an encoded ID containing the item type ID and encoded item state
- The following API methods have been renamed:
- `Item->describeType()` -> `Item->describeState()`
- The following classes have been added:
- `BoatType` - enum of all boat types
- The following API methods have signature changes:
- `BoatType::__construct()` now accepts `BoatType $boatType` instead of `TreeType $woodType`.
### `pocketmine\world`
- The following API methods have been added:
- `public World->setDisplayName(string $name) : void`
### `pocketmine\world\format`
- Fixed outdated documentation for various methods of `Chunk`.
### `pocketmine\world\format\io\data`
- The following API interface requirements have been added:
- `public WorldData->setDisplayName(string $value) : void`
## Internals
- Reduced global usage in world providers. In the future, we want to have blockstate deserializers etc. injected rather than being global singletons.
- `BlockStateUpgrader` now always updates the blockstate version, even if no changes were made. PM itself doesn't require this, but it's useful for tools to know whether to upgrade the data again (e.g. in testing scenarios).
- `BlockStateDictionary` memory usage is now reduced from 9 MB to 3.5 MB using various techniques, including string reuse and binary-encoded states.
- `RuntimeBlockMapping` has been renamed to `BlockTranslator`.
- Singletons in the `pocketmine\network\mcpe\convert` package have been centralized under `TypeConverter`. In the future, this will be injected where needed, allowing different converters to be used for different sessions (useful for multiversion).
- Overriding of serializers and deserializers of items and blocks is now consistently disallowed. Due to the lack of a good reason to allow overriding built-in blocks and items, this is no longer allowed.
# 5.0.0-BETA4
Released 23rd May 2023.
## General
- [`ext-pmmpthread` version 6.0.0](https://github.com/pmmp/ext-pmmpthread/releases/6.0.0) (renamed from `ext-pthreads`) is now required. This version has API changes compared to pthreads v5. Please read the linked changelog for details.
- [`pocketmine/snooze` version 0.5.0](https://github.com/pmmp/Snooze/releases/0.5.0) is now required.
- `pocketmine/classloader` and `pocketmine/log-pthreads` packages have been removed. The relevant classes from these packages are now included in-house in the `pocketmine/thread` namespace.
- `BaseClassLoader` is replaced with `pocketmine\thread\ThreadSafeClassLoader`
- `ThreadedLogger` is replaced by `pocketmine\thread\ThreadSafeLogger`
- `AttachableThreadedLogger` is replaced by `pocketmine\thread\AttachableThreadSafeLogger`
- `ThreadedLoggerAttachment` is replaced by `pocketmine\thread\ThreadSafeLoggerAttachment`
## Fixes
- Fixed crash on unknown blocks due to late initialization of properties in `UnknownBlock`.
## API changes
### `pocketmine\scheduler`
- `AsyncTask->setResult()` now works with thread-safe objects. This was previously not possible due to limitations in the `pthreads` extension.

791
changelogs/5.0.md Normal file
View File

@ -0,0 +1,791 @@
# 5.0.0
Released 1st June 2023.
**For Minecraft: Bedrock Edition 1.19.80**
5.0.0 is a major feature update to PocketMine-MP, including support for Bedrock worlds from 1.13 onwards, a large array of new blocks and items, and various changes to the plugin API.
It is **not** compatible with plugins written for 4.x.y, and plugins may require code changes to work with it.
**As this changelog is quite large, its accuracy and completeness cannot be guaranteed.**
Make sure you're looking at the [latest revision](https://github.com/pmmp/PocketMine-MP/blob/stable/changelogs/5.0.md), as it may be amended after release.
## Core
- Worlds are now saved according to the Bedrock 1.19.80 format.
- Worlds generated by Bedrock from 1.13.0 and up are now supported (previously, only worlds up to 1.12 were supported).
- `/particle` now accepts strings for particle data instead of integers.
- `/particle` no longer accepts integers for block or item IDs.
- The usage of `blockcrack`, `iconcrack` and `blockdust` particle types in `/particle` now follows the same pattern as
other particle types, with the data for each being passed in the `data` parameter instead of being baked into the
particle name.
- Commands are now enabled by default in worlds exported from PocketMine-MP to Bedrock.
## Build system
- `build/generate-block-serializer-consts.php` has been added to generate `BlockTypeNames`, `BlockStateNames` and `BlockStateStringValues` in the `pocketmine\data\bedrock\block` package.
- `build/generate-item-type-names.php` has been added to generate `ItemTypeNames` in the `pocketmine\data\bedrock\item` package.
- `build/generate-runtime-enum-serializers.php` has been added to generate `RuntimeEnumSerializer`, `RuntimeEnumSerializerTrait`, and `RuntimeEnumSizeCalculatorTrait` in `pocketmine\data\runtime` package.
## Localization
- Localized disconnect messages are now used in the following cases:
- Server full
- Player not on the server whitelist
- Player on the server ban list
- Invalid skin
- Invalid username
- Kicked using `/kick`
- Banned using `/ban`
- Failure to find a safe spawn position
- Session open, session close and session player name discovery messages are now localized.
- All permissions now have localized descriptions. These are not currently used by PocketMine-MP, but may be useful for plugins.
## Performance
- Improved performance of dropping block inventory contents when the block is destroyed.
- Improved light propagation performance by 10-15%.
- [`ext-pmmpthread` version 6.0.0](https://github.com/pmmp/ext-pmmpthread/releases/tag/6.0.0) is now used, featuring significant performance improvements for thread-safe objects and various threading use-cases.
## Tools
- The following tool scripts have been added:
- `generate-block-palette-spec.php` - generates a JSON file with a readable overview of blocks, their state
properties, and their possible values
- `generate-blockstate-upgrade-schema.php` - generates JSON blockstate upgrade schemas like those found
in [BedrockBlockUpgradeSchema](https://github.com/pmmp/BedrockBlockUpgradeSchema)
- `generate-item-upgrade-schema.php` - generates JSON item ID/meta upgrade schemas like those found
in [BedrockItemUpgradeSchema](https://github.com/pmmp/BedrockItemUpgradeSchema)
- `generate-bedrock-data-from-packets.php` - generates various files for [BedrockData](https://github.com/pmmp/BedrockData)
- This script accepts a txt file containing base64-encoded packet dumps.
- This script has been in use for several years, but has only now been open-sourced.
- It's used to generate data such as crafting recipes, creative inventory data, and various other blobs of data needed to support the current version of Minecraft: Bedrock Edition.
## Gameplay
### Blocks
- Added the following new blocks:
- Amethyst Block
- Ancient Debris
- Azalea Leaves
- Basalt
- Blackstone blocks, slabs, stairs, and walls
- Cakes with Candle & Dyed Candle
- Calcite
- Candle & Dyed Candle
- Cartography Table (not currently usable due to maps not being implemented)
- Cauldron
- Cave Vines
- Chain
- Chiseled Deepslate
- Chiseled Nether Bricks
- Chiseled Polished Blackstone
- Chorus Flower
- Chorus Plant
- Cobbled Deepslate blocks, slabs, stairs, and walls
- Copper Ore
- Copper block (random oxidation not yet implemented)
- Crached Deepslate Tiles
- Cracked Deepslate Bricks
- Cracked Nether Bricks
- Cracked Polished Blackstone Bricks
- Crimson buttons, doors, fences, fence gates, hyphae, planks, pressure plates, signs, slabs, stairs, stems, and trapdoors
- Crying Obsidian
- Cut Copper block, stairs and slabs (random oxidation not yet implemented)
- Deepslate
- Deepslate Bricks blocks, slabs, stairs, and walls
- Deepslate Ores (coal, copper, diamond, emerald, gold, iron, lapis lazuli, redstone)
- Deepslate Tiles blocks, slabs, stairs, and walls
- Flowering Azalea Leaves
- Froglight (pearlescent, verdant, ochre)
- Gilded Blackstone
- Glow Item Frame
- Hanging Roots
- Honeycomb Block
- Light Block
- Lightning Rod
- Mangrove Leaves
- Mangrove Roots
- Mangrove buttons, doors, fences, fence gates, logs, planks, pressure plates, signs, slabs, stairs, trapdoors, and wood
- Mud Bricks blocks, slabs, stairs, and walls
- Muddy Mangrove Roots
- Nether Gold Ore
- Netherite Block
- Polished Basalt
- Polished Blackstone Bricks blocks, slabs, stairs, and walls
- Polished Blackstone blocks, buttons, pressure plates, slabs, stairs, and walls
- Polished Deepslate blocks, slabs, stairs, and walls
- Quartz Bricks
- Reinforced Deepslate
- Rooted Dirt
- Sculk
- Shroomlight
- Smithing Table
- Smooth Basalt
- Soul Fire
- Soul Lantern
- Soul Soil
- Soul Torch
- Spore Blossom
- Tinted Glass
- Tuff
- Twisting Vines
- Warped Wart Block
- Warped buttons, doors, fences, fence gates, hyphae, planks, pressure plates, signs, slabs, stairs, stems, and trapdoors
- Weeping Vines
- Wither Rose
- Added support for basalt generators
- Added support for dyeing sign text and making it glow.
- All-sided logs ("wood", for want of a better name) can now be placed in X, Y, and Z orientations.
- Coral and coral fans now behave correctly when placed out of water (they no longer immediately die).
- Fixed dead bush being able to be placed on some invalid blocks (e.g. stone).
- Fixed lava setting entities on fire for an incorrect duration (Java vs Bedrock inconsistency).
- Fixed sugarcane not being able to be placed on some blocks.
- Iron Ore and Gold Ore now drop Raw Iron and Raw Gold respectively, instead of the ore blocks.
- Item frames can now be placed on the top and bottom of blocks.
- Stripping logs by right-clicking them with an axe is now supported.
- TNT can now be ignited by fire charges.
- Vines can now only be placed on the side of full-cube blocks.
- Walls now connect when placed, following the pre-1.16 logic. (1.16 logic is planned to be implemented, but currently low priority.)
- Anvils are now damaged when they hit the ground after falling.
- Added missing sounds for anvils hitting the ground after falling.
- Anvils now damage entities when they fall on top of them.
### Items
- Added the following new items:
- Amethyst Shard
- Antidote (from Education Edition)
- Copper Ingot
- Disc Fragment (5)
- Echo Shard
- Elixir (from Education Edition)
- Eye Drops (from Education Edition)
- Fire Charge
- Glow Berries
- Glow Ink Sac
- Honey Bottle
- Honeycomb
- Mangrove Boat (incomplete)
- Music Disc (5)
- Music Disc (Otherside)
- Music Disc (Pigstep)
- Netherite Axe
- Netherite Boots
- Netherite Chestplate
- Netherite Helmet
- Netherite Ingot
- Netherite Leggings
- Netherite Pickaxe
- Netherite Scrap
- Netherite Shovel
- Netherite Sword
- Phantom Membrane
- Raw Copper
- Raw Gold
- Raw Iron
- Spyglass
- Suspicious Stew
- Tonic (from Education Edition)
- Glass bottles can now be filled with water by clicking on a water source block.
- Implemented Swift Sneak enchantment.
- Armour durability is now only reduced when the wearer receives a type of damage that the armour can protect against.
- Bells now ring when hit by a projectile.
### Worlds
- World height of -64 to 319 is now supported.
- Added support for 3D biomes. This isn't used by PocketMine-MP yet, but is necessary to be able to fully load 1.18 worlds.
## API
### General
- Union and mixed native parameter, return and property types are now used where appropriate.
- Protected and public properties now use native property types wherever possible.
- Parameter and return typehints have been applied in many places where it wasn't previously possible.
### Dependencies
- [`ext-pmmpthread` version 6.0.0](https://github.com/pmmp/ext-pmmpthread/releases/6.0.0) (renamed from `ext-pthreads`) is now required. This version features major API changes and improvements. Please read the [upgrading guide](https://github.com/pmmp/ext-pmmpthread/blob/fork/docs/UPGRADING_4.x_to_6.0.md) for details.
- [`pocketmine/snooze` version 0.5.0](https://github.com/pmmp/Snooze/releases/0.5.0) is now required.
- [`pocketmine/raklib` version 0.15.0](https://github.com/pmmp/RakLib/releases/0.15.0) is now required.
- [`pocketmine/raklib-ipc` version 0.2.0](https://github.com/pmmp/RakLibIpc/releases/0.2.0) is now required.
- `pocketmine/classloader` and `pocketmine/log-pthreads` packages have been removed. The relevant classes from these packages are now included in-house in the `pocketmine/thread` namespace.
- `BaseClassLoader` is replaced with `pocketmine\thread\ThreadSafeClassLoader`
- `ThreadedLogger` is replaced by `pocketmine\thread\ThreadSafeLogger`
- `AttachableThreadedLogger` is replaced by `pocketmine\thread\AttachableThreadSafeLogger`
- `ThreadedLoggerAttachment` is replaced by `pocketmine\thread\ThreadSafeLoggerAttachment`
- `webmozart/path-util` has been removed (replaced by [`symfony/filesystem`](https://github.com/symfony/filesystem)).
### `pocketmine\block`
#### Highlights
- Blocks no longer use internal Minecraft IDs and metadata to identify themselves. All APIs associated with legacy IDs
and meta have been removed.
- A new set of runtime IDs generated from `VanillaBlocks` is used to identify block types. These IDs are defined
in `BlockTypeIds`.
- These new IDs are used for runtime representation of blocks on chunks, and for type comparison purposes.
- Block type IDs are used at **runtime only**. **Do not store them in configs or databases**, as they are subject to
change without warning.
- Block type IDs are **specific to PocketMine-MP** and have no relation to the IDs used by Minecraft.
- Block type IDs cannot be negative
- Block type IDs must not be reused, even if overriding an already defined block
- Block state properties (e.g. facing, colour, etc.) are now represented by PM-specific state data instead of legacy
metadata. The state data consists of:
- Block-item state properties - retained by items when the block is broken (colour, wet/dry, coral type, etc.) - handled by `Block->describeBlockItemState()`
- Block-only state data - discarded when the block is broken (facing direction, lit/unlit, powered/unpowered, etc.) - handled by `Block->describeBlockOnlyState()`
- Chunks now store dynamic state ID derived from the runtime type ID and runtime (PocketMine-MP defined) state data.
- Introduced "type tags" concept, which allows marking certain blocks as having certain behaviours.
- The idea for this system was borrowed from the Minecraft Java tags system.
- It's still in very early concept stage, but is currently used for deciding which types of blocks plants can be placed on without needing to enumerate every single ID in every class, eliminating a bunch of boilerplate code and improving consistency.
- All `Block` descendents now accept `BlockTypeInfo` in the constructor, instead of `BlockBreakInfo`. This allows for future additions without needing to change dozens of overridden constructors.
- `&$returnedItems` reference parameter is now used in some places such as `Block->onInteract()` to enable actions to return items to players without caring about whether they are in creative or anything else.
- This eliminates boilerplate code of deciding whether to set the player's held item or not, as well as automatically dropping any overflow items that don't fit into the inventory.
- This is currently used when filling/emptying cauldrons using buckets or glass bottles.
- Dependency between `RuntimeBlockStateRegistry` (previously `BlockFactory`) and `VanillaBlocks` has been inverted.
- Now, blocks types are defined in `VanillaBlocks`
- `RuntimeBlockStateRegistry` automatically registers states for blocks defined in `VanillaBlocks`.
- Manual registration in `RuntimeBlockStateRegistry` is still required for custom blocks (see section below about registering new blocks).
- `RuntimeBlockStateRegistry` now has only one purpose - to map internal blockstate IDs to `Block` objects when reading blocks from chunks. It should not be used by plugins unless registering new blocks.
- To get a block at runtime, e.g. stone, use `VanillaBlocks::STONE()`
- To load a block from **old** config or database data:
1. Use `GlobalBlockStateHandlers::getUpgrader()->upgradeIntIdMeta()` to convert it to modern data
2. Pass the data to `GlobalBlockStateHandlers::getDeserializer()` to get a blockstate ID
3. Pass the blockstate ID to `RuntimeBlockStateRegistry::fromStateId()` to get a `Block` instance
- Prefer using `StringToItemParser` wherever possible for configs and databases (see `lookupAliases()` and `lookupBlockAliases()`).
#### Registering new blocks
##### In a plugin
To add a vanilla block in a plugin which isn't yet supported by PocketMine-MP, do the following:
1. Get a new type ID using `BlockTypeIds::newId()` - _you'll want to keep this in a property somewhere if you want to
compare using `getTypeId()` later_
2. Set up the block type somewhere - _this can be anywhere you like, e.g. a plugin main class property, but using
a `RegistryTrait` class is recommended - you'll need this later to create new instances of the block_
3. Register the block in `RuntimeBlockStateRegistry` - _this informs the server of all the block's possible states so
that it can be read from chunks at runtime_
4. Register a deserializer for the block's Minecraft ID in `BlockStateToObjectDeserializer` - _needed for the block to
be recognized when loaded from disk_
5. Register a serializer for the block in `BlockObjectToStateSerializer` - _needed for the block to be saved to disk,
and to be sent over the network_
6. Optionally, register a string alias for the block in `StringToItemParser` - _so that it can be given via `/give`_
To see a demo of how to do this in a plugin, see [this example plugin](https://github.com/pmmp/RegisterBlocksDemoPM5).
Registering custom blocks follows a similar process, but requires additional steps to modify `BlockStateDictionary`
which won't be covered here.
Since this is not currently officially supported by PocketMine-MP, this won't be covered here.
This is admittedly rather more of a hassle than in PM4, but this system offers significantly more flexibility than the
old system.
##### As a PocketMine-MP core contribution
To register a new vanilla block into the core, the process is slightly different:
1. Instead of using `BlockTypeIds::newId()`, add a new constant for the block to `BlockTypeIds`
2. Register the new block in `VanillaBlocks` - `RuntimeBlockStateRegistry` will automagically take notice of all blocks
defined in `VanillaBlocks`
3. Follow steps 4 onwards above
#### Change list
- The following classes have been removed:
- `BlockIdentifierFlattened`
- `BlockLegacyIdHelper`
- `BlockLegacyIds`
- `BlockLegacyMetadata`
- `utils\BlockDataSerializer`
- `utils\ColorInMetadataTrait` - `utils\ColoredTrait` now implements colour type data serialization uniformly
- `utils\InvalidBlockStateException` - this has been superseded by `pocketmine\data\runtime\InvalidSerializedRuntimeDataException`
- `utils\NormalHorizontalFacingInMetadataTrait` - `utils\HorizontalFacingTrait` now implements facing type data serialization uniformly
- `utils\PillarRotationInMetadataTrait` - `utils\PillarRotationTrait` now implements rotation type data serialization uniformly
- The following classes have been renamed:
- `BlockFactory` -> `RuntimeBlockStateRegistry` - this class is now exclusively used for mapping state IDs to block instances for runtime chunk block reading
- `Skull` -> `MobHead`
- `utils\SkullType` -> `utils\MobHeadType`
- `utils\TreeType` -> `pocketmine\world\generator\object\TreeType`
- The following classes have been added:
- `BaseCake`
- `BaseFire`
- `BlockTypeIds` - list of type IDs, one for each entry in `VanillaBlocks`
- `BlockTypeInfo`
- `BlockTypeTags`
- `CakeWithCandle`
- `CakeWithDyedCandle`
- `Candle`
- `CartographyTable`
- `Chain`
- `CopperOre`
- `CopperSlab`
- `CopperStairs`
- `Copper`
- `DyedCandle`
- `GildedBlackstone`
- `GoldOre`
- `HangingRoots`
- `IronOre`
- `Light`
- `LightningRod`
- `NetherGoldOre`
- `Sculk`
- `SmithingTable`
- `SoulFire`
- `WitherRose`
- `utils\CandleTrait`
- `utils\CopperOxidation`
- `utils\CopperTrait`
- `utils\SaplingType` - enum of all sapling types
- `utils\WallConnectionType` - enum of all possible wall connection types
- `utils\WoodTypeTrait`
- `utils\WoodType` - enum of all possible wood types, used for wood material blocks like planks and logs
- The following API methods have been removed:
- `Block->getId()` - for type comparisons, use `Block->getTypeId()` instead
- `Block->getMeta()` - for state comparisons, use `Block->getStateId()` instead
- `Block->getStateBitmask()`
- `Block->readStateFromData()`
- `Block->writeStateToItemMeta()`
- `Block->writeStateToMeta()`
- `BlockFactory->get()` - see notes above about `RuntimeBlockStateRegistry`
- `BlockIdentifier->getAllBlockIds()`
- `BlockIdentifier->getBlockId()`
- `BlockIdentifier->getItemId()`
- `BlockIdentifier->getVariant()`
- `Door->isPowered()`
- `Door->setPowered()`
- `MobHead->isNoDrops()` (previously `Skull->isNoDrops()`)
- `MobHead->setNoDrops()` (previously `Skull->setNoDrops()`)
- `VanillaBlocks::*_GLAZED_TERRACOTTA()` - use `VanillaBlocks::GLAZED_TERRACOTTA()->setColor(DyeColor::WHATEVER())` instead
- `utils\FallableTrait->getId()` is no longer required
- `utils\FallableTrait->getMeta()` is no longer required
- `utils\MobHeadType->getMagicNumber()` (previously `utils\SkullType->getMagicNumber()`)
- `utils\MobHeadType::fromMagicNumber()` (previously `utils\SkullType::fromMagicNumber()`)
- The following constants have been removed:
- `Block::INTERNAL_METADATA_BITS`
- `Block::INTERNAL_METADATA_MASK`
- The following API methods have been renamed:
- `Block->getFullId()` -> `Block->getStateId()`
- `Block->isSameType()` -> `Block->hasSameTypeId()`
- `MobHead->getSkullType()` -> `MobHead->getMobHeadType()` (previously `Skull->getSkullType()`)
- `MobHead->setSkullType()` -> `MobHead->setMobHeadType()` (previously `Skull->setSkullType()`)
- The following API methods have signature changes:
- `Block->onBreak()` now accepts `array<Item> &$returnedItems` reference parameter.
- `Block->onInteract()` now accepts `array<Item> &$returnedItems` reference parameter.
- `Block->readStateFromWorld()` now returns `Block` - this allows blocks to replace themselves with a different block entirely based on world conditions.
- `BlockIdentifier->__construct()` now accepts `int $blockTypeId`, and no longer accepts `int $blockId, int $variant, ?int $itemId`
- `ItemFrame->getFacing()` may now return `Facing::UP` and `Facing::DOWN`
- `ItemFrame->setFacing()` now accepts `Facing::UP` and `Facing::DOWN`
- `Leaves->__construct()` now accepts `LeavesType $leavesType` instead of `TreeType $treeType`
- `RuntimeBlockStateRegistry->register()` no longer accepts an `$override` parameter.
- `Sapling::__construct()` now accepts `SaplingType $saplingType` instead of `TreeType $treeType`
- `utils\SignText::__construct()` now accepts two new optional parameters: `?Color $baseColor` and `bool $glowing`
- `utils\SignText::fromBlob()` now accepts two new optional parameters: `?Color $baseColor` and `bool $glowing`
- The following API methods have been added:
- `protected Block->describeBlockOnlyState(RuntimeDataDescriber $w) : void` - describes state properties which are discarded when the block is broken or block-picked, such as facing, powered, etc.
- `public Block->describeBlockItemState(RuntimeDataDescriber $w) : void` - describes state properties which are kept by the item when the block is broken or block-picked, such as dye color
- `public Block->generateStatePermutations() : \Generator<int, Block, void, void>` - yields all possible states this block type can be in (used for `RuntimeBlockStateRegistry`)
- `public Block->getTypeTags() : array<string>`
- `public Block->hasTypeTag(string $tag) : bool`
- `public Block->isFireProofAsItem() : bool`
- `public Block->onProjectileHit(Projectile $projectile, RayTraceResult $hitResult) : void`
- `public BlockIdentifier->getBlockTypeId() : int` - returns the block's type ID according to `BlockTypeIds`
- `public Furnace->getFurnaceType() : utils\FurnaceType`
- `public GlazedTerracotta->getColor() : utils\DyeColor` (from `ColoredTrait`) - this was previously unsupported due to legacy limitations
- `public GlazedTerracotta->setColor(utils\DyeColor $color) : $this` (from `ColoredTrait`) - this was previously unsupported due to legacy limitations
- `public Leaves->getLeavesType() : utils\LeavesType` - returns the type of leaves
- `public Wall->getConnection(int $face) : utils\WallConnectionType`
- `public Wall->getConnections() : array<int, utils\WallConnectionType>` - returns the wall's connections and their types (see `utils\WallConnectionType`)
- `public Wall->isPost() : bool`
- `public Wall->setConnection(int $face, ?utils\WallConnectionType $type) : $this`
- `public Wall->setConnections()` - sets the wall's connections and their types (see `utils\WallConnectionType`)
- `public Wall->setPost(bool $post) : $this`
- `public Wood->isStripped() : bool`
- `public Wood->setStripped(bool $stripped) : $this`
- `public static BlockBreakInfo::axe(float $hardness, ?ToolTier $toolTier = null, ?float $blastResistance = null) : BlockBreakInfo`
- `public static BlockBreakInfo::pickaxe(float $hardness, ?ToolTier $toolTier = null, ?float $blastResistance = null) : BlockBreakInfo`
- `public static BlockBreakInfo::shovel(float $hardness, ?ToolTier $toolTier = null, ?float $blastResistance = null) : BlockBreakInfo`
- `public static BlockBreakInfo::tier(float $hardness, int $toolType, ToolTier $toolTier, ?float $blastResistance = null) : BlockBreakInfo`
- `public tile\Spawnable->getRenderUpdateBugWorkaroundStateProperties(Block $block) : array<string, Tag>` - allows spawnable tiles to spoof block state properties to work around client-side rendering bugs without actually changing the block server-side
- `public utils\SignText->getBaseColor() : \pocketmine\color\Color`
- `public utils\SignText->isGlowing() : bool`
- The following classes now use new traits, adding API methods and/or properties:
- `FenceGate` uses `utils\WoodTypeTrait`
- `GlazedTerracotta` uses `utils\ColoredTrait`
- `Planks` uses `utils\WoodTypeTrait`
- `Wood` uses `utils\WoodTypeTrait`
- `WoodenButton` uses `utils\WoodTypeTrait`
- `WoodenDoor` uses `utils\WoodTypeTrait`
- `WoodenFence` uses `utils\WoodTypeTrait`
- `WoodenPressurePlate` uses `utils\WoodTypeTrait`
- `WoodenSlab` uses `utils\WoodTypeTrait`
- `WoodenStairs` uses `utils\WoodTypeTrait`
- `WoodenTrapdoor` uses `utils\WoodTypeTrait`
- The following API interface requirements have been added (BC breaking):
- `public utils\Fallable->getFallDamagePerBlock() : float` (default implementation provided by `utils\FallableTrait`)
- `public utils\Fallable->getLandSound() : ?Sound` (default implementation provided by `utils\FallableTrait`)
- `public utils\Fallable->getMaxFallDamage() : float` (default implementation provided by `utils\FallableTrait`)
- `public utils\Fallable->onHitGround(FallingBlock $blockEntity) : bool` (default implementation provided by `utils\FallableTrait`)
### `pocketmine\command`
- Command permissions are now always checked by the server when running a command.
- This only affects commands implemented by extending `Command`. Plugins using `PluginBase->onCommand()` are not affected by this change, since they already had permissions checked by the server anyway.
- Previously, direct inheritors of `Command` were responsible for checking permissions, which required developers to duplicate the same code in every command, and opened lots of potential for security vulnerabilities.
- If you want to do something on permission denied (e.g. sending a special message, or audit logging), you can do so by overriding `Command->testPermission()`, instead of baking the code directly into `Command->execute()`.
- If you don't want to use permissions at all, just create a permission with a default of `true` (or belonging to `pocketmine.group.user`) and assign that.
- `SimpleCommandMap` now requires all commands to have a permission set when registered.
- If you actually want to allow everyone to use your command (not advised), you can add a new permission to the `pocketmine.group.user` group, or use `default: true` for `plugin.yml` permissions.
- The following API methods have changed behaviour:
- `Command->testPermissionSilent()` now returns `false` if there are no permissions associated with the command. This is to prevent commands with no permissions being usable by everyone, which has previously been a source of security issues.
- The following API methods have been added:
- `public Command->getPermissions() : list<string>` - returns a list of permissions which grant usage access to this command. A user with one or more of these permissions will be able to invoke the command's `execute()` method
- `public Command->setPermissions(list<string> $permissions) : void` - sets the permissions which grant usage access to this command. This should be used instead of `setPermission()` with `;` separators (which is now deprecated)
### `pocketmine\crafting`
- JSON models have been updated to reflect updated crafting data format.
- The following enum classes have new members:
- `ShapelessRecipeType` has new members `CARTOGRAPHY` and `SMITHING`
- The following classes have been added:
- `ExactRecipeIngredient` - matches an exact item
- `MetaWildcardRecipeIngredient` - matches an item with the given legacy Minecraft ID, but any metadata value
- `RecipeIngredient` interface
- `TagWildcardRecipeIngredient` - matches an item based on its Minecraft tags, e.g. `minecraft:wooden_tier`
- The following API methods have signature changes:
- `FurnaceRecipe->__construct()` now accepts `RecipeIngredient` instead of `Item`
- `FurnaceRecipe->getInput()` now returns `RecipeIngredient` instead of `Item`
- `PotionContainerChangeRecipe->__construct()` now accepts `string, RecipeIngredient, string` (using Minecraft string IDs instead of legacy integers).
- `PotionContainerChangeRecipe->getIngredient()` now returns `RecipeIngredient` instead of `Item`.
- `PotionContainerChangeRecipe->getInputItemId()` now returns `string` (using Minecraft string IDs instead of legacy integers).
- `PotionContainerChangeRecipe->getOutputItemId()` now returns `string` (using Minecraft string IDs instead of legacy integers).
- `PotionTypeRecipe->__construct()` now accepts `RecipeIngredient` instead of `Item`
- `PotionTypeRecipe->getIngredient()` now returns `RecipeIngredient` instead of `Item`
- `PotionTypeRecipe->getInput()` now returns `RecipeIngredient` instead of `Item`
- `ShapedRecipe->__construct()` now accepts `RecipeIngredient` instead of `Item`
- `ShapedRecipe->getIngredient()` now returns `?RecipeIngredient` instead of `?Item`
- `ShapedRecipe->getIngredientList()` now returns `RecipeIngredient[]` instead of `Item[]`
- `ShapedRecipe->getIngredientMap()` now returns `RecipeIngredient[][]` instead of `Item[][]`
- `ShapelessRecipe->__construct()` `$type` parameter is now mandatory.
- `ShapelessRecipe->__construct()` now accepts `RecipeIngredient` instead of `Item`
- `ShapelessRecipe->getIngredientList()` now returns `RecipeIngredient[]` instead of `Item[]`
### `pocketmine\data`
- New packages `bedrock\block` and `bedrock\item` have been added. These packages contain all the necessary code for loading and saving Bedrock blocks and items from disk.
- New package `runtime` has been added. This package contains code for serializing runtime data for blocks and items.
- `LegacyToStringBidirectionalIdMap` has been reduced to `LegacyToStringIdMap`.
- Since we never map from string ID to legacy ID, bidirectional mapping is no longer necessary.
- This affects the following subclasses:
- `LegacyBiomeIdToStringIdMap`
- `LegacyBlockIdToStringIdMap`
- `LegacyEntityIdToStringIdMap`
- `LegacyItemIdToStringIdMap`
- The following internal API methods have been added:
- `public LegacyToStringIdMap->add(string $string, int $legacy) : void` - adds a mapping from a custom legacy ID to custom string ID, needed for upgrading old saved data
### `pocketmine\entity`
- `Entity` now declares new abstract methods which must be implemented by subclasses:
- `public Entity->getInitialDragMultiplier() : float`
- `public Entity->getInitialGravity() : float`
- The following new API methods have been added:
- `public Living->getDisplayName() : string`
- The following API methods have changed signatures:
- `EntityFactory->register()` no longer accepts a `$legacyMcpeSaveId` parameter (now handled by internal conversions instead).
- The following API methods have been renamed:
- `Entity->isImmobile()` -> `Entity->hasNoClientPredictions()`
- `Entity->setImmobile()` -> `Entity->setNoClientPredictions()`
- The following internal fields have been renamed:
- `Entity->immobile` -> `Entity->noClientPredictions`
- The following classes have been removed:
- `EntityLegacyIds`
### `pocketmine\event`
- The following classes have inheritance changes:
- `block\BlockPlaceEvent` no longer extends `BlockEvent`, and therefore no longer has `getBlock()`. Use `getTransaction()` instead (may contain multiple blocks).
- `BlockFormEvent` now includes information about the block which caused the event.
- The following new classes have been added:
- `world\WorldDisplayNameChangeEvent` - called when a world's display name is changed
- The following classes have been renamed:
- `entity\ExplosionPrimeEvent` -> `entity\EntityPreExplodeEvent`
- The following API methods have been added:
- `public block\BlockFormEvent->getCausingBlock() : Block`
- `public block\BlockGrowEvent->getPlayer() : ?Player` - returns the player that triggered the block growth, or `null` if it was not triggered by a player
- `public block\BlockPlaceEvent->getTransaction() : BlockTransaction` - returns the transaction containing a list of changed block positions and the blockstates they will be changed to
- `public server\DataPacketSendEvent->setPackets(list<ClientboundPacket> $packets) : void`
- The following API methods have changed signatures:
- `block\BlockPlaceEvent->__construct()` now accepts `BlockTransaction $transaction` instead of `Block $blockPlace, Block $blockReplace`
- `entity\EntityPreExplodeEvent->__construct()` has the `$force` parameter renamed to `$radius`
- `entity\EntityPreExplodeEvent->getForce() : float` -> `entity\EntityPreExplodeEvent->getRadius() : float`
- `entity\EntityPreExplodeEvent->setForce(float $force) : void` -> `entity\EntityPreExplodeEvent->setRadius(float $radius) : void`
- The following API methods have been removed:
- `block\BlockPlaceEvent->getBlockReplaced()` - this information is now provided in the `BlockTransaction` object returned by `BlockPlaceEvent->getTransaction()`
- The following new API constants have been added:
- `entity\EntityDamageEvent::CAUSE_FALLING_BLOCK`
- `entity\EntityDamageEvent::MODIFIER_ARMOR_HELMET`
### `pocketmine\event\player`
- `PlayerPreLoginEvent`, `PlayerDuplicateLoginEvent` and `PlayerKickEvent` now supports setting separate log reasons (disconnect reason) and disconnect screen messages.
- The following classes have been removed:
- `PlayerCommandPreprocessEvent`
- The following API methods have changed signatures:
- `PlayerDuplicateLoginEvent->getDisconnectMessage()` now returns `Translatable|string` instead of `string`
- `PlayerDuplicateLoginEvent->setDisconnectMessage()` now accepts `Translatable|string` instead of `string`
- `PlayerKickEvent->getReason()` now returns `Translatable|string` instead of `string`
- `PlayerKickEvent->setReason()` now accepts `Translatable|string` instead of `string`
- `PlayerLoginEvent->getKickMessage()` now returns `Translatable|string` instead of `string`
- `PlayerLoginEvent->setKickMessage()` now accepts `Translatable|string` instead of `string`
- `PlayerPreLoginEvent->getFinalKickMessage()` now returns `Translatable|string` instead of `string`
- `PlayerPreLoginEvent->getKickMessage()` now returns `Translatable|string|null` instead of `string|null`
- `PlayerPreLoginEvent->setKickFlag()` (previously `setKickReason()`) now accepts `Translatable|string $disconnectReason, Translatable|string|null $disconnectScreenMessage = null` instead of `Translatable|string $message`
- `PlayerPreLoginEvent->setKickReason()` now accepts `Translatable|string` for the `$message` parameter instead of `string`
- `PlayerQuitEvent->getQuitReason()` now returns `Translatable|string` instead of `string`
- The following API methods have been removed:
- `PlayerChatEvent->getFormat()` (use `PlayerChatEvent->getChatFormatter()` instead)
- `PlayerChatEvent->setFormat()` (use `PlayerChatEvent->setChatFormatter()` instead)
- `PlayerDuplicateLoginEvent->getDisconnectMessage()` - replaced by `getDisconnectReason()` and `getDisconnectScreenMessage()`
- `PlayerDuplicateLoginEvent->setDisconnectMessage()` - replaced by `setDisconnectReason()` and `setDisconnectScreenMessage()`
- `PlayerKickEvent->getReason()` - replaced by `getDisconnectReason()` and `getDisconnectScreenMessage()`
- `PlayerKickEvent->setReason()` - replaced by `setDisconnectReason()` and `setDisconnectScreenMessage()`
- The following new API methods have been added:
- `public PlayerChatEvent->getChatFormatter() : \pocketmine\player\chat\ChatFormatter` - returns the chat formatter to be used for this event
- `public PlayerChatEvent->setChatFormatter(\pocketmine\player\chat\ChatFormatter $formatter) : void` - sets the chat formatter to be used for this event
- `public PlayerDeathEvent->getDeathScreenMessage() : Translatable|string` - returns the message to be displayed on the death screen
- `public PlayerDeathEvent->setDeathScreenMessage(Translatable|string $deathScreenMessage) : void` - sets the message to be displayed on the death screen
- `public PlayerDuplicateLoginEvent->getDisconnectReason() : Translatable|string` - returns the reason for the disconnection displayed in the console and server log
- `public PlayerDuplicateLoginEvent->getDisconnectScreenMessage() : Translatable|string|null` - returns the message to be displayed on the disconnect screen (the message in `getDisconnectReason()` is used if null is returned)
- `public PlayerDuplicateLoginEvent->setDisconnectReason(Translatable|string $disconnectReason) : void` - sets the reason for the disconnection displayed in the console and server log
- `public PlayerDuplicateLoginEvent->setDisconnectScreenMessage(Translatable|string|null $disconnectScreenMessage) : void` - sets the message to be displayed on the disconnect screen (the message in `setDisconnectReason()` is used if null is passed)
- `public PlayerKickEvent->getDisconnectReason() : Translatable|string` - returns the reason for the disconnection displayed in the console and server log
- `public PlayerKickEvent->getDisconnectScreenMessage() : Translatable|string|null` - returns the message to be displayed on the disconnect screen (the message in `getDisconnectReason()` is used if null is returned)
- `public PlayerKickEvent->setDisconnectReason(Translatable|string $disconnectReason) : void` - sets the reason for the disconnection displayed in the console and server log
- `public PlayerKickEvent->setDisconnectScreenMessage(Translatable|string|null $disconnectScreenMessage) : void` - sets the message to be displayed on the disconnect screen (the message in `setDisconnectReason()` is used if null is passed)
- `public PlayerPreLoginEvent->getDisconnectScreenMessage(int $flag) : Translatable|string|null` - returns the message to be displayed on the disconnect screen for the specified kick flag, if set
- `public PlayerPreLoginEvent->getFinalDisconnectScreenMessage() : Translatable|string|null` - returns the message to be displayed on the disconnect screen, taking into account the kick flags set
- The following classes have inheritance changes:
- `PlayerPreLoginEvent` no longer implements `Cancellable`. This caused unexpected behaviour for most plugin devs due to default-ignoring cancelled events, forcing people to usually have to use `@handleCancelled` to handle the event when they wanted to use it.
- The following API constants have been renamed:
- `PlayerPreLoginEvent::KICK_REASON_BANNED` -> `PlayerPreLoginEvent::KICK_FLAG_BANNED`
- `PlayerPreLoginEvent::KICK_REASON_PLUGIN` -> `PlayerPreLoginEvent::KICK_FLAG_PLUGIN`
- `PlayerPreLoginEvent::KICK_REASON_PRIORITY` -> `PlayerPreLoginEvent::KICK_FLAG_PRIORITY`
- `PlayerPreLoginEvent::KICK_REASON_SERVER_FULL` -> `PlayerPreLoginEvent::KICK_FLAG_SERVER_FULL`
- `PlayerPreLoginEvent::KICK_REASON_SERVER_WHITELISTED` -> `PlayerPreLoginEvent::KICK_FLAG_SERVER_WHITELISTED`
- The following API methods have been renamed:
- `PlayerPreLoginEvent->clearAllKickReasons()` -> `PlayerPreLoginEvent->clearAllKickFlags()`
- `PlayerPreLoginEvent->clearKickReason()` -> `PlayerPreLoginEvent->clearKickFlag()`
- `PlayerPreLoginEvent->getFinalKickMessage()` -> `PlayerPreLoginEvent->getFinalDisconnectReason()` (now used for logs only, if a disconnect screen message is set for the highest priority flag)
- `PlayerPreLoginEvent->getKickMessage()` -> `PlayerPreLoginEvent->getDisconnectReason()` (now used for logs only, if a disconnect screen message is set for the flag)
- `PlayerPreLoginEvent->getKickReasons()` -> `PlayerPreLoginEvent->getKickFlags()`
- `PlayerPreLoginEvent->isKickReasonSet()` -> `PlayerPreLoginEvent->isKickFlagSet()`
- `PlayerPreLoginEvent->setKickReason()` -> `PlayerPreLoginEvent->setKickFlag()`
### `pocketmine\item`
#### Highlights
- `ItemFactory` has been removed. Vanilla item registration is now done via `VanillaItems`.
- To get an item at runtime, e.g. iron ingot, use `VanillaItems::IRON_INGOT()`
- To get a block as an item, e.g. stone, use `VanillaBlocks::STONE()->asItem()`
- To load an item from legacy ID and meta:
1. Use `GlobalItemDataHandlers::getUpgrader()->upgradeItemTypeDataInt()` to convert the legacy ID and meta to `SavedItemStackData`
2. Pass the itemstack data to `GlobalItemDataHandlers::getDeserializer()` to get an `Item` instance
- Items no longer use internal Minecraft string IDs and metadata to identify themselves. All APIs associated with legacy
IDs and/or meta have been removed.
- A new set of runtime item IDs generated from `VanillaItems` is now used to identify item types. These IDs are defined
in `ItemTypeIds`.
- These new IDs are primarily intended for type comparison purposes.
- Item type IDs are used at **runtime only**. They should **NOT** be stored in configs or databases, as they are not
guaranteed to remain the same between versions.
- In some cases, items may have additional "type data" which provides extra type information about an item. This
replaces item metadata in some cases.
- Type data may be used to store dynamic type information such as dye colour, potion type, etc.
- Items must have the same type ID **and** type data in order to be stackable.
- Blocks, when represented as items:
- retain their block type data, but not state data (for example, different colours of concrete don't stack, but things
like facing don't affect stackability)
- use the negative of their block type ID (e.g. a block with type ID `1` will have an item type ID of `-1`).
- Durable items (e.g. tools, armour) now use NBT `Damage` tag to store durability (like Minecraft 1.13+), instead of
legacy meta values.
- `&$returnedItems` reference parameter is now used in some places (e.g. `onInteractBlock()`) to enable actions to return items to players without caring about whether they are in creative or anything else.
- This eliminates boilerplate code of deciding whether to set the player's held item or not, as well as automatically dropping any overflow items that don't fit into the inventory.
- This is used for things like filling/emptying buckets and bottles, and equipping armor.
- Blocks which previously had separate items, such as mob heads and beds, no longer do. Their item form can be acquired using `Block->asItem()` in the same way as every other block. This is facilitated by the new serializer system.
#### Implementing new items
##### In a plugin
This follows a similar process to registering blocks.
1. Get a new type ID using `ItemTypeIds::newId()` - _you'll want to keep this in a property somewhere if you want to
compare using `getTypeId()` later_
2. Set up the item type somewhere - _this can be anywhere you like, e.g. a plugin main class property, but using
a `RegistryTrait` class is recommended - you'll need this later to create new instances of the item_
3. Register a deserializer in `ItemDeserializer` - _needed for the item to be recognized when loaded from disk_
4. Register a serializer in `ItemSerializer` - _needed for the item to be saved to disk, and to be sent over the
network_
5. Optionally, register a string alias for the item in `StringToItemParser` - _so that it can be given via `/give`_
To see a demo of how to do this in a plugin, see [this example plugin](https://github.com/pmmp/RegisterBlocksDemoPM5).
Again, it's acknowledged this is rather more cumbersome than it should be, but this is an ongoing process.
##### As a PocketMine-MP core contribution
To register a new vanilla item into the core, the process is slightly different:
1. Instead of using `ItemTypeIds::newId()`, add a new constant for the block to `ItemTypeIds`
2. Register the new item in `VanillaItems`
3. Follow steps 3 onwards from the plugin instructions above
#### Change list
- `Item` is no longer `json_encode()`-able.
- The original purpose of this was to allow items to be serialized to JSON for crafting data generated from `CraftingDataPacket`. Due to changes in the generation methodology, bypassing `Item`s entirely, this is no longer necessary.
- In addition, `jsonSerialize()` required the item to know about the method by which it will be serialized (since there is no way to inject context), creating a cyclic dependency between the `Item` implementation and its serialization method.
- It's relatively easy to write a replacement method to encode items to JSON as you desire.
- `Item::legacyJsonDeserialize()` (previously `Item::jsonDeserialize()`) is retained to allow loading legacy data, although it may be removed in the future.
- The following classes have been removed:
- `Bed`
- `ItemFactory`
- `ItemIds`
- `Skull`
- The following classes have been added:
- `BoatType` - enum of all boat types
- `CoralFan`
- `HoneyBottle`
- `MedicineType`
- `Medicine`
- `Spyglass`
- `SuspiciousStewType`
- `SuspiciousStew`
- The following API methods have been added:
- `protected Item->describeState(RuntimeDataDescriber $w) : void`
- `public Armor->clearCustomColor() : $this` - clears the custom color of an armor item
- `public ArmorTypeInfo->getToughness() : int`
- `public ArmorTypeInfo->isFireProof() : bool`
- `public Boat->getType() : BoatType`
- `public Dye->setColor(\pocketmine\block\utils\DyeColor $color) : $this`
- `public Item->getStateId() : int` - returns a runtime numeric state ID for comparisons including information such as coral type, dye color, etc. - DO NOT save this to disk or databases
- `public Item->getTypeId() : int` - returns a runtime numeric type ID for comparisons - DO NOT save this to disk or databases
- `public Item->isFireProof() : bool`
- `public ItemIdentifer->getTypeId() : int`
- `public Potion->setType(PotionType $type) : $this`
- `public SplashPotion->setType(PotionType $type) : $this`
- `public StringToItemParser->lookupAliases(Item $item) : list<string>` - returns a list of all registered aliases for the given item
- `public StringToItemParser->lookupBlockAliases(Block $block) : list<string>` - returns a list of all registered aliases for the given block
- `public static ItemIdentifier::fromBlock(Block $block) : self`
- The following API methods have been removed:
- `Boat->getWoodType()`
- `Item->getId()` - for type comparisons, use `Item->getTypeId()` instead
- `Item->getMeta()` - use the item's specific API methods to compare information such as colour, potion type etc.
- `Item->hasAnyDamageValue()` - for meta wildcard recipe ingredients, use `pocketmine\crafting\MetaWildcardRecipeIngredient` instead
- `ItemIdentifier->getId()`
- `ItemIdentifier->getMeta()`
- The following API methods have been renamed:
- `Item::jsonDeserialize()` -> `Item::legacyJsonDeserialize()`
- The following API methods have signature changes:
- `ArmorTypeInfo->__construct()` now accepts optional parameters `int $toughness` and `bool $fireProof`
- `BoatType::__construct()` now accepts `BoatType $boatType` instead of `TreeType $woodType`.
- `Item->onAttackEntity()` now accepts `array<Item> &$returnedItems` reference parameter.
- `Item->onClickAir()` now accepts `array<Item> &$returnedItems` reference parameter.
- `Item->onDestroyBlock()` now accepts `array<Item> &$returnedItems` reference parameter.
- `Item->onInteractBlock()` now accepts `array<Item> &$returnedItems` reference parameter.
- `Item->onReleaseUsing()` now accepts `array<Item> &$returnedItems` reference parameter.
- `ItemIdentifier->__construct()` no longer accepts a `$variant` parameter, and now expects an item type ID for the ID parameter
- `LegacyStringToItemParser->addMapping()` now accepts a string for ID, instead of an integer
- The following API methods have behaviour changes:
- `Item->equals()`'s `$checkDamage` parameter is now ignored, as tool damage is now stored as an NBT tag. This parameter wasn't removed due to being followed by a second `bool` parameter, which would potentially end up in the wrong place and silently cause bugs in updated plugins.
- `Item->equals()`'s `$checkTags` parameter will now cause tool and armor damage to be checked if true.
- The following enums have new members:
- `ToolTier` has new member `NETHERITE`
### `pocketmine\network`
- The following API methods have changed signatures:
- `NetworkSessionManager->close()` now accepts an additional `Translatable|string|null $disconnectScreenMessage` parameter.
- The following API methods have changed signatures:
- `query\QueryInfo->getPlayerList()` now returns `list<string>` instead of `list<Player>`
- `query\QueryInfo->setPlayerList()` now accepts `list<string>` instead of `list<Player>`
### `pocketmine\player`
- The following API methods have changed signatures:
- `Player->disconnect()` now accepts `Translatable|string` for `$reason` instead of `string` (to allow localized disconnect messages)
- `Player->disconnect()` now accepts an additional `Translatable|string|null $disconnectScreenMessage` parameter, which is the message to be displayed on the disconnect screen (the message in `$reason` is used if null is passed)
- `Player->kick()` now accepts `Translatable|string` for `$reason` instead of `string` (to allow localized kick messages)
- `Player->kick()` now accepts an additional `Translatable|string|null $disconnectScreenMessage` parameter, which is the message to be displayed on the disconnect screen (the message in `$reason` is used if null is passed)
- `Player->sendJukeboxPopup()` now accepts `Translatable|string` instead of `string, string[]`
- The following classes have been removed:
- `PlayerChunkLoader` - deprecated in 4.19.0 (this was technically internal, but never marked as such)
### `pocketmine\player\chat`
- The following new classes have been added:
- `ChatFormatter` - interface implemented by chat formatters - this is far more powerful than the old API
- `LegacyRawChatFormatter` - implements the same behaviour previously used by `PlayerChatEvent->setFormat()`
- `StandardChatFormatter` - formats chat messages in the vanilla Minecraft style
### `pocketmine\scheduler`
- `AsyncTask->setResult()` now works with thread-safe objects. This was previously not possible due to limitations in the `pthreads` extension.
### `pocketmine\world`
- The following API methods have been added:
- `public World->setDisplayName(string $name) : void`
- The following API methods have changed signatures:
- `Explosion->__construct()` has the `$size` parameter renamed to `$radius`
- The following public properties have been renamed:
- `Explosion->size` -> `Explosion->radius`
### `pocketmine\world\format`
- Chunks are now considered dirty (modified) by default, unless loaded from a `WorldProvider` by `World`. Previously, chunks were considered unmodified by default, which allowed several pathways to bugs.
- The following classes have been added:
- `io\GlobalBlockStateHandlers` - gives access to block data serializer, deserializer, and upgraders
- `io\GlobalItemDataHandlers` - gives access to item data serializer, deserializer, and upgraders
- `io\LoadedChunkData` - represents a chunk loaded from disk, along with information such as whether the chunk was upgraded and what fixes it requires
- The following new API methods have been added:
- `public SubChunk->getBiomeArray() : PalettedBlockArray`
- The following classes have been removed:
- `BiomeArray` - `PalettedBlockArray` is now used for 3D biome data
- The following API methods have changed signatures:
- `Chunk->getBiomeId()` now accepts `int $x, int $y, int $z` instead of `int $x, int $z`
- `Chunk->setBiomeId()` now accepts `int $x, int $y, int $z` instead of `int $x, int $z`
- `Chunk->__construct()` no longer accepts `BiomeArray` as a parameter (contained in each subchunk instead)
- `SubChunk->__construct()` now accepts `int $emptyBlockId, list<PalettedBlockArray> $blockLayers, PalettedBlockArray $biomes, ?LightArray $blockLight, ?LightArray $skyLight` instead of `int, list<PalettedBlockArray>, ?LightArray, ?LightArray`
- `io\WorldProvider->loadChunk()` now returns `LoadedChunkData` instead of `ChunkData`
- `io\WorldProvider->getAllChunks()` now yields `LoadedChunkData` instead of `ChunkData`
- `io\ChunkData->__construct()` now accepts `array<int, SubChunk>, bool $populated` instead of `Chunk $chunk`
- The following API methods have been renamed:
- `Chunk->getFullBlock()` -> `Chunk->getBlockStateId()`
- `Chunk->setFullBlock()` -> `Chunk->setBlockStateId()`
- `SubChunk->getFullBlock()` -> `SubChunk->getBlockStateId()`
- `SubChunk->setFullBlock()` -> `SubChunk->setBlockStateId()`
- The following API interface requirements have been added:
- `public io\data\WorldData->setDisplayName(string $value) : void`
### `pocketmine\world\generator\object`
- The following API methods have been removed:
- `TreeType::fromMagicNumber()`
- `TreeType->getMagicNumber()`
### `pocketmine\world\sound`
- The following classes have been added:
- `CopperWaxApplySound`
- `CopperWaxRemoveSound`
- `DyeUseSound`
- `InkSacUseSound`
- The following enums have new members:
- `NoteInstrument` has new members `BELL`, `FLUTE`, `CHIME`, `XYLOPHONE`, `IRON_XYLOPHONE`, `COW_BELL`, `DIDGERIDOO`, `BIT`, `BANJO`, `PLING`
- The following API methods have been removed:
- `NoteInstrument::fromMagicNumber()`
- `NoteInstrument->getMagicNumber()`
## Internals
- All external usages of `KnownTranslationKeys` are now removed. All localized messages are now sent using `Translatable` objects (usually from `KnownTranslationFactory`).
- All usages of NBT keys now use class constants instead of hardcoded strings (except for an occasional overlooked one).
- Built-in commands now declare their names inside the class constructor, rather than accepting them as parameters. This improves code consistency.
- Commands now use an array for permissions internally, instead of a string separated by `;`.
- Make use of `Item->canStackWith()` instead of `Item->equals()` wherever possible, to make the code more readable.
- Moved command timings to `Timings`.
- Overriding of serializers and deserializers of items and blocks is now consistently disallowed. Since overriding stuff is non-cooperative, it doesn't make any sense in plugins, which must coexist with other plugins. If you want to modify the functionality of built-in stuff, you have several alternative options:
- Use existing API (e.g. events, API methods) - most uses of overrides in PM4 and earlier were abuses that could have been done with events
- Submit feature proposals or pull requests for new API to be added (e.g. new events)
- Register completely custom items, and reuse behaviour from the item you want to mimic
- Fork PocketMine-MP and alter the code directly - this way your plugins aren't pretending to be cooperative with other plugins
- `level.dat`, block, item, entity, tile and chunk data are now tagged with a version ID as per `VersionInfo::WORLD_DATA_VERSION`. This allows the server to apply fixes to older worlds if necessary.
- Protocol creative inventory entries are now cached in `CreativeInventoryCache` to improve performance of initial join and game mode changes.
- Singletons in the `pocketmine\network\mcpe\convert` package have been centralized under `TypeConverter`. In the future, this will be injected where needed, allowing different converters to be used for different sessions (useful for multiversion).
- `BlockStateDictionary` memory usage is now reduced from 9 MB to 3.5 MB using various techniques, including string reuse and binary-encoded states.
- `NetworkSession` disconnect APIs now accept `Translatable|string` instead of `string` to allow localized disconnect messages.
- `NetworkSession` disconnect methods have been altered to allow specifying a different disconnect reason and disconnection screen message.
- `RuntimeBlockMapping` has been renamed to `BlockTranslator`.
# 5.0.1
Released 3rd June 2023.
## Changes
- [`ext-pmmpthread` version 6.0.1](https://github.com/pmmp/ext-pmmpthread/releases/tag/6.0.1) is now required (for bug fixes).
## Fixes
- Fixed server crash when breaking blocks placed in the same session (mishandled default block states).
- Fixed spore blossoms not dropping when broken.
- Fixed jukebox music not stopping when destroyed by an explosion.
## Documentation
- Added documentation for `BlockSpreadEvent->__construct()` parameters.

52
changelogs/5.1.md Normal file
View File

@ -0,0 +1,52 @@
# 5.1.0
Released 7th June 2023.
**For Minecraft: Bedrock Edition 1.20.0**
This is a support release for Minecraft: Bedrock Edition 1.20.0.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.20.0.
- Removed support for older versions.
# 5.1.1
Released 7th June 2023.
## Fixes
- Fixed blockstates being saved with the wrong version ID for 1.20.0.
# 5.1.2
Released 9th June 2023.
**This release includes changes from the following releases:**
- [4.22.1](https://github.com/pmmp/PocketMine-MP/blob/4.22.1/changelogs/4.22.md#4221) - Teleportation client bug workarounds
This release contains no other changes.
# 5.1.3
Released 1st July 2023.
**This release includes changes from the following releases:**
- [4.22.2](https://github.com/pmmp/PocketMine-MP/blob/4.22.2/changelogs/4.22.md#4222) - Authentication time bomb fix
## General
- Updated logos to new RGB-style logo. Thanks to @MrCakeSlayer and @HBIDamian for their efforts.
- Improved error messages generated by the world system when some version tags are missing from `level.dat` in Bedrock worlds.
- Outsourced Composer dependencies now only receive patch updates automatically (pinned using the `~` constraint).
- Minor and major updates now require manually updating `composer.json`, to ensure that the plugin API is not broken by libraries getting randomly updated from one patch release to the next.
## Documentation
- Updated doc comment for `Player->setGamemode()` to remove outdated information.
- Added documentation for the `$clickVector` parameter of `Block->onInteract()` to specify that it is relative to the block's position.
- Added missing `@required` tag for `BlockStateUpgradeSchemaModelBlockRemap->newState`.
## Fixes
- Fixed blue candles not appearing in the creative inventory.
- Fixed server crash when block-picking candle cakes.
- `World->useItemOn()` now ensures that the `$clickVector` components are always in the range of 0-1. Previously, any invalid values were accepted, potentially leading to a crash.

46
changelogs/5.10.md Normal file
View File

@ -0,0 +1,46 @@
# 5.10.0
Released 14th December 2023.
**For Minecraft: Bedrock Edition 1.20.50**
This is a minor feature release, including new gameplay features and minor performance improvements.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- PHP 8.2 is now used by default. PHP 8.1 is still supported, but will be removed in a future 5.x release.
- Improved timings reports by removing `Breakdown` timings group. This group serves no purpose with tree timings and made for confusing reading.
## Performance
- Improved performance of `Block::encodeFullState()` in most conditions. This in turn improves performance of `World::setBlock()` and `World::setBlockAt()`.
- Improved network compression performance by avoiding unnecessary object allocations.
- Timings now report time spent in individual `Snooze` handlers, making it easier to debug performance issues.
## Gameplay
### Blocks
- Implemented crop growth speed modifiers.
- The following things now positively affect crop growth speed:
- Being planted on or being adjacent to farmland (hydrated farmland offers a larger benefit than dry farmland)
- Potential light level of at least 9
- Being planted in rows with space between them (or a different type of crop)
- The following things now negatively affect crop growth speed:
- Improper arrangement (e.g. the same crop on all sides)
- Insufficient light level (below 9)
- Poorly arranged crops will grow slower in this version. Past versions behaved as if crops were always planted in ideal conditions.
- Crops planted in ideal conditions will grow at the same speed as before.
### Items
- Added the following new items:
- All types of Smithing Template
- Pitcher Pod is now correctly registered. In previous versions, it was mapped to the Pitcher Crop block, causing incorrect name display in commands.
## Internals
- Cleaned up various getter usages where direct property access is possible.
- Avoided unnecessary repeated getter calls in some loops.
- `NetworkSession` may now track `string` instead of `CompressBatchPromise` when a batch was synchronously compressed. This significantly reduces object allocations and improves performance.
- `NetworkSession` now sends less information to clients on login validation failure. This avoids leaking potentially sensitive error information to clients.
- Clients can correlate their disconnects with server-side logs using the `Error ID` shown on the disconnect screen.

45
changelogs/5.11.md Normal file
View File

@ -0,0 +1,45 @@
# 5.11.0
Released 7th February 2024.
**For Minecraft: Bedrock Edition 1.20.60**
This is a support release for Minecraft: Bedrock Edition 1.20.60.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.20.60.
- Removed support for earlier versions.
## Fixes
- Fixed `tools/generate-item-upgrade-schema.php` not correctly handling items whose IDs were changed multiple times.
- Fixed `ServerKiller` not working correctly in some cases (incorrectly handled wake-up conditions).
- `ItemBlock`s of `Air` blocks are now always considered as "null" items regardless of count, and don't occupy inventory slots.
## Internals
- Restructured GitHub Actions CI workflows to make them easier to maintain (no need to update PHP versions in multiple places anymore).
- GitHub Actions CodeStyle workflow now uses php-cs-fixer 3.49.x.
- Dependabot updates are now processed weekly instead of daily.
# 5.11.1
Released 23rd February 2024.
## Fixes
- Fixed subchunk count calculation in `ChunkSerializer` for non-overworld dimension (useful for dimension plugins).
- Harden options used for processing JSON data, particularly on the network, to close security issues.
## Documentation
- Fixed PHPStan signature for `Utils::cloneObjectArray()`.
## Internals
- Updated GitHub Actions versions to get rid of deprecation warnings.
# 5.11.2
Released 26th February 2024.
## Fixes
- Added extra checks for `BookEditPacket` handling.

63
changelogs/5.12.md Normal file
View File

@ -0,0 +1,63 @@
# 5.12.0
Released 28th February 2024
**For Minecraft: Bedrock Edition 1.20.60**
This is a minor feature release, with a few new features and improvements.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added a `--version` command-line option to display the server version and exit.
## Tools
- Added `tools/generate-biome-ids.php` to generate `pocketmine\data\bedrock\BiomeIds`.
- Fixed ordering of property values generated by `tools/generate-block-palette-spec.php`.
## API
### `pocketmine\block`
- The following new classes have been added:
- `utils\LightableTrait` - used by blocks with `getLit()` and `setLit()` methods
- The following methods have been deprecated:
- `Block->isSolid()` - this method returns confusing results which don't match expectations and no one really knows what it actually means
- `CocoaBlock` now extends `Flowable` to match vanilla Minecraft behaviour.
### `pocketmine\plugin`
- `PluginManager->registerEvent()` now throws an exception when given a generator function for the event handler.
- `PluginManager->registerEvents()` now throws an exception if any of the detected event handlers are generator functions. Use `@notHandler` to have the function ignored if intended.
### `pocketmine\promise`
- The following methods have been added:
- `public static Promise::all(list<Promise> $promises) : Promise` - returns a promise that is resolved once all given promises are resolved, or is rejected if any of the promises are rejected.
### `pocketmine\scheduler`
- The following methods have been deprecated:
- `AsyncWorker->getFromThreadStore()` - use class static properties for thread-local storage
- `AsyncWorker->removeFromThreadStore()`
- `AsyncWorker->saveToThreadStore()`
## Documentation
- Improved documentation of various methods in `Block`.
## Gameplay
- The following new items have been added:
- Name Tag
## Internals
- Removed specialization of shutdown logic for `Thread` vs `Worker` (no specialization is required).
- Authentication system no longer accepts logins signed with the old Mojang root public key.
- ID to enum mappings in `pocketmine\data` now use a new `match` convention to allow static analysis to ensure that all enum cases are handled.
- Updated version of `pocketmine/bedrock-protocol` allows avoiding decoding of some itemstack data from the client in most cases, improving performance.
# 5.12.1
Released 13th March 2024.
## Fixes
- Fixed `Player Network Receive - Decompression` timings not being stopped correctly when receiving an uncompressed packet.
## Internals
- Removed hardcoded batch packet size limit. This was already covered by other limits anyway.

16
changelogs/5.13.md Normal file
View File

@ -0,0 +1,16 @@
# 5.13.0
Released 13th March 2024.
**For Minecraft: Bedrock Edition 1.20.70**
This is a support release for Minecraft: Bedrock Edition 1.20.70.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.20.70.
- Removed support for earlier versions.

94
changelogs/5.14.md Normal file
View File

@ -0,0 +1,94 @@
# 5.14.0
Released 5th April 2024.
**For Minecraft: Bedrock Edition 1.20.70**
This is a minor feature release, including performance improvements, minor gameplay features, new API features, and various internal improvements.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for a `--no-log-file` command-line option, which disables the creation of a `server.log` file.
- **Use this with caution.** If you don't have another mechanism for collecting logs (e.g. Docker), this may make debugging harder.
- Added support for automatic `server.log` rotation. When the `server.log` exceeds 32 MB, it will be renamed and moved to the `log_archive` folder in the server's data directory.
- Files in the `log_archive` folder can be safely modified or deleted without stopping the server.
- We suggest a cron job or similar to manage old log files (e.g. deleting or compressing them).
- Added a new cache mechanism for `PocketMine-MP.phar`. This has several advantages:
- Caches are now reused by all threads - this significantly reduces `/tmp` usage (previously every thread generated its own cache, wasting lots of space)
- Dead cache files are automatically cleaned up by new servers - this means that a server crash loop won't flood `/tmp` anymore
- `/status` now reports a more accurate number of threads on Windows.
- Large resource packs are now able to be properly downloaded from the server.
- Larger player skin sizes are now accepted by the server.
- Improved logging from world providers to reduce spam when chunks contain invalid data.
- Added more error logging for Anvil, PMAnvil and MCRegion worlds.
- PHP deprecation warnings no longer cause the server to crash. This should make it easier for server owners to update to newer PHP versions.
## Performance
- Improved world loading performance. This was achieved through a combination of changes:
- Improvements to `BlockStateUpgrader` to avoid unnecessary work
- Improvements to `BlockStateUpgradeSchema` to clean up stupid code
- Improvements to `BlockStateReader` unused state handling
- Optimizations to `RegistryTrait` (see below)
- Improved performance of `RegistryTrait::__callStatic()` accessor by introducing a fast-path optimization. Ensure that you access registries with the correct function name case to benefit from this.
- This improves the performance of `VanillaBlocks::WHATEVER()`, `VanillaItems`, etc.
## Tools
- `tools/generate-blockstate-upgrade-schema.php` now supports generating schemas using `flattenedValueRemaps` (described in [BlockStateUpgradeSchema](https://github.com/pmmp/BedrockBlockUpgradeSchema/releases/tag/4.0.0)).
## Gameplay
- Added sounds for armour equipping and unequipping.
- Added sound for picking berries from a sweet berry bush.
## API
### `pocketmine\block\utils`
- The following enum cases have been added:
- `BannerPatternType::GLOBE`
- `BannerPatternType::PIGLIN`
### `pocketmine\event\player`
- The following classes have been added:
- `PlayerResourcePackOfferEvent` - called before the server tells a connecting client which resource packs are available to download - allows customizing the pack list and other options
### `pocketmine\item`
- The following API methods have been added:
- `public ArmorMaterial->getEquipSound() : ?\pocketmine\world\Sound` - returns the sound to play when this armour is equipped or unequipped
- The following API methods have signature changes:
- `ArmorMaterial->__construct()` now accepts an optional `?Sound $equipSound` parameter
### `pocketmine\utils`
- The following API methods have signature changes:
- `MainLogger->__construct()` now accepts `null` for the `$logFile` parameter - this disables the creation of a logger thread and log file
- `MainLogger->__construct()` now accepts an optional `?string $logArchiveDir` parameter. If set, this enables log archiving in the specified directory when the current log file exceeds 32 MB.
## Dependencies
- Now uses [`pocketmine/bedrock-block-upgrade-schema` version 4.0.0](https://github.com/pmmp/BedrockBlockUpgradeSchema/releases/tag/4.0.0).
- Now uses [`pmmp/ext-pmmpthread` version 6.1.0](https://github.com/pmmp/ext-pmmpthread/releases/tag/6.1.0).
- Now uses [`pocketmine/errorhandler` version 0.7.0](https://github.com/pmmp/ErrorHandler/releases/tag/0.7.0).
- Now uses [`pocketmine/raklib` version 1.1.0](https://github.com/pmmp/RakLib/releases/tag/1.1.0).
- Now uses [`pocketmine/raklib-ipc` version 1.0.0](https://github.com/pmmp/RakLibIpc/releases/tag/1.0.0).
## Internals
- (Re)Added support for RakLib packet ACK receipts. This was used to throttle resource pack sending and prevent network overloading.
- Added `NetworkSession->sendDataPacketWithReceipt()` to make use of this feature.
- `PacketSender` now requires an additional `?int $receiptId` parameter.
- `ResourcePackPacketHandler` now uses `sendDataPacketWithReceipt()` to send resource packs, and delays sending the next chunk until the current one is acknowledged.
- `ResourcePackPacketHandler` now accepts resource pack info directly in the constructor, instead of `ResourcePackManager`. This eases the implementation of `PlayerResourcePackOfferEvent`.
- Increased `ZlibCompressor::DEFAULT_MAX_DECOMPRESSION_SIZE` to 8 MB (previously 2 MB). While this weakens server security, it appears to be necessary to deal with extremely bloated Persona skins.
- Increased max split packet parts accepted by `RakLib` to 512 (previously 128). Again, this is necessary to deal with extremely bloated Persona skins.
- Added a new cache mechanism for `PocketMine-MP.phar`.
- `ext-phar`'s default mechanism is extremely wasteful (generating a separate cache file per thread), and doesn't clean up after itself.
- The new cache mechanism is shared between all threads, and automatically cleans up stale caches.
- The phar stub (`build/server-phar-stub.php`) now converts the phar contents into a `.tar`, and decompresses all the files into `$TMPDIR/PocketMine-MP-phar-cache.<random>/`.
- `phar://` URIs still work with this system, but `new Phar(__FILE__)` must be replaced by `new PharData(__FILE__)` within PocketMine-MP core code.
- Backtraces from a `phar`'d server will now point to a location in the extracted phar cache, rather than the phar itself.
- `block_factory_consistency_check` test (actually for `RuntimeBlockStateRegistry`) now stores less data, and is no longer affected by changes to internal state ID construction.
# 5.14.1
Released 5th April 2024.
## Fixes
- Fixed incorrect `pmmpthread` version check in server bootstrap.

16
changelogs/5.15.md Normal file
View File

@ -0,0 +1,16 @@
# 5.15.0
Released 25th April 2024.
**For Minecraft: Bedrock Edition 1.20.80**
This is a support release for Minecraft: Bedrock Edition 1.20.80.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.20.80.
- Removed support for earlier versions.

26
changelogs/5.16.md Normal file
View File

@ -0,0 +1,26 @@
# 5.16.0
Released 13th June 2024.
**For Minecraft: Bedrock Edition 1.21.0**
This is a support release for Minecraft: Bedrock Edition 1.21.0.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.21.0.
- Removed support for earlier versions.
- Generated permission docs are now included with every release.
- Crash throttle message (which appears when the server crashed after being up for less than 120 seconds) now shows the server uptime as well as the wait time. This should make it clearer how the wait time is decided.
## Tools
- Added `install-local-protocol.sh` script. This allows installing local copies of protocol dependencies without needing to create releases. Useful for integration testing when doing protocol updates.
## Fixes
- Attacking an entity with a higher damage weapon while it's on attack cooldown from a lower damage weapon (switching) no longer causes additional knockback to the victim.
- Wooden stairs can now be used as fuel in furnaces.
- Fixed incorrect description of the permission `pocketmine.command.save.perform`.

38
changelogs/5.17.md Normal file
View File

@ -0,0 +1,38 @@
# 5.17.0
Released 10th July 2024.
**For Minecraft: Bedrock Edition 1.21.2**
This is a support release for Minecraft: Bedrock Edition 1.21.2.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.21.2.
- Removed support for earlier versions.
## API
### `pocketmine\player`
- The following methods have been added:
- `public function closeAllForms() : void` - closes the current viewing form and forms in queue.
## Fixes
- Bowl can now be used as fuel.
- Bells always drops themselves even when using an incompatible tool.
# 5.17.1
Released 13th August 2024.
## Documentation
- Added a note about `BlockStateData::CURRENT_VERSION`.
## Fixes
- Fixed anvil placement rotation to match vanilla.
- Fixed outdated `BedrockWorldData` version, this was preventing use newer worlds.
## Internals
- Dependabot: PHPStan and patch updates are now grouped into a single PR.

79
changelogs/5.2.md Normal file
View File

@ -0,0 +1,79 @@
# 5.2.0
Released 4th July 2023.
**For Minecraft: Bedrock Edition 1.20.0**
This is a minor technical update, including changes to AsyncTask error handling and support for BedrockBlockUpgradeSchema version 3.0.0.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## Core
- [BedrockBlockUpgradeSchema version 3.0.0](https://github.com/pmmp/BedrockBlockUpgradeSchema/releases/tag/3.0.0) is now supported.
- [`ext-pmmpthread` version 6.0.4](https://github.com/pmmp/ext-pmmpthread/releases/tag/6.0.4) is now required (bug fixes required to support technical changes in this release).
## Performance
- Improved performance of `AsyncPool->submitTask()` and `AsyncPool->submitTaskToWorker()`.
- Added new timings for `AsyncTask->onProgressUpdate()` and `AsyncTask->onCompletion()`.
## Gameplay
### Blocks
- Added the following new blocks:
- Cherry Button
- Cherry Door
- Cherry Fence
- Cherry Fence Gate
- Cherry Leaves
- Cherry Log
- Cherry Planks
- Cherry Pressure Plate
- Cherry Sign
- Cherry Slab
- Cherry Stairs
- Cherry Trapdoor
- Cherry Wood
- Glow Lichen
- Piglin Head
## Tools
- `generate-block-upgrade-schema.php` now supports generating schemas a la BedrockBlockUpgradeSchema version 3.0.0, using `newFlattenedName` to reduce schema size.
- Improved property remapping detection in `generate-block-upgrade-schema.php`. It now detects related properties with more confidence (even when multiple properties were change), and no longer considers unrelated properties as mapped (e.g. `mapped_type` and `deprecated` in 1.9->1.10).
## API
### `pocketmine\data\bedrock\block`
- The following new API methods have been added:
- `public BlockStateData->toVanillaNbt() : CompoundTag` - returns the NBT for the blockstate without any PMMP extra metadata (`toNbt()` will normally include a `PMMPDataVersion` tag).
### `pocketmine\data\runtime`
- The following new API methods have been added:
- `public RuntimeDataDescriber->facingFlags(list<int> $faces) : void`
### `pocketmine\scheduler`
- `AsyncTask->onRun()` no longer tolerates uncaught exceptions.
- This means that any uncaught exceptions thrown from `AsyncTask->onRun()` will now crash the worker thread, and by extension, the server.
- This change makes it easier to debug errors by detecting them earlier.
- The following API methods have been deprecated:
- `AsyncTask->onError()`
## Internals
- `AsyncTask->progressUpdates` is now lazily initialized when a task publishes a progress update.
- This was previously not possible due to technical limitations of the `ext-pmmpthread` extension.
- This change improves performance of `AsyncPool->submitTask()` and `AsyncPool->submitTaskToWorker()`, as well as reducing the amount of work needed to check for progress updates on tick.
- Errors in `AsyncWorker` now cascade and crash the whole server.
- This makes it easier to debug errors by detecting them earlier.
- This includes all types of unexpected errors, such as OOM, uncaught exceptions, etc.
- This change is not expected to affect normal server operation, as worker threads are not expected to crash under normal circumstances.
- `AsyncTask::$threadLocalStorage` now uses a plain `array` instead of `ArrayObject`. The `ArrayObject` was a workaround for `ext-pthreads` to prevent thread-locals getting copied to the worker thread, and is no longer necessary.
- Regenerated `pocketmine\data\bedrock\item\ItemTypeNames` for Bedrock 1.20 (BC breaking, some item names have changed).
- Fixed `build/generate-item-type-names.php` not including some newer blockitems, such as doors and hanging signs.
# 5.2.1
Released 11th July 2023.
**This release includes changes from the following releases:**
- [4.22.3](https://github.com/pmmp/PocketMine-MP/blob/4.22.3/changelogs/4.22.md#4223) - Fixes for some crash issues
This release contains no other changes.

81
changelogs/5.3.md Normal file
View File

@ -0,0 +1,81 @@
# 5.3.0
Released 12th July 2023.
**For Minecraft: Bedrock Edition 1.20.10**
This is a support release for Minecraft: Bedrock Edition 1.20.10.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## Interim releases
If you're upgrading directly from 5.1.x to 5.3.x, please also read the following changelogs, as the interim releases contain important changes:
- [5.2.0](https://github.com/pmmp/PocketMine-MP/blob/5.2.0/changelogs/5.2.md#520)
## Included releases
**This release includes changes from the following releases:**
- [4.23.0](https://github.com/pmmp/PocketMine-MP/blob/4.23.0/changelogs/4.23.md#4230) - Support for Minecraft: Bedrock Edition 1.20.10
## Internals
- `BlockTypeNames`, `BlockStateNames`, `BlockStateStringValues` and `ItemTypeNames` in the `pocketmine\data\bedrock` package have BC-breaking changes to accommodate Bedrock 1.20.10.
# 5.3.1
Released 14th July 2023.
## Included releases
**This release includes changes from the following releases:**
- [4.23.1](https://github.com/pmmp/PocketMine-MP/blob/4.23.1/changelogs/4.23.md#4231) - Security fixes
## General
- Updated `build/php` submodule to pmmp/PHP-Binaries@e0c918d1379465964acefd562d9e48f87cfc2c9e.
# 5.3.2
Released 18th July 2023.
## Included releases
**This release includes changes from the following releases:**
- [4.23.2](https://github.com/pmmp/PocketMine-MP/blob/4.23.2/changelogs/4.23.md#4232) - Fix for `sandboxId`-related login errors
## Documentation
- Fixed documentation error in `StringToTParser`.
## Fixes
- Fixed turtle helmet not being able to be unequipped.
## Internals
- Armor pieces are no longer set back into the armor inventory if no change was made. This reduces the number of slot updates sent to clients, as well as avoiding unnecessary updates for armor pieces which have Unbreaking enchantments.
# 5.3.3
Released 24th July 2023.
## Included releases
**This release includes changes from the following releases:**
- [4.23.3](https://github.com/pmmp/PocketMine-MP/blob/4.23.3/changelogs/4.23.md#4233) - Various bug fixes
## Fixes
- Added a workaround for PM4 worlds with chunks corrupted by [Refaltor77/CustomItemAPI](https://github.com/Refaltor77/CustomItemAPI).
- While this was not the fault of PocketMine-MP itself, a significant number of users were affected by this problem.
- This error was not detected by PM4 due to missing validation of certain data which should not have existed in 1.12.
- An error will now be logged when this corruption is detected, but the affected chunks should otherwise load normally.
- Relaxed validation of expected 3D biome array counts per chunk in LevelDB worlds.
- Vanilla Bedrock currently saves 24 palettes (and only 24 are required), but it saved 25, 32, or 64 biome palettes per chunk in older versions.
- Core validation for these padding biomes was very strict, enforcing exact compliance with vanilla.
- Since only 24 palettes are actually required, the remaining palettes may now be omitted irrespective of the chunk version.
- An error will still be logged when this mistake is detected, but the affected chunks will otherwise load normally.
- Fixed `/kill` not working on players who had (re)spawned in the 3 seconds immediately after (re)spawning (due to `noDamageTicks`).
- Fixed `/kill` not working correctly for players with high levels of Health Boost or other health-altering effects.
- Fixed netherite items being destroyed by lava.
- Fireproof entities no longer display the burning animation when in fire or lava. This does not apply to creative players, who are immortal rather than being fireproof.
- Fixed frosted ice melting in certain conditions which didn't match vanilla Bedrock.
# 5.3.4
Released 1st August 2023.
## Included releases
This release includes changes from the following releases:
- [4.23.4](https://github.com/pmmp/PocketMine-MP/blob/4.23.4/changelogs/4.23.md#4234) - Item entity lag fix
This release contains no other significant changes.

133
changelogs/5.4.md Normal file
View File

@ -0,0 +1,133 @@
# 5.4.0
Released 1st August 2023.
**For Minecraft: Bedrock Edition 1.20.10**
This is a minor feature update, including a handful of new gameplay features, new plugin APIs and improvements to error reporting.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Improved error reporting for async task and thread crashes.
- Players may now have different creative inventories.
## Gameplay
### General
- Added support for 1.5-block height sneaking.
- Fixed missing player arm swing and sounds when punching the air.
### Blocks
- Implemented the following new blocks:
- Big Dripleaf Head
- Big Dripleaf Stem
- Small Dripleaf
- Acacia saplings now grow into acacia trees.
- Fixed melon and pumpkin stems not attaching to the correct block when growing.
- Various blocks now drop more items when mined with a compatible tool enchanted with Fortune.
### Items
- Implemented Strong Slowness potion.
- Implemented Fortune enchantment.
## API
### `pocketmine\block`
- The following new classes have been added:
- `utils\FortuneDropHelper` - utility methods for calculating the drop counts for Fortune-affected blocks
- The following new API methods have been added:
- `protected Block->getAdjacentSupportType(int $facing) : utils\SupportType` - returns the type of support provided by the block in the given direction on the adjacent face
### `pocketmine\entity`
- The following new API constants have been added:
- `Living::DEFAULT_KNOCKBACK_FORCE`
- `Living::DEFAULT_KNOCKBACK_VERTICAL_LIMIT`
### `pocketmine\entity\animation`
- `ConsumingItemAnimation` now accepts `Living` instances instead of just `Human`.
### `pocketmine\event`
- The following new classes have been added:
- `PlayerMissSwingEvent` - called when the player attempts the attack action (left click on desktop) without any target
- This is possible thanks to the introduction of new flags in `PlayerAuthInputPacket` in Bedrock 1.20.10
- The following new API methods have been added:
- `public EntityDamageByEntityEvent->getVerticalKnockBackLimit() : float`
- `public EntityDamageByEntityEvent->setVerticalKnockBackLimit(float $verticalKnockBackLimit) : void` - sets the max vertical velocity that can result from the victim being knocked back
### `pocketmine\player`
- The following new API methods have been added:
- `public Player->getCreativeInventory() : pocketmine\inventory\CreativeInventory`
- `public Player->setCreativeInventory(pocketmine\inventory\CreativeInventory $inventory) : void`
- `public Player->missSwing() : void` - performs actions associated with the attack action when there is no target (see `PlayerMissSwingEvent`)
### `pocketmine\scheduler`
- Cancellation functionality has been removed from `AsyncTask`, as it didn't make any sense and wasn't used by anything for what it was intended for.
- It broke sequential task execution - later tasks might depend on state from earlier tasks
- It didn't actually cancel the task anyway - at best, it prevented it from running, but couldn't interrupt it (though interrupting a task does not make sense either)
- The following API methods have been deprecated, and their functionality has been removed:
- `AsyncTask->hasCancelledRun()`
- `AsyncTask->cancelRun()`
## Internals
- Uncaught exceptions and fatal errors in `AsyncTask`, threads extending `pocketmine\thread\Thread`, and `pocketmine\thread\Worker` are now recorded in crashdumps, making it significantly easier to debug errors in these areas.
- JWT signature DER <-> raw conversions are now handled in-house using code in `JwtUtils`
- Due to the simplicity of the conversion and only requiring a tiny subset of the ASN.1 spec, it didn't make much sense to introduce another dependency.
- `fgrosse/phpasn1` is no longer required. This package was abandoned by its author and only used by PocketMine-MP for this one purpose.
- Various usages of `Closure::fromCallable()` have been replaced by PHP 8.1 first-class callable syntax.
- Blocks requiring support shifted to a "can be supported at" model, rather than "can be supported by".
- This model reduces repeated logic when placing and performing nearby block updates (no need to hardcode facing everywhere).
- In addition, this change facilitates the use of the newly introduced `Block->getAdjacentSupportType()` API method, reducing boilerplate support-type checking code.
- Bell block code has been simplified and cleaned up.
- `TallGrass` and `DoubleTallGrass` now use a shared `TallGrassTrait` to reduce code duplication.
# 5.4.1
Released 8th August 2023.
## General
- Updated translation data to [pmmp/Language 2.19.6](https://github.com/pmmp/Language/releases/tag/2.19.6).
- [`ext-pmmpthread` 6.0.7](https://github.com/pmmp/ext-pmmpthread/releases/tag/6.0.7) is now required (needed for bug fixes).
## Fixes
- Fixed Podzol not dropping itself when mined with Silk Touch.
- Fixed `World->getSafeSpawn()` not accepting positions below `y=0` (world height limit change).
- Fixed `pocketmine\thread\Thread` and `pocketmine\thread\Worker` instances not logging any information when they crash.
- Fixed `CraftItemEvent` not cloning returned items.
## Internals
- Foreach by-reference is now disallowed via a custom PHPStan rule.
# 5.4.2
Released 9th August 2023.
## Included releases
- [4.23.5](https://github.com/pmmp/PocketMine-MP/blob/4.23.5/changelogs/4.23.md#4235) - Minor bug fixes
## Fixes
- Fixed cake accepting candle placement when slices have already been eaten.
- Fixed fire charges not lighting candles.
# 5.4.3
Released 21st August 2023.
## Included releases
- [4.23.6](https://github.com/pmmp/PocketMine-MP/blob/4.23.6/changelogs/4.23.md#4236) - Armor inventory client bug workaround
## Fixes
- Fixed crashdumps not generating correctly on fatal errors.
- Fixed `PotionCauldron::setPotionItem()` not validating the item type.
- Fixed chorus fruit not considering teleport destinations below y=0.
- Fixed cake dropping itself when mined.
# 5.4.4
Released 6th September 2023.
## General
- Crashdumps caused by non-phar plugins are now submitted to the Crash Archive, the same as other plugins. Previously, non-phar plugin crashes would not be submitted, causing maintainers to potentially miss important issues.
## Fixes
- Fixed player Y coordinates sometimes being slightly below the top of the block they were standing on (floating point error due to subtracting eye height).
- Fixed template slot of smithing tables not accepting any items.
- `tools/generate-bedrock-data-from-packets.php` is now significantly less spammy when warning about duplicated recipes.
- Fixed empty stack traces in `lastError` data of crashdumps.

156
changelogs/5.5-beta.md Normal file
View File

@ -0,0 +1,156 @@
# 5.5.0-BETA1
Released 23rd August 2023.
**For Minecraft: Bedrock Edition 1.20.10**
This is a minor feature release, including performance improvements, new API methods, and new gameplay features.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## Dependencies
- Updated `pocketmine/math` dependency to [`1.0.0`](https://github.com/pmmp/Math/releases/tag/1.0.0).
- Updated `pocketmine/nbt` dependency to [`1.0.0`](https://github.com/pmmp/NBT/releases/tag/1.0.0).
## Performance
- Some events are now no longer fired if no handlers are registered.
- This improves performance by avoiding unnecessary object allocations and function calls.
- Events such as `DataPacketReceiveEvent`, `DataPacketSendEvent` and `PlayerMoveEvent` are optimized away almost completely by this change, offering some much-needed performance gains.
- Significantly improved performance of small moving entities, such as dropped items.
- This was achieved by a combination of changes, which together improved observed performance with 2000 item entities moving in water by 30-40%.
- The benefit of this will be most noticeable in SkyBlock servers, where large cactus farms can generate thousands of dropped items.
- `World->getCollisionBoxes()` now uses an improved search method, which reduces the work done by the function by almost 90% for small entities.
- This improves performance of collision detection for small entities, such as dropped items.
## Gameplay
### General
- Implemented enchanting using an enchanting table (yes, finally!)
- Thanks to [@S3v3Nice](https://github.com/S3v3Nice) for investing lots of time and effort into developing this.
- Since this feature is quite complex, it's possible there may be bugs. Please be vigilant and report any issues you find.
### Blocks
- The following new blocks have been implemented:
- Pink Petals
- Pressure plates are now functional, in the sense that they react when entities stand on them and perform the correct logic.
- Note that since redstone is not yet implemented, pressure plates do not activate any redstone devices, similar to buttons and levers.
- Signs can now be edited by right-clicking them.
- Signs can now be waxed using a honeycomb, which prevents them from being edited.
### Items
- The following new items have been implemented:
- Enchanted Book
## API
### `pocketmine\block`
- The following new API methods have been added:
- `public Block->getEnchantmentTags() : list<string>` returns a list of strings indicating which types of enchantment can be applied to the block when in item form
- `public BlockTypeInfo->getEnchantmentTags() : list<string>`
- `protected PressurePlate->getActivationBox() : AxisAlignedBB` - returns the AABB entities must intersect with in order to activate the pressure plate (not the same as the visual shape)
- `protected PressurePlate->hasOutputSignal() : bool` - returns whether the pressure plate has an output signal - this should be implemented by subclasses
- `protected PressurePlate->calculatePlateState() : array{Block, ?bool}` - returns the state the pressure plate will change to if the given list of entities are standing on it, and a bool indicating whether the plate activated or deactivated this tick
- `protected PressurePlate->filterIrrelevantEntities(list<Entity> $entities) : list<Entity>` - returns the given list filtered of entities that don't affect the plate's state (e.g. dropped items don't affect stone pressure plates)
- `public BaseSign->isWaxed() : bool`
- `public BaseSign->setWaxed(bool $waxed) : $this`
- `public inventory\EnchantInventory->getInput() : Item`
- `public inventory\EnchantInventory->getLapis() : Item`
- `public inventory\EnchantInventory->getOutput(int $optionId) : ?Item` - returns the item that would be produced if the input item was enchanted with the selected option, or `null` if the option is invalid
- `public inventory\EnchantInventory->getOption(int $optionId) : EnchantOption` - returns the enchanting option at the given index
- The following API methods have signature changes:
- `BlockTypeInfo->__construct()` now accepts an optional `list<string> $enchantmentTags` parameter
- `PressurePlate->__construct()` now accepts an optional `int $deactivationDelayTicks` parameter
- `WeightedPressurePlate->__construct()` now accepts optional `int $deactivationDelayTicks` and `float $signalStrengthFactor` parameters
- `SimplePressurePlate->__construct()` now accepts an optional `int $deactivationDelayTicks` parameter
- The following new classes have been added:
- `PinkPetals`
- `utils\BlockEventHelper` - provides helper methods for calling block-related events
- The following classes have been deprecated:
- `WeightedPressurePlateLight`
- `WeightedPressurePlateHeavy`
### `pocketmine\entity`
- The following new API methods have been added:
- `public Human->getEnchantmentSeed() : int` - returns the current seed used to randomize options shown on the enchanting table for this human
- `public Human->setEnchantmentSeed(int $seed) : void`
- `public Human->regenerateEnchantmentSeed() : void` - returns a new randomly generated seed which can be set with `setEnchantmentSeed()`
### `pocketmine\event`
- The following new classes have been added:
- `block\FarmlandHydrationChangeEvent` - called when farmland is hydrated or dehydrated
- `block\PressurePlateUpdateEvent` - called when a pressure plate is activated or changes its power output
- `player\PlayerEnchantingOptionsRequestEvent` - called when a player puts an item to be enchanted into an enchanting table, to allow plugins to modify the enchanting options shown
- `player\PlayerItemEnchantEvent` - called when a player enchants an item in an enchanting table
- `world\WorldDifficultyChangeEvent` - called when a world's difficulty is changed
- The following new API methods have been added:
- `public static Event::hasHandlers() : bool` - returns whether the event class has any registered handlers - used like `SomeEvent::hasHandlers()`
- `public HandlerListManager->getHandlersFor(class-string<? extends Event> $event) : list<RegisteredListener>` - returns a list of all registered listeners for the given event class, using cache if available
### `pocketmine\inventory\transaction`
- The following new classes have been added:
- `EnchantingTransaction` - used when a player enchants an item in an enchanting table
### `pocketmine\item`
- The following new API methods have been added:
- `public Armor->getMaterial() : ArmorMaterial` - returns an object containing properties shared by all items of the same armor material
- `public ArmorTypeInfo->getMaterial() : ArmorMaterial`
- `public Item->getEnchantability() : int` - returns the enchantability value of the item - higher values increase the chance of more powerful enchantments being offered by an enchanting table
- `public Item->getEnchantmentTags() : list<string>` - returns a list of strings indicating which types of enchantment can be applied to the item
- `public ToolTier->getEnchantability() : int`
- The following API methods have signature changes:
- `Item->__construct()` now accepts an optional `list<string> $enchantmentTags` parameter
- `ArmorTypeInfo->__construct()` now accepts an optional `?ArmorMaterial $material` parameter
- The following new classes have been added:
- `ArmorMaterial` - container for shared armor properties
- `VanillaArmorMaterials` - all vanilla armor materials
- `EnchantedBook` - represents an enchanted book item
### `pocketmine\item\enchantment`
- The following new classes have been added:
- `AvailableEnchantmentRegistry` - enchantments to be displayed on the enchanting table are selected from here - custom enchantments may be added
- `EnchantingHelper` - static class containing various helper methods for enchanting tables
- `EnchantingOption` - represents an option on the enchanting table menu
- `IncompatibleEnchantmentGroups` - list of constants naming groups of enchantments that are incompatible with each other - custom enchantments may be added using these group names to make them incompatible with existing enchantments in the same group
- `IncompatibleEnchantmentRegistry` - manages which enchantments are considered incompatible with each other - custom enchantments may be added using existing group names to make them incompatible with existing enchantments in the same group, or to entirely new groups
- `ItemEnchantmentTagRegistry` - manages item enchantment compatibility tags and which tags include which other tags
- `ItemEnchantmentTags` - list of constants naming item types for enchantment compatibility checks
- The following classes have been deprecated
- `ItemFlags`
- The following API methods have been added:
- `public Enchantment->isCompatibleWith(Enchantment $other) : bool`
- `public Enchantment->getMinEnchantingPower()` - returns the minimum enchanting power (derived from enchantability and number of bookshelves) needed to allow this enchantment to show on the enchanting table with a given level
- `public Enchantment->getMaxEnchantingPower()` - upper limit of enchanting power for this enchantment to be offered on the enchanting table with a given level
- The following API methods have signature changes:
- `Enchantment->__construct()` now accepts optional `(\Closure(int $level) : int)|null $minEnchantingPower` and `int $enchantingPowerRange` parameters
- `Enchantment->__construct()` parameters `$primaryItemFlags` and `$secondaryItemFlags` are now deprecated and no longer used
- `ProtectionEnchantment->__construct()` has extra parameters to reflect `Enchantment->__construct()` changes
- The following API methods have been deprecated:
- `Enchantment->getPrimaryItemFlags()` - use API methods provided by `AvailableEnchantmentRegistry` instead
- `Enchantment->getSecondaryItemFlags()` - use API methods provided by `AvailableEnchantmentRegistry` instead
- `Enchantment->hasPrimaryItemType()`
- `Enchantment->hasSecondaryItemType()`
### `pocketmine\plugin`
- The following new API methods have been added:
- `public PluginBase->getResourcePath(string $filename) : string` - returns a URI to an embedded resource file that can be used with `file_get_contents()` and similar functions
- `public PluginBase->getResourceFolder() : string` - returns a URI to the plugin's folder of embedded resources
- The following API methods have been deprecated:
- `PluginBase->getResource()` - prefer using `getResourcePath()` with `file_get_contents()` or other PHP built-in functions instead
### `pocketmine\resourcepacks`
- The following new API methods have been added:
- `public ResourcePackManager->setResourcePacksRequired(bool $value) : void` - sets whether players must accept resource packs in order to join
### `pocketmine\world\generator`
- The following new API methods have been added:
- `public GeneratorManager->addAlias(string $name, string $alias) : void` - allows registering a generator alias without copying the generator registration parameters
### `pocketmine\world\sound`
- The following new classes have been added:
- `PressurePlateActivateSound`
- `PressurePlateDeactivateSound`
### `pocketmine\utils`
- The following new API methods have been added:
- `public StringToTParser->registerAlias(string $existing, string $alias) : void` - allows registering a string alias without copying registration parameters

162
changelogs/5.5.md Normal file
View File

@ -0,0 +1,162 @@
# 5.5.0
Released 6th September 2023.
**For Minecraft: Bedrock Edition 1.20.10**
This is a minor feature release, including performance improvements, new API methods, and new gameplay features.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## Dependencies
- Updated `pocketmine/math` dependency to [`1.0.0`](https://github.com/pmmp/Math/releases/tag/1.0.0).
- Updated `pocketmine/nbt` dependency to [`1.0.0`](https://github.com/pmmp/NBT/releases/tag/1.0.0).
## Performance
- Some events are now no longer fired if no handlers are registered.
- This improves performance by avoiding unnecessary object allocations and function calls.
- Events such as `DataPacketReceiveEvent`, `DataPacketSendEvent` and `PlayerMoveEvent` are optimized away almost completely by this change, offering some much-needed performance gains.
- Significantly improved performance of small moving entities, such as dropped items.
- This was achieved by a combination of changes, which together improved observed performance with 2000 item entities moving in water by 30-40%.
- The benefit of this will be most noticeable in SkyBlock servers, where large cactus farms can generate thousands of dropped items.
- `World->getCollisionBoxes()` now uses an improved search method, which reduces the work done by the function by almost 90% for small entities.
- This improves performance of collision detection for small entities, such as dropped items.
## Gameplay
### General
- Implemented enchanting using an enchanting table (yes, finally!)
- Thanks to [@S3v3Nice](https://github.com/S3v3Nice) for investing lots of time and effort into developing this.
- Since this feature is quite complex, it's possible there may be bugs. Please be vigilant and report any issues you find.
### Blocks
- The following new blocks have been implemented:
- Pink Petals
- Pressure plates are now functional, in the sense that they react when entities stand on them and perform the correct logic.
- Note that since redstone is not yet implemented, pressure plates do not activate any redstone devices, similar to buttons and levers.
- Signs can now be edited by right-clicking them.
- Signs can now be waxed using a honeycomb, which prevents them from being edited.
### Items
- The following new items have been implemented:
- Enchanted Book
## API
### `pocketmine\block`
- The following new API methods have been added:
- `public Block->getEnchantmentTags() : list<string>` returns a list of strings indicating which types of enchantment can be applied to the block when in item form
- `public BlockTypeInfo->getEnchantmentTags() : list<string>`
- `protected PressurePlate->getActivationBox() : AxisAlignedBB` - returns the AABB entities must intersect with in order to activate the pressure plate (not the same as the visual shape)
- `protected PressurePlate->hasOutputSignal() : bool` - returns whether the pressure plate has an output signal - this should be implemented by subclasses
- `protected PressurePlate->calculatePlateState() : array{Block, ?bool}` - returns the state the pressure plate will change to if the given list of entities are standing on it, and a bool indicating whether the plate activated or deactivated this tick
- `protected PressurePlate->filterIrrelevantEntities(list<Entity> $entities) : list<Entity>` - returns the given list filtered of entities that don't affect the plate's state (e.g. dropped items don't affect stone pressure plates)
- `public BaseSign->isWaxed() : bool`
- `public BaseSign->setWaxed(bool $waxed) : $this`
- `public inventory\EnchantInventory->getInput() : Item`
- `public inventory\EnchantInventory->getLapis() : Item`
- `public inventory\EnchantInventory->getOutput(int $optionId) : ?Item` - returns the item that would be produced if the input item was enchanted with the selected option, or `null` if the option is invalid
- `public inventory\EnchantInventory->getOption(int $optionId) : EnchantOption` - returns the enchanting option at the given index
- The following API methods have signature changes:
- `BlockTypeInfo->__construct()` now accepts an optional `list<string> $enchantmentTags` parameter
- `PressurePlate->__construct()` now accepts an optional `int $deactivationDelayTicks` parameter
- `WeightedPressurePlate->__construct()` now accepts optional `int $deactivationDelayTicks` and `float $signalStrengthFactor` parameters
- `SimplePressurePlate->__construct()` now accepts an optional `int $deactivationDelayTicks` parameter
- The following new classes have been added:
- `PinkPetals`
- `utils\BlockEventHelper` - provides helper methods for calling block-related events
- The following classes have been deprecated:
- `WeightedPressurePlateLight`
- `WeightedPressurePlateHeavy`
### `pocketmine\entity`
- The following new API methods have been added:
- `public Human->getEnchantmentSeed() : int` - returns the current seed used to randomize options shown on the enchanting table for this human
- `public Human->setEnchantmentSeed(int $seed) : void`
- `public Human->regenerateEnchantmentSeed() : void` - returns a new randomly generated seed which can be set with `setEnchantmentSeed()`
### `pocketmine\event`
- The following new classes have been added:
- `block\FarmlandHydrationChangeEvent` - called when farmland is hydrated or dehydrated
- `block\PressurePlateUpdateEvent` - called when a pressure plate is activated or changes its power output
- `player\PlayerEnchantingOptionsRequestEvent` - called when a player puts an item to be enchanted into an enchanting table, to allow plugins to modify the enchanting options shown
- `player\PlayerItemEnchantEvent` - called when a player enchants an item in an enchanting table
- `world\WorldDifficultyChangeEvent` - called when a world's difficulty is changed
- The following new API methods have been added:
- `public static Event::hasHandlers() : bool` - returns whether the event class has any registered handlers - used like `SomeEvent::hasHandlers()`
- `public HandlerListManager->getHandlersFor(class-string<? extends Event> $event) : list<RegisteredListener>` - returns a list of all registered listeners for the given event class, using cache if available
### `pocketmine\inventory\transaction`
- The following new classes have been added:
- `EnchantingTransaction` - used when a player enchants an item in an enchanting table
### `pocketmine\item`
- The following new API methods have been added:
- `public Armor->getMaterial() : ArmorMaterial` - returns an object containing properties shared by all items of the same armor material
- `public ArmorTypeInfo->getMaterial() : ArmorMaterial`
- `public Item->getEnchantability() : int` - returns the enchantability value of the item - higher values increase the chance of more powerful enchantments being offered by an enchanting table
- `public Item->getEnchantmentTags() : list<string>` - returns a list of strings indicating which types of enchantment can be applied to the item
- `public ToolTier->getEnchantability() : int`
- The following API methods have signature changes:
- `Item->__construct()` now accepts an optional `list<string> $enchantmentTags` parameter
- `ArmorTypeInfo->__construct()` now accepts an optional `?ArmorMaterial $material` parameter
- The following new classes have been added:
- `ArmorMaterial` - container for shared armor properties
- `VanillaArmorMaterials` - all vanilla armor materials
- `EnchantedBook` - represents an enchanted book item
### `pocketmine\item\enchantment`
- The following new classes have been added:
- `AvailableEnchantmentRegistry` - enchantments to be displayed on the enchanting table are selected from here - custom enchantments may be added
- `EnchantingHelper` - static class containing various helper methods for enchanting tables
- `EnchantingOption` - represents an option on the enchanting table menu
- `IncompatibleEnchantmentGroups` - list of constants naming groups of enchantments that are incompatible with each other - custom enchantments may be added using these group names to make them incompatible with existing enchantments in the same group
- `IncompatibleEnchantmentRegistry` - manages which enchantments are considered incompatible with each other - custom enchantments may be added using existing group names to make them incompatible with existing enchantments in the same group, or to entirely new groups
- `ItemEnchantmentTagRegistry` - manages item enchantment compatibility tags and which tags include which other tags
- `ItemEnchantmentTags` - list of constants naming item types for enchantment compatibility checks
- The following classes have been deprecated
- `ItemFlags`
- The following API methods have been added:
- `public Enchantment->isCompatibleWith(Enchantment $other) : bool`
- `public Enchantment->getMinEnchantingPower()` - returns the minimum enchanting power (derived from enchantability and number of bookshelves) needed to allow this enchantment to show on the enchanting table with a given level
- `public Enchantment->getMaxEnchantingPower()` - upper limit of enchanting power for this enchantment to be offered on the enchanting table with a given level
- The following API methods have signature changes:
- `Enchantment->__construct()` now accepts optional `(\Closure(int $level) : int)|null $minEnchantingPower` and `int $enchantingPowerRange` parameters
- `Enchantment->__construct()` parameters `$primaryItemFlags` and `$secondaryItemFlags` are now deprecated and no longer used
- `ProtectionEnchantment->__construct()` has extra parameters to reflect `Enchantment->__construct()` changes
- The following API methods have been deprecated:
- `Enchantment->getPrimaryItemFlags()` - use API methods provided by `AvailableEnchantmentRegistry` instead
- `Enchantment->getSecondaryItemFlags()` - use API methods provided by `AvailableEnchantmentRegistry` instead
- `Enchantment->hasPrimaryItemType()`
- `Enchantment->hasSecondaryItemType()`
### `pocketmine\plugin`
- The following new API methods have been added:
- `public PluginBase->getResourcePath(string $filename) : string` - returns a URI to an embedded resource file that can be used with `file_get_contents()` and similar functions
- `public PluginBase->getResourceFolder() : string` - returns a URI to the plugin's folder of embedded resources
- The following API methods have been deprecated:
- `PluginBase->getResource()` - prefer using `getResourcePath()` with `file_get_contents()` or other PHP built-in functions instead
### `pocketmine\resourcepacks`
- The following new API methods have been added:
- `public ResourcePackManager->setResourcePacksRequired(bool $value) : void` - sets whether players must accept resource packs in order to join
### `pocketmine\world\generator`
- The following new API methods have been added:
- `public GeneratorManager->addAlias(string $name, string $alias) : void` - allows registering a generator alias without copying the generator registration parameters
### `pocketmine\world\sound`
- The following new classes have been added:
- `PressurePlateActivateSound`
- `PressurePlateDeactivateSound`
### `pocketmine\utils`
- The following new API methods have been added:
- `public StringToTParser->registerAlias(string $existing, string $alias) : void` - allows registering a string alias without copying registration parameters
## Internals
- Various `TypeIdMap` classes in the `pocketmine\data\bedrock` package now use the new `IntSaveIdMapTrait` to reduce code duplication.
- Added a new `ServerProperties` class containing constants for all known `server.properties` keys.
- Added a new `YmlServerProperties` class containing generated constants for all known `pocketmine.yml` keys. These keys can be used with `Config->getNested()`.

34
changelogs/5.6.md Normal file
View File

@ -0,0 +1,34 @@
# 5.6.0
Released 20th September 2023.
**For Minecraft: Bedrock Edition 1.20.30**
This is a support release for Minecraft: Bedrock Edition 1.20.30.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.20.30.
- Removed support for older versions.
## Fixes
- Fixed support conditions for hanging roots, cave vines and dead bushes.
- Fixed connection conditions for fences, glass panes, iron bars, and walls.
# 5.6.1
Released 20th October 2023.
## Performance
- Improved performance of cactus growth by disabling neighbour updates when only the age property was updated. While this isn't a perfect solution, it provides significant performance gains for servers with large cactus farms.
## Fixes
- Fixed `tools/generate-bedrock-data-from-packets.php` incorrectly interpreting network meta as blockstates in some cases (broken crafting recipes).
- Fixed crafting recipes involving beds, skulls and some other items not working correctly (incorrectly interpreted data).
- Fixed crashes when flower pot or cauldron blockentities exist in places where they shouldn't (leftovers from upgraded PM3 worlds).
- Fixed `Entity->broadcastSound()` not firing `WorldSoundEvent` (bypassing internal sound system).
- Fixed wooden signs, buttons and doors not being able to be used as furnace fuel.
- Fixed bone meal and tools only working when used on the top side of dirt and grass. Bone meal now works from any side, and tools work on any side except the bottom.

27
changelogs/5.7.md Normal file
View File

@ -0,0 +1,27 @@
# 5.7.0
Released 26th October 2023.
**For Minecraft: Bedrock Edition 1.20.40**
This is a support release for Minecraft: Bedrock Edition 1.20.40.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.20.40.
- Removed support for older versions.
## Fixes
- Fixed `cartography_table`, `smithing_table`, `stripped_cherry_log` and `stripped_cherry_wood` not working in `StringToItemParser`.
- Fixed `Promise<null>::onCompletion()` always calling the reject handler if the promise was already completed.
# 5.7.1
Released 1st November 2023.
## Fixes
- Fixed non-reentrant-safe code in `PermissionManager` and various other subscriber subsystems.
- These issues caused server crashes when deleting a subscriber indirectly triggered the deletion of other subscribers (e.g. due to the GC activating in `unset()`).

138
changelogs/5.8.md Normal file
View File

@ -0,0 +1,138 @@
# 5.8.0
Released 1st November 2023.
**Borked release, forgot to merge branches.**
# 5.8.1
Released 1st November 2023.
**For Minecraft: Bedrock Edition 1.20.40**
This is a minor feature release, including new gameplay features, various performance improvements to internal `World` and `Block` systems, and changes to the API.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Neighbour block updates now have a separate timer for timings. Previously, these were counted under `Scheduled Block Updates`, which was misleading.
## Performance
- `LightUpdate` now avoids attempting to propagate back in the same direction the light came from. This produces a small performance improvement of around 6% in light propagation.
- Improved worst-case (non-cached) performance of `World::getCollisionBlocks()` (and its successor `World::getBlockCollisionBlocks()`).
- While 5.5.0 introduced caching at the `World` level for AABBs, the cache was rarely useful due to entity and player movement being too unpredictable. This meant that most users saw a performance degradation with lots of moving entities, except in specific situations.
- Performance for fetching non-cached AABBs for a cell is now improved by 2x. Overall performance benefit to a server depends on the number of entities and players.
- Added cache for hydrated farmland blocks to remember the last known location of nearby water.
- If nearby water sources are not changed, this cache allows hydrated farmland to completely avoid checking up to 161 nearby blocks for water after the first check.
- Tests with large wheat farms showed a 25% performance improvement in overall server performance compared to previous 5.x versions.
- Migrated various internal enums to native PHP 8.1 enums. Bypassing magic `__callStatic()` accessors improved performance in many areas, although it's hard to quantify the exact benefit.
- Made use of `Facing::OFFSET` constant in various places to avoid unnecessary `Vector3` and `Position` object allocations. Many pathways benefit from this, including neighbour block updates (due to faster `Block::getSide()` and less useless objects).
- Avoided clearing block AABB caches except when strictly necessary. Previously, the cache was wiped every time blocks were read from the world, making them mostly useless.
- Avoided random updates on blocks which have reached their final state, such as fully-grown crops. This produces a minimal performance improvement.
- Removed useless checks in some `World` hot paths.
## API
### General
- All enums have been migrated to native PHP 8.1 enums.
- For now, the old APIs and accessors are still usable (via `LegacyEnumShimTrait`), but these will be removed in the next major release.
- `EnumTrait` has been deprecated, and will be removed in the next major release.
- Migration for most plugin developers will simply involve deleting `()` from the end of enum case usages, which is a trivial change and also improves performance.
- Plugin usages of `EnumTrait` are encouraged to move to native enums, optionally using `LegacyEnumShimTrait` to provide backwards compatibility.
- See [this code](https://github.com/pmmp/PocketMine-MP/blob/9832fe899f13a8ea47cc9d73de7088f7775a12f5/src/block/utils/DyeColor.php#L85-L107) for an example of how to associate properties with enum cases (since native enums don't support this directly).
- Thanks to improvements in `RuntimeDataDescriber`, any native enum can now be used as a custom block's state property.
### `pocketmine\block`
- The following classes have been added:
- `utils\AgeableTrait` - used by blocks which have an age property, such as crops
- `utils\StaticSupportTrait` - used by blocks which have the same support requirements regardless of their state, such as crops
### `pocketmine\data\runtime`
- The following API methods have been added:
- `public RuntimeDataDescriber->boundedIntAuto(int $min, int $max, int &$value) : void` - similar to `boundedInt()`, but automatically calculates the needed number of bits based on the given min/max
- `public RuntimeDataDescriber->enum(T extends \UnitEnum &$case) : void` - describes any native PHP 8.1 enum case
- `public RuntimeDataDescriber->enumSet(array<int, T extends \UnitEnum> &$set, array<int, T extends \UnitEnum> $allCases) : void` - describes a set of enum cases (similar to bitflags)
- The following API methods have been deprecated:
- `RuntimeDataDescriber->bellAttachmentType()` - use `enum()` instead
- `RuntimeDataDescriber->boundedInt()` - use `boundedIntAuto()` instead
- `RuntimeDataDescriber->brewingStandSlots()` - use `enumSet()` instead
- `RuntimeDataDescriber->copperOxidation()` - use `enum()` instead
- `RuntimeDataDescriber->coralType()` - use `enum()` instead
- `RuntimeDataDescriber->dirtType()` - use `enum()` instead
- `RuntimeDataDescriber->dripleafState()` - use `enum()` instead
- `RuntimeDataDescriber->dyeColor()` - use `enum()` instead
- `RuntimeDataDescriber->froglightType()` - use `enum()` instead
- `RuntimeDataDescriber->leverFacing()` - use `enum()` instead
- `RuntimeDataDescriber->medicineType()` - use `enum()` instead
- `RuntimeDataDescriber->mobHeadType()` - use `enum()` instead
- `RuntimeDataDescriber->mushroomBlockType()` - use `enum()` instead
- `RuntimeDataDescriber->potionType()` - use `enum()` instead
- `RuntimeDataDescriber->slabType()` - use `enum()` instead
- `RuntimeDataDescriber->suspiciousStewType()` - use `enum()` instead
### `pocketmine\player`
- `TitleID` is now included in `PlayerInfo` metadata for plugin consumption.
### `pocketmine\world`
- The following API methods have been added:
- `public World->getBlockCollisionBoxes(AxisAlignedBB $bb) : list<AxisAlignedBB>` - similar to `getCollisionBoxes` but exclusively for blocks, avoiding the need for conditionally useless parameters
- The following API methods have been deprecated:
- `World->getCollisionBoxes()` - use `getBlockCollisionBoxes()` instead (alongside `getCollidingEntities()` if entity collision boxes are also required)
### `pocketmine\utils`
- The following classes have been deprecated:
- `EnumTrait` - use native PHP 8.1 enums instead
- The following classes have been added:
- `LegacyEnumShimTrait` - can be `use`d by native PHP 8.1 enums to provide the same API as `EnumTrait`
## Gameplay
### Blocks
- Implemented the following blocks:
- Amethyst
- Amethyst Cluster
- Chiseled Bookshelf
- Crimson Roots
- Pitcher Crop
- Pitcher Plant
- Torchflower
- Torchflower Crop
- Warped Roots
### Items
- Implemented the following items:
- Pitcher Pod
- Torchflower Seeds
## Internals
- `Farmland` block now has an extra property (`waterPositionIndex`) stored in its blockstate ID to track the position of nearby water. This property is not saved to disk, and is only used for caching.
- The format of internal blockstate ID has been updated.
- The lower `11` bits are now reserved for state data (previously `8` bits). This increase facilitates the new cache for `Farmland` blocks.
- The state data bits are now XOR'd with the `xxh3` of the block's type ID, instead of being directly XOR'd with the type ID.
- This XOR improves the distribution of the lower bits of the blockstate ID, which is important for hashtable indexing to minimize collisions.
- Previously, the lower bits were XOR'd with the type ID directly, but the effectiveness of this reduced as more state data bits were added.
- `xxh3` produces consistently good results for this purpose regardless of the number of state data bits allocated.
- Hash collisions with blockstate IDs are reduced by 50% with this change, which is a happy side effect.
- This is backwards-incompatible, so anyone saving internal blockstate IDs on disk or in a DB will be burned by this change (though they shouldn't have been doing that anyway).
- Removed code generation step for `RuntimeDataDescriber` enum serialization. All described enums now use PHP 8.1 native enums, which can be described without codegen using `RuntimeDataDescriber->enum()`.
- Added `DeprecatedLegacyEnumAccessRule` custom PHPStan rule to flag legacy `EnumTrait` case accessors.
- Cleaned up remaining hardcoded `Config` keys in `SetupWizard`. These usages now use auto-generated constants like the rest of the codebase.
# 5.8.2
Released 9th November 2023.
## Performance
- Improved performance of small packet zero-compression (unintended use of slow zlib compressor instead of fast libdeflate one).
- This affected the majority of outbound packets, as most packets are below the 256-byte threshold for compression.
- This faster method is over 20x faster than the old method, producing noticeable performance gains for large servers.
## Fixes
- Fixed melons and pumpkins not growing.
- Fixed melon and pumpkin stems not attaching to the grown melon/pumpkin.
- Fixed iron and gold ores not being affected by the Fortune enchantment.
- Fixed ancient debris burning in lava.
- Fixed sign (front) text loading from vanilla world saves (back text is not yet supported).
## Internals
- Removed bogus optimization from `tools/generate-blockstate-upgrade-schema.php` that could cause incorrect `remappedStates` generation when some of the states stayed under the old ID.
- Fixed possible crash in `BlockStateUpgrader` name flattening rule handling with invalid blockstate NBT data.

30
changelogs/5.9.md Normal file
View File

@ -0,0 +1,30 @@
# 5.9.0
Released 6th December 2023.
**For Minecraft: Bedrock Edition 1.20.50**
This is a support release for Minecraft: Bedrock Edition 1.20.50.
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
## General
- Added support for Minecraft: Bedrock Edition 1.20.50.
- Removed support for older versions.
## Fixes
- Fixed `pitcher_plant` and `pitcher_pod` not being accepted by `StringToItemParser` (and therefore not being usable in commands).
- Rotation of items in item frames in worlds from newer versions of Bedrock is now correctly loaded.
- Fixed possible crash in block update sending if a chunk was unloaded during a previous chunk's block update syncing.
- Fixed `AsyncTask::fetchLocal()` throwing an exception if `null` was stored in the local storage.
## Documentation
- `Server::prepareBatch()` is now correctly marked as `@internal`.
- Updated documentation for `Server::prepareBatch()` to accurately reflect its behaviour.
- Fixed incorrect path in doc comments of `EnumTrait` and `RegistryTrait`.
## Internals
- Added PHP 8.3 to the test matrix. This has not been thoroughly tested yet, so it should only be used for testing purposes.

View File

@ -5,9 +5,9 @@
"homepage": "https://pmmp.io",
"license": "LGPL-3.0",
"require": {
"php": "^8.0",
"php": "^8.1",
"php-64bit": "*",
"ext-chunkutils2": "^0.3.0",
"ext-chunkutils2": "^0.3.1",
"ext-crypto": "^0.3.1",
"ext-ctype": "*",
"ext-curl": "*",
@ -22,7 +22,7 @@
"ext-openssl": "*",
"ext-pcre": "*",
"ext-phar": "*",
"ext-pthreads": "~3.2.0",
"ext-pmmpthread": "^6.1.0",
"ext-reflection": "*",
"ext-simplexml": "*",
"ext-sockets": "*",
@ -31,32 +31,31 @@
"ext-zip": "*",
"ext-zlib": ">=1.2.11",
"composer-runtime-api": "^2.0",
"adhocore/json-comment": "^1.1",
"fgrosse/phpasn1": "^2.3",
"netresearch/jsonmapper": "^4.0",
"pocketmine/bedrock-protocol": "1.0.0+bedrock1.17.10",
"adhocore/json-comment": "~1.2.0",
"pocketmine/netresearch-jsonmapper": "~v4.4.999",
"pocketmine/bedrock-block-upgrade-schema": "~4.2.0+bedrock-1.21.0",
"pocketmine/bedrock-data": "~2.11.0+bedrock-1.21.0",
"pocketmine/bedrock-item-upgrade-schema": "~1.10.0+bedrock-1.21.0",
"pocketmine/bedrock-protocol": "~32.1.0+bedrock-1.21.2",
"pocketmine/binaryutils": "^0.2.1",
"pocketmine/callback-validator": "^1.0.2",
"pocketmine/classloader": "dev-master",
"pocketmine/color": "^0.2.0",
"pocketmine/errorhandler": "^0.3.0",
"pocketmine/log": "^0.3.0",
"pocketmine/log-pthreads": "^0.2.0",
"pocketmine/math": "^0.3.0",
"pocketmine/nbt": "^0.3.0",
"pocketmine/raklib": "^0.13.1",
"pocketmine/raklib-ipc": "^0.1.0",
"pocketmine/snooze": "^0.3.0",
"pocketmine/spl": "dev-master",
"ramsey/uuid": "^4.1",
"respect/validation": "^2.0",
"webmozart/path-util": "^2.3"
"pocketmine/color": "^0.3.0",
"pocketmine/errorhandler": "^0.7.0",
"pocketmine/locale-data": "~2.19.0",
"pocketmine/log": "^0.4.0",
"pocketmine/math": "~1.0.0",
"pocketmine/nbt": "~1.0.0",
"pocketmine/raklib": "~1.1.0",
"pocketmine/raklib-ipc": "~1.0.0",
"pocketmine/snooze": "^0.5.0",
"ramsey/uuid": "~4.7.0",
"symfony/filesystem": "~6.4.0"
},
"require-dev": {
"phpstan/phpstan": "0.12.98",
"phpstan/phpstan-phpunit": "^0.12.6",
"phpstan/phpstan-strict-rules": "^0.12.2",
"phpunit/phpunit": "^9.2"
"phpstan/phpstan": "1.11.10",
"phpstan/phpstan-phpunit": "^1.1.0",
"phpstan/phpstan-strict-rules": "^1.2.0",
"phpunit/phpunit": "^10.5.24"
},
"autoload": {
"psr-4": {
@ -74,21 +73,24 @@
},
"config": {
"platform": {
"php": "8.0.0"
"php": "8.1.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-devtools": "@php -dphar.readonly=0 tests/plugins/DevTools/src/ConsoleScript.php --make ./ --relative tests/plugins/DevTools --out plugins/DevTools.phar",
"make-server": [
"@composer install --no-dev --classmap-authoritative --ignore-platform-reqs",
"@php -dphar.readonly=0 build/server-phar.php"
],
"update-registry-annotations": [
"update-codegen": [
"@php build/generate-bedrockdata-path-consts.php",
"@php build/generate-biome-ids.php",
"@php build/generate-block-serializer-consts.php vendor/pocketmine/bedrock-data/canonical_block_states.nbt",
"@php build/generate-item-type-names.php vendor/pocketmine/bedrock-data/required_item_list.json",
"@php build/generate-known-translation-apis.php",
"@php build/generate-pocketmine-yml-property-consts.php",
"@php build/generate-registry-annotations.php src"
],
"update-translation-apis": [
"@php build/generate-known-translation-apis.php"
]
}
}

2025
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
# Doxyfile 1.8.15
# Doxyfile 1.9.3
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@ -93,14 +93,6 @@ ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all generated output in the proper direction.
# Possible values are: None, LTR, RTL and Context.
# The default value is: None.
OUTPUT_TEXT_DIRECTION = None
# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
@ -197,6 +189,16 @@ SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
# such as
# /***************
# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
# Javadoc-style will behave just like regular comments and it will not be
# interpreted by doxygen.
# The default value is: NO.
JAVADOC_BANNER = NO
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
# line (until the first dot) of a Qt-style comment as the brief description. If
# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
@ -217,6 +219,14 @@ QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
# By default Python docstrings are displayed as preformatted text and doxygen's
# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
# doxygen's special commands can be used and the contents of the docstring
# documentation blocks is shown as doxygen documentation.
# The default value is: YES.
PYTHON_DOCSTRING = YES
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
# documentation from any documented member that it re-implements.
# The default value is: YES.
@ -240,25 +250,19 @@ TAB_SIZE = 4
# the documentation. An alias has the form:
# name=value
# For example adding
# "sideeffect=@par Side Effects:\n"
# "sideeffect=@par Side Effects:^^"
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines (in the resulting output). You can put ^^ in the value part of an
# alias to insert a newline as if a physical newline was in the original file.
# When you need a literal { or } or , in the value part of an alias you have to
# escape them by means of a backslash (\), this can lead to conflicts with the
# commands \{ and \} for these it is advised to use the version @{ and @} or use
# a double escape (\\{ and \\})
# "Side Effects:". Note that you cannot put \n's in the value part of an alias
# to insert newlines (in the resulting output). You can put ^^ in the value part
# of an alias to insert a newline as if a physical newline was in the original
# file. When you need a literal { or } or , in the value part of an alias you
# have to escape them by means of a backslash (\), this can lead to conflicts
# with the commands \{ and \} for these it is advised to use the version @{ and
# @} or use a double escape (\\{ and \\})
ALIASES =
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
@ -299,19 +303,22 @@ OPTIMIZE_OUTPUT_SLICE = NO
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice,
# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,
# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
# tries to guess whether the code is fixed or free formatted code, this is the
# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat
# .inc files as Fortran files (default is PHP), and .f files as C (default is
# Fortran), use: inc=Fortran f=C.
# default for Fortran type files). For instance to make doxygen treat .inc files
# as Fortran files (default is PHP), and .f files as C (default is Fortran),
# use: inc=Fortran f=C.
#
# Note: For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
# the files are not read by doxygen. When specifying no_extension you should add
# * to the FILE_PATTERNS.
#
# Note see also the list of default file extension mappings.
EXTENSION_MAPPING =
@ -329,7 +336,7 @@ MARKDOWN_SUPPORT = YES
# to that level are automatically included in the table of contents, even if
# they do not have an id attribute.
# Note: This feature currently applies only to Markdown headings.
# Minimum value: 0, maximum value: 99, default value: 0.
# Minimum value: 0, maximum value: 99, default value: 5.
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
TOC_INCLUDE_HEADINGS = 0
@ -445,6 +452,19 @@ TYPEDEF_HIDES_STRUCT = NO
LOOKUP_CACHE_SIZE = 0
# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use
# during processing. When set to 0 doxygen will based this on the number of
# cores available in the system. You can set it explicitly to a value larger
# than 0 to get more control over the balance between CPU load and processing
# speed. At this moment only the input processing can be done using multiple
# threads. Since this is still an experimental feature the default is set to 1,
# which effectively disables parallel processing. Please report any issues you
# encounter. Generating dot graphs in parallel is controlled by the
# DOT_NUM_THREADS setting.
# Minimum value: 0, maximum value: 32, default value: 1.
NUM_PROC_THREADS = 1
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@ -465,6 +485,12 @@ EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
# methods of a class will be included in the documentation.
# The default value is: NO.
EXTRACT_PRIV_VIRTUAL = NO
# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
# scope will be included in the documentation.
# The default value is: NO.
@ -502,6 +528,13 @@ EXTRACT_LOCAL_METHODS = YES
EXTRACT_ANON_NSPACES = YES
# If this flag is set to YES, the name of an unnamed parameter in a declaration
# will be determined by the corresponding definition. By default unnamed
# parameters remain unnamed in the output.
# The default value is: YES.
RESOLVE_UNNAMED_PARAMS = YES
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
# undocumented members inside documented classes or files. If set to NO these
# members will be included in the various overviews, but no documentation
@ -519,8 +552,8 @@ HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
# (class|struct|union) declarations. If set to NO, these declarations will be
# included in the documentation.
# declarations. If set to NO, these declarations will be included in the
# documentation.
# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
@ -539,11 +572,18 @@ HIDE_IN_BODY_DOCS = YES
INTERNAL_DOCS = NO
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
# names in lower-case letters. If set to YES, upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
# With the correct setting of option CASE_SENSE_NAMES doxygen will better be
# able to match the capabilities of the underlying filesystem. In case the
# filesystem is case sensitive (i.e. it supports files in the same directory
# whose names only differ in casing), the option must be set to YES to properly
# deal with such files in case they appear in the input. For filesystems that
# are not case sensitive the option should be be set to NO to properly deal with
# output files written for symbols that only differ in casing, such as for two
# classes, one named CLASS and the other named Class, and to also support
# references to files without having to specify the exact matching casing. On
# Windows (including Cygwin) and MacOS, users should typically set this option
# to NO, whereas on Linux or other Unix flavors it should typically be set to
# YES.
# The default value is: system dependent.
CASE_SENSE_NAMES = NO
@ -562,6 +602,12 @@ HIDE_SCOPE_NAMES = NO
HIDE_COMPOUND_REFERENCE= NO
# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class
# will show which file needs to be included to use the class.
# The default value is: YES.
SHOW_HEADERFILE = YES
# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
# the files that are included by a file in the documentation of that file.
# The default value is: YES.
@ -719,7 +765,8 @@ FILE_VERSION_FILTER =
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option. You can
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
# will be used as the name of the layout file.
# will be used as the name of the layout file. See also section "Changing the
# layout of pages" for information.
#
# Note that if you run doxygen from a directory containing a file called
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
@ -765,24 +812,35 @@ WARNINGS = NO
WARN_IF_UNDOCUMENTED = NO
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
# in a documented function, or documenting parameters that don't exist or using
# markup commands wrongly.
# potential errors in the documentation, such as documenting some parameters in
# a documented function twice, or documenting parameters that don't exist or
# using markup commands wrongly.
# The default value is: YES.
WARN_IF_DOC_ERROR = YES
# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete
# function parameter documentation. If set to NO, doxygen will accept that some
# parameters have no documentation without warning.
# The default value is: YES.
WARN_IF_INCOMPLETE_DOC = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
# value. If set to NO, doxygen will only warn about wrong or incomplete
# parameter documentation, but not about the absence of documentation. If
# EXTRACT_ALL is set to YES then this flag will automatically be disabled.
# value. If set to NO, doxygen will only warn about wrong parameter
# documentation, but not about the absence of documentation. If EXTRACT_ALL is
# set to YES then this flag will automatically be disabled. See also
# WARN_IF_INCOMPLETE_DOC
# The default value is: NO.
WARN_NO_PARAMDOC = NO
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
# a warning is encountered.
# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
# at the end of the doxygen process doxygen will return with a non-zero status.
# Possible values are: NO, YES and FAIL_ON_WARNINGS.
# The default value is: NO.
WARN_AS_ERROR = NO
@ -799,7 +857,10 @@ WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning and error
# messages should be written. If left blank the output is written to standard
# error (stderr).
# error (stderr). In case the file specified cannot be opened for writing the
# warning and error messages are written to standard error. When as file - is
# specified the warning and error messages are written to standard output
# (stdout).
WARN_LOGFILE =
@ -820,8 +881,8 @@ INPUT = ../src \
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see: https://www.gnu.org/software/libiconv/) for the list of
# possible encodings.
# documentation (see:
# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
@ -834,11 +895,15 @@ INPUT_ENCODING = UTF-8
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# read by doxygen.
#
# Note the list of default checked file patterns might differ from the list of
# default file extension mappings.
#
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml,
# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C
# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd,
# *.vhdl, *.ucf, *.qsf and *.ice.
FILE_PATTERNS = *.php
@ -883,7 +948,7 @@ EXCLUDE_PATTERNS = */bin/* \
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
# ANamespace::AClass, ANamespace::*Test
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
@ -1059,16 +1124,24 @@ USE_HTAGS = NO
VERBATIM_HEADERS = YES
# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
# cost of reduced performance. This can be particularly helpful with template
# rich C++ code for which doxygen's built-in parser lacks the necessary type
# information.
# clang parser (see:
# http://clang.llvm.org/) for more accurate parsing at the cost of reduced
# performance. This can be particularly helpful with template rich C++ code for
# which doxygen's built-in parser lacks the necessary type information.
# Note: The availability of this option depends on whether or not doxygen was
# generated with the -Duse_libclang=ON option for CMake.
# The default value is: NO.
CLANG_ASSISTED_PARSING = NO
# If the CLANG_ASSISTED_PARSING tag is set to YES and the CLANG_ADD_INC_PATHS
# tag is set to YES then doxygen will add the directory of each input to the
# include path.
# The default value is: YES.
# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
CLANG_ADD_INC_PATHS = YES
# If clang assisted parsing is enabled you can provide the compiler with command
# line options that you would normally use when invoking the compiler. Note that
# the include paths will already be set by doxygen for the files and directories
@ -1078,10 +1151,13 @@ CLANG_ASSISTED_PARSING = NO
CLANG_OPTIONS =
# If clang assisted parsing is enabled you can provide the clang parser with the
# path to the compilation database (see:
# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files
# were built. This is equivalent to specifying the "-p" option to a clang tool,
# such as clang-check. These options will then be passed to the parser.
# path to the directory containing a file called compile_commands.json. This
# file is the compilation database (see:
# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the
# options used when the source files were built. This is equivalent to
# specifying the -p option to a clang tool, such as clang-check. These options
# will then be passed to the parser. Any options specified with CLANG_OPTIONS
# will be added as well.
# Note: The availability of this option depends on whether or not doxygen was
# generated with the -Duse_libclang=ON option for CMake.
@ -1098,13 +1174,6 @@ CLANG_DATABASE_PATH =
ALPHABETICAL_INDEX = YES
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
@ -1204,7 +1273,7 @@ HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the style sheet and background images according to
# this color. Hue is specified as an angle on a colorwheel, see
# this color. Hue is specified as an angle on a color-wheel, see
# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
# purple, and 360 is red again.
@ -1214,7 +1283,7 @@ HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
# in the HTML output. For a value of 0 the output will use grayscales only. A
# in the HTML output. For a value of 0 the output will use gray-scales only. A
# value of 255 will produce the most vivid colors.
# Minimum value: 0, maximum value: 255, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
@ -1239,13 +1308,13 @@ HTML_COLORSTYLE_GAMMA = 80
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
HTML_TIMESTAMP = NO
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
# documentation will contain a main index with vertical navigation menus that
# are dynamically created via Javascript. If disabled, the navigation index will
# are dynamically created via JavaScript. If disabled, the navigation index will
# consists of multiple levels of tabs that are statically embedded in every HTML
# page. Disable this option to support browsers that do not have Javascript,
# page. Disable this option to support browsers that do not have JavaScript,
# like the Qt help browser.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
@ -1275,10 +1344,11 @@ HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
# environment (see: https://developer.apple.com/xcode/), introduced with OSX
# 10.5 (Leopard). To create a documentation set, doxygen will generate a
# Makefile in the HTML output directory. Running make will produce the docset in
# that directory and running make install will install the docset in
# environment (see:
# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To
# create a documentation set, doxygen will generate a Makefile in the HTML
# output directory. Running make will produce the docset in that directory and
# running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
# genXcode/_index.html for more information.
@ -1295,6 +1365,13 @@ GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
# This tag determines the URL of the docset feed. A documentation feed provides
# an umbrella under which multiple documentation sets from a single provider
# (such as a company or product suite) can be grouped.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDURL =
# This tag specifies a string that should uniquely identify the documentation
# set bundle. This should be a reverse domain-name style string, e.g.
# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
@ -1320,8 +1397,12 @@ DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# Windows.
# on Windows. In the beginning of 2021 Microsoft took the original page, with
# a.o. the download links, offline the HTML help workshop was already many years
# in maintenance mode). You can download the HTML help workshop from the web
# archives at Installation executable (see:
# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo
# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe).
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
@ -1351,7 +1432,7 @@ CHM_FILE =
HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated
# (YES) or that it should be included in the master .chm file (NO).
# (YES) or that it should be included in the main .chm file (NO).
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
@ -1396,7 +1477,8 @@ QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
# (see:
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
@ -1404,8 +1486,8 @@ QHP_NAMESPACE = org.doxygen.Project
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-
# folders).
# Folders (see:
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
@ -1413,30 +1495,30 @@ QHP_VIRTUAL_FOLDER = doc
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# filters).
# Filters (see:
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# filters).
# Filters (see:
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
# The QHG_LOCATION tag can be used to specify the location of Qt's
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
# generated .qhp file.
# The QHG_LOCATION tag can be used to specify the location (absolute path
# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to
# run qhelpgenerator on the generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
@ -1479,16 +1561,28 @@ DISABLE_INDEX = NO
# to work a browser that supports JavaScript, DHTML, CSS and frames is required
# (i.e. any modern browser). Windows users are probably better off using the
# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
# further fine-tune the look of the index. As an example, the default style
# sheet generated by doxygen has an example that shows how to put an image at
# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
# the same information as the tab index, you could consider setting
# DISABLE_INDEX to YES when enabling this option.
# further fine tune the look of the index (see "Fine-tuning the output"). As an
# example, the default style sheet generated by doxygen has an example that
# shows how to put an image at the root of the tree instead of the PROJECT_NAME.
# Since the tree basically has the same information as the tab index, you could
# consider setting DISABLE_INDEX to YES when enabling this option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = YES
# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
# area (value NO) or if it should extend to the full height of the window (value
# YES). Setting this to YES gives a layout similar to
# https://docs.readthedocs.io with more room for contents, but less room for the
# project logo, title, and description. If either GENERATE_TREEVIEW or
# DISABLE_INDEX is set to NO, this option has no effect.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
FULL_SIDEBAR = NO
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
# doxygen will group on one line in the generated HTML documentation.
#
@ -1513,6 +1607,24 @@ TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email
# addresses.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
OBFUSCATE_EMAILS = YES
# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg
# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see
# https://inkscape.org) to generate formulas as SVG images instead of PNGs for
# the HTML output. These images will generally look nicer at scaled resolutions.
# Possible values are: png (the default) and svg (looks nicer but requires the
# pdf2svg or inkscape tool).
# The default value is: png.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FORMULA_FORMAT = png
# Use this tag to change the font size of LaTeX formulas included as images in
# the HTML documentation. When you change the font size after a successful
# doxygen run you need to manually remove any form_*.png images from the HTML
@ -1533,8 +1645,14 @@ FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
# to create new LaTeX commands to be used in formulas as building blocks. See
# the section "Including formulas" for details.
FORMULA_MACROFILE =
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# https://www.mathjax.org) which uses client side Javascript for the rendering
# https://www.mathjax.org) which uses client side JavaScript for the rendering
# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
@ -1544,11 +1662,29 @@ FORMULA_TRANSPARENT = YES
USE_MATHJAX = YES
# With MATHJAX_VERSION it is possible to specify the MathJax version to be used.
# Note that the different versions of MathJax have different requirements with
# regards to the different settings, so it is possible that also other MathJax
# settings have to be changed when switching between the different MathJax
# versions.
# Possible values are: MathJax_2 and MathJax_3.
# The default value is: MathJax_2.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_VERSION = MathJax_2
# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
# http://docs.mathjax.org/en/latest/output.html) for more details.
# the MathJax output. For more details about the output format see MathJax
# version 2 (see:
# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3
# (see:
# http://docs.mathjax.org/en/latest/web/components/output.html).
# Possible values are: HTML-CSS (which is slower, but has the best
# compatibility), NativeMML (i.e. MathML) and SVG.
# compatibility. This is the name for Mathjax version 2, for MathJax version 3
# this will be translated into chtml), NativeMML (i.e. MathML. Only supported
# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This
# is the name for Mathjax version 3, for MathJax version 2 this will be
# translated into HTML-CSS) and SVG.
# The default value is: HTML-CSS.
# This tag requires that the tag USE_MATHJAX is set to YES.
@ -1561,22 +1697,29 @@ MATHJAX_FORMAT = HTML-CSS
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
# MathJax from https://www.mathjax.org before deployment.
# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/.
# MathJax from https://www.mathjax.org before deployment. The default value is:
# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2
# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = https://cdn.mathjax.org/mathjax/latest
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
# for MathJax version 2 (see
# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions):
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# For example for MathJax version 3 (see
# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html):
# MATHJAX_EXTENSIONS = ams
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
# (see:
# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an
# example see the documentation.
# This tag requires that the tag USE_MATHJAX is set to YES.
@ -1604,7 +1747,7 @@ MATHJAX_CODEFILE =
SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a web server instead of a web client using Javascript. There
# implemented using a web server instead of a web client using JavaScript. There
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
# setting. When disabled, doxygen will generate a PHP script for searching and
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
@ -1623,7 +1766,8 @@ SERVER_BASED_SEARCH = NO
#
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: https://xapian.org/).
# Xapian (see:
# https://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# The default value is: NO.
@ -1636,8 +1780,9 @@ EXTERNAL_SEARCH = NO
#
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: https://xapian.org/). See the section "External Indexing and
# Searching" for details.
# Xapian (see:
# https://xapian.org/). See the section "External Indexing and Searching" for
# details.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
@ -1708,10 +1853,11 @@ LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
# generate index for LaTeX.
# generate index for LaTeX. In case there is no backslash (\) as first character
# it will be automatically added in the LaTeX code.
# Note: This tag is used in the generated output file (.tex).
# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
# The default value is: \makeindex.
# The default value is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_MAKEINDEX_CMD = \makeindex
@ -1745,29 +1891,31 @@ PAPER_TYPE = a4
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first
# chapter. If it is left blank doxygen will generate a standard header. See
# section "Doxygen usage" for information on how to let doxygen write the
# default header to a separate file.
# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for
# the generated LaTeX document. The header should contain everything until the
# first chapter. If it is left blank doxygen will generate a standard header. It
# is highly recommended to start with a default header using
# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty
# and then modify the file new_header.tex. See also section "Doxygen usage" for
# information on how to generate the default header that doxygen normally uses.
#
# Note: Only use a user-defined header if you know what you are doing! The
# following commands have a special meaning inside the header: $title,
# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
# string, for the replacement values of the other commands the user is referred
# to HTML_HEADER.
# Note: Only use a user-defined header if you know what you are doing!
# Note: The header is subject to change so you typically have to regenerate the
# default header when upgrading to a newer version of doxygen. The following
# commands have a special meaning inside the header (and footer): For a
# description of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
# generated LaTeX document. The footer should contain everything after the last
# chapter. If it is left blank doxygen will generate a standard footer. See
# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for
# the generated LaTeX document. The footer should contain everything after the
# last chapter. If it is left blank doxygen will generate a standard footer. See
# LATEX_HEADER for more information on how to generate a default footer and what
# special commands can be used inside the footer.
#
# Note: Only use a user-defined footer if you know what you are doing!
# special commands can be used inside the footer. See also section "Doxygen
# usage" for information on how to generate the default footer that doxygen
# normally uses. Note: Only use a user-defined footer if you know what you are
# doing!
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
@ -1800,9 +1948,11 @@ LATEX_EXTRA_FILES =
PDF_HYPERLINKS = YES
# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
# the PDF file directly from the LaTeX files. Set this option to YES, to get a
# higher quality PDF documentation.
# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
# files. Set this option to YES, to get a higher quality PDF documentation.
#
# See also section LATEX_CMD_NAME for selecting the engine.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
@ -1810,8 +1960,7 @@ USE_PDFLATEX = YES
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
# command to the generated LaTeX files. This will instruct LaTeX to keep running
# if errors occur, instead of asking the user for help. This option is also used
# when generating formulas in HTML.
# if errors occur, instead of asking the user for help.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
@ -1824,16 +1973,6 @@ LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
# code with syntax highlighting in the LaTeX output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
@ -1914,16 +2053,6 @@ RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
# with syntax highlighting in the RTF output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_SOURCE_CODE = NO
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
@ -2020,15 +2149,6 @@ GENERATE_DOCBOOK = NO
DOCBOOK_OUTPUT = docbook
# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
# program listings (including syntax highlighting and cross-referencing
# information) to the DOCBOOK output. Note that enabling this will significantly
# increase the size of the DOCBOOK output.
# The default value is: NO.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
@ -2203,34 +2323,10 @@ EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of 'which perl').
# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
# The default value is: YES.
CLASS_DIAGRAMS = NO
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see:
# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
@ -2287,11 +2383,14 @@ DOT_FONTSIZE = 10
DOT_FONTPATH =
# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
# each documented class showing the direct and indirect inheritance relations.
# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
# If the CLASS_GRAPH tag is set to YES (or GRAPH) then doxygen will generate a
# graph for each documented class showing the direct and indirect inheritance
# relations. In case HAVE_DOT is set as well dot will be used to draw the graph,
# otherwise the built-in generator will be used. If the CLASS_GRAPH tag is set
# to TEXT the direct and indirect inheritance relations will be shown as texts /
# links.
# Possible values are: NO, YES, TEXT and GRAPH.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
@ -2328,10 +2427,32 @@ UML_LOOK = YES
# but if the number exceeds 15, the total amount of fields shown is limited to
# 10.
# Minimum value: 0, maximum value: 100, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
# This tag requires that the tag UML_LOOK is set to YES.
UML_LIMIT_NUM_FIELDS = 10
# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and
# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS
# tag is set to YES, doxygen will add type and arguments for attributes and
# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen
# will not generate fields with class member information in the UML graphs. The
# class diagrams will look similar to the default class diagrams but using UML
# notation for the relationships.
# Possible values are: NO, YES and NONE.
# The default value is: NO.
# This tag requires that the tag UML_LOOK is set to YES.
DOT_UML_DETAILS = NO
# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters
# to display on a single line. If the actual line length exceeds this threshold
# significantly it will wrapped across multiple lines. Some heuristics are apply
# to avoid ugly line breaks.
# Minimum value: 0, maximum value: 1000, default value: 17.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_WRAP_THRESHOLD = 17
# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
# collaboration graphs will show the relations between templates and their
# instances.
@ -2398,6 +2519,13 @@ GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels
# of child directories generated in directory dependency graphs by dot.
# Minimum value: 1, maximum value: 25, default value: 1.
# This tag requires that the tag DIRECTORY_GRAPH is set to YES.
DIR_GRAPH_MAX_DEPTH = 1
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. For an explanation of the image formats see the section
# output formats in the documentation of the dot tool (Graphviz (see:
@ -2451,10 +2579,10 @@ MSCFILE_DIRS =
DIAFILE_DIRS =
# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
# path where java can find the plantuml.jar file. If left blank, it is assumed
# PlantUML is not used or called during a preprocessing step. Doxygen will
# generate a warning when it encounters a \startuml command in this case and
# will not generate output for the diagram.
# path where java can find the plantuml.jar file or to the filename of jar file
# to be used. If left blank, it is assumed PlantUML is not used or called during
# a preprocessing step. Doxygen will generate a warning when it encounters a
# \startuml command in this case and will not generate output for the diagram.
PLANTUML_JAR_PATH =
@ -2516,14 +2644,18 @@ DOT_MULTI_TARGETS = YES
# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
# explaining the meaning of the various boxes and arrows in the dot generated
# graphs.
# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal
# graphical representation for inheritance and collaboration diagrams is used.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate
# files that are used to generate the various graphs.
#
# Note: This setting is not only used for dot files but also for msc temporary
# files.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES

Some files were not shown because too many files have changed in this diff Show More