12644 Commits

Author SHA1 Message Date
Dylan K. Taylor
f43d20b47a Move attribute net sync to NetworkSession 2020-11-08 14:15:11 +00:00
Dylan K. Taylor
64afb6f2e2 Move responsibility of firing chunk requests from World to NetworkSession
this is, after all, all about sending chunks ...
2020-11-08 14:14:43 +00:00
Dylan K. Taylor
4ae7efbfbc [ci skip] add some documentation to Player internals 2020-11-08 14:03:30 +00:00
Dylan K. Taylor
ffff0a6244 NetworkSession: remove obsolete TODO 2020-11-08 14:03:30 +00:00
David
b059e0b475
Item: fixed wrong tag being removed during serialization of custom name (#3894) 2020-11-07 01:25:37 +00:00
Dylan K. Taylor
beb6a50883 Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	composer.lock
#	resources/vanilla
#	src/pocketmine/Player.php
#	tests/phpstan/configs/runtime-type-checks.neon
2020-11-06 13:18:49 +00:00
Dylan K. Taylor
528726068e phpstan 0.12.54 2020-11-06 13:09:04 +00:00
Dylan K. Taylor
3aa902ff77 Updated composer dependencies 2020-11-06 13:07:28 +00:00
Dylan K. Taylor
e6348bbd34 Entity: do not assume that save IDs are always strings
this is only the first of many changes needed to make entity savedata fully format-agnostic, but it's a start.
2020-11-06 13:05:17 +00:00
Dylan K. Taylor
37ee3f2775 Player: fixed orderChunks performance issue on newly-generated maps
every time a chunk passed through Level->generateChunkCallback(), it fired onChunkChanged() for chunk listeners, which in turn caused players to rerun chunk orders even though the target chunk had not been sent yet anyway.
2020-11-05 16:17:39 +00:00
Dylan K. Taylor
bfdcc12e81 phpstan 0.12.54 2020-11-05 14:49:00 +00:00
Dylan K. Taylor
4b46549cd1 fix PHPStan failure
setDirtyFlag has a void return type, so PHPStan assumes it's non-pure and invalidates the type info.
2020-11-05 14:35:23 +00:00
Dylan K. Taylor
058a3b3fa6 relocate some world-specific logic from Chunk to World 2020-11-05 14:28:36 +00:00
Dylan K. Taylor
8762d44506 World: skip lighting updates on chunks which are not yet light populated 2020-11-04 17:50:16 +00:00
Dylan K. Taylor
72ace3951e InGamePacketHandler: fixed crafting table breaking when clicked while sneaking 2020-11-03 22:56:20 +00:00
Dylan K. Taylor
142102a054 ItemFactory: remap bucket:9 and bucket:11 to their appropriate counterparts 2020-11-03 19:44:57 +00:00
Dylan K. Taylor
518a7827a6 BlockFactory: make slab registration slightly less awful to look at 2020-11-03 19:28:32 +00:00
Dylan K. Taylor
32929925aa Block: added a bunch of state manipulation APIs 2020-11-03 19:13:32 +00:00
Dylan K. Taylor
0a8dc3edd3 Fixed users of ColorInMetadataTrait having uninitialized default colours 2020-11-03 18:42:40 +00:00
Dylan K. Taylor
bcedbc364b BlockDataSerializer: added methods to read/write coral facing 2020-11-03 18:41:12 +00:00
Dylan K. Taylor
c3af0eff93 travis: use pmmp/leveldb 2020-11-03 17:56:15 +00:00
Dylan K. Taylor
b2299e08e0 phpstan 0.12.53 2020-11-03 15:00:56 +00:00
Dylan K. Taylor
d7741050c5 Updated composer dependencies 2020-11-03 14:54:50 +00:00
Dylan K. Taylor
5c5fe15483 tests: remove unused script 2020-11-03 14:42:29 +00:00
Dylan K. Taylor
a05f67bc77 Position::fromObject() world parameter is now mandatory (although still nullable) 2020-11-03 14:33:26 +00:00
Dylan K. Taylor
5cc2a9c3dd World: rename getChunkAtPosition() to getOrLoadChunkAtPosition()
this more accurately reflects what it does.
2020-11-03 14:12:47 +00:00
Dylan K. Taylor
bd78d0bff8 Player: added getItemCooldownExpiry() 2020-11-03 14:11:28 +00:00
Dylan K. Taylor
2e9b2d4aae World: fixed false unload events firing on chunk replacement when tiles and entities are deleted 2020-11-01 17:41:58 +00:00
Dylan K. Taylor
61112e4912 World: make create params of loadChunk and getOrLoadChunk mandatory
differences in the default values almost caused me to miss some bugs while trying to remove them.
2020-11-01 17:36:56 +00:00
Dylan K. Taylor
0bb37b5065 World: formalize setBlockAt()'s refusal to modify un-generated chunks
closes #2631
2020-11-01 17:24:09 +00:00
Dylan K. Taylor
b7690fed04 BiomeSelector: replace phpdoc with typehints 2020-11-01 17:09:10 +00:00
Dylan K. Taylor
12e185e3f6 Relocate EntityLegacyIds to pocketmine\data\bedrock package 2020-11-01 17:07:34 +00:00
Dylan K. Taylor
1f2bc8cb69 World: remove rogue import 2020-11-01 17:05:57 +00:00
Dylan K. Taylor
0ae17af1e0 BiomeRegistry: fixed EOF newline 2020-11-01 16:53:42 +00:00
Dylan K. Taylor
4231bfdc7e Relocate biome ID constants to pocketmine\data\bedrock package 2020-11-01 16:53:06 +00:00
Dylan K. Taylor
b176f4c12f Switch to BiomeRegistry
I accidentally committed this in c869a7f099237ca189dc574fe3df6e7630eeec51 and didn't notice. I intended to use it and never noticed.
2020-11-01 16:47:13 +00:00
Dylan K. Taylor
f991961d9a Generator no longer requires a ChunkManager to construct
this allows injection of arbitrary ChunkManagers into a single Generator instance.
The objective here was to remove the requirement to cache a SimpleChunkManager instance in worker-local storage, because that requires that the chunks it stores be manually removed to avoid memory leaks. However, there are some other obstacles, primarily the worldHeight which is not retained anywhere else.
2020-11-01 16:34:56 +00:00
Dylan K. Taylor
315962c12c Added __clone() for Chunk and SubChunk
we need this because the flatworld generator uses clone to produce new chunks, so we don't want the chunks getting fucked up.
2020-11-01 16:14:25 +00:00
Dylan K. Taylor
1d551af54a Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/level/Level.php
#	src/pocketmine/level/format/Chunk.php
#	tests/phpstan/configs/l7-baseline.neon
2020-11-01 15:58:16 +00:00
Dylan K. Taylor
2684ee96f7 World: do not perform base lighting calculation on non-generated chunks
this was causing twice as many light calculations for freshly generated chunks.
2020-11-01 15:53:50 +00:00
Dylan K. Taylor
6cff08cd65 Chunk: fixed hasChanged being set on fastDeserialize() chunks (caused by 2bb497b7162719507184e0e3a36027cedd7bbe29)
this caused some performance issues and silent bugs with the generator, notably that the generator would always think all chunks had been changed, causing them to be re-set back into the world 9 times.
2020-11-01 15:50:21 +00:00
Dylan K. Taylor
ef542880de WorldManager: allow different World instances to have different AsyncPool instances
instead of being forced to use the Server async pool
right now the intent of this is to reduce (and ultimately eliminate) the dependency of World on Server, but it might come in useful for other stuff too, for example a chunkserver-based generator implementation which blocks on network instead of eating CPU (it would just waste CPU for other tasks).
2020-11-01 15:21:15 +00:00
Dylan K. Taylor
11434f3a27 World::setBiomeId() now bails when trying to modify a non-generated chunk (or chunk locked for generation) 2020-11-01 15:00:48 +00:00
Dylan K. Taylor
3e21e47b7a Liquid: make getFlowVector() slightly less cancerous to read 2020-11-01 14:39:59 +00:00
Dylan K. Taylor
fec42f16ba Level: properly define type of generator field 2020-11-01 14:36:05 +00:00
Dylan K. Taylor
19bc879dc1 lose useless blank line 2020-11-01 14:24:02 +00:00
Dylan K. Taylor
be1da07ee5 tests: phpdoc cleanup 2020-11-01 14:23:44 +00:00
Dylan K. Taylor
d6d9dde0b2 imports cleanup 2020-11-01 14:23:21 +00:00
Dylan K. Taylor
73a8c90bee Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	resources/vanilla
#	src/world/Explosion.php
#	tests/phpunit/item/ItemTest.php
#	tests/phpunit/world/format/io/region/RegionLoaderTest.php
#	tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskMainLoggerTest.php
#	tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskMemoryLeakTest.php
2020-11-01 14:21:47 +00:00
Nick
deb0cee8a0
BaseInventory::canAddItem(): consider item max stack size (#3881)
this fixes addItem() failing when canAddItem() reported that an item can be added.
2020-11-01 13:49:13 +00:00