13039 Commits

Author SHA1 Message Date
Dylan K. Taylor
9b01fb3d89 Release 3.16.1 3.16.1 2020-12-07 17:16:10 +00:00
Dylan K. Taylor
f28405fcfb phpstan 0.12.59 2020-12-07 17:12:55 +00:00
Ifera
c4b47c6c06 Implemented /clear command (#3854)
closes #3854
2020-12-06 15:26:12 +00:00
Dylan K. Taylor
d9de775c27 Updated DevTools submodule to pmmp/DevTools@888d021260 2020-12-05 22:56:27 +00:00
Dylan K. Taylor
0bbceee86d PermissionParser: give permissions default FALSE if they don't specify their own default 2020-12-05 21:06:07 +00:00
Dylan K. Taylor
9c07c206f6 Updated DevTools submodule to pmmp/DevTools@1606a4307b 2020-12-05 20:02:14 +00:00
Dylan K. Taylor
d0d701f232 Updated build/php submodule to pmmp/php-build-scripts@a42c7df20a 2020-12-05 19:42:41 +00:00
Dylan K. Taylor
07cae8a129 Updated composer dependencies 2020-12-05 19:40:30 +00:00
Dylan K. Taylor
59cb11dc83 ChunkManager->setChunk() no longer accepts NULL 2020-12-05 18:54:30 +00:00
Dylan K. Taylor
b6df5b974d World->getHighestBlockAt() may still return -1 if the queried column of blocks is all air 2020-12-05 18:14:38 +00:00
Dylan K. Taylor
531c191431 Finalize Utils class 2020-12-05 18:09:23 +00:00
Dylan K. Taylor
1f330c0f50 World: ignore entities calling onEntityMoved() who aren't members of the world
this can happen if movement or teleportation occurs during the creation of an entity.
2020-12-05 17:49:34 +00:00
Dylan K. Taylor
b2bab6c2fb clean dead errors out of phpstan l8 baseline 2020-12-05 01:32:23 +00:00
Dylan K. Taylor
a5315991d5 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/serializer/PacketSerializer.php
#	src/world/biome/Biome.php
#	tests/phpstan/configs/l8-baseline.neon
2020-12-05 01:30:39 +00:00
Dylan K. Taylor
6869ee1c2d Clean up nonsensical code in NetworkBinaryStream->getSlot() 2020-12-05 01:24:41 +00:00
Dylan K. Taylor
eca0e88471 BaseInventory: fixed passing NULL slots to InventoryListener->onContentChange()
as per the documentation, InventoryListener->onContentChange() does not expect to receive NULL in the given array.
2020-12-05 01:11:30 +00:00
Dylan K. Taylor
070d8efda3 [ci skip] more world stuff for changelog 2020-12-05 01:02:53 +00:00
Dylan K. Taylor
d728160a77 Removed the cycle between Entity and Chunk
it's now the World's responsibility to manage adding/removing entities from appropriate chunks. Entities no longer know or care that chunks exist.
Entity->checkChunks() remains as-is for backwards compatibility - now it just calls the world to sync its position.
2020-12-05 00:59:16 +00:00
Dylan T
03b1ea766a
Added a DedicatedQueryNetworkInterface to ensure Query functionality when RakLibInterface is disabled (#3942) 2020-12-04 21:21:25 +00:00
Dylan K. Taylor
37b9694845 ConsumingItemAnimation: fixed itemID translation for 1.16.100 2020-12-04 20:44:03 +00:00
Dylan K. Taylor
1c49cedc8c World: disallow block placement and breaking in unloaded, ungenerated and locked chunks 2020-12-04 15:49:35 +00:00
Dylan K. Taylor
bacdb7bde5 Make sure generator gets preemptively registered when a worker restart is detected
if a PopulationTask took place after the target worker was garbage collected, the population would fail and the chunks it used would be copied for nothing.
This change marks workers as having unregistered generators when detecting that a worker that previously had a generator registered is restarted.
2020-12-04 15:44:17 +00:00
Dylan K. Taylor
e056456dd1 Player: fixed crash when stopping using a chunk before it's finished being generated 2020-12-04 15:36:43 +00:00
HighTec
26155acff2
register HellBiome (#3950) 2020-12-04 11:58:49 +00:00
Dylan K. Taylor
5ba09b6a25 fix PopulationTask crash 2020-12-03 23:48:40 +00:00
Dylan K. Taylor
5f55cdfa76 Cleaned out dead error patterns from phpstan level 8 baseline 2020-12-03 22:44:03 +00:00
Dylan K. Taylor
b9cd633cee Chunks no longer exist in un-generated state
a non-generated chunk is now always represented by NULL. This forces the case of ungenerated chunks to be handled by all code, which is necessary because ungenerated chunks cannot be interacted with or modified in any meaningful way.
2020-12-03 22:28:43 +00:00
Dylan K. Taylor
05ab44f768 PopulationTask no longer creates chunks if they don't exist
creating a throwaway empty chunk on the main thread is pointless.
2020-12-03 22:12:42 +00:00
Dylan K. Taylor
c808095978 Chunks no longer contain their own coordinates 2020-12-03 21:59:30 +00:00
Dylan K. Taylor
1f5998d24c FastChunkSerializer no longer encodes chunk coordinates
in cases like PopulationTask it makes more sense to store the coordinates separately where they can be stored more efficiently (once instead of 9 times)
In addition, PopulationTask shouldn't need to serialize an empty chunk just to copy coordinates.

I've made changes like this in other areas already in preparation for the day when chunks no longer contain their coordinates, so this brings us one step closer to that goal.
2020-12-03 20:52:33 +00:00
Dylan K. Taylor
5b1fa25dff LightPopulationTask: remove useless @var 2020-12-03 20:29:41 +00:00
Dylan K. Taylor
7edfa3713b Do not persist SimpleChunkManager between async tasks
this is just asking for memory leaks.
2020-12-03 19:46:23 +00:00
Dylan K. Taylor
dde2e7e66f generation: drop AsyncWorker thread-local storage in favour of a more specialized storage 2020-12-03 19:28:22 +00:00
Dylan K. Taylor
999defd20d World: remove create params from loadChunk() and loadChunkAtPosition() 2020-12-03 18:49:14 +00:00
Dylan K. Taylor
a67f0d1f75 World->registerChunkLoader() no longer causes creation of an empty chunk
this only made sense to work around the server crashing when creating a player in ungenerated terrain, but spawning at y=256 is hardly preferable, and it'll crash since fd99445c5bbd2a5a6fdd0109d8a196ea6160e0a3 anyway ...
2020-12-03 18:41:53 +00:00
Dylan K. Taylor
1e7f9214cc Entity: flag for despawn if entering ungenerated terrain
previously this created an empty chunk for the entity to hang around in until the terrain was generated, but that's problematic for several reasons, most importantly the fact that non-generated chunks are not saved.
2020-12-03 18:36:54 +00:00
Dylan K. Taylor
ec2feeffcb World->populateChunk() no longer causes ChunkLoadEvent to fire with an empty chunk
instead, it will fire when the chunk comes out of PopulationTask and is set into the world using setChunk().
There is still one place left where auto-creation of empty chunks is used by the core, and that's an issue i'm still deciding how to deal with.
2020-12-03 18:23:03 +00:00
Dylan K. Taylor
fa9be2477d World: do not fire ChunkListener->onChunkChanged() when a new chunk is set
the documentation expressly describes a chunk being _replaced_ by a new chunk. This doesn't fit when the chunk didn't exist to begin with.
2020-12-03 18:20:43 +00:00
Dylan K. Taylor
74744fd498 World: fire ChunkLoadEvent in setChunk() if the chunk did not previously exist
I'm of two minds whether this should continue to fire onChunkChanged() on chunk loaders or not, since the chunks won't be referenced by any chunk loader anyway by virtue of not existing ...
2020-12-03 18:15:09 +00:00
Dylan K. Taylor
5197707d32 Separated TimingsRecord from TimingsHandler (different lifetimes)
this fixes #3906.
TimingsHandler will now be automatically destroyed when there are no TimingsRecord referencing it and its owner has no references left to it.
TimingsRecord will be automatically destroyed at the end of the timings session (if active).

This fixes records from temporary timers being lost after the timings handlers are removed, while also fixing TimingsHandlers piling up regardless of whether timings are running or not.
This opens the doors to have more volatile timers, such as per-player/per-session timers, which are destroyed on player quit, but which won't result in the timings disappearing from the final timings result.
2020-12-03 15:45:49 +00:00
Dylan K. Taylor
29f6ed3f68 Use Snooze to improve AsyncTask collection times
regardless of how long an async task takes to run, it will take a multiple of 50ms to get the result processed. This delay causes issues in some cases for stuff like generation, which causes locking of adjacent chunks, and async packet compression, which experiences elevated latency because of this problem.
This is not an ideal solution for packet compression since it will cause the sleeper handler to get hammered, but since it's already getting hammered by every packet from RakLib, I don't think that's a big problem.
2020-12-02 19:34:34 +00:00
Dylan K. Taylor
1775fb669b SurvivalBlockBreakHandler: fixed block break effects stopping beyond 4 blocks distance
this was actually intended to be 16 blocks ...
2020-12-02 18:56:39 +00:00
Dylan K. Taylor
0574b59df9 Network: fixed interfaces registered after raw packet handlers not respecting raw packet handler filters 2020-12-02 17:11:15 +00:00
Dylan K. Taylor
bc2fafca27 Fixed players losing all permissions when being de-opped after joining as op 2020-12-02 17:04:37 +00:00
Dylan K. Taylor
687ad28fa6 Added a PacketBroadcaster interface
this gives a bit more control over how packets are broadcasted, which might be useful if the batch format changes (e.g. adding a length prefix) for multi version.
This really ought to be unique to a protocol context instead of a network interface, but for now this is the best we can do.
2020-12-02 16:34:14 +00:00
Dylan K. Taylor
6001f69d52 Network->registerInterface() now returns whether the registration succeeded or not 2020-12-02 16:16:04 +00:00
Dylan K. Taylor
807474b3fb PermissibleBase: do not assign any permissions by default
there is no longer such a thing as a permission granted to 'everyone', since we're no longer limited to true/false/op/notop, and regular players are now assigned the pocketmine.group.user permission.
It's possible we might want to add more restricted groups than 'user' in the future, in which case it would be behaviour-BC-breaking to change the default assigned permissions when creating a new PermissibleBase. Therefore, it's better to not assign any permissions at all and let the caller decide.
In addition, this solves the problem of implied permission subscriptions and leak on PermissibleBase construction - if base permissions are provided, it should be expected that the permissible will subscribe to those permissions.
2020-12-02 15:56:54 +00:00
Dylan K. Taylor
05c52fef46 Updated DevTools submodule to pmmp/DevTools@7c2d05cafc 2020-12-02 14:41:28 +00:00
Dylan K. Taylor
b51c6e89b3 Introduced pocketmine.group.console
this is only used for /dumpmemory right now, but it's planned to be used for more stuff.
2020-12-02 13:35:48 +00:00
Dylan K. Taylor
c5e12bb11f PermissibleBase: simplify diff calculation 2020-12-02 11:29:45 +00:00