Commit Graph

18194 Commits

Author SHA1 Message Date
a897bdfaa0 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-05-30 14:17:21 +01:00
09668a37d6 Use fork of JsonMapper to solve cweiske/JsonMapper#210 2023-05-30 14:17:09 +01:00
ea92a23d0d Bump build/php from b1d5c0d to f2ece7b (#5765)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `b1d5c0d` to `f2ece7b`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](b1d5c0d737...f2ece7b30d)

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-29 21:36:58 +01:00
fe2140a716 Bump shivammathur/setup-php from 2.25.1 to 2.25.2 (#5766)
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.25.1 to 2.25.2.
- [Release notes](https://github.com/shivammathur/setup-php/releases)
- [Commits](https://github.com/shivammathur/setup-php/compare/2.25.1...2.25.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-29 21:36:46 +01:00
8744032ab6 Fixed empty block handling after blockstate ID XOR change 2023-05-29 18:26:23 +01:00
5a9cdef40c Chunk: added DIRTY_FLAGS_ALL and DIRTY_FLAGS_NONE 2023-05-29 17:45:19 +01:00
a49842278a WorldProvider subsystem no longer depends on Chunk
Instead, it provides the data needed to construct the chunk, which doesn't require the provider to be aware of anywhere near as much logic.
2023-05-29 17:44:00 +01:00
d57954dff0 PopulationTask: ensure that unmodified chunks don't get sent back to the main thread for no reason 2023-05-29 17:30:04 +01:00
ce5e663a73 Assume chunks are dirty by default
having them be clean by default makes no sense. It only makes sense for them to be clean if they were loaded directly from disk without any alterations.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-19 15:09:24 +01:00