14567 Commits

Author SHA1 Message Date
Dylan K. Taylor
0f0b6f0efa
Utils: eliminate usages of backtick operator 2021-11-01 15:25:56 +00:00
Dylan K. Taylor
d5f13d8be2
Timezone: make PHPStan 1.0 happy 2021-11-01 15:24:16 +00:00
Dylan K. Taylor
27ae959e89
Terminal: backport shell_exec() code from PM4 to make PHPStan 1.0 happy 2021-11-01 15:23:36 +00:00
Dylan K. Taylor
f8f39687e2
Achievement: declare proper type for $list static property 2021-11-01 15:22:33 +00:00
Dylan K. Taylor
94737934de
PlayerDeathEvent: fixed LSP violation reported by PHPStan 1.0 2021-11-01 14:17:54 +00:00
Dylan K. Taylor
debb469de1
Updated PHPUnit dependency junk 2021-11-01 13:54:04 +00:00
Dylan K. Taylor
616eb0050d
World: remove premature optimisation of setBlockAt() introduced by ece28e5d7b0d4c8d12a9477cdd1d3337277e892d
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
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
e4a54f5b6a
World: deduplicate code in request/orderChunkPopulation 2021-11-01 00:33:18 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
f4a3c40b5c
World: use better variable names in orderChunkPopulation() 2021-10-31 23:48:00 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
bd60e41268
Revert "Revert "Player: do not re-request the same ungenerated chunks multiple times""
This reverts commit 3265d3f6b4d6705276b56fab5f765e2f97b5d992.
2021-10-31 22:57:56 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
08636d079d
Promise: expose isResolved() 2021-10-31 22:48:52 +00:00
Dylan K. Taylor
3265d3f6b4
Revert "Player: do not re-request the same ungenerated chunks multiple times"
This reverts commit 866020dfdb06434b4f361a4a0f0faf7a89c30ed2.

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
Dylan T
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
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
c580bb2434
InGamePacketHandler: mark player as not using item in more cases
fixes #4355
2021-10-31 14:41:31 +00:00
Dylan K. Taylor
4fe3f69702
World: eliminate final remaining 'no loaders attached' debug message on player creation 2021-10-31 14:33:27 +00:00
Dylan K. Taylor
018006541e
changelog: mention block-picking changes
[ci skip]
2021-10-31 14:12:12 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
3dc75644d9
World: avoid duplicated logger code in initChunk() 2021-10-31 14:02:25 +00:00
Dylan K. Taylor
1cabe4baf3
World: do not crash on duplicate tiles loaded from disk
closes #4049
2021-10-31 13:58:32 +00:00
Dylan K. Taylor
73dc0598e4
CrashDump: remove derp space 2021-10-30 23:22:37 +01:00
Dylan K. Taylor
faad2365e2
World: Register a temporary chunk loader on chunks used by PopulationTask
fixes #3839
2021-10-30 22:17:06 +01:00
Dylan K. Taylor
4f816d03a7
SurvivalBlockBreakHandler: remove useless code 2021-10-30 21:35:58 +01:00
Dylan K. Taylor
1d22761d27
Remove useless newline 2021-10-30 21:25:47 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
08f3c18de9
Arrow: do not add pickups to creative players' inventories
closes #2932
2021-10-30 17:16:46 +01:00
Dylan K. Taylor
141fbde660
Player: fixed getting re-banned on rejoin after unban from hardcore death
closes #2175
2021-10-30 16:58:03 +01:00
Dylan K. Taylor
465a509858
World: remove spammy debug message 2021-10-30 16:13:01 +01:00
Dylan K. Taylor
69952ae2af
Human: limit lifetime total XP range to INT32_MAX
closes #4484
2021-10-30 16:05:10 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
63dfcc60c3
4.0.0-BETA9 is next 2021-10-29 22:35:23 +01:00
Dylan K. Taylor
428bd5ae91
Release 4.0.0-BETA8 4.0.0-BETA8 2021-10-29 22:35:15 +01:00
Dylan K. Taylor
d17cd65803
3.25.2 is next 2021-10-29 22:23:28 +01:00
Dylan K. Taylor
a8d5e8c5f6
Release 3.25.1 3.25.1 2021-10-29 22:23:22 +01:00
Dylan K. Taylor
19f448d074
pocketmine/math 0.4.0 2021-10-29 21:56:56 +01:00
Dylan K. Taylor
1c18c731ef
bootstrap: check for zlib raw support in leveldb 2021-10-29 19:15:12 +01:00
Dylan K. Taylor
8a2ecfe1d4
Merge branch 'stable' 2021-10-29 19:04:01 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
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