14027 Commits

Author SHA1 Message Date
Dylan K. Taylor
5a14c1cb89
Entity: don't rebuild metadata every tick unless an associated property changed
this should improve performance back to PM3 levels.
2021-05-17 20:05:52 +01:00
dependabot[bot]
c9b33e2b9f
Bump phpstan/phpstan-phpunit from 0.12.18 to 0.12.19 (#4214)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 0.12.18 to 0.12.19.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/0.12.18...0.12.19)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 15:17:18 +01:00
dependabot[bot]
2f2be84b12
Bump phpstan/phpstan from 0.12.86 to 0.12.87 (#4217)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.86 to 0.12.87.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.86...0.12.87)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 12:25:25 +01:00
Dylan K. Taylor
bdce781c6d
Chunk: do not close preexisting tiles in addTile()
if it's desired to actually replace a tile, the old tile should be explicitly removed and closed first.
2021-05-12 12:32:36 +01:00
Dylan K. Taylor
b2e806e2fa
World: Harden chunk loading against bad data in entity/tile NBT 2021-05-12 12:26:41 +01:00
Dylan K. Taylor
80e4da85df
Fixed PHPStan build 2021-05-12 12:12:29 +01:00
Dylan K. Taylor
42e915b902
Player: added locking variable to prevent reentry into respawn() while awaiting spawn terrain generation 2021-05-12 12:10:32 +01:00
Dylan K. Taylor
34ee1c2354
pocketmine.yml: update preset example for worlds
preset is now supported as its own key, and it's less confusing to present it separately, since that's how it's displayed in the server.properties also.
2021-05-12 12:00:52 +01:00
Dylan K. Taylor
4a68e0219e
shut 2021-05-11 19:29:30 +01:00
Dylan K. Taylor
4c4db1836f
Merge remote-tracking branch 'origin/stable' 2021-05-11 19:28:09 +01:00
Dylan K. Taylor
dfdd59734c
[ci skip] update changelog 2021-05-11 19:26:01 +01:00
Dylan K. Taylor
ab0500ae4f
Player: Fixed a multitude of bugs with respawning
the following things are changed:
- Player->getSpawn() no longer returns a safe spawn by default. Instead, if the player doesn't have a spawn set, it returns the world's stored spawn directly. This allows consistent behaviour of locating safe respawn positions without double calculation of safe spawn position, and also fixes crash issues during the login sequence if the player's spawn position referred to ungenerated terrain.
- Player->respawn() is now asynchronous, using the promise returned by orderChunkPopulation() to complete respawn after the terrain is generated. This allows consistently selecting a safe respawn position and fixes crashes when respawning if the spawn location was in ungenerated terrain.

There remains a problem that ragequit respawns are still only handled right after PlayerJoinEvent, which leads to the original spawn terrain being sent to the player, which is obviously very wasteful. However, that's a problem for a later commit.
2021-05-11 19:15:31 +01:00
Dylan K. Taylor
094c949e86
Entity: fixed extremely stupid bug with player respawning after ragequit 2021-05-11 19:08:56 +01:00
Dylan K. Taylor
5a7736b179
actions: go with PHP 7.4.19 2021-05-10 20:30:08 +01:00
Dylan K. Taylor
e648f1c91e
Remove unnecessary script copy 2021-05-10 17:55:52 +01:00
Dylan K. Taylor
5116e11cea
Only install the stuff we need to run PHP, not to build it 2021-05-10 17:55:52 +01:00
Dylan K. Taylor
0ff21557e4
World: fixed generation requests being rejected during resolution
when a chunk population is ordered, its only chunk loader is the one that the World installed to keep the chunk loaded while it was generated. So, when the resolver removes its chunk loader from the chunk, it triggers the chunk unloading mechanism, which causes the promise to directly be rejected.
2021-05-10 17:20:04 +01:00
dependabot[bot]
9c05e37fbe
Bump phpstan/phpstan from 0.12.85 to 0.12.86 (#4212)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.85 to 0.12.86.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.85...0.12.86)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 16:53:43 +01:00
Dylan K. Taylor
f909557529
Cleaned up implementations for EnderChestInventory/DoubleChestInventory
previously, these were forced to extend BaseInventory because of the amount of crap in Inventory's interface.
This meant that these inventories had their own slots storage, which would be _mostly_ unused because these inventories aren't real inventories, but rather just delegates.
This lead to a variety of bugs in the past, such as certain API methods on BaseInventory not working correctly for DoubleChestInventory in particular.

Now, BaseInventory just implements the functional part of the inventory implementation, leaving the storage system up to the implementation.
A SimpleInventory class is provided with a simple SplFixedArray storage backing, which is used by most inventories.
EnderChestInventory and DoubleChestInventory now extend BaseInventory directly, and implement custom methods for dealing with their delegates.
2021-05-09 20:51:16 +01:00
Dylan K. Taylor
1533789f35
Player: fixed not subscribing to own inventory updates
fixes #4211
2021-05-09 19:36:36 +01:00
Dylan K. Taylor
922164ff2c
Updated composer dependencies 2021-05-08 21:15:13 +01:00
Dylan K. Taylor
20197e6813
RakLibServer: clean up constructor parameters 2021-05-08 20:13:29 +01:00
Dylan K. Taylor
1003fde2fc
RakLibServer: make all parameters mandatory 2021-05-08 20:11:16 +01:00
Dylan K. Taylor
2ce6a87d05
getSafeSpawn() may throw if the target terrain is not generated 2021-05-08 16:22:13 +01:00
Dylan K. Taylor
e9f3cefe94
Default world might be null 2021-05-08 16:21:34 +01:00
Dylan K. Taylor
027109075c
WorldManager: don't recalculate the spawn point for every player teleported during world unload 2021-05-08 16:19:22 +01:00
Dylan K. Taylor
624495f4d3
Added a generic Promise type
I anticipate increasing demand for promises, and since all the libraries I could find suck, we'll stick to our own impl for now.
2021-05-08 15:57:30 +01:00
Dylan K. Taylor
33eb97da97
Remove dead PHPStan pattern 2021-05-08 15:53:55 +01:00
Dylan K. Taylor
6384b6602c
phpstorm you piece of shit 2021-05-07 23:55:49 +01:00
Dylan K. Taylor
998a583815
World: Fixed inverted completion callbacks for chunk population
this would have caused any chunk populated by a plugin to remain loaded forever.
2021-05-07 23:39:44 +01:00
Dylan K. Taylor
f9bfc0df73
NetworkSession: don't crash on teleporting to other world during PlayerLoginEvent 2021-05-07 22:47:06 +01:00
Dylan K. Taylor
5324474194
Merge remote-tracking branch 'origin/stable' 2021-05-07 20:47:35 +01:00
Dylan K. Taylor
fb4796f35e
Added PhpStorm code style and file templates 2021-05-07 20:44:46 +01:00
Dylan K. Taylor
6cb285d4a9
Added constants for the handler tag types 2021-05-06 18:40:14 +01:00
Dylan K. Taylor
742f86e022
Rename DestroyBlockParticle -> BlockBreakParticle
closes #3461

literally every other particle/sound has the subject first, followed by the (optional) verb, and finally Particle (or Sound).
In addition, we refer to breaking blocks as 'break' everywhere except here, where we refer to it as 'destroy'.
2021-05-06 18:33:18 +01:00
Dylan K. Taylor
7d1c4efdfb
Updated composer dependencies 2021-05-06 18:17:05 +01:00
Dylan K. Taylor
7b2c6c5ceb
Avoid more $this refs on long-life closures 2021-05-06 14:27:56 +01:00
Dylan K. Taylor
c356abb917
BlockTransaction: remove cyclic reference to self in callbacks 2021-05-06 14:27:08 +01:00
Dylan K. Taylor
01794adef1
... 2021-05-05 22:24:23 +01:00
Dylan K. Taylor
5e5277acb5
Merge branch 'stable' 2021-05-05 22:22:32 +01:00
Dylan K. Taylor
0c2ba66078
Updated build/php submodule to pmmp/php-build-scripts@07129c61d6 2021-05-05 22:15:48 +01:00
Dylan K. Taylor
17bbb9330f
Updated RakLib, require pocketmine/raklib-ipc 2021-05-05 21:31:48 +01:00
Dylan K. Taylor
cc73571307
Updated composer dependencies 2021-05-05 19:43:39 +01:00
Dylan K. Taylor
73420819f6
Clean PHPStan baselines 2021-05-05 14:51:39 +01:00
Dylan K. Taylor
652de2632a
Rough OffHand implementation
this doesn't do stuff like taking arrows from offhand yet.
2021-05-05 14:46:51 +01:00
Dylan K. Taylor
e8cb49f7ae
php-cs-fixer fixing php-cs-fixer's own mess 2021-05-05 11:25:11 +01:00
Dylan K. Taylor
4ca5558ec1
Merge remote-tracking branch 'origin/stable' 2021-05-05 11:14:01 +01:00
Dylan K. Taylor
267b49247e
Updated composer deps (except pocketmine/nbt) 2021-05-04 22:27:34 +01:00
Dylan K. Taylor
c29cd8e2eb
actions: added PHP script to update versions 2021-05-04 22:21:45 +01:00
Dylan K. Taylor
a13b0c98a1
Updated to PHP-CS-Fixer 3.0.0 2021-05-04 22:18:18 +01:00