Compare commits

...

1686 Commits

Author SHA1 Message Date
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
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
d7f40f75d2 PlayerPreLoginEvent: fixed documentation errors 2023-01-18 20:45:49 +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
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
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
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
ba18a81e88 NetworkSession: fixed rate limit getting exhausted after 2.5 seconds during PvP 2023-01-13 15:28:03 +00:00
39218017ca Fixed walls and thin blocks not connecting to each other
closes #5498
2023-01-12 22:16:41 +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
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
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
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
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
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
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
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
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
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
fc63c54116 CraftingManager: more detailed type information for shapelessRecipes and shapedRecipes 2023-01-04 00:32:26 +00:00
db07976aab TypeConverter: do not send useless meta to the client 2023-01-03 23:50:31 +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
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
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
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
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
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
97ef209c5f HandlerList: added missing class-string type for constructor 2022-12-19 16:26:36 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
c9626c610b Skin: Correctly handle errors produced by commented JSON decoder 2022-08-16 17:35:23 +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
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
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
f7ab0a3b92 Merge branch 'stable' into next-minor 2022-08-14 18:37:56 +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
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
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
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
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
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
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
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
fec89b7803 Lava burns entities for only 8 seconds in Bedrock (#5173) 2022-07-17 20:50:15 +01:00
4e3964ffce Armor: added clearCustomColor() 2022-07-16 15:10:07 +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
e00f8e3a32 Merge branch 'stable' into next-minor 2022-07-14 20:59:06 +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
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
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
Ali
705df7d508 EffectManager: remove redundant check (#5153) 2022-07-14 17:56:18 +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
4b1052022c Merge branch 'stable' into next-minor 2022-07-13 17:00:58 +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
0ad2985247 Update documentation for Item::__construct() 2022-07-06 23:54:29 +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
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
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
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
38651fde74 Merge branch 'stable' into next-minor 2022-06-29 16:53:31 +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
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
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
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
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
5e22b70b6d this is a joke ... 2022-06-08 14:56:25 +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
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
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
becbd562d6 FormattedCommandAlias: fixed incorrect arguments array being passed to the target 2022-06-07 19:47:45 +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
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
6ecfbd1bde FishingRod: make class less useless 2022-06-05 20:20:16 +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
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
4b662d65b3 PluginManager: check graylist before doing any loadability checks
fixes #5087
2022-06-02 16:29:22 +01:00
c87a3b054c composer.json: fix make-devtools command 2022-06-01 20:04:47 +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
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
6d7318af43 Liquid: fixed merge regression 2022-05-26 18:48:45 +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
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
227f28a6d2 Use VanillaItems::AIR() instead of ItemFactory 2022-05-24 15:47:27 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
f25beab6cb Use constants for compound meta values 2022-03-23 15:58:27 +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
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
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
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
55c744cc00 Added missing changes to the 4.0 changelog (#4820) 2022-02-11 17:39:45 +00:00
7e903fde5b Fixed multiple players being able to sleep in the same bed 2022-02-10 00:57:43 +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
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
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
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
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
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
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
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
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
26e3280fea Release 4.0.0-BETA2 2021-09-10 17:18:31 +01:00
fa45d1cdb5 Merge branch 'stable' 2021-09-10 17:13:51 +01:00
33b5da3749 3.22.6 is next 2021-09-10 17:09:51 +01:00
40e88f1686 Release 3.22.5 2021-09-10 17:09:50 +01:00
c995c2de37 updated changelog
[ci skip]
2021-09-10 17:04:35 +01:00
7701e1ff98 InGamePacketHandler: fix regression in movement handling since 82c8fa696a
fixes #4291
fixes #4398
2021-09-10 16:52:46 +01:00
4111d92b98 Stop hardcoding chunk dimensions everywhere (#4443) 2021-09-10 16:13:25 +01:00
9d5a86fe53 Revert "World: make the second parameter for getCollidingEntities() mandatory and non-nullable"
This reverts commit e1b7bf31bb.

fixes #4447
2021-09-10 16:06:08 +01:00
cf762d345d Player: Log debug messages when canInteract() prevents block interaction 2021-09-10 15:58:38 +01:00
f5c9c02e09 Improve documentation of Thread and Worker 2021-09-10 15:57:45 +01:00
32588d79c8 ConsoleReaderThread: remove useless code 2021-09-10 13:54:42 +01:00
1cc57afd25 Stop the ConsoleReaderThread explicitly, instead of letting ThreadManager do it
this hack dates back to the days when the console reader would get stuck on shutdown on some platforms.
2021-09-10 13:48:01 +01:00
334bf1277d BlockTransaction: Return failure if no blocks were changed
fixes #2813
2021-09-10 00:32:46 +01:00
082f0f2d57 Player: Generate an InventoryTransaction (with event) for crafting grid/cursor evacuation
this fixes the crack in the armour that allows creative players to drop items even when all drops are being cancelled by plugins.

closes #3284
2021-09-09 17:11:59 +01:00
5d4f14b388 Added TransactionBuilderInventory for server-side inventory transaction generation 2021-09-09 17:10:04 +01:00
4a787769bf Merge branch 'stable' 2021-09-09 16:06:16 +01:00
4c65a0cdaa LegacySkinAdapter: Use 64x64 for persona polyfilled skins
64x32 has some corruption issues and generally just looks really bad.
2021-09-09 16:04:43 +01:00
e0e19c67ef World: do not warn about leaked Player entities during world unload
this raises false-positives during shutdown if players were online.
The fact that the player entity leans on the World to clean up after it is slightly problematic, but I'm not sure what else to do about it for now.
2021-09-09 15:55:37 +01:00
6f8261f26a Added changelog so far for beta2 2021-09-09 01:32:39 +01:00
34f01a3ce3 World: Track entities separately from chunks
this allows entities to exist outside of generated chunks, with one caveat: they won't be saved in such cases.
Obviously, for player entities, this doesn't matter.

fixes #3947
2021-09-09 01:17:41 +01:00
ba2bfe0e11 World: depopulate neighbourBlockUpdateQueueIndex sooner
this fixes 2 problems:
1) Blocks which set themselves to something else during onNearbyBlockChange() would not receive any block update
2) A memory leak when blocks in unloaded chunks were scheduled for an update.

I'm a little uneasy about this change, because there must have been some reason why I put this at the end of the block and not at the start, but whatever it is, I can't reason about it, and there's reasons not to put it at the end too.
2021-09-08 22:11:17 +01:00
b9b1ba9526 Include eye height in Living->lookAt() calculation (#4440) 2021-09-08 21:54:32 +01:00
dca5a9d8ea Remove PHP Version from notice. (#4442) 2021-09-08 17:00:12 +01:00
7c943880b2 Do not show update notifications to users running from git sources 2021-09-07 23:52:11 +01:00
b8a15b647c Updated build/php submodule to pmmp/php-build-scripts@ad9cd1fdb4 2021-09-07 22:35:02 +00:00
627c70c4df actions: use chunkutils2 0.3.1 2021-09-07 22:55:50 +01:00
bc6e73e81d SubChunk: fixed light array GC since native LightArray introduction
since this went native, there was no support for copy-on-write, so this was only lazy-inited, but never cleaned if the array remained empty.
2021-09-07 22:54:54 +01:00
11d2e1ef08 Require ext-chunkutils ^0.3.0 2021-09-07 22:53:50 +01:00
c605b54591 Accept dev versions of chunkutils2 2021-09-07 22:52:00 +01:00
0f70348821 Remove noise 2021-09-07 20:31:13 +01:00
72fb49b356 World: add notifyNeighbourBlockUpdate() to allow triggering neighbour block updates on blocks manually
this can be useful if blocks were modified asynchronously.
2021-09-07 20:18:53 +01:00
ac55b21fb4 4.0.0-BETA2 is next 2021-09-07 14:19:29 +01:00
806f03bd37 consistency ... 2021-09-07 13:00:28 +01:00
39820be836 draft-release: preprocess only src of dependencies
p sure we had this problem already somewhere else? ...
2021-09-07 12:59:32 +01:00
1261 changed files with 27915 additions and 16408 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

@ -6,3 +6,19 @@ updates:
interval: daily
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"
- package-ecosystem: gitsubmodule
directory: "/"
schedule:
interval: daily
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,97 @@
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@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Clone pmmp/PocketMine-Docker repository
uses: actions/checkout@v3
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 ::set-output name=TAG_NAME::$VERSION
echo ::set-output name=MAJOR::$(echo $VERSION | cut -d. -f1)
echo ::set-output name=MINOR::$(echo $VERSION | cut -d. -f1-2)
- name: Download new release information
run: curl -f -L ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ steps.tag-name.outputs.TAG_NAME }}/build_info.json -o new_build_info.json
- name: Detect channel
id: channel
run: echo ::set-output name=CHANNEL::$(jq -r '.channel' new_build_info.json)
- name: Get name of Docker repository name
id: docker-repo-name
run: echo ::set-output name=NAME::$(echo "${GITHUB_REPOSITORY,,}")
- name: Build image for tag
uses: docker/build-push-action@v3.3.0
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@v3.3.0
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@v3.3.0
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@v3.3.0
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,100 @@
<?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) : array{
return [
"embeds" => [
[
"title" => "New PocketMine-MP release: $version ($channel)",
"description" => <<<DESCRIPTION
$description
[Details]($detailsUrl) | [Source Code]($sourceUrl) | [Build Log]($buildLogUrl) | [Download]($pharDownloadUrl)
DESCRIPTION,
"url" => $detailsUrl,
"color" => $channel === "stable" ? 0x57ab5a : 0xc69026
]
]
];
}
if(count($argv) !== 5){
fwrite(STDERR, "Required arguments: github repo, version, API token\n");
exit(1);
}
[, $repo, $tagName, $token, $hookURL] = $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"];
$description = $releaseInfoJson["body"];
$discordPayload = generateDiscordEmbed($buildInfoJson["base_version"], $buildInfoJson["channel"], $description, $detailsUrl, $sourceUrl, $pharDownloadUrl, $buildLogUrl);
$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@v3
- name: Setup PHP and tools
uses: shivammathur/setup-php@2.23.0
with:
php-version: 8.0
- name: Restore Composer package cache
uses: actions/cache@v3
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 ::set-output name=TAG_NAME::$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{')
- 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 }}

View File

@ -13,17 +13,17 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup PHP
uses: shivammathur/setup-php@2.12.0
uses: shivammathur/setup-php@2.23.0
with:
php-version: 8.0
- name: Restore Composer package cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cache/composer/files
@ -35,17 +35,18 @@ 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 ::set-output name=BUILD_NUMBER::$BUILD_NUMBER
- 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
@ -54,12 +55,13 @@ jobs:
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 ::set-output name=CHANGELOG_SUFFIX::$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BUILD_CHANNEL === "stable" ? "" : "-" . \pocketmine\VersionInfo::BUILD_CHANNEL;')
- 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 }} > build_info.json
- name: Upload release artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: release_artifacts
path: |
@ -68,7 +70,7 @@ jobs:
${{ github.workspace }}/build_info.json
- name: Create draft release
uses: ncipollo/release-action@v1.8.6
uses: ncipollo/release-action@v1.12.0
with:
artifacts: ${{ github.workspace }}/PocketMine-MP.phar,${{ github.workspace }}/start.*,${{ github.workspace }}/build_info.json
commit: ${{ github.sha }}
@ -79,4 +81,4 @@ jobs:
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.

View File

@ -13,20 +13,14 @@ jobs:
strategy:
matrix:
image: [ubuntu-20.04]
php: [8.0.9]
php: [8.0.27, 8.1.14, 8.2.1]
steps:
- uses: actions/checkout@v2 #needed for build.sh
- name: Check for PHP build cache
id: php-build-cache
uses: actions/cache@v2
- name: Build and prepare PHP cache
uses: pmmp/setup-php-action@7e0f5f0a95e9d45d1d5fab0e1ee7555fa3b04339
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 }}"
php-version: ${{ matrix.php }}
install-path: "./bin"
phpstan:
name: PHPStan analysis
@ -37,34 +31,22 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.9]
php: [8.0.27, 8.1.14, 8.2.1]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Restore PHP build cache
id: php-build-cache
uses: actions/cache@v2
- name: Setup PHP
uses: pmmp/setup-php-action@7e0f5f0a95e9d45d1d5fab0e1ee7555fa3b04339
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
php-version: ${{ matrix.php }}
install-path: "./bin"
- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php
- name: Restore Composer package cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cache/composer/files
@ -87,36 +69,22 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.9]
php: [8.0.27, 8.1.14, 8.2.1]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup PHP
uses: pmmp/setup-php-action@7e0f5f0a95e9d45d1d5fab0e1ee7555fa3b04339
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
php-version: ${{ matrix.php }}
install-path: "./bin"
- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php
- name: Restore Composer package cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cache/composer/files
@ -139,36 +107,24 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.9]
php: [8.0.27, 8.1.14, 8.2.1]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true
- name: Restore PHP build cache
id: php-build-cache
uses: actions/cache@v2
- name: Setup PHP
uses: pmmp/setup-php-action@7e0f5f0a95e9d45d1d5fab0e1ee7555fa3b04339
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
php-version: ${{ matrix.php }}
install-path: "./bin"
- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php
- name: Restore Composer package cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cache/composer/files
@ -183,6 +139,52 @@ jobs:
- name: Run integration tests
run: ./tests/travis.sh -t4
codegen:
name: Generated Code consistency checks
needs: build-php
runs-on: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.27, 8.1.14, 8.2.1]
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: pmmp/setup-php-action@7e0f5f0a95e9d45d1d5fab0e1ee7555fa3b04339
with:
php-version: ${{ matrix.php }}
install-path: "./bin"
- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php
- name: Restore Composer package cache
uses: actions/cache@v3
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: Regenerate registry annotations
run: php build/generate-registry-annotations.php src
- name: Regenerate KnownTranslation APIs
run: php build/generate-known-translation-apis.php
- name: Verify code is unchanged
run: |
git diff
git diff --quiet
codestyle:
name: Code Style checks
runs-on: ubuntu-20.04
@ -190,13 +192,15 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup PHP and tools
uses: shivammathur/setup-php@2.9.0
uses: shivammathur/setup-php@2.23.0
with:
php-version: 8.0
tools: php-cs-fixer
tools: php-cs-fixer:3.11
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@v3
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

@ -22,9 +22,9 @@
declare(strict_types=1);
const VERSIONS = [
"7.3",
"7.4",
"8.0"
"8.0",
"8.1",
"8.2"
];
$workflowFile = file_get_contents(__DIR__ . '/main.yml');

View File

@ -13,7 +13,7 @@ jobs:
- name: Install jq
run: sudo apt update && sudo apt install jq -y
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: pmmp/update.pmmp.io
ssh-key: ${{ secrets.UPDATE_PMMP_IO_DEPLOY_KEY }}

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

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

View File

@ -18,6 +18,32 @@ Larger contributions like feature additions should be preceded by a [Change Prop
## Other things you'll need
- [git](https://git-scm.com/)
## Choosing a target branch
PocketMine-MP has three primary branches of development.
| Type of change | `stable` | `next-minor` | `next-major` |
|:---------------|:--------:|:------------:|:------------:|
| 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) | ❌ | ❌ | ✔️ |
### 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**.
## 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.

View File

@ -1,13 +1,24 @@
<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://github.com/pmmp/PocketMine-MP/raw/stable/.github/readme/pocketmine-dark.png" media="(prefers-color-scheme: dark)">
<img src="https://github.com/pmmp/PocketMine-MP/raw/stable/.github/readme/pocketmine.png" 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://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://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://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
@ -24,7 +35,8 @@
## 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 `next-major` 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 Guidelines](CONTRIBUTING.md)

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

@ -17,21 +17,21 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
require dirname(__DIR__) . '/vendor/autoload.php';
if(count($argv) !== 4){
fwrite(STDERR, "required args: <git hash> <tag name> <github repo (owner/name)>");
if(count($argv) !== 6){
fwrite(STDERR, "required args: <git hash> <tag name> <github repo (owner/name)> <build number> <github actions run ID>\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,
"build" => (int) $argv[4],
"is_dev" => \pocketmine\VersionInfo::IS_DEVELOPMENT_BUILD,
"channel" => \pocketmine\VersionInfo::BUILD_CHANNEL,
"git_commit" => $argv[1],
@ -40,4 +40,5 @@ echo json_encode([
"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]",
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR) . "\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

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -29,7 +29,9 @@ 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;
@ -37,9 +39,11 @@ use function sprintf;
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(substr($file, -4) !== ".php"){
continue;
}
processFile($file);
}
}else{
processFile($argv[1]);
}

View File

@ -17,31 +17,40 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
namespace pocketmine\build\make_release;
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_replace;
use function sleep;
use function sprintf;
use function str_pad;
use function strlen;
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 = Utils::assumeNotFalse(file_get_contents($versionInfoPath), $versionInfoPath . " should always exist");
$versionInfo = preg_replace(
$pattern = '/^([\t ]*public )?const BASE_VERSION = "(\d+)\.(\d+)\.(\d+)(?:-(.*))?";$/m',
'$1const BASE_VERSION = "' . $newVersion . '";',
@ -60,22 +69,46 @@ 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]);
if(isset($filteredOpts["current"])){
$currentVer = new VersionString($filteredOpts["current"]);
}else{
$currentVer = new VersionString(VersionInfo::BASE_VERSION);
}
if(isset($filteredOpts["next"])){
$nextVer = new VersionString($filteredOpts["next"]);
}else{
$nextVer = new VersionString(sprintf(
"%u.%u.%u",
@ -84,26 +117,29 @@ function main(array $argv) : void{
$currentVer->getPatch() + 1
));
}
$channel = $filteredOpts["channel"] ?? VersionInfo::BUILD_CHANNEL;
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 . '"');
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");
echo "pushing changes in 5 seconds\n";
sleep(5);
system('git push origin HEAD ' . $currentVer->getBaseVersion());
systemWrapper('git push origin HEAD ' . $currentVer->getBaseVersion(), "failed to push changes to remote");
}
main($argv);
main();

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -40,12 +40,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,13 +135,18 @@ 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;
}
foreach(buildPhar(
$opts["out"] ?? getcwd() . DIRECTORY_SEPARATOR . "PocketMine-MP.phar",
dirname(__DIR__) . DIRECTORY_SEPARATOR,
@ -150,7 +156,8 @@ function main() : void{
'vendor'
],
[
'git' => $gitHash
'git' => $gitHash,
'build' => $build
],
<<<'STUB'
<?php

View File

@ -31,3 +31,6 @@ Plugin developers should **only** update their required API to this version if y
# 3.22.4
- Fixed a bug which broke the build of 3.22.3.
# 3.22.5
- Added a workaround for polyfilled solid-colour Persona skin replacements turning into a corrupted mess (caused by https://bugs.mojang.com/browse/MCPE-130275).

14
changelogs/3.23.md Normal file
View File

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

12
changelogs/3.24.md Normal file
View File

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

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

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.

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.

View File

@ -7,7 +7,7 @@
"require": {
"php": "^8.0",
"php-64bit": "*",
"ext-chunkutils2": "^0.2.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-pthreads": "^4.0",
"ext-reflection": "*",
"ext-simplexml": "*",
"ext-sockets": "*",
@ -34,28 +34,29 @@
"adhocore/json-comment": "^1.1",
"fgrosse/phpasn1": "^2.3",
"netresearch/jsonmapper": "^4.0",
"pocketmine/bedrock-protocol": "1.0.0+bedrock1.17.10",
"pocketmine/bedrock-data": "~1.13.0+bedrock-1.19.50",
"pocketmine/bedrock-protocol": "~17.1.0+bedrock-1.19.50",
"pocketmine/binaryutils": "^0.2.1",
"pocketmine/callback-validator": "^1.0.2",
"pocketmine/classloader": "dev-master",
"pocketmine/classloader": "^0.2.0",
"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/errorhandler": "^0.6.0",
"pocketmine/locale-data": "~2.11.0",
"pocketmine/log": "^0.4.0",
"pocketmine/log-pthreads": "^0.4.0",
"pocketmine/math": "^0.4.0",
"pocketmine/nbt": "^0.3.2",
"pocketmine/raklib": "^0.14.2",
"pocketmine/raklib-ipc": "^0.1.0",
"pocketmine/snooze": "^0.3.0",
"pocketmine/spl": "dev-master",
"ramsey/uuid": "^4.1",
"respect/validation": "^2.0",
"symfony/filesystem": "^5.4",
"webmozart/path-util": "^2.3"
},
"require-dev": {
"phpstan/phpstan": "0.12.98",
"phpstan/phpstan-phpunit": "^0.12.6",
"phpstan/phpstan-strict-rules": "^0.12.2",
"phpstan/phpstan": "1.9.13",
"phpstan/phpstan-phpunit": "^1.1.0",
"phpstan/phpstan-strict-rules": "^1.2.0",
"phpunit/phpunit": "^9.2"
},
"autoload": {
@ -79,7 +80,7 @@
"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"

1348
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

View File

@ -1,13 +1,10 @@
includes:
- tests/phpstan/analyse-for-current-php-version.neon.php
- tests/phpstan/configs/actual-problems.neon
- tests/phpstan/configs/check-explicit-mixed-baseline.neon
- tests/phpstan/configs/gc-hacks.neon
- tests/phpstan/configs/impossible-generics.neon
- tests/phpstan/configs/l7-baseline.neon
- tests/phpstan/configs/l8-baseline.neon
- tests/phpstan/configs/php-bugs.neon
- tests/phpstan/configs/phpstan-bugs.neon
- tests/phpstan/configs/pthreads-bugs.neon
- tests/phpstan/configs/runtime-type-checks.neon
- tests/phpstan/configs/spl-fixed-array-sucks.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
@ -16,11 +13,11 @@ includes:
rules:
- pocketmine\phpstan\rules\DisallowEnumComparisonRule
- pocketmine\phpstan\rules\UnsafeForeachArrayOfStringRule
# - pocketmine\phpstan\rules\ThreadedSupportedTypesRule
parameters:
level: 8
checkExplicitMixed: true
level: 9
checkMissingCallableSignature: true
treatPhpDocTypesAsCertain: false
bootstrapFiles:
@ -38,6 +35,9 @@ parameters:
- tests/phpunit
- tests/plugins/TesterPlugin
- tools
excludePaths:
analyseAndScan:
- build/php
dynamicConstantNames:
- pocketmine\VersionInfo::IS_DEVELOPMENT_BUILD
- pocketmine\DEBUG
@ -54,5 +54,5 @@ parameters:
#variadics don't work for this - mixed probably shouldn't work either, but for now it does
#what we actually need is something that accepts an infinite number of parameters, but in the absence of that,
#we'll just fill it with 10 - it's very unlikely to encounter a callable with 10 parameters anyway.
anyCallable: 'callable(mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed) : mixed'
anyClosure: '\Closure(mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed) : mixed'
anyCallable: 'callable(never, never, never, never, never, never, never, never, never, never) : mixed'
anyClosure: '\Closure(never, never, never, never, never, never, never, never, never, never) : mixed'

View File

@ -1,4 +1,691 @@
{
"-2": -2,
"-3": -3,
"-4": -4,
"-5": -5,
"-6": -6,
"-7": -7,
"-8": -8,
"-9": -9,
"-10": -10,
"-11": -11,
"-12": -12,
"-13": -13,
"-14": -14,
"-15": -15,
"-16": -16,
"-17": -17,
"-18": -18,
"-19": -19,
"-20": -20,
"-21": -21,
"-22": -22,
"-23": -23,
"-24": -24,
"-25": -25,
"-26": -26,
"-27": -27,
"-28": -28,
"-29": -29,
"-30": -30,
"-31": -31,
"-32": -32,
"-33": -33,
"-34": -34,
"-35": -35,
"-36": -36,
"-37": -37,
"-38": -38,
"-39": -39,
"-40": -40,
"-41": -41,
"-42": -42,
"-43": -43,
"-44": -44,
"-45": -45,
"-46": -46,
"-47": -47,
"-48": -48,
"-49": -49,
"-50": -50,
"-51": -51,
"-52": -52,
"-53": -53,
"-54": -54,
"-55": -55,
"-56": -56,
"-57": -57,
"-58": -58,
"-59": -59,
"-60": -60,
"-61": -61,
"-62": -62,
"-63": -63,
"-64": -64,
"-65": -65,
"-66": -66,
"-67": -67,
"-68": -68,
"-69": -69,
"-70": -70,
"-71": -71,
"-72": -72,
"-73": -73,
"-74": -74,
"-75": -75,
"-76": -76,
"-77": -77,
"-78": -78,
"-79": -79,
"-80": -80,
"-81": -81,
"-82": -82,
"-83": -83,
"-84": -84,
"-85": -85,
"-86": -86,
"-87": -87,
"-88": -88,
"-89": -89,
"-90": -90,
"-91": -91,
"-92": -92,
"-93": -93,
"-94": -94,
"-95": -95,
"-96": -96,
"-97": -97,
"-98": -98,
"-99": -99,
"-100": -100,
"-101": -101,
"-102": -102,
"-103": -103,
"-104": -104,
"-105": -105,
"-106": -106,
"-107": -107,
"-108": -108,
"-109": -109,
"-110": -110,
"-111": -111,
"-112": -112,
"-113": -113,
"-114": -114,
"-115": -115,
"-116": -116,
"-117": -117,
"-118": -118,
"-119": -119,
"-120": -120,
"-121": -121,
"-122": -122,
"-123": -123,
"-124": -124,
"-125": -125,
"-126": -126,
"-127": -127,
"-128": -128,
"-129": -129,
"-130": -130,
"-131": -131,
"-132": -132,
"-133": -133,
"-134": -134,
"-135": -135,
"-136": -136,
"-137": -137,
"-138": -138,
"-139": -139,
"-140": -140,
"-141": -141,
"-142": -142,
"-143": -143,
"-144": -144,
"-145": -145,
"-146": -146,
"-147": -147,
"-148": -148,
"-149": -149,
"-150": -150,
"-151": -151,
"-152": -152,
"-153": -153,
"-154": -154,
"-155": -155,
"-156": -156,
"-157": -157,
"-159": -159,
"-160": -160,
"-161": -161,
"-162": -162,
"-163": -163,
"-164": -164,
"-165": -165,
"-166": -166,
"-167": -167,
"-168": -168,
"-169": -169,
"-170": -170,
"-171": -171,
"-172": -172,
"-173": -173,
"-174": -174,
"-175": -175,
"-176": -176,
"-177": -177,
"-178": -178,
"-179": -179,
"-180": -180,
"-181": -181,
"-182": -182,
"-183": -183,
"-184": -184,
"-185": -185,
"-186": -186,
"-187": -187,
"-188": -188,
"-189": -189,
"-190": -190,
"-191": -191,
"-192": -192,
"-193": -193,
"-194": -194,
"-195": -195,
"-196": -196,
"-197": -197,
"-198": -198,
"-199": -199,
"-200": -200,
"-201": -201,
"-202": -202,
"-203": -203,
"-204": -204,
"-206": -206,
"-207": -207,
"-208": -208,
"-209": -209,
"-210": -210,
"-211": -211,
"-213": -213,
"-214": -214,
"0": 0,
"1": 1,
"2": 2,
"3": 3,
"4": 4,
"5": 5,
"6": 6,
"7": 7,
"8": 8,
"9": 9,
"10": 10,
"11": 11,
"12": 12,
"13": 13,
"14": 14,
"15": 15,
"16": 16,
"17": 17,
"18": 18,
"19": 19,
"20": 20,
"21": 21,
"22": 22,
"23": 23,
"24": 24,
"25": 25,
"26": 26,
"27": 27,
"28": 28,
"29": 29,
"30": 30,
"31": 31,
"32": 32,
"33": 33,
"34": 34,
"35": 35,
"36": 36,
"37": 37,
"38": 38,
"39": 39,
"40": 40,
"41": 41,
"42": 42,
"43": 43,
"44": 44,
"45": 45,
"46": 46,
"47": 47,
"48": 48,
"49": 49,
"50": 50,
"51": 51,
"52": 52,
"53": 53,
"54": 54,
"55": 55,
"56": 56,
"57": 57,
"58": 58,
"59": 59,
"60": 60,
"61": 61,
"62": 62,
"63": 63,
"64": 64,
"65": 65,
"66": 66,
"67": 67,
"68": 68,
"69": 69,
"70": 70,
"71": 71,
"72": 72,
"73": 73,
"74": 74,
"75": 75,
"76": 76,
"77": 77,
"78": 78,
"79": 79,
"80": 80,
"81": 81,
"82": 82,
"83": 83,
"84": 84,
"85": 85,
"86": 86,
"87": 87,
"88": 88,
"89": 89,
"90": 90,
"91": 91,
"92": 92,
"93": 93,
"94": 94,
"95": 95,
"96": 96,
"97": 97,
"98": 98,
"99": 99,
"100": 100,
"101": 101,
"102": 102,
"103": 103,
"104": 104,
"105": 105,
"106": 106,
"107": 107,
"108": 108,
"109": 109,
"110": 110,
"111": 111,
"112": 112,
"113": 113,
"114": 114,
"115": 115,
"116": 116,
"117": 117,
"118": 118,
"119": 119,
"120": 120,
"121": 121,
"122": 122,
"123": 123,
"124": 124,
"125": 125,
"126": 126,
"127": 127,
"128": 128,
"129": 129,
"130": 130,
"131": 131,
"132": 132,
"133": 133,
"134": 134,
"135": 135,
"136": 136,
"137": 137,
"138": 138,
"139": 139,
"140": 140,
"141": 141,
"142": 142,
"143": 143,
"144": 144,
"145": 145,
"146": 146,
"147": 147,
"148": 148,
"149": 149,
"150": 150,
"151": 151,
"152": 152,
"153": 153,
"154": 154,
"155": 155,
"156": 156,
"157": 157,
"158": 158,
"159": 159,
"160": 160,
"161": 161,
"162": 162,
"163": 163,
"164": 164,
"165": 165,
"166": 166,
"167": 167,
"168": 168,
"169": 169,
"170": 170,
"171": 171,
"172": 172,
"173": 173,
"174": 174,
"175": 175,
"176": 176,
"177": 177,
"178": 178,
"179": 179,
"180": 180,
"181": 181,
"182": 182,
"183": 183,
"184": 184,
"185": 185,
"186": 186,
"187": 187,
"188": 188,
"189": 189,
"190": 190,
"191": 191,
"192": 192,
"193": 193,
"194": 194,
"195": 195,
"196": 196,
"197": 197,
"198": 198,
"199": 199,
"200": 200,
"201": 201,
"202": 202,
"203": 203,
"204": 204,
"205": 205,
"206": 206,
"207": 207,
"208": 208,
"209": 209,
"213": 213,
"214": 214,
"215": 215,
"216": 216,
"218": 218,
"219": 219,
"220": 220,
"221": 221,
"222": 222,
"223": 223,
"224": 224,
"225": 225,
"226": 226,
"227": 227,
"228": 228,
"229": 229,
"231": 231,
"232": 232,
"233": 233,
"234": 234,
"235": 235,
"236": 236,
"237": 237,
"238": 238,
"239": 239,
"240": 240,
"241": 241,
"243": 243,
"244": 244,
"245": 245,
"246": 246,
"247": 247,
"248": 248,
"249": 249,
"250": 250,
"251": 251,
"252": 252,
"253": 253,
"254": 254,
"255": 255,
"256": 256,
"257": 257,
"258": 258,
"259": 259,
"260": 260,
"261": 261,
"262": 262,
"263": 263,
"264": 264,
"265": 265,
"266": 266,
"267": 267,
"268": 268,
"269": 269,
"270": 270,
"271": 271,
"272": 272,
"273": 273,
"274": 274,
"275": 275,
"276": 276,
"277": 277,
"278": 278,
"279": 279,
"280": 280,
"281": 281,
"282": 282,
"283": 283,
"284": 284,
"285": 285,
"286": 286,
"287": 287,
"288": 288,
"289": 289,
"290": 290,
"291": 291,
"292": 292,
"293": 293,
"294": 294,
"295": 295,
"296": 296,
"297": 297,
"298": 298,
"299": 299,
"300": 300,
"301": 301,
"302": 302,
"303": 303,
"304": 304,
"305": 305,
"306": 306,
"307": 307,
"308": 308,
"309": 309,
"310": 310,
"311": 311,
"312": 312,
"313": 313,
"314": 314,
"315": 315,
"316": 316,
"317": 317,
"318": 318,
"319": 319,
"320": 320,
"321": 321,
"322": 322,
"323": 323,
"324": 324,
"325": 325,
"328": 328,
"329": 329,
"330": 330,
"331": 331,
"332": 332,
"333": 333,
"334": 334,
"335": 335,
"336": 336,
"337": 337,
"338": 338,
"339": 339,
"340": 340,
"341": 341,
"342": 342,
"344": 344,
"345": 345,
"346": 346,
"347": 347,
"348": 348,
"349": 349,
"350": 350,
"351": 351,
"352": 352,
"353": 353,
"354": 354,
"355": 355,
"356": 356,
"357": 357,
"358": 358,
"359": 359,
"360": 360,
"361": 361,
"362": 362,
"363": 363,
"364": 364,
"365": 365,
"366": 366,
"367": 367,
"368": 368,
"369": 369,
"370": 370,
"371": 371,
"372": 372,
"373": 373,
"374": 374,
"375": 375,
"376": 376,
"377": 377,
"378": 378,
"379": 379,
"380": 380,
"381": 381,
"382": 382,
"383": 383,
"384": 384,
"385": 385,
"386": 386,
"387": 387,
"388": 388,
"389": 389,
"390": 390,
"391": 391,
"392": 392,
"393": 393,
"394": 394,
"395": 395,
"396": 396,
"397": 397,
"398": 398,
"399": 399,
"400": 400,
"401": 401,
"402": 402,
"403": 403,
"404": 404,
"405": 405,
"406": 406,
"407": 407,
"408": 408,
"409": 409,
"410": 410,
"411": 411,
"412": 412,
"413": 413,
"414": 414,
"415": 415,
"416": 416,
"417": 417,
"418": 418,
"419": 419,
"420": 420,
"421": 421,
"422": 422,
"423": 423,
"424": 424,
"425": 425,
"426": 426,
"427": 427,
"428": 428,
"429": 429,
"430": 430,
"431": 431,
"432": 432,
"433": 433,
"434": 434,
"437": 437,
"438": 438,
"441": 441,
"442": 442,
"443": 443,
"444": 444,
"445": 445,
"446": 446,
"447": 447,
"448": 448,
"449": 449,
"450": 450,
"451": 451,
"452": 452,
"453": 453,
"455": 455,
"457": 457,
"458": 458,
"459": 459,
"460": 460,
"461": 461,
"462": 462,
"463": 463,
"464": 464,
"465": 465,
"466": 466,
"467": 467,
"468": 468,
"469": 469,
"470": 470,
"471": 471,
"472": 472,
"473": 473,
"474": 474,
"475": 475,
"476": 476,
"477": 477,
"499": 499,
"500": 500,
"501": 501,
"502": 502,
"503": 503,
"504": 504,
"505": 505,
"506": 506,
"507": 507,
"508": 508,
"509": 509,
"510": 510,
"511": 511,
"513": 513,
"acacia_button": -140,
"acacia_door": 430,
"acacia_door_block": 196,
@ -226,27 +913,16 @@
"egg": 344,
"element_0": 36,
"element_1": -12,
"element_2": -13,
"element_3": -14,
"element_4": -15,
"element_5": -16,
"element_6": -17,
"element_7": -18,
"element_8": -19,
"element_9": -20,
"element_10": -21,
"element_100": -111,
"element_101": -112,
"element_102": -113,
"element_103": -114,
"element_104": -115,
"element_105": -116,
"element_106": -117,
"element_107": -118,
"element_108": -119,
"element_109": -120,
"element_11": -22,
"element_110": -121,
"element_111": -122,
"element_112": -123,
"element_113": -124,
"element_114": -125,
"element_115": -126,
"element_116": -127,
"element_117": -128,
"element_118": -129,
"element_12": -23,
"element_13": -24,
"element_14": -25,
@ -255,7 +931,6 @@
"element_17": -28,
"element_18": -29,
"element_19": -30,
"element_2": -13,
"element_20": -31,
"element_21": -32,
"element_22": -33,
@ -266,7 +941,6 @@
"element_27": -38,
"element_28": -39,
"element_29": -40,
"element_3": -14,
"element_30": -41,
"element_31": -42,
"element_32": -43,
@ -277,7 +951,6 @@
"element_37": -48,
"element_38": -49,
"element_39": -50,
"element_4": -15,
"element_40": -51,
"element_41": -52,
"element_42": -53,
@ -288,7 +961,6 @@
"element_47": -58,
"element_48": -59,
"element_49": -60,
"element_5": -16,
"element_50": -61,
"element_51": -62,
"element_52": -63,
@ -299,7 +971,6 @@
"element_57": -68,
"element_58": -69,
"element_59": -70,
"element_6": -17,
"element_60": -71,
"element_61": -72,
"element_62": -73,
@ -310,7 +981,6 @@
"element_67": -78,
"element_68": -79,
"element_69": -80,
"element_7": -18,
"element_70": -81,
"element_71": -82,
"element_72": -83,
@ -321,7 +991,6 @@
"element_77": -88,
"element_78": -89,
"element_79": -90,
"element_8": -19,
"element_80": -91,
"element_81": -92,
"element_82": -93,
@ -332,7 +1001,6 @@
"element_87": -98,
"element_88": -99,
"element_89": -100,
"element_9": -20,
"element_90": -101,
"element_91": -102,
"element_92": -103,
@ -343,6 +1011,25 @@
"element_97": -108,
"element_98": -109,
"element_99": -110,
"element_100": -111,
"element_101": -112,
"element_102": -113,
"element_103": -114,
"element_104": -115,
"element_105": -116,
"element_106": -117,
"element_107": -118,
"element_108": -119,
"element_109": -120,
"element_110": -121,
"element_111": -122,
"element_112": -123,
"element_113": -124,
"element_114": -125,
"element_115": -126,
"element_116": -127,
"element_117": -128,
"element_118": -129,
"elytra": 444,
"emerald": 388,
"emerald_block": 133,
@ -532,8 +1219,8 @@
"leather_pants": 300,
"leather_tunic": 299,
"leave": 18,
"leaves": 18,
"leave2": 161,
"leaves": 18,
"leaves2": 161,
"lectern": -194,
"lever": 69,

Submodule resources/locale deleted from 95b9c82f25

View File

@ -108,7 +108,7 @@ player:
verify-xuid: true
level-settings:
#The default format that levels will use when created
#The default format that worlds will use when created
default-format: leveldb
chunk-sending:
@ -119,8 +119,6 @@ chunk-sending:
spawn-radius: 4
chunk-ticking:
#Max amount of chunks processed each tick
per-tick: 40
#Radius of chunks around a player to tick
tick-radius: 3
#Number of blocks inside ticking areas' subchunks that get ticked every tick. Higher values will accelerate events
@ -128,7 +126,9 @@ chunk-ticking:
blocks-per-subchunk-per-tick: 3
#IDs of blocks not to perform random ticking on.
disable-block-ticking:
#- 2 # grass
#- grass
#- ice
#- fire
chunk-generation:
#Max. amount of chunks in the waiting queue to be populated
@ -166,17 +166,47 @@ timings:
host: timings.pmmp.io
console:
#Whether to accept commands via the console. If disabled, anything typed on the console will be ignored.
#Useful to save resources on headless servers where the console is never used (e.g. hosted server, Docker, etc.)
enable-input: true
#Choose whether to enable server stats reporting on the console title.
#NOTE: The title ticker will be disabled regardless if console colours are not enabled.
title-tick: true
aliases:
#Examples:
#showtheversion: version
##This section allows you to add, remove or remap command aliases.
##A single alias can call one or more other commands (or aliases).
##Aliases defined here will override any command aliases declared by plugins or PocketMine-MP itself.
##To remove an alias, set it to [], like so (note that prefixed aliases like "pocketmine:stop" will remain and can't
##be removed):
#stop: []
##Commands are not removed, only their aliases. You can still refer to a command using its full (prefixed)
##name, even if all its aliases are overwritten. The full name is usually something like "pocketmine:commandname" or
##"pluginname:commandname".
#abort: [pocketmine:stop]
##To add an alias, list the command(s) that it calls:
#showtheversion: [version]
#savestop: [save-all, stop]
##To invoke another command with arguments, use $1 to pass the first argument, $2 for the second etc:
#giveadmin: [op $1] ## `giveadmin alex` -> `op alex`
#kill: [suicide, say "I tried to kill $1"] ## `kill alex` -> `suicide` + `say "I tried to kill alex"`
#giverandom: [give $1 $2, say "Someone has just received a $2!"] ## `giverandom alex diamond` -> `give alex diamond` + `say "Someone has just received a diamond!"`
##To make arguments mandatory (so that the command fails if they are not provided), use $$, e.g. $$1, $$2:
#makeadmin: [op $$1] ## `makeadmin alex` -> `op alex`, `makeadmin` with no arguments = error
##To pass through a range of arguments, put a - (hyphen) after the index:
#tpalias: [tp $1-] ## `tpalias 256 70 256` -> `tp 256 70 256` - this passes arguments 1 and everything after it to the `tp` command
##To change an existing command alias and make it do something else:
#tp: [suicide]
worlds:
#These settings will override the generator set in server.properties and allows loading multiple levels
#These settings will override the generator set in server.properties and allows loading multiple worlds
#Example:
#world:
# seed: 404

View File

@ -10,3 +10,4 @@ resource_stack:
# - natural.zip
# - vanilla.zip
#If you want to force clients to use vanilla resources, you must place a vanilla resource pack in your resources folder and add it to the stack here.
#To specify a resource encryption key, put the key in the <resource>.key file alongside the resource pack. Example: vanilla.zip.key

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -35,3 +35,6 @@ define('pocketmine\_CORE_CONSTANTS_INCLUDED', true);
define('pocketmine\PATH', dirname(__DIR__) . '/');
define('pocketmine\RESOURCE_PATH', dirname(__DIR__) . '/resources/');
define('pocketmine\BEDROCK_DATA_PATH', dirname(__DIR__) . '/vendor/pocketmine/bedrock-data/');
define('pocketmine\LOCALE_DATA_PATH', dirname(__DIR__) . '/vendor/pocketmine/locale-data/');
define('pocketmine\COMPOSER_AUTOLOADER_PATH', dirname(__DIR__) . '/vendor/autoload.php');

View File

@ -1,379 +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);
namespace pocketmine;
use Composer\InstalledVersions;
use pocketmine\errorhandler\ErrorTypeToStringMap;
use pocketmine\network\mcpe\protocol\ProtocolInfo;
use pocketmine\plugin\PluginBase;
use pocketmine\plugin\PluginManager;
use pocketmine\utils\AssumptionFailedError;
use pocketmine\utils\Filesystem;
use pocketmine\utils\Utils;
use Webmozart\PathUtil\Path;
use function base64_encode;
use function date;
use function error_get_last;
use function fclose;
use function file;
use function file_exists;
use function file_get_contents;
use function fopen;
use function fwrite;
use function get_loaded_extensions;
use function implode;
use function is_dir;
use function is_resource;
use function json_encode;
use function json_last_error_msg;
use function ksort;
use function max;
use function mb_strtoupper;
use function microtime;
use function mkdir;
use function ob_end_clean;
use function ob_get_contents;
use function ob_start;
use function php_uname;
use function phpinfo;
use function phpversion;
use function preg_replace;
use function sprintf;
use function str_split;
use function strpos;
use function substr;
use function zend_version;
use function zlib_encode;
use const FILE_IGNORE_NEW_LINES;
use const JSON_UNESCAPED_SLASHES;
use const PHP_EOL;
use const PHP_OS;
use const SORT_STRING;
class CrashDump{
/**
* Crashdump data format version, used by the crash archive to decide how to decode the crashdump
* This should be incremented when backwards incompatible changes are introduced, such as fields being removed or
* having their content changed, version format changing, etc.
* It is not necessary to increase this when adding new fields.
*/
private const FORMAT_VERSION = 4;
private const PLUGIN_INVOLVEMENT_NONE = "none";
private const PLUGIN_INVOLVEMENT_DIRECT = "direct";
private const PLUGIN_INVOLVEMENT_INDIRECT = "indirect";
/** @var Server */
private $server;
/** @var resource */
private $fp;
/** @var float */
private $time;
/**
* @var mixed[]
* @phpstan-var array<string, mixed>
*/
private $data = [];
/** @var string */
private $encodedData = "";
/** @var string */
private $path;
public function __construct(Server $server){
$this->time = microtime(true);
$this->server = $server;
$crashPath = Path::join($this->server->getDataPath(), "crashdumps");
if(!is_dir($crashPath)){
mkdir($crashPath);
}
$this->path = Path::join($crashPath, date("D_M_j-H.i.s-T_Y", (int) $this->time) . ".log");
$fp = @fopen($this->path, "wb");
if(!is_resource($fp)){
throw new \RuntimeException("Could not create Crash Dump");
}
$this->fp = $fp;
$this->data["format_version"] = self::FORMAT_VERSION;
$this->data["time"] = $this->time;
$this->data["uptime"] = $this->time - $this->server->getStartTime();
$this->addLine($this->server->getName() . " Crash Dump " . date("D M j H:i:s T Y", (int) $this->time));
$this->addLine();
$this->baseCrash();
$this->generalData();
$this->pluginsData();
$this->extraData();
$this->encodeData();
fclose($this->fp);
}
public function getPath() : string{
return $this->path;
}
public function getEncodedData() : string{
return $this->encodedData;
}
/**
* @return mixed[]
* @phpstan-return array<string, mixed>
*/
public function getData() : array{
return $this->data;
}
private function encodeData() : void{
$this->addLine();
$this->addLine("----------------------REPORT THE DATA BELOW THIS LINE-----------------------");
$this->addLine();
$this->addLine("===BEGIN CRASH DUMP===");
$json = json_encode($this->data, JSON_UNESCAPED_SLASHES);
if($json === false){
throw new \RuntimeException("Failed to encode crashdump JSON: " . json_last_error_msg());
}
$zlibEncoded = zlib_encode($json, ZLIB_ENCODING_DEFLATE, 9);
if($zlibEncoded === false) throw new AssumptionFailedError("ZLIB compression failed");
$this->encodedData = $zlibEncoded;
foreach(str_split(base64_encode($this->encodedData), 76) as $line){
$this->addLine($line);
}
$this->addLine("===END CRASH DUMP===");
}
private function pluginsData() : void{
if($this->server->getPluginManager() instanceof PluginManager){
$this->addLine();
$this->addLine("Loaded plugins:");
$this->data["plugins"] = [];
$plugins = $this->server->getPluginManager()->getPlugins();
ksort($plugins, SORT_STRING);
foreach($plugins as $p){
$d = $p->getDescription();
$this->data["plugins"][$d->getName()] = [
"name" => $d->getName(),
"version" => $d->getVersion(),
"authors" => $d->getAuthors(),
"api" => $d->getCompatibleApis(),
"enabled" => $p->isEnabled(),
"depends" => $d->getDepend(),
"softDepends" => $d->getSoftDepend(),
"main" => $d->getMain(),
"load" => mb_strtoupper($d->getOrder()->name()),
"website" => $d->getWebsite()
];
$this->addLine($d->getName() . " " . $d->getVersion() . " by " . implode(", ", $d->getAuthors()) . " for API(s) " . implode(", ", $d->getCompatibleApis()));
}
}
}
private function extraData() : void{
global $argv;
if($this->server->getConfigGroup()->getPropertyBool("auto-report.send-settings", true)){
$this->data["parameters"] = (array) $argv;
if(($serverDotProperties = @file_get_contents(Path::join($this->server->getDataPath(), "server.properties"))) !== false){
$this->data["server.properties"] = preg_replace("#^rcon\\.password=(.*)$#m", "rcon.password=******", $serverDotProperties);
}else{
$this->data["server.properties"] = $serverDotProperties;
}
if(($pocketmineDotYml = @file_get_contents(Path::join($this->server->getDataPath(), "pocketmine.yml"))) !== false){
$this->data["pocketmine.yml"] = $pocketmineDotYml;
}else{
$this->data["pocketmine.yml"] = "";
}
}else{
$this->data["pocketmine.yml"] = "";
$this->data["server.properties"] = "";
$this->data["parameters"] = [];
}
$extensions = [];
foreach(get_loaded_extensions() as $ext){
$extensions[$ext] = phpversion($ext);
}
$this->data["extensions"] = $extensions;
if($this->server->getConfigGroup()->getPropertyBool("auto-report.send-phpinfo", true)){
ob_start();
phpinfo();
$this->data["phpinfo"] = ob_get_contents();
ob_end_clean();
}
}
private function baseCrash() : void{
global $lastExceptionError, $lastError;
if(isset($lastExceptionError)){
$error = $lastExceptionError;
}else{
$error = error_get_last();
if($error === null){
throw new \RuntimeException("Crash error information missing - did something use exit()?");
}
$error["trace"] = Utils::currentTrace(3); //Skipping CrashDump->baseCrash, CrashDump->construct, Server->crashDump
$error["fullFile"] = $error["file"];
$error["file"] = Filesystem::cleanPath($error["file"]);
try{
$error["type"] = ErrorTypeToStringMap::get($error["type"]);
}catch(\InvalidArgumentException $e){
//pass
}
if(($pos = strpos($error["message"], "\n")) !== false){
$error["message"] = substr($error["message"], 0, $pos);
}
}
if(isset($lastError)){
if(isset($lastError["trace"])){
$lastError["trace"] = Utils::printableTrace($lastError["trace"]);
}
$this->data["lastError"] = $lastError;
}
$this->data["error"] = $error;
unset($this->data["error"]["fullFile"]);
unset($this->data["error"]["trace"]);
$this->addLine("Error: " . $error["message"]);
$this->addLine("File: " . $error["file"]);
$this->addLine("Line: " . $error["line"]);
$this->addLine("Type: " . $error["type"]);
$this->data["plugin_involvement"] = self::PLUGIN_INVOLVEMENT_NONE;
if(!$this->determinePluginFromFile($error["fullFile"], true)){ //fatal errors won't leave any stack trace
foreach($error["trace"] as $frame){
if(!isset($frame["file"])){
continue; //PHP core
}
if($this->determinePluginFromFile($frame["file"], false)){
break;
}
}
}
$this->addLine();
$this->addLine("Code:");
$this->data["code"] = [];
if($this->server->getConfigGroup()->getPropertyBool("auto-report.send-code", true) and file_exists($error["fullFile"])){
$file = @file($error["fullFile"], FILE_IGNORE_NEW_LINES);
if($file !== false){
for($l = max(0, $error["line"] - 10); $l < $error["line"] + 10 and isset($file[$l]); ++$l){
$this->addLine("[" . ($l + 1) . "] " . $file[$l]);
$this->data["code"][$l + 1] = $file[$l];
}
}
}
$this->addLine();
$this->addLine("Backtrace:");
foreach(($this->data["trace"] = Utils::printableTrace($error["trace"])) as $line){
$this->addLine($line);
}
$this->addLine();
}
private function determinePluginFromFile(string $filePath, bool $crashFrame) : bool{
$frameCleanPath = Filesystem::cleanPath($filePath);
if(strpos($frameCleanPath, Filesystem::CLEAN_PATH_SRC_PREFIX) !== 0){
$this->addLine();
if($crashFrame){
$this->addLine("THIS CRASH WAS CAUSED BY A PLUGIN");
$this->data["plugin_involvement"] = self::PLUGIN_INVOLVEMENT_DIRECT;
}else{
$this->addLine("A PLUGIN WAS INVOLVED IN THIS CRASH");
$this->data["plugin_involvement"] = self::PLUGIN_INVOLVEMENT_INDIRECT;
}
if(file_exists($filePath)){
$reflection = new \ReflectionClass(PluginBase::class);
$file = $reflection->getProperty("file");
$file->setAccessible(true);
foreach($this->server->getPluginManager()->getPlugins() as $plugin){
$filePath = Filesystem::cleanPath($file->getValue($plugin));
if(strpos($frameCleanPath, $filePath) === 0){
$this->data["plugin"] = $plugin->getName();
$this->addLine("BAD PLUGIN: " . $plugin->getDescription()->getFullName());
break;
}
}
}
return true;
}
return false;
}
private function generalData() : void{
$version = VersionInfo::VERSION();
$composerLibraries = [];
foreach(InstalledVersions::getInstalledPackages() as $package){
$composerLibraries[$package] = sprintf(
"%s@%s",
InstalledVersions::getPrettyVersion($package) ?? "unknown",
InstalledVersions::getReference($package) ?? "unknown"
);
}
$this->data["general"] = [];
$this->data["general"]["name"] = $this->server->getName();
$this->data["general"]["base_version"] = VersionInfo::BASE_VERSION;
$this->data["general"]["build"] = VersionInfo::BUILD_NUMBER;
$this->data["general"]["is_dev"] = VersionInfo::IS_DEVELOPMENT_BUILD;
$this->data["general"]["protocol"] = ProtocolInfo::CURRENT_PROTOCOL;
$this->data["general"]["git"] = VersionInfo::GIT_HASH();
$this->data["general"]["uname"] = php_uname("a");
$this->data["general"]["php"] = phpversion();
$this->data["general"]["zend"] = zend_version();
$this->data["general"]["php_os"] = PHP_OS;
$this->data["general"]["os"] = Utils::getOS();
$this->data["general"]["composer_libraries"] = $composerLibraries;
$this->addLine($this->server->getName() . " version: " . $version->getFullVersion(true) . " [Protocol " . ProtocolInfo::CURRENT_PROTOCOL . "]");
$this->addLine("Git commit: " . VersionInfo::GIT_HASH());
$this->addLine("uname -a: " . php_uname("a"));
$this->addLine("PHP Version: " . phpversion());
$this->addLine("Zend version: " . zend_version());
$this->addLine("OS : " . PHP_OS . ", " . Utils::getOS());
$this->addLine("Composer libraries: ");
foreach($composerLibraries as $library => $libraryVersion){
$this->addLine("- $library $libraryVersion");
}
}
/**
* @param string $line
*/
public function addLine($line = "") : void{
fwrite($this->fp, $line . PHP_EOL);
}
/**
* @param string $str
*/
public function add($str) : void{
fwrite($this->fp, $str);
}
}

View File

@ -17,20 +17,20 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
namespace pocketmine;
use pocketmine\event\server\LowMemoryEvent;
use pocketmine\network\mcpe\cache\ChunkCache;
use pocketmine\scheduler\DumpWorkerMemoryTask;
use pocketmine\scheduler\GarbageCollectionTask;
use pocketmine\timings\Timings;
use pocketmine\utils\AssumptionFailedError;
use pocketmine\utils\Process;
use pocketmine\utils\Utils;
use Webmozart\PathUtil\Path;
use Symfony\Component\Filesystem\Path;
use function arsort;
use function count;
use function fclose;
@ -64,13 +64,11 @@ use function sprintf;
use function strlen;
use function substr;
use const JSON_PRETTY_PRINT;
use const JSON_THROW_ON_ERROR;
use const JSON_UNESCAPED_SLASHES;
use const SORT_NUMERIC;
class MemoryManager{
private Server $server;
private int $memoryLimit;
private int $globalMemoryLimit;
private int $checkRate;
@ -97,8 +95,9 @@ class MemoryManager{
private \Logger $logger;
public function __construct(Server $server){
$this->server = $server;
public function __construct(
private Server $server
){
$this->logger = new \PrefixedLogger($server->getLogger(), "Memory Manager");
$this->init($server->getConfigGroup());
@ -167,14 +166,14 @@ class MemoryManager{
}
public function canUseChunkCache() : bool{
return !$this->lowMemory or !$this->lowMemDisableChunkCache;
return !$this->lowMemory || !$this->lowMemDisableChunkCache;
}
/**
* Returns the allowed chunk radius based on the current memory usage.
*/
public function getViewDistance(int $distance) : int{
return ($this->lowMemory and $this->lowMemChunkRadiusOverride > 0) ? min($this->lowMemChunkRadiusOverride, $distance) : $distance;
return ($this->lowMemory && $this->lowMemChunkRadiusOverride > 0) ? min($this->lowMemChunkRadiusOverride, $distance) : $distance;
}
/**
@ -187,6 +186,7 @@ class MemoryManager{
foreach($this->server->getWorldManager()->getWorlds() as $world){
$world->clearCache(true);
}
ChunkCache::pruneCaches();
}
if($this->lowMemChunkGC){
@ -212,18 +212,18 @@ class MemoryManager{
public function check() : void{
Timings::$memoryManager->startTiming();
if(($this->memoryLimit > 0 or $this->globalMemoryLimit > 0) and ++$this->checkTicker >= $this->checkRate){
if(($this->memoryLimit > 0 || $this->globalMemoryLimit > 0) && ++$this->checkTicker >= $this->checkRate){
$this->checkTicker = 0;
$memory = Process::getAdvancedMemoryUsage();
$trigger = false;
if($this->memoryLimit > 0 and $memory[0] > $this->memoryLimit){
if($this->memoryLimit > 0 && $memory[0] > $this->memoryLimit){
$trigger = 0;
}elseif($this->globalMemoryLimit > 0 and $memory[1] > $this->globalMemoryLimit){
}elseif($this->globalMemoryLimit > 0 && $memory[1] > $this->globalMemoryLimit){
$trigger = 1;
}
if($trigger !== false){
if($this->lowMemory and $this->continuousTrigger){
if($this->lowMemory && $this->continuousTrigger){
if(++$this->continuousTriggerTicker >= $this->continuousTriggerRate){
$this->continuousTriggerTicker = 0;
$this->trigger($memory[$trigger], $this->memoryLimit, $trigger > 0, ++$this->continuousTriggerCount);
@ -238,7 +238,7 @@ class MemoryManager{
}
}
if($this->garbageCollectionPeriod > 0 and ++$this->garbageCollectionTicker >= $this->garbageCollectionPeriod){
if($this->garbageCollectionPeriod > 0 && ++$this->garbageCollectionTicker >= $this->garbageCollectionPeriod){
$this->garbageCollectionTicker = 0;
$this->triggerGarbageCollector();
}
@ -286,11 +286,10 @@ class MemoryManager{
/**
* Static memory dumper accessible from any thread.
*
* @param mixed $startingObject
* @param mixed $startingObject
*/
public static function dumpMemory($startingObject, string $outputFolder, int $maxNesting, int $maxStringSize, \Logger $logger) : void{
$hardLimit = ini_get('memory_limit');
if($hardLimit === false) throw new AssumptionFailedError("memory_limit INI directive should always exist");
$hardLimit = Utils::assumeNotFalse(ini_get('memory_limit'), "memory_limit INI directive should always exist");
ini_set('memory_limit', '-1');
gc_disable();
@ -298,7 +297,7 @@ class MemoryManager{
mkdir($outputFolder, 0777, true);
}
$obData = fopen(Path::join($outputFolder, "objects.js"), "wb+");
$obData = Utils::assumeNotFalse(fopen(Path::join($outputFolder, "objects.js"), "wb+"));
$objects = [];
@ -316,13 +315,16 @@ class MemoryManager{
$reflection = new \ReflectionClass($className);
$staticProperties[$className] = [];
foreach($reflection->getProperties() as $property){
if(!$property->isStatic() or $property->getDeclaringClass()->getName() !== $className){
if(!$property->isStatic() || $property->getDeclaringClass()->getName() !== $className){
continue;
}
if(!$property->isPublic()){
$property->setAccessible(true);
}
if(!$property->isInitialized()){
continue;
}
$staticCount++;
$staticProperties[$className][$property->getName()] = self::continueDump($property->getValue(), $objects, $refCounts, 0, $maxNesting, $maxStringSize);
@ -347,38 +349,36 @@ class MemoryManager{
}
}
file_put_contents(Path::join($outputFolder, "staticProperties.js"), json_encode($staticProperties, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
file_put_contents(Path::join($outputFolder, "staticProperties.js"), json_encode($staticProperties, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
$logger->info("Wrote $staticCount static properties");
if(isset($GLOBALS)){ //This might be null if we're on a different thread
$globalVariables = [];
$globalCount = 0;
$globalVariables = [];
$globalCount = 0;
$ignoredGlobals = [
'GLOBALS' => true,
'_SERVER' => true,
'_REQUEST' => true,
'_POST' => true,
'_GET' => true,
'_FILES' => true,
'_ENV' => true,
'_COOKIE' => true,
'_SESSION' => true
];
$ignoredGlobals = [
'GLOBALS' => true,
'_SERVER' => true,
'_REQUEST' => true,
'_POST' => true,
'_GET' => true,
'_FILES' => true,
'_ENV' => true,
'_COOKIE' => true,
'_SESSION' => true
];
foreach($GLOBALS as $varName => $value){
if(isset($ignoredGlobals[$varName])){
continue;
}
$globalCount++;
$globalVariables[$varName] = self::continueDump($value, $objects, $refCounts, 0, $maxNesting, $maxStringSize);
foreach(Utils::stringifyKeys($GLOBALS) as $varName => $value){
if(isset($ignoredGlobals[$varName])){
continue;
}
file_put_contents(Path::join($outputFolder, "globalVariables.js"), json_encode($globalVariables, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
$logger->info("Wrote $globalCount global variables");
$globalCount++;
$globalVariables[$varName] = self::continueDump($value, $objects, $refCounts, 0, $maxNesting, $maxStringSize);
}
file_put_contents(Path::join($outputFolder, "globalVariables.js"), json_encode($globalVariables, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
$logger->info("Wrote $globalCount global variables");
foreach(get_defined_functions()["user"] as $function){
$reflect = new \ReflectionFunction($function);
@ -391,14 +391,14 @@ class MemoryManager{
$functionStaticVarsCount += count($vars);
}
}
file_put_contents(Path::join($outputFolder, 'functionStaticVars.js'), json_encode($functionStaticVars, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
file_put_contents(Path::join($outputFolder, 'functionStaticVars.js'), json_encode($functionStaticVars, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
$logger->info("Wrote $functionStaticVarsCount function static variables");
$data = self::continueDump($startingObject, $objects, $refCounts, 0, $maxNesting, $maxStringSize);
do{
$continue = false;
foreach($objects as $hash => $object){
foreach(Utils::stringifyKeys($objects) as $hash => $object){
if(!is_object($object)){
continue;
}
@ -448,13 +448,16 @@ class MemoryManager{
if(!$property->isPublic()){
$property->setAccessible(true);
}
if(!$property->isInitialized($object)){
continue;
}
$info["properties"][$name] = self::continueDump($property->getValue($object), $objects, $refCounts, 0, $maxNesting, $maxStringSize);
}
}
}
fwrite($obData, json_encode($info, JSON_UNESCAPED_SLASHES) . "\n");
fwrite($obData, json_encode($info, JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR) . "\n");
}
}while($continue);
@ -463,11 +466,11 @@ class MemoryManager{
fclose($obData);
file_put_contents(Path::join($outputFolder, "serverEntry.js"), json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
file_put_contents(Path::join($outputFolder, "referenceCounts.js"), json_encode($refCounts, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
file_put_contents(Path::join($outputFolder, "serverEntry.js"), json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
file_put_contents(Path::join($outputFolder, "referenceCounts.js"), json_encode($refCounts, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
arsort($instanceCounts, SORT_NUMERIC);
file_put_contents(Path::join($outputFolder, "instanceCounts.js"), json_encode($instanceCounts, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
file_put_contents(Path::join($outputFolder, "instanceCounts.js"), json_encode($instanceCounts, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
$logger->info("Finished!");
@ -477,9 +480,14 @@ class MemoryManager{
/**
* @param mixed $from
* @param object[] $objects reference parameter
* @param object[] $objects reference parameter
* @param int[] $refCounts reference parameter
*
* @phpstan-param array<string, object> $objects
* @phpstan-param array<string, int> $refCounts
* @phpstan-param-out array<string, object> $objects
* @phpstan-param-out array<string, int> $refCounts
*
* @return mixed
*/
private static function continueDump($from, array &$objects, array &$refCounts, int $recursion, int $maxNesting, int $maxStringSize){
@ -503,8 +511,13 @@ class MemoryManager{
return "(error) ARRAY RECURSION LIMIT REACHED";
}
$data = [];
$numeric = 0;
foreach($from as $key => $value){
$data[$key] = self::continueDump($value, $objects, $refCounts, $recursion + 1, $maxNesting, $maxStringSize);
$data[$numeric] = [
"k" => self::continueDump($key, $objects, $refCounts, $recursion + 1, $maxNesting, $maxStringSize),
"v" => self::continueDump($value, $objects, $refCounts, $recursion + 1, $maxNesting, $maxStringSize),
];
$numeric++;
}
}elseif(is_string($from)){
$data = "(string) len(" . strlen($from) . ") " . substr(Utils::printable($from), 0, $maxStringSize);

View File

@ -32,14 +32,21 @@ namespace pocketmine {
use pocketmine\utils\ServerKiller;
use pocketmine\utils\Terminal;
use pocketmine\utils\Timezone;
use pocketmine\utils\Utils;
use pocketmine\wizard\SetupWizard;
use Webmozart\PathUtil\Path;
use Symfony\Component\Filesystem\Path;
use function defined;
use function extension_loaded;
use function function_exists;
use function getcwd;
use function is_dir;
use function mkdir;
use function phpversion;
use function preg_match;
use function preg_quote;
use function strpos;
use function realpath;
use function version_compare;
use const DIRECTORY_SEPARATOR;
require_once __DIR__ . '/VersionInfo.php';
@ -111,29 +118,30 @@ namespace pocketmine {
}
}
if(extension_loaded("pthreads")){
$pthreads_version = phpversion("pthreads");
if(($pthreads_version = phpversion("pthreads")) !== false){
if(substr_count($pthreads_version, ".") < 2){
$pthreads_version = "0.$pthreads_version";
}
if(version_compare($pthreads_version, "3.2.0") < 0){
$messages[] = "pthreads >= 3.2.0 is required, while you have $pthreads_version.";
if(version_compare($pthreads_version, "4.0.0") < 0 || version_compare($pthreads_version, "5.0.0") >= 0){
$messages[] = "pthreads ^4.0.0 is required, while you have $pthreads_version.";
}
}
if(extension_loaded("leveldb")){
$leveldb_version = phpversion("leveldb");
if(($leveldb_version = phpversion("leveldb")) !== false){
if(version_compare($leveldb_version, "0.2.1") < 0){
$messages[] = "php-leveldb >= 0.2.1 is required, while you have $leveldb_version.";
}
if(!defined('LEVELDB_ZLIB_RAW_COMPRESSION')){
$messages[] = "Given version of php-leveldb doesn't support ZLIB_RAW compression (use https://github.com/pmmp/php-leveldb)";
}
}
$chunkutils2_version = phpversion("chunkutils2");
$wantedVersionLock = "0.2";
$wantedVersionLock = "0.3";
$wantedVersionMin = "$wantedVersionLock.0";
if($chunkutils2_version !== false && (
version_compare($chunkutils2_version, $wantedVersionMin) < 0 ||
preg_match("/^" . preg_quote($wantedVersionLock, "/") . "\.\d+$/", $chunkutils2_version) === 0 //lock in at ^0.2, optionally at a patch release
preg_match("/^" . preg_quote($wantedVersionLock, "/") . "\.\d+(?:-dev)?$/", $chunkutils2_version) === 0 //lock in at ^0.2, optionally at a patch release
)){
$messages[] = "chunkutils2 ^$wantedVersionMin is required, while you have $chunkutils2_version.";
}
@ -142,6 +150,10 @@ namespace pocketmine {
$messages[] = "The native PocketMine extension is no longer supported.";
}
if(!defined('AF_INET6')){
$messages[] = "IPv6 support is required, but your PHP binary was built without IPv6 support.";
}
return $messages;
}
@ -152,7 +164,7 @@ namespace pocketmine {
if(PHP_DEBUG !== 0){
$logger->warning("This PHP binary was compiled in debug mode. This has a major impact on performance.");
}
if(extension_loaded("xdebug")){
if(extension_loaded("xdebug") && (!function_exists('xdebug_info') || count(xdebug_info('mode')) !== 0)){
$logger->warning("Xdebug extension is enabled. This has a major impact on performance.");
}
if(((int) ini_get('zend.assertions')) !== -1){
@ -168,10 +180,10 @@ namespace pocketmine {
--------------------------------------- ! WARNING ! ---------------------------------------
You're using PHP 8.0 with JIT enabled. This provides significant performance improvements.
You're using PHP with JIT enabled. This provides significant performance improvements.
HOWEVER, it is EXPERIMENTAL, and has already been seen to cause weird and unexpected bugs.
Proceed with caution.
If you want to report any bugs, make sure to mention that you are using PHP 8.0 with JIT.
If you want to report any bugs, make sure to mention that you have enabled PHP JIT.
To turn off JIT, change `opcache.jit` to `0` in your php.ini file.
-------------------------------------------------------------------------------------------
@ -192,6 +204,22 @@ JIT_WARNING
ini_set('assert.exception', '1');
}
function getopt_string(string $opt) : ?string{
$opts = getopt("", ["$opt:"]);
if(isset($opts[$opt])){
if(is_string($opts[$opt])){
return $opts[$opt];
}
if(is_array($opts[$opt])){
critical_error("Cannot specify --$opt multiple times");
}else{
critical_error("Missing value for --$opt");
}
exit(1);
}
return null;
}
/**
* @return void
*/
@ -205,6 +233,8 @@ JIT_WARNING
}
critical_error("PHP binary used: " . $binary);
critical_error("Loaded php.ini: " . (($file = php_ini_loaded_file()) !== false ? $file : "none"));
$phprc = getenv("PHPRC");
critical_error("Value of PHPRC environment variable: " . ($phprc === false ? "" : $phprc));
critical_error("Please recompile PHP with the needed configuration, or refer to the installation instructions at http://pmmp.rtfd.io/en/rtfd/installation.html.");
echo PHP_EOL;
exit(1);
@ -214,20 +244,13 @@ JIT_WARNING
error_reporting(-1);
set_ini_entries();
$opts = getopt("", ["bootstrap:"]);
if(isset($opts["bootstrap"])){
$bootstrap = ($real = realpath($opts["bootstrap"])) !== false ? $real : $opts["bootstrap"];
}else{
$bootstrap = dirname(__FILE__, 2) . '/vendor/autoload.php';
}
if($bootstrap === false or !is_file($bootstrap)){
$bootstrap = dirname(__FILE__, 2) . '/vendor/autoload.php';
if(!is_file($bootstrap)){
critical_error("Composer autoloader not found at " . $bootstrap);
critical_error("Please install/update Composer dependencies or use provided builds.");
exit(1);
}
define('pocketmine\COMPOSER_AUTOLOADER_PATH', $bootstrap);
require_once(\pocketmine\COMPOSER_AUTOLOADER_PATH);
require_once($bootstrap);
$composerGitHash = InstalledVersions::getReference('pocketmine/pocketmine-mp');
if($composerGitHash !== null){
@ -248,26 +271,42 @@ JIT_WARNING
ErrorToExceptionHandler::set();
$opts = getopt("", ["data:", "plugins:", "no-wizard", "enable-ansi", "disable-ansi"]);
$dataPath = isset($opts["data"]) ? $opts["data"] . DIRECTORY_SEPARATOR : realpath(getcwd()) . DIRECTORY_SEPARATOR;
$pluginPath = isset($opts["plugins"]) ? $opts["plugins"] . DIRECTORY_SEPARATOR : realpath(getcwd()) . DIRECTORY_SEPARATOR . "plugins" . DIRECTORY_SEPARATOR;
$cwd = Utils::assumeNotFalse(realpath(Utils::assumeNotFalse(getcwd())));
$dataPath = getopt_string("data") ?? $cwd;
$pluginPath = getopt_string("plugins") ?? $cwd . DIRECTORY_SEPARATOR . "plugins";
Filesystem::addCleanedPath($pluginPath, Filesystem::CLEAN_PATH_PLUGINS_PREFIX);
if(!file_exists($dataPath)){
mkdir($dataPath, 0777, true);
if(!@mkdir($dataPath, 0777, true) && !is_dir($dataPath)){
critical_error("Unable to create/access data directory at $dataPath. Check that the target location is accessible by the current user.");
exit(1);
}
//this has to be done after we're sure the data path exists
$dataPath = realpath($dataPath) . DIRECTORY_SEPARATOR;
$lockFilePath = Path::join($dataPath, 'server.lock');
if(($pid = Filesystem::createLockFile($lockFilePath)) !== null){
try{
$pid = Filesystem::createLockFile($lockFilePath);
}catch(\InvalidArgumentException $e){
critical_error($e->getMessage());
critical_error("Please ensure that there is enough space on the disk and that the current user has read/write permissions to the selected data directory $dataPath.");
exit(1);
}
if($pid !== null){
critical_error("Another " . VersionInfo::NAME . " instance (PID $pid) is already using this folder (" . realpath($dataPath) . ").");
critical_error("Please stop the other server first before running a new one.");
exit(1);
}
if(!@mkdir($pluginPath, 0777, true) && !is_dir($pluginPath)){
critical_error("Unable to create plugin directory at $pluginPath. Check that the target location is accessible by the current user.");
exit(1);
}
$pluginPath = realpath($pluginPath) . DIRECTORY_SEPARATOR;
//Logger has a dependency on timezone
Timezone::init();
$opts = getopt("", ["no-wizard", "enable-ansi", "disable-ansi"]);
if(isset($opts["enable-ansi"])){
Terminal::init(true);
}elseif(isset($opts["disable-ansi"])){
@ -283,7 +322,7 @@ JIT_WARNING
$exitCode = 0;
do{
if(!file_exists(Path::join($dataPath, "server.properties")) and !isset($opts["no-wizard"])){
if(!file_exists(Path::join($dataPath, "server.properties")) && !isset($opts["no-wizard"])){
$installer = new SetupWizard($dataPath);
if(!$installer->run()){
$exitCode = -1;
@ -307,7 +346,7 @@ JIT_WARNING
if(ThreadManager::getInstance()->stopAll() > 0){
$logger->debug("Some threads could not be stopped, performing a force-kill");
Process::kill(Process::pid());
Process::kill(Process::pid(), true);
}
}while(false);

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -27,28 +27,24 @@ use pocketmine\utils\Config;
use function array_key_exists;
use function getopt;
use function is_bool;
use function is_int;
use function is_string;
use function strtolower;
final class ServerConfigGroup{
/** @var Config */
private $pocketmineYml;
/** @var Config */
private $serverProperties;
/**
* @var mixed[]
* @phpstan-var array<string, mixed>
*/
private $propertyCache = [];
private array $propertyCache = [];
public function __construct(Config $pocketmineYml, Config $serverProperties){
$this->pocketmineYml = $pocketmineYml;
$this->serverProperties = $serverProperties;
}
public function __construct(
private Config $pocketmineYml,
private Config $serverProperties
){}
/**
* @param mixed $defaultValue
* @param mixed $defaultValue
*
* @return mixed
*/
@ -110,16 +106,20 @@ final class ServerConfigGroup{
}else{
$value = $this->serverProperties->exists($variable) ? $this->serverProperties->get($variable) : $defaultValue;
}
if(is_bool($value)){
return $value;
}
switch(strtolower($value)){
case "on":
case "true":
case "1":
case "yes":
return true;
if(is_int($value)){
return $value !== 0;
}
if(is_string($value)){
switch(strtolower($value)){
case "on":
case "true":
case "1":
case "yes":
return true;
}
}
return false;

View File

@ -0,0 +1,64 @@
<?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;
use pocketmine\snooze\SleeperHandler;
use pocketmine\timings\TimingsHandler;
use function hrtime;
/**
* Custom Snooze sleeper handler which captures notification processing time.
* @internal
*/
final class TimeTrackingSleeperHandler extends SleeperHandler{
private int $notificationProcessingTimeNs = 0;
public function __construct(
private TimingsHandler $timings
){
parent::__construct();
}
/**
* Returns the time in nanoseconds spent processing notifications since the last reset.
*/
public function getNotificationProcessingTime() : int{ return $this->notificationProcessingTimeNs; }
/**
* Resets the notification processing time tracker to zero.
*/
public function resetNotificationProcessingTime() : void{ $this->notificationProcessingTimeNs = 0; }
public function processNotifications() : void{
$startTime = hrtime(true);
$this->timings->startTiming();
try{
parent::processNotifications();
}finally{
$this->notificationProcessingTimeNs += hrtime(true) - $startTime;
$this->timings->stopTiming();
}
}
}

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -25,21 +25,21 @@ namespace pocketmine;
use pocketmine\utils\Git;
use pocketmine\utils\VersionString;
use function is_array;
use function is_int;
use function str_repeat;
final class VersionInfo{
public const NAME = "PocketMine-MP";
public const BASE_VERSION = "4.0.0-BETA1";
public const BASE_VERSION = "4.12.11";
public const IS_DEVELOPMENT_BUILD = false;
public const BUILD_NUMBER = 0;
public const BUILD_CHANNEL = "beta";
public const BUILD_CHANNEL = "stable";
private function __construct(){
//NOOP
}
/** @var string|null */
private static $gitHash = null;
private static ?string $gitHash = null;
public static function GIT_HASH() : string{
if(self::$gitHash === null){
@ -61,12 +61,28 @@ final class VersionInfo{
return self::$gitHash;
}
/** @var VersionString|null */
private static $fullVersion = null;
private static ?int $buildNumber = null;
public static function BUILD_NUMBER() : int{
if(self::$buildNumber === null){
self::$buildNumber = 0;
if(\Phar::running(true) !== ""){
$phar = new \Phar(\Phar::running(false));
$meta = $phar->getMetadata();
if(is_array($meta) && isset($meta["build"]) && is_int($meta["build"])){
self::$buildNumber = $meta["build"];
}
}
}
return self::$buildNumber;
}
private static ?VersionString $fullVersion = null;
public static function VERSION() : VersionString{
if(self::$fullVersion === null){
self::$fullVersion = new VersionString(self::BASE_VERSION, self::IS_DEVELOPMENT_BUILD, self::BUILD_NUMBER);
self::$fullVersion = new VersionString(self::BASE_VERSION, self::IS_DEVELOPMENT_BUILD, self::BUILD_NUMBER());
}
return self::$fullVersion;
}

View File

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

View File

@ -17,22 +17,16 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\math\AxisAlignedBB;
/**
* Air block
*/
class Air extends Transparent{
public function canBeFlowedInto() : bool{
return true;
}
class Air extends Flowable{
public function canBeReplaced() : bool{
return true;
@ -41,15 +35,4 @@ class Air extends Transparent{
public function canBePlaced() : bool{
return false;
}
public function isSolid() : bool{
return false;
}
/**
* @return AxisAlignedBB[]
*/
protected function recalculateCollisionBoxes() : array{
return [];
}
}

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -28,6 +28,7 @@ use pocketmine\block\utils\BlockDataSerializer;
use pocketmine\block\utils\Fallable;
use pocketmine\block\utils\FallableTrait;
use pocketmine\block\utils\HorizontalFacingTrait;
use pocketmine\block\utils\SupportType;
use pocketmine\item\Item;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;
@ -39,7 +40,11 @@ class Anvil extends Transparent implements Fallable{
use FallableTrait;
use HorizontalFacingTrait;
private int $damage = 0;
public const UNDAMAGED = 0;
public const SLIGHTLY_DAMAGED = 1;
public const VERY_DAMAGED = 2;
private int $damage = self::UNDAMAGED;
protected function writeStateToMeta() : int{
return BlockDataSerializer::writeLegacyHorizontalFacing($this->facing) | ($this->damage << 2);
@ -47,7 +52,7 @@ class Anvil extends Transparent implements Fallable{
public function readStateFromData(int $id, int $stateMeta) : void{
$this->facing = BlockDataSerializer::readLegacyHorizontalFacing($stateMeta & 0x3);
$this->damage = BlockDataSerializer::readBoundedInt("damage", $stateMeta >> 2, 0, 2);
$this->damage = BlockDataSerializer::readBoundedInt("damage", $stateMeta >> 2, self::UNDAMAGED, self::VERY_DAMAGED);
}
public function getStateBitmask() : int{
@ -62,8 +67,8 @@ class Anvil extends Transparent implements Fallable{
/** @return $this */
public function setDamage(int $damage) : self{
if($damage < 0 || $damage > 2){
throw new \InvalidArgumentException("Damage must be in range 0-2");
if($damage < self::UNDAMAGED || $damage > self::VERY_DAMAGED){
throw new \InvalidArgumentException("Damage must be in range " . self::UNDAMAGED . " ... " . self::VERY_DAMAGED);
}
$this->damage = $damage;
return $this;
@ -76,6 +81,10 @@ class Anvil extends Transparent implements Fallable{
return [AxisAlignedBB::one()->squash(Facing::axis(Facing::rotateY($this->facing, false)), 1 / 8)];
}
public function getSupportType(int $facing) : SupportType{
return SupportType::NONE();
}
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($player instanceof Player){
$player->setCurrentWindow(new AnvilInventory($this->position));

View File

@ -17,13 +17,14 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\block\utils\BlockDataSerializer;
use pocketmine\block\utils\SupportType;
use pocketmine\event\block\StructureGrowEvent;
use pocketmine\item\Bamboo as ItemBamboo;
use pocketmine\item\Fertilizer;
@ -100,6 +101,10 @@ class Bamboo extends Transparent{
return [AxisAlignedBB::one()->trim(Facing::SOUTH, $inset)->trim(Facing::EAST, $inset)];
}
public function getSupportType(int $facing) : SupportType{
return SupportType::NONE();
}
private static function getOffsetSeed(int $x, int $y, int $z) : int{
$p1 = gmp_mul($z, 0x6ebfff5);
$p2 = gmp_mul($x, 0x2fc20f);
@ -115,7 +120,7 @@ class Bamboo extends Transparent{
return 12 + (self::getOffsetSeed($x, 0, $z) % 5);
}
public function getPositionOffset() : ?Vector3{
public function getModelPositionOffset() : ?Vector3{
$seed = self::getOffsetSeed($this->position->getFloorX(), 0, $this->position->getFloorZ());
$retX = (($seed % 12) + 1) / 16;
$retZ = ((($seed >> 8) % 12) + 1) / 16;
@ -145,12 +150,12 @@ class Bamboo extends Transparent{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($item instanceof Fertilizer){
$top = $this->seekToTop();
if($top->grow(self::getMaxHeight($top->position->getFloorX(), $top->position->getFloorZ()), mt_rand(1, 2))){
if($top->grow(self::getMaxHeight($top->position->getFloorX(), $top->position->getFloorZ()), mt_rand(1, 2), $player)){
$item->pop();
return true;
}
}elseif($item instanceof ItemBamboo){
if($this->seekToTop()->grow(PHP_INT_MAX, 1)){
if($this->seekToTop()->grow(PHP_INT_MAX, 1, $player)){
$item->pop();
return true;
}
@ -159,13 +164,14 @@ class Bamboo extends Transparent{
}
public function onNearbyBlockChange() : void{
$below = $this->position->getWorld()->getBlock($this->position->down());
if(!$this->canBeSupportedBy($below) and !$below->isSameType($this)){
$this->position->getWorld()->useBreakOn($this->position);
$world = $this->position->getWorld();
$below = $world->getBlock($this->position->down());
if(!$this->canBeSupportedBy($below) && !$below->isSameType($this)){
$world->useBreakOn($this->position);
}
}
private function grow(int $maxHeight, int $growAmount) : bool{
private function grow(int $maxHeight, int $growAmount, ?Player $player) : bool{
$world = $this->position->getWorld();
if(!$world->getBlock($this->position->up())->canBeReplaced()){
return false;
@ -207,12 +213,12 @@ class Bamboo extends Transparent{
}
}
$tx = new BlockTransaction($this->position->getWorld());
$tx = new BlockTransaction($world);
foreach($newBlocks as $idx => $newBlock){
$tx->addBlock($this->position->subtract(0, $idx - $growAmount, 0), $newBlock);
}
$ev = new StructureGrowEvent($this, $tx);
$ev = new StructureGrowEvent($this, $tx, $player);
$ev->call();
if($ev->isCancelled()){
return false;
@ -229,7 +235,7 @@ class Bamboo extends Transparent{
$world = $this->position->getWorld();
if($this->ready){
$this->ready = false;
if($world->getFullLight($this->position) < 9 || !$this->grow(self::getMaxHeight($this->position->getFloorX(), $this->position->getFloorZ()), 1)){
if($world->getFullLight($this->position) < 9 || !$this->grow(self::getMaxHeight($this->position->getFloorX(), $this->position->getFloorZ()), 1, null)){
$world->setBlock($this->position, $this);
}
}elseif($world->getBlock($this->position->up())->canBeReplaced()){

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -36,14 +36,14 @@ final class BambooSapling extends Flowable{
private bool $ready = false;
public function readStateFromData(int $id, int $stateMeta) : void{
$this->ready = ($stateMeta & BlockLegacyMetadata::SAPLING_FLAG_READY) !== 0;
$this->ready = ($stateMeta & BlockLegacyMetadata::BAMBOO_SAPLING_FLAG_READY) !== 0;
}
protected function writeStateToMeta() : int{
return $this->ready ? BlockLegacyMetadata::SAPLING_FLAG_READY : 0;
return $this->ready ? BlockLegacyMetadata::BAMBOO_SAPLING_FLAG_READY : 0;
}
public function getStateBitmask() : int{ return 0b1000; }
public function getStateBitmask() : int{ return 0b1; }
public function isReady() : bool{ return $this->ready; }
@ -73,7 +73,7 @@ final class BambooSapling extends Flowable{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($item instanceof Fertilizer || $item instanceof ItemBamboo){
if($this->grow()){
if($this->grow($player)){
$item->pop();
return true;
}
@ -82,12 +82,13 @@ final class BambooSapling extends Flowable{
}
public function onNearbyBlockChange() : void{
if(!$this->canBeSupportedBy($this->position->getWorld()->getBlock($this->position->down()))){
$this->position->getWorld()->useBreakOn($this->position);
$world = $this->position->getWorld();
if(!$this->canBeSupportedBy($world->getBlock($this->position->down()))){
$world->useBreakOn($this->position);
}
}
private function grow() : bool{
private function grow(?Player $player) : bool{
$world = $this->position->getWorld();
if(!$world->getBlock($this->position->up())->canBeReplaced()){
return false;
@ -98,7 +99,7 @@ final class BambooSapling extends Flowable{
$tx->addBlock($this->position, $bamboo)
->addBlock($this->position->up(), (clone $bamboo)->setLeafSize(Bamboo::SMALL_LEAVES));
$ev = new StructureGrowEvent($this, $tx);
$ev = new StructureGrowEvent($this, $tx, $player);
$ev->call();
if($ev->isCancelled()){
return false;
@ -115,7 +116,7 @@ final class BambooSapling extends Flowable{
$world = $this->position->getWorld();
if($this->ready){
$this->ready = false;
if($world->getFullLight($this->position) < 9 || !$this->grow()){
if($world->getFullLight($this->position) < 9 || !$this->grow(null)){
$world->setBlock($this->position, $this);
}
}elseif($world->getBlock($this->position->up())->canBeReplaced()){

View File

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

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -27,6 +27,7 @@ use pocketmine\block\tile\Banner as TileBanner;
use pocketmine\block\utils\BannerPatternLayer;
use pocketmine\block\utils\ColoredTrait;
use pocketmine\block\utils\DyeColor;
use pocketmine\block\utils\SupportType;
use pocketmine\data\bedrock\DyeColorIdMap;
use pocketmine\item\Banner as ItemBanner;
use pocketmine\item\Item;
@ -86,7 +87,7 @@ abstract class BaseBanner extends Transparent{
}
/**
* @param BannerPatternLayer[] $patterns
* @param BannerPatternLayer[] $patterns
*
* @phpstan-param list<BannerPatternLayer> $patterns
* @return $this
@ -107,7 +108,18 @@ abstract class BaseBanner extends Transparent{
return [];
}
public function getSupportType(int $facing) : SupportType{
return SupportType::NONE();
}
private function canBeSupportedBy(Block $block) : bool{
return $block->isSolid();
}
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if(!$this->canBeSupportedBy($blockReplace->getSide($this->getSupportingFace()))){
return false;
}
if($item instanceof ItemBanner){
$this->color = $item->getColor();
$this->setPatterns($item->getPatterns());
@ -119,7 +131,7 @@ abstract class BaseBanner extends Transparent{
abstract protected function getSupportingFace() : int;
public function onNearbyBlockChange() : void{
if($this->getSide($this->getSupportingFace())->getId() === BlockLegacyIds::AIR){
if(!$this->canBeSupportedBy($this->getSide($this->getSupportingFace()))){
$this->position->getWorld()->useBreakOn($this->position);
}
}
@ -130,7 +142,7 @@ abstract class BaseBanner extends Transparent{
public function getDropsForCompatibleTool(Item $item) : array{
$drop = $this->asItem();
if($drop instanceof ItemBanner and count($this->patterns) > 0){
if($drop instanceof ItemBanner && count($this->patterns) > 0){
$drop->setPatterns($this->patterns);
}
@ -139,7 +151,7 @@ abstract class BaseBanner extends Transparent{
public function getPickedItem(bool $addUserData = false) : Item{
$result = $this->asItem();
if($addUserData and $result instanceof ItemBanner and count($this->patterns) > 0){
if($addUserData && $result instanceof ItemBanner && count($this->patterns) > 0){
$result->setPatterns($this->patterns);
}
return $result;

View File

@ -17,41 +17,26 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\block\utils\CoralType;
use pocketmine\block\utils\CoralTypeTrait;
use pocketmine\block\utils\SupportType;
use pocketmine\event\block\BlockDeathEvent;
use pocketmine\item\Item;
abstract class BaseCoral extends Transparent{
protected CoralType $coralType;
protected bool $dead = false;
use CoralTypeTrait;
public function __construct(BlockIdentifier $idInfo, string $name, BlockBreakInfo $breakInfo){
parent::__construct($idInfo, $name, $breakInfo);
$this->coralType = CoralType::TUBE();
}
public function getCoralType() : CoralType{ return $this->coralType; }
/** @return $this */
public function setCoralType(CoralType $coralType) : self{
$this->coralType = $coralType;
return $this;
}
public function isDead() : bool{ return $this->dead; }
/** @return $this */
public function setDead(bool $dead) : self{
$this->dead = $dead;
return $this;
}
public function onNearbyBlockChange() : void{
if(!$this->dead){
$world = $this->position->getWorld();
@ -66,7 +51,11 @@ abstract class BaseCoral extends Transparent{
//TODO: check water inside the block itself (not supported on the API yet)
if(!$hasWater){
$world->setBlock($this->position, $this->setDead(true));
$ev = new BlockDeathEvent($this, $this->setDead(true));
$ev->call();
if(!$ev->isCancelled()){
$world->setBlock($this->position, $ev->getNewState());
}
}
}
}
@ -82,4 +71,8 @@ abstract class BaseCoral extends Transparent{
public function isSolid() : bool{ return false; }
protected function recalculateCollisionBoxes() : array{ return []; }
public function getSupportType(int $facing) : SupportType{
return SupportType::NONE();
}
}

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -38,7 +38,7 @@ use function in_array;
abstract class BaseRail extends Flowable{
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if(!$blockReplace->getSide(Facing::DOWN)->isTransparent()){
if($blockReplace->getSide(Facing::DOWN)->getSupportType(Facing::UP)->hasEdgeSupport()){
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}
@ -101,7 +101,7 @@ abstract class BaseRail extends Flowable{
}
if(
$other instanceof BaseRail and
$other instanceof BaseRail &&
in_array($otherConnection, $other->getCurrentShapeConnections(), true)
){
$connections[] = $connection;
@ -162,6 +162,7 @@ abstract class BaseRail extends Flowable{
$thisConnections = $this->getConnectedDirections();
$changed = false;
$world = $this->position->getWorld();
do{
$possible = $this->getPossibleConnectionDirections($thisConnections);
$continue = false;
@ -179,7 +180,7 @@ abstract class BaseRail extends Flowable{
$otherSide |= RailConnectionInfo::FLAG_ASCEND;
}
if(!($other instanceof BaseRail) or count($otherConnections = $other->getConnectedDirections()) >= 2){
if(!($other instanceof BaseRail) || count($otherConnections = $other->getConnectedDirections()) >= 2){
//we can only connect to a rail that has less than 2 connections
continue;
}
@ -189,7 +190,7 @@ abstract class BaseRail extends Flowable{
if(isset($otherPossible[$otherSide])){
$otherConnections[] = $otherSide;
$other->setConnections($otherConnections);
$this->position->getWorld()->setBlock($other->position, $other);
$world->setBlock($other->position, $other);
$changed = true;
$thisConnections[] = $thisSide;
@ -202,7 +203,7 @@ abstract class BaseRail extends Flowable{
if($changed){
$this->setConnections($thisConnections);
$this->position->getWorld()->setBlock($this->position, $this);
$world->setBlock($this->position, $this);
}
}
@ -220,12 +221,13 @@ abstract class BaseRail extends Flowable{
}
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::DOWN)->isTransparent()){
$this->position->getWorld()->useBreakOn($this->position);
$world = $this->position->getWorld();
if(!$this->getSide(Facing::DOWN)->getSupportType(Facing::UP)->hasEdgeSupport()){
$world->useBreakOn($this->position);
}else{
foreach($this->getCurrentShapeConnections() as $connection){
if(($connection & RailConnectionInfo::FLAG_ASCEND) !== 0 and $this->getSide($connection & ~RailConnectionInfo::FLAG_ASCEND)->isTransparent()){
$this->position->getWorld()->useBreakOn($this->position);
if(($connection & RailConnectionInfo::FLAG_ASCEND) !== 0 && !$this->getSide($connection & ~RailConnectionInfo::FLAG_ASCEND)->getSupportType(Facing::UP)->hasEdgeSupport()){
$world->useBreakOn($this->position);
break;
}
}

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -25,6 +25,7 @@ namespace pocketmine\block;
use pocketmine\block\tile\Sign as TileSign;
use pocketmine\block\utils\SignText;
use pocketmine\block\utils\SupportType;
use pocketmine\event\block\SignChangeEvent;
use pocketmine\item\Item;
use pocketmine\math\AxisAlignedBB;
@ -37,8 +38,6 @@ use function assert;
use function strlen;
abstract class BaseSign extends Transparent{
//TODO: conditionally useless properties, find a way to fix
protected SignText $text;
protected ?int $editorEntityRuntimeId = null;
@ -79,6 +78,10 @@ abstract class BaseSign extends Transparent{
return [];
}
public function getSupportType(int $facing) : SupportType{
return SupportType::NONE();
}
abstract protected function getSupportingFace() : int;
public function onNearbyBlockChange() : void{

View File

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

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -28,6 +28,7 @@ use pocketmine\block\utils\BlockDataSerializer;
use pocketmine\block\utils\ColoredTrait;
use pocketmine\block\utils\DyeColor;
use pocketmine\block\utils\HorizontalFacingTrait;
use pocketmine\block\utils\SupportType;
use pocketmine\data\bedrock\DyeColorIdMap;
use pocketmine\entity\Entity;
use pocketmine\entity\Living;
@ -94,6 +95,10 @@ class Bed extends Transparent{
return [AxisAlignedBB::one()->trim(Facing::UP, 7 / 16)];
}
public function getSupportType(int $facing) : SupportType{
return SupportType::NONE();
}
public function isHeadPart() : bool{
return $this->head;
}
@ -120,7 +125,7 @@ class Bed extends Transparent{
public function getOtherHalf() : ?Bed{
$other = $this->getSide($this->getOtherHalfSide());
if($other instanceof Bed and $other->head !== $this->head and $other->facing === $this->facing){
if($other instanceof Bed && $other->head !== $this->head && $other->facing === $this->facing){
return $other;
}
@ -135,17 +140,17 @@ class Bed extends Transparent{
$player->sendMessage(TextFormat::GRAY . "This bed is incomplete");
return true;
}elseif($playerPos->distanceSquared($this->position) > 4 and $playerPos->distanceSquared($other->position) > 4){
}elseif($playerPos->distanceSquared($this->position) > 4 && $playerPos->distanceSquared($other->position) > 4){
$player->sendMessage(KnownTranslationFactory::tile_bed_tooFar()->prefix(TextFormat::GRAY));
return true;
}
$time = $this->position->getWorld()->getTimeOfDay();
$isNight = ($time >= World::TIME_NIGHT and $time < World::TIME_SUNRISE);
$isNight = ($time >= World::TIME_NIGHT && $time < World::TIME_SUNRISE);
if(!$isNight){
$player->sendMessage(KnownTranslationFactory::tile_bed_tooFar()->prefix(TextFormat::GRAY));
$player->sendMessage(KnownTranslationFactory::tile_bed_noSleep()->prefix(TextFormat::GRAY));
return true;
}
@ -166,7 +171,7 @@ class Bed extends Transparent{
}
public function onNearbyBlockChange() : void{
if(($other = $this->getOtherHalf()) !== null and $other->occupied !== $this->occupied){
if(!$this->head && ($other = $this->getOtherHalf()) !== null && $other->occupied !== $this->occupied){
$this->occupied = $other->occupied;
$this->position->getWorld()->setBlock($this->position, $this);
}
@ -181,12 +186,11 @@ class Bed extends Transparent{
}
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN);
if(!$down->isTransparent()){
if($this->canBeSupportedBy($this->getSide(Facing::DOWN))){
$this->facing = $player !== null ? $player->getHorizontalFacing() : Facing::NORTH;
$next = $this->getSide($this->getOtherHalfSide());
if($next->canBeReplaced() and !$next->getSide(Facing::DOWN)->isTransparent()){
if($next->canBeReplaced() && $this->canBeSupportedBy($next->getSide(Facing::DOWN))){
$nextState = clone $this;
$nextState->head = true;
$tx->addBlock($blockReplace->position, $this)->addBlock($next->position, $nextState);
@ -216,4 +220,8 @@ class Bed extends Transparent{
return parent::getAffectedBlocks();
}
private function canBeSupportedBy(Block $block) : bool{
return !$block->getSupportType(Facing::UP)->equals(SupportType::NONE());
}
}

View File

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

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -30,7 +30,7 @@ use function mt_rand;
class Beetroot extends Crops{
public function getDropsForCompatibleTool(Item $item) : array{
if($this->age >= 7){
if($this->age >= self::MAX_AGE){
return [
VanillaItems::BEETROOT(),
VanillaItems::BEETROOT_SEEDS()->setCount(mt_rand(0, 3))

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -28,7 +28,9 @@ use pocketmine\block\utils\BellAttachmentType;
use pocketmine\block\utils\BlockDataSerializer;
use pocketmine\block\utils\HorizontalFacingTrait;
use pocketmine\block\utils\InvalidBlockStateException;
use pocketmine\block\utils\SupportType;
use pocketmine\item\Item;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;
use pocketmine\math\Vector3;
use pocketmine\player\Player;
@ -37,8 +39,6 @@ use pocketmine\world\BlockTransaction;
use pocketmine\world\sound\BellRingSound;
final class Bell extends Transparent{
private const BELL_RINGING_REPEAT_TICKS = 20;
use HorizontalFacingTrait;
private BellAttachmentType $attachmentType;
@ -80,6 +80,32 @@ final class Bell extends Transparent{
return 0b1111;
}
protected function recalculateCollisionBoxes() : array{
if($this->attachmentType->equals(BellAttachmentType::FLOOR())){
return [
AxisAlignedBB::one()->squash(Facing::axis($this->facing), 1 / 4)->trim(Facing::UP, 3 / 16)
];
}
if($this->attachmentType->equals(BellAttachmentType::CEILING())){
return [
AxisAlignedBB::one()->contract(1 / 4, 0, 1 / 4)->trim(Facing::DOWN, 1 / 4)
];
}
$box = AxisAlignedBB::one()
->squash(Facing::axis(Facing::rotateY($this->facing, true)), 1 / 4)
->trim(Facing::UP, 1 / 16)
->trim(Facing::DOWN, 1 / 4);
return [
$this->attachmentType->equals(BellAttachmentType::ONE_WALL()) ? $box->trim($this->facing, 3 / 16) : $box
];
}
public function getSupportType(int $facing) : SupportType{
return SupportType::NONE();
}
public function getAttachmentType() : BellAttachmentType{ return $this->attachmentType; }
/** @return $this */
@ -88,14 +114,13 @@ final class Bell extends Transparent{
return $this;
}
private function canBeSupportedBy(Block $block) : bool{
//TODO: this isn't the actual logic, but it's the closest approximation we can support for now
return $block->isSolid();
private function canBeSupportedBy(Block $block, int $face) : bool{
return !$block->getSupportType($face)->equals(SupportType::NONE());
}
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($face === Facing::UP){
if(!$this->canBeSupportedBy($tx->fetchBlock($this->position->down()))){
if(!$this->canBeSupportedBy($tx->fetchBlock($this->position->down()), Facing::UP)){
return false;
}
if($player !== null){
@ -103,18 +128,18 @@ final class Bell extends Transparent{
}
$this->setAttachmentType(BellAttachmentType::FLOOR());
}elseif($face === Facing::DOWN){
if(!$this->canBeSupportedBy($tx->fetchBlock($this->position->up()))){
if(!$this->canBeSupportedBy($tx->fetchBlock($this->position->up()), Facing::DOWN)){
return false;
}
$this->setAttachmentType(BellAttachmentType::CEILING());
}else{
$this->setFacing($face);
if($this->canBeSupportedBy($tx->fetchBlock($this->position->getSide(Facing::opposite($face))))){
if($this->canBeSupportedBy($tx->fetchBlock($this->position->getSide(Facing::opposite($face))), $face)){
$this->setAttachmentType(BellAttachmentType::ONE_WALL());
}else{
return false;
}
if($this->canBeSupportedBy($tx->fetchBlock($this->position->getSide($face)))){
if($this->canBeSupportedBy($tx->fetchBlock($this->position->getSide($face)), Facing::opposite($face))){
$this->setAttachmentType(BellAttachmentType::TWO_WALLS());
}
}
@ -123,10 +148,10 @@ final class Bell extends Transparent{
public function onNearbyBlockChange() : void{
if(
($this->attachmentType->equals(BellAttachmentType::CEILING()) && !$this->canBeSupportedBy($this->getSide(Facing::UP))) ||
($this->attachmentType->equals(BellAttachmentType::FLOOR()) && !$this->canBeSupportedBy($this->getSide(Facing::DOWN))) ||
($this->attachmentType->equals(BellAttachmentType::ONE_WALL()) && !$this->canBeSupportedBy($this->getSide(Facing::opposite($this->facing)))) ||
($this->attachmentType->equals(BellAttachmentType::TWO_WALLS()) && (!$this->canBeSupportedBy($this->getSide($this->facing)) || !$this->canBeSupportedBy($this->getSide(Facing::opposite($this->facing)))))
($this->attachmentType->equals(BellAttachmentType::CEILING()) && !$this->canBeSupportedBy($this->getSide(Facing::UP), Facing::DOWN)) ||
($this->attachmentType->equals(BellAttachmentType::FLOOR()) && !$this->canBeSupportedBy($this->getSide(Facing::DOWN), Facing::UP)) ||
($this->attachmentType->equals(BellAttachmentType::ONE_WALL()) && !$this->canBeSupportedBy($this->getSide(Facing::opposite($this->facing)), $this->facing)) ||
($this->attachmentType->equals(BellAttachmentType::TWO_WALLS()) && (!$this->canBeSupportedBy($this->getSide($this->facing), Facing::opposite($this->facing)) || !$this->canBeSupportedBy($this->getSide(Facing::opposite($this->facing)), $this->facing)))
){
$this->position->getWorld()->useBreakOn($this->position);
}
@ -135,28 +160,28 @@ final class Bell extends Transparent{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($player !== null){
$faceHit = Facing::opposite($player->getHorizontalFacing());
if($this->attachmentType->equals(BellAttachmentType::CEILING())){
$this->ring($faceHit);
}
if($this->attachmentType->equals(BellAttachmentType::FLOOR()) && Facing::axis($faceHit) === Facing::axis($this->facing)){
$this->ring($faceHit);
}
if(
($this->attachmentType->equals(BellAttachmentType::ONE_WALL()) || $this->attachmentType->equals(BellAttachmentType::TWO_WALLS())) &&
($faceHit === Facing::rotateY($this->facing, false) || $faceHit === Facing::rotateY($this->facing, true))
$this->attachmentType->equals(BellAttachmentType::CEILING()) ||
($this->attachmentType->equals(BellAttachmentType::FLOOR()) && Facing::axis($faceHit) === Facing::axis($this->facing)) ||
(
($this->attachmentType->equals(BellAttachmentType::ONE_WALL()) || $this->attachmentType->equals(BellAttachmentType::TWO_WALLS())) &&
($faceHit === Facing::rotateY($this->facing, false) || $faceHit === Facing::rotateY($this->facing, true))
)
){
$this->ring($faceHit);
return true;
}
}
return true;
return false;
}
public function ring(int $faceHit) : void{
$this->position->getWorld()->addSound($this->position, new BellRingSound());
$tile = $this->position->getWorld()->getTile($this->position);
$world = $this->position->getWorld();
$world->addSound($this->position, new BellRingSound());
$tile = $world->getTile($this->position);
if($tile instanceof TileBell){
$this->position->getWorld()->broadcastPacketToViewers($this->position, $tile->createFakeUpdatePacket($faceHit));
$world->broadcastPacketToViewers($this->position, $tile->createFakeUpdatePacket($faceHit));
}
}
}

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -29,6 +29,7 @@ namespace pocketmine\block;
use pocketmine\block\tile\Spawnable;
use pocketmine\block\tile\Tile;
use pocketmine\block\utils\InvalidBlockStateException;
use pocketmine\block\utils\SupportType;
use pocketmine\entity\Entity;
use pocketmine\item\enchantment\VanillaEnchantments;
use pocketmine\item\Item;
@ -40,6 +41,7 @@ use pocketmine\math\Vector3;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\player\Player;
use pocketmine\world\BlockTransaction;
use pocketmine\world\format\Chunk;
use pocketmine\world\Position;
use pocketmine\world\World;
use function assert;
@ -60,7 +62,7 @@ class Block{
protected ?array $collisionBoxes = null;
/**
* @param string $name English name of the block type (TODO: implement translations)
* @param string $name English name of the block type (TODO: implement translations)
*/
public function __construct(BlockIdentifier $idInfo, string $name, BlockBreakInfo $breakInfo){
if(($idInfo->getVariant() & $this->getStateBitmask()) !== 0){
@ -76,25 +78,47 @@ class Block{
$this->position = clone $this->position;
}
/**
* Returns an object containing information about how to identify and store this block type, such as its legacy
* numeric ID(s), tile type (if any), and legacy variant metadata.
*/
public function getIdInfo() : BlockIdentifier{
return $this->idInfo;
}
/**
* Returns the printable English name of the block.
*/
public function getName() : string{
return $this->fallbackName;
}
/**
* @deprecated
*
* Returns the legacy numeric Minecraft block ID.
*/
public function getId() : int{
return $this->idInfo->getBlockId();
}
/**
* @internal
*
* Returns the full blockstate ID of this block. This is a compact way of representing a blockstate used to store
* blocks in chunks at runtime.
*
* This ID can be used to later obtain a copy of this block using {@link BlockFactory::get()}.
*/
public function getFullId() : int{
return ($this->getId() << self::INTERNAL_METADATA_BITS) | $this->getMeta();
}
/**
* Returns the block as an item.
* State information such as facing, powered/unpowered, open/closed, etc., is discarded.
* Type information such as colour, wood type, etc. is preserved.
*/
public function asItem() : Item{
return ItemFactory::getInstance()->get(
$this->idInfo->getItemId(),
@ -102,6 +126,12 @@ class Block{
);
}
/**
* @deprecated
*
* Returns the legacy Minecraft block meta value. This is a mixed-purpose value, which is used to store different
* things for different blocks.
*/
public function getMeta() : int{
$stateMeta = $this->writeStateToMeta();
assert(($stateMeta & ~$this->getStateBitmask()) === 0);
@ -114,6 +144,7 @@ class Block{
/**
* Returns a bitmask used to extract state bits from block metadata.
* This is used to remove unwanted information from the legacy meta value when getting the block as an item.
*/
public function getStateBitmask() : int{
return 0;
@ -141,44 +172,59 @@ class Block{
$this->collisionBoxes = null;
}
/**
* Writes information about the block into the world. This writes the blockstate ID into the chunk, and creates
* and/or removes tiles as necessary.
*
* Note: Do not call this directly. Pass the block to {@link World::setBlock()} instead.
*/
public function writeStateToWorld() : void{
$this->position->getWorld()->getOrLoadChunkAtPosition($this->position)->setFullBlock($this->position->x & 0xf, $this->position->y, $this->position->z & 0xf, $this->getFullId());
$world = $this->position->getWorld();
$world->getOrLoadChunkAtPosition($this->position)->setFullBlock($this->position->x & Chunk::COORD_MASK, $this->position->y, $this->position->z & Chunk::COORD_MASK, $this->getFullId());
$tileType = $this->idInfo->getTileClass();
$oldTile = $this->position->getWorld()->getTile($this->position);
$oldTile = $world->getTile($this->position);
if($oldTile !== null){
if($tileType === null or !($oldTile instanceof $tileType)){
if($tileType === null || !($oldTile instanceof $tileType)){
$oldTile->close();
$oldTile = null;
}elseif($oldTile instanceof Spawnable){
$oldTile->setDirty(); //destroy old network cache
$oldTile->clearSpawnCompoundCache(); //destroy old network cache
}
}
if($oldTile === null and $tileType !== null){
if($oldTile === null && $tileType !== null){
/**
* @var Tile $tile
* @see Tile::__construct()
*/
$tile = new $tileType($this->position->getWorld(), $this->position->asVector3());
$this->position->getWorld()->addTile($tile);
$tile = new $tileType($world, $this->position->asVector3());
$world->addTile($tile);
}
}
/**
* Returns whether the given block has an equivalent type to this one. This compares base legacy ID and variant.
* Returns a type ID that identifies this type of block. This does not include information like facing, open/closed,
* powered/unpowered, etc.
*/
public function getTypeId() : int{
return ($this->idInfo->getBlockId() << Block::INTERNAL_METADATA_BITS) | $this->idInfo->getVariant();
}
/**
* Returns whether the given block has an equivalent type to this one. This compares the type IDs.
*
* Note: This ignores additional IDs used to represent additional states. This means that, for example, a lit
* furnace and unlit furnace are considered the same type.
*/
public function isSameType(Block $other) : bool{
return $this->idInfo->getBlockId() === $other->idInfo->getBlockId() and $this->idInfo->getVariant() === $other->idInfo->getVariant();
return $this->getTypeId() === $other->getTypeId();
}
/**
* Returns whether the given block has the same type and properties as this block.
*/
public function isSameState(Block $other) : bool{
return $this->isSameType($other) and $this->writeStateToMeta() === $other->writeStateToMeta();
return $this->getFullId() === $other->getFullId();
}
/**
@ -188,22 +234,44 @@ class Block{
return true;
}
/**
* Returns whether this block can be replaced by another block placed in the same position.
*/
public function canBeReplaced() : bool{
return false;
}
/**
* Returns whether this block can replace the given block in the given placement conditions.
* This is used to allow slabs of the same type to combine into double slabs.
*/
public function canBePlacedAt(Block $blockReplace, Vector3 $clickVector, int $face, bool $isClickedBlock) : bool{
return $blockReplace->canBeReplaced();
}
/**
* Places the Block, using block space and block target, and side. Returns if the block has been placed.
* Generates a block transaction to set all blocks affected by placing this block. Usually this is just the block
* itself, but may be multiple blocks in some cases (such as doors).
*
* @param BlockTransaction $tx Blocks to be set should be added to this transaction (do not modify thr world directly)
* @param Item $item Item used to place the block
* @param Block $blockReplace Block expected to be replaced
* @param Block $blockClicked Block that was clicked using the item
* @param int $face Face of the clicked block which was clicked
* @param Vector3 $clickVector Exact position inside the clicked block where the click occurred, relative to the block's position
* @param Player|null $player Player who placed the block, or null if it was not a player
*
* @return bool whether the placement should go ahead
*/
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$tx->addBlock($blockReplace->position, $this);
return true;
}
/**
* Called immediately after the block has been placed in the world. Since placement uses a block transaction, some
* things may not be possible until after the transaction has been executed.
*/
public function onPostPlace() : void{
}
@ -219,10 +287,11 @@ class Block{
* Do the actions needed so the block is broken with the Item
*/
public function onBreak(Item $item, ?Player $player = null) : bool{
if(($t = $this->position->getWorld()->getTile($this->position)) !== null){
$world = $this->position->getWorld();
if(($t = $world->getTile($this->position)) !== null){
$t->onBlockDestroyed();
}
$this->position->getWorld()->setBlock($this->position, VanillaBlocks::AIR());
$world->setBlock($this->position, VanillaBlocks::AIR());
return true;
}
@ -242,7 +311,7 @@ class Block{
/**
* Called when this block is randomly updated due to chunk ticking.
* WARNING: This will not be called if ticksRandomly() does not return true!
* WARNING: This will not be called if {@link Block::ticksRandomly()} does not return true!
*/
public function onRandomTick() : void{
@ -263,8 +332,7 @@ class Block{
}
/**
* Called when this block is attacked (left-clicked). This is called when a player left-clicks the block to try and
* start to break it in survival mode.
* Called when this block is attacked (left-clicked) by a player attempting to start breaking it in survival.
*
* @return bool if an action took place, prevents starting to break the block if true.
*/
@ -272,11 +340,19 @@ class Block{
return false;
}
/**
* Returns a multiplier applied to the velocity of entities moving on top of this block. A higher value will make
* the block more slippery (like ice).
*
* @return float 0.0-1.0
*/
public function getFrictionFactor() : float{
return 0.6;
}
/**
* Returns the amount of light emitted by this block.
*
* @return int 0-15
*/
public function getLightLevel() : int{
@ -319,10 +395,6 @@ class Block{
return false;
}
public function hasEntityCollision() : bool{
return false;
}
/**
* Returns whether entities can climb up this block.
*/
@ -330,10 +402,6 @@ class Block{
return false;
}
public function addVelocityToEntity(Entity $entity) : ?Vector3{
return null;
}
final public function getPosition() : Position{
return $this->position;
}
@ -352,7 +420,7 @@ class Block{
*/
public function getDrops(Item $item) : array{
if($this->breakInfo->isToolCompatible($item)){
if($this->isAffectedBySilkTouch() and $item->hasEnchantment(VanillaEnchantments::SILK_TOUCH())){
if($this->isAffectedBySilkTouch() && $item->hasEnchantment(VanillaEnchantments::SILK_TOUCH())){
return $this->getSilkTouchDrops($item);
}
@ -393,7 +461,7 @@ class Block{
* Returns how much XP will be dropped by breaking this block with the given item.
*/
public function getXpDropForTool(Item $item) : int{
if($item->hasEnchantment(VanillaEnchantments::SILK_TOUCH()) or !$this->breakInfo->isToolCompatible($item)){
if($item->hasEnchantment(VanillaEnchantments::SILK_TOUCH()) || !$this->breakInfo->isToolCompatible($item)){
return 0;
}
@ -416,6 +484,7 @@ class Block{
/**
* Returns the item that players will equip when middle-clicking on this block.
* If addUserData is true, additional data may be added, such as banner patterns, chest contents, etc.
*/
public function getPickedItem(bool $addUserData = false) : Item{
$item = $this->asItem();
@ -492,7 +561,7 @@ class Block{
return $this->position->getWorld()->getBlock($this->position->getSide($side, $step));
}
throw new \InvalidStateException("Block does not have a valid world");
throw new \LogicException("Block does not have a valid world");
}
/**
@ -539,7 +608,7 @@ class Block{
}
/**
* Checks for collision against an AxisAlignedBB
* Returns whether any of the block's collision boxes intersect with the given AxisAlignedBB.
*/
public function collidesWithBB(AxisAlignedBB $bb) : bool{
foreach($this->getCollisionBoxes() as $bb2){
@ -551,10 +620,21 @@ class Block{
return false;
}
/**
* Returns whether the block has actions to be executed when an entity enters its cell (full cube space).
*
* @see Block::onEntityInside()
*/
public function hasEntityCollision() : bool{
return false;
}
/**
* Called when an entity's bounding box clips inside this block's cell. Note that the entity may not be intersecting
* with the collision box or bounding box.
*
* WARNING: This will not be called if {@link Block::hasEntityCollision()} returns false.
*
* @return bool Whether the block is still the same after the intersection. If it changed (e.g. due to an explosive
* being ignited), this should return false.
*/
@ -562,6 +642,19 @@ class Block{
return true;
}
/**
* Returns a direction vector describing which way an entity intersecting this block should be pushed.
* This is used by liquids to push entities in liquid currents.
*
* The returned vector is summed with vectors from every other block the entity is intersecting, and normalized to
* produce a final direction vector.
*
* WARNING: This will not be called if {@link Block::hasEntityCollision()} does not return true!
*/
public function addVelocityToEntity(Entity $entity) : ?Vector3{
return null;
}
/**
* Called when an entity lands on this block (usually due to falling).
* @return float|null The new vertical velocity of the entity, or null if unchanged.
@ -571,12 +664,19 @@ class Block{
}
/**
* Returns an array of collision bounding boxes for this block.
* These are used for:
* - entity movement collision checks (to ensure entities can't clip through blocks)
* - projectile flight paths
* - block placement (to ensure the player can't place blocks inside itself or another entity)
* - anti-cheat checks in plugins
*
* @return AxisAlignedBB[]
*/
final public function getCollisionBoxes() : array{
if($this->collisionBoxes === null){
$this->collisionBoxes = $this->recalculateCollisionBoxes();
$extraOffset = $this->getPositionOffset();
$extraOffset = $this->getModelPositionOffset();
$offset = $extraOffset !== null ? $this->position->addVector($extraOffset) : $this->position;
foreach($this->collisionBoxes as $bb){
$bb->offset($offset->x, $offset->y, $offset->z);
@ -587,10 +687,10 @@ class Block{
}
/**
* Returns an additional fractional vector to shift the block's effective position by based on the current position.
* Returns an additional fractional vector to shift the block model's position by based on the current position.
* Used to randomize position of things like bamboo canes and tall grass.
*/
public function getPositionOffset() : ?Vector3{
public function getModelPositionOffset() : ?Vector3{
return null;
}
@ -601,12 +701,24 @@ class Block{
return [AxisAlignedBB::one()];
}
/**
* Returns the type of support that the block can provide on the given face. This is used to determine whether
* blocks placed on the given face can be supported by this block.
*/
public function getSupportType(int $facing) : SupportType{
return SupportType::FULL();
}
public function isFullCube() : bool{
$bb = $this->getCollisionBoxes();
return count($bb) === 1 and $bb[0]->getAverageEdgeLength() >= 1 and $bb[0]->isCube();
return count($bb) === 1 && $bb[0]->getAverageEdgeLength() >= 1 && $bb[0]->isCube();
}
/**
* Performs a ray trace along the line between the two positions using the block's collision boxes.
* Returns the intersection point closest to pos1, or null if no intersection occurred.
*/
public function calculateIntercept(Vector3 $pos1, Vector3 $pos2) : ?RayTraceResult{
$bbs = $this->getCollisionBoxes();
if(count($bbs) === 0){

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -38,18 +38,17 @@ class BlockBreakInfo{
*/
public const INCOMPATIBLE_TOOL_MULTIPLIER = 5.0;
private float $hardness;
private float $blastResistance;
private int $toolType;
private int $toolHarvestLevel;
/**
* @param float|null $blastResistance default 5x hardness
*/
public function __construct(float $hardness, int $toolType = BlockToolType::NONE, int $toolHarvestLevel = 0, ?float $blastResistance = null){
$this->hardness = $hardness;
$this->toolType = $toolType;
$this->toolHarvestLevel = $toolHarvestLevel;
public function __construct(
private float $hardness,
private int $toolType = BlockToolType::NONE,
private int $toolHarvestLevel = 0,
?float $blastResistance = null
){
$this->blastResistance = $blastResistance ?? $hardness * 5;
}
@ -119,8 +118,8 @@ class BlockBreakInfo{
return false;
}
return $this->toolType === BlockToolType::NONE or $this->toolHarvestLevel === 0 or (
($this->toolType & $tool->getBlockToolType()) !== 0 and $tool->getBlockToolHarvestLevel() >= $this->toolHarvestLevel);
return $this->toolType === BlockToolType::NONE || $this->toolHarvestLevel === 0 || (
($this->toolType & $tool->getBlockToolType()) !== 0 && $tool->getBlockToolHarvestLevel() >= $this->toolHarvestLevel);
}
/**

File diff suppressed because it is too large Load Diff

View File

@ -17,30 +17,28 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\block\tile\Tile;
use pocketmine\utils\Utils;
class BlockIdentifier{
private int $blockId;
private int $variant;
private ?int $itemId;
/** @phpstan-var class-string<Tile>|null */
private ?string $tileClass;
/**
* @phpstan-param class-string<Tile>|null $tileClass
*/
public function __construct(int $blockId, int $variant, ?int $itemId = null, ?string $tileClass = null){
$this->blockId = $blockId;
$this->variant = $variant;
$this->itemId = $itemId;
$this->tileClass = $tileClass;
public function __construct(
private int $blockId,
private int $variant,
private ?int $itemId = null,
private ?string $tileClass = null
){
if($tileClass !== null){
Utils::testValidInstance($tileClass, Tile::class);
}
}
public function getBlockId() : int{

View File

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

View File

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

View File

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

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -42,6 +42,8 @@ final class BlockLegacyMetadata{
public const BAMBOO_LEAF_SIZE_SHIFT = 1;
public const BAMBOO_LEAF_SIZE_MASK = 0x03;
public const BAMBOO_SAPLING_FLAG_READY = 0x01;
public const BARREL_FLAG_OPEN = 0x08;
public const BED_FLAG_HEAD = 0x08;
@ -142,6 +144,8 @@ final class BlockLegacyMetadata{
public const LEAVES_FLAG_NO_DECAY = 0x04;
public const LEAVES_FLAG_CHECK_DECAY = 0x08;
public const LECTERN_FLAG_POWERED = 0x04;
public const LEVER_FLAG_POWERED = 0x08;
public const LIQUID_FLAG_FALLING = 0x08;

View File

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

View File

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

View File

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

View File

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

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -25,7 +25,11 @@ namespace pocketmine\block;
use pocketmine\block\tile\BrewingStand as TileBrewingStand;
use pocketmine\block\utils\BrewingStandSlot;
use pocketmine\block\utils\SupportType;
use pocketmine\item\Item;
use pocketmine\math\Axis;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;
use pocketmine\math\Vector3;
use pocketmine\player\Player;
use function array_key_exists;
@ -67,6 +71,23 @@ class BrewingStand extends Transparent{
return 0b111;
}
protected function recalculateCollisionBoxes() : array{
return [
//bottom slab part - in PC this is also inset on X/Z by 1/16, but Bedrock sucks
AxisAlignedBB::one()->trim(Facing::UP, 7 / 8),
//center post
AxisAlignedBB::one()
->squash(Axis::X, 7 / 16)
->squash(Axis::Z, 7 / 16)
->trim(Facing::UP, 1 / 8)
];
}
public function getSupportType(int $facing) : SupportType{
return SupportType::NONE();
}
public function hasSlot(BrewingStandSlot $slot) : bool{
return array_key_exists($slot->id(), $this->slots);
}
@ -100,7 +121,7 @@ class BrewingStand extends Transparent{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($player instanceof Player){
$stand = $this->position->getWorld()->getTile($this->position);
if($stand instanceof TileBrewingStand and $stand->canOpenWith($item->getCustomName())){
if($stand instanceof TileBrewingStand && $stand->canOpenWith($item->getCustomName())){
$player->setCurrentWindow($stand->getInventory());
}
}
@ -109,6 +130,25 @@ class BrewingStand extends Transparent{
}
public function onScheduledUpdate() : void{
//TODO
$world = $this->position->getWorld();
$brewing = $world->getTile($this->position);
if($brewing instanceof TileBrewingStand){
if($brewing->onUpdate()){
$world->scheduleDelayedBlockUpdate($this->position, 1);
}
$changed = false;
foreach(BrewingStandSlot::getAll() as $slot){
$occupied = !$brewing->getInventory()->isSlotEmpty($slot->getSlotNumber());
if($occupied !== $this->hasSlot($slot)){
$this->setSlot($slot, $occupied);
$changed = true;
}
}
if($changed){
$world->setBlock($this->position, $this);
}
}
}
}

View File

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

View File

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

View File

@ -17,7 +17,7 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
@ -61,9 +61,11 @@ abstract class Button extends Flowable{
}
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
//TODO: check valid target block
$this->facing = $face;
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
if($this->canBeSupportedBy($blockReplace->getSide(Facing::opposite($face)), $face)){
$this->facing = $face;
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}
return false;
}
abstract protected function getActivationTime() : int;
@ -71,9 +73,10 @@ abstract class Button extends Flowable{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if(!$this->pressed){
$this->pressed = true;
$this->position->getWorld()->setBlock($this->position, $this);
$this->position->getWorld()->scheduleDelayedBlockUpdate($this->position, $this->getActivationTime());
$this->position->getWorld()->addSound($this->position->add(0.5, 0.5, 0.5), new RedstonePowerOnSound());
$world = $this->position->getWorld();
$world->setBlock($this->position, $this);
$world->scheduleDelayedBlockUpdate($this->position, $this->getActivationTime());
$world->addSound($this->position->add(0.5, 0.5, 0.5), new RedstonePowerOnSound());
}
return true;
@ -82,8 +85,19 @@ abstract class Button extends Flowable{
public function onScheduledUpdate() : void{
if($this->pressed){
$this->pressed = false;
$this->position->getWorld()->setBlock($this->position, $this);
$this->position->getWorld()->addSound($this->position->add(0.5, 0.5, 0.5), new RedstonePowerOffSound());
$world = $this->position->getWorld();
$world->setBlock($this->position, $this);
$world->addSound($this->position->add(0.5, 0.5, 0.5), new RedstonePowerOffSound());
}
}
public function onNearbyBlockChange() : void{
if(!$this->canBeSupportedBy($this->getSide(Facing::opposite($this->facing)), $this->facing)){
$this->position->getWorld()->useBreakOn($this->position);
}
}
private function canBeSupportedBy(Block $support, int $face) : bool{
return $support->getSupportType($face)->hasCenterSupport();
}
}

View File

@ -17,13 +17,14 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\block\utils\BlockDataSerializer;
use pocketmine\block\utils\SupportType;
use pocketmine\entity\Entity;
use pocketmine\event\block\BlockGrowEvent;
use pocketmine\event\entity\EntityDamageByBlockEvent;
@ -36,6 +37,7 @@ use pocketmine\player\Player;
use pocketmine\world\BlockTransaction;
class Cactus extends Transparent{
public const MAX_AGE = 15;
protected int $age = 0;
@ -44,7 +46,7 @@ class Cactus extends Transparent{
}
public function readStateFromData(int $id, int $stateMeta) : void{
$this->age = BlockDataSerializer::readBoundedInt("age", $stateMeta, 0, 15);
$this->age = BlockDataSerializer::readBoundedInt("age", $stateMeta, 0, self::MAX_AGE);
}
public function getStateBitmask() : int{
@ -55,8 +57,8 @@ class Cactus extends Transparent{
/** @return $this */
public function setAge(int $age) : self{
if($age < 0 || $age > 15){
throw new \InvalidArgumentException("Age must be in range 0-15");
if($age < 0 || $age > self::MAX_AGE){
throw new \InvalidArgumentException("Age must be in range 0 ... " . self::MAX_AGE);
}
$this->age = $age;
return $this;
@ -70,10 +72,14 @@ class Cactus extends Transparent{
* @return AxisAlignedBB[]
*/
protected function recalculateCollisionBoxes() : array{
static $shrinkSize = 1 / 16;
$shrinkSize = 1 / 16;
return [AxisAlignedBB::one()->contract($shrinkSize, 0, $shrinkSize)->trim(Facing::UP, $shrinkSize)];
}
public function getSupportType(int $facing) : SupportType{
return SupportType::NONE();
}
public function onEntityInside(Entity $entity) : bool{
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_CONTACT, 1);
$entity->attack($ev);
@ -82,13 +88,14 @@ class Cactus extends Transparent{
public function onNearbyBlockChange() : void{
$down = $this->getSide(Facing::DOWN);
if($down->getId() !== BlockLegacyIds::SAND and !$down->isSameType($this)){
$this->position->getWorld()->useBreakOn($this->position);
$world = $this->position->getWorld();
if($down->getId() !== BlockLegacyIds::SAND && !$down->isSameType($this)){
$world->useBreakOn($this->position);
}else{
foreach(Facing::HORIZONTAL as $side){
$b = $this->getSide($side);
if($b->isSolid()){
$this->position->getWorld()->useBreakOn($this->position);
$world->useBreakOn($this->position);
break;
}
}
@ -101,35 +108,36 @@ class Cactus extends Transparent{
public function onRandomTick() : void{
if(!$this->getSide(Facing::DOWN)->isSameType($this)){
if($this->age === 15){
$world = $this->position->getWorld();
if($this->age === self::MAX_AGE){
for($y = 1; $y < 3; ++$y){
if(!$this->position->getWorld()->isInWorld($this->position->x, $this->position->y + $y, $this->position->z)){
if(!$world->isInWorld($this->position->x, $this->position->y + $y, $this->position->z)){
break;
}
$b = $this->position->getWorld()->getBlockAt($this->position->x, $this->position->y + $y, $this->position->z);
$b = $world->getBlockAt($this->position->x, $this->position->y + $y, $this->position->z);
if($b->getId() === BlockLegacyIds::AIR){
$ev = new BlockGrowEvent($b, VanillaBlocks::CACTUS());
$ev->call();
if($ev->isCancelled()){
break;
}
$this->position->getWorld()->setBlock($b->position, $ev->getNewState());
$world->setBlock($b->position, $ev->getNewState());
}else{
break;
}
}
$this->age = 0;
$this->position->getWorld()->setBlock($this->position, $this);
$world->setBlock($this->position, $this);
}else{
++$this->age;
$this->position->getWorld()->setBlock($this->position, $this);
$world->setBlock($this->position, $this);
}
}
}
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN);
if($down->getId() === BlockLegacyIds::SAND or $down->isSameType($this)){
if($down->getId() === BlockLegacyIds::SAND || $down->isSameType($this)){
foreach(Facing::HORIZONTAL as $side){
if($this->getSide($side)->isSolid()){
return false;

View File

@ -17,13 +17,14 @@
* @link http://www.pocketmine.net/
*
*
*/
*/
declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\block\utils\BlockDataSerializer;
use pocketmine\block\utils\SupportType;
use pocketmine\entity\effect\EffectInstance;
use pocketmine\entity\FoodSource;
use pocketmine\entity\Living;
@ -35,6 +36,7 @@ use pocketmine\player\Player;
use pocketmine\world\BlockTransaction;
class Cake extends Transparent implements FoodSource{
public const MAX_BITES = 6;
protected int $bites = 0;
@ -43,7 +45,7 @@ class Cake extends Transparent implements FoodSource{
}
public function readStateFromData(int $id, int $stateMeta) : void{
$this->bites = BlockDataSerializer::readBoundedInt("bites", $stateMeta, 0, 6);
$this->bites = BlockDataSerializer::readBoundedInt("bites", $stateMeta, 0, self::MAX_BITES);
}
public function getStateBitmask() : int{
@ -62,12 +64,16 @@ class Cake extends Transparent implements FoodSource{
];
}
public function getSupportType(int $facing) : SupportType{
return SupportType::NONE();
}
public function getBites() : int{ return $this->bites; }
/** @return $this */
public function setBites(int $bites) : self{
if($bites < 0 || $bites > 6){
throw new \InvalidArgumentException("Bites must be in range 0-6");
if($bites < 0 || $bites > self::MAX_BITES){
throw new \InvalidArgumentException("Bites must be in range 0 ... " . self::MAX_BITES);
}
$this->bites = $bites;
return $this;
@ -94,8 +100,7 @@ class Cake extends Transparent implements FoodSource{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($player !== null){
$player->consumeObject($this);
return true;
return $player->consumeObject($this);
}
return false;
@ -119,7 +124,7 @@ class Cake extends Transparent implements FoodSource{
public function getResidue(){
$clone = clone $this;
$clone->bites++;
if($clone->bites > 6){
if($clone->bites > self::MAX_BITES){
$clone = VanillaBlocks::AIR();
}
return $clone;

View File

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

Some files were not shown because too many files have changed in this diff Show More