16987 Commits

Author SHA1 Message Date
Dylan K. Taylor
6186fc0bfe
4.21.1 is next 2023-05-17 16:45:35 +01:00
Dylan K. Taylor
ef40934d24
Release 4.21.0 4.21.0 2023-05-17 16:45:32 +01:00
Dylan K. Taylor
69b668355f
Merge branch 'minor-next' into stable 2023-05-17 16:12:24 +01:00
Dylan K. Taylor
ee9ce8a4f4
Merge branch 'minor-next' into major-next 2023-05-17 15:45:03 +01:00
Dylan K. Taylor
59ca7b75e1
Fixed PHPStan error 2023-05-17 15:32:38 +01:00
Dylan K. Taylor
9621836e36
Clean up confusing mess around block and item overriding
right now, I don't see an obvious reason to do this. If it turns out I was wrong later on, we can add functionality back, but we can't remove functionality after release.
2023-05-17 15:21:49 +01:00
Dylan K. Taylor
0547383296
Update build/php submodule to pmmp/PHP-Binaries@f860ade30a 2023-05-17 15:08:05 +01:00
Dylan K. Taylor
c7dff9ea40
bootstrap: remove ext-parallel bootstrapping code
I have no intention of using parallel, so this code is not necessary.
2023-05-17 14:11:43 +01:00
Dylan K. Taylor
043350753b
Drop PHP 8.0, 8.1 is now minimum version 2023-05-17 13:53:57 +01:00
Dylan K. Taylor
5ad8016b99
Merge branch 'stable' into minor-next 2023-05-17 13:44:45 +01:00
Dylan K. Taylor
2e5b2eed6e
Update composer dependencies 2023-05-17 13:43:28 +01:00
Dylan K. Taylor
5a0cde49cc
AsyncPool: do not double-check progress updates on finished tasks
checkProgressUpdates is called directly before onCompletion, so we only need to call it again if the task isn't finished yet.
2023-05-16 23:37:58 +01:00
Dylan K. Taylor
008a022ec1
Players now have finite resources in spectator mode
this seems like the logical solution for the block picking issues.
2023-05-16 23:02:33 +01:00
Dylan K. Taylor
5c85a7c306
Merge remote-tracking branch 'origin/stable' into minor-next 2023-05-16 22:54:53 +01:00
Dylan K. Taylor
599c4284f5
Introduce 10 KB threshold for async compression
due to the extremely large performance cost of instantiating AsyncTasks, it's usually not worth bothering with async compression except for very large packets.
While this large overhead can be significantly reduced by using specialized threads, it's early days in the testing stages for such improvements, and for now, we still have this to deal with.

Since async compression is always used prior to player spawn, this change may slightly improve the performance of the pre-join stage of the game.
2023-05-16 22:54:06 +01:00
Dylan K. Taylor
9499e2e595
always the CS... 2023-05-16 14:22:03 +01:00
Dylan K. Taylor
a4fea1444a
Remove validateCallableSignature() calls from network hot paths
we rely on phpstan for validation of this internally, and plugins shouldn't be calling these methods anyway.
this significantly reduces the overhead of CompressBatchPromise.
2023-05-16 14:21:32 +01:00
Dylan K. Taylor
c9bb4335a1
Item: added getStateId(), removed state data from public API
state data was only used for indexing stuff along with state ID anyway, so it makes more sense to lock it away in here instead.
2023-05-16 14:14:18 +01:00
Dylan K. Taylor
015c668885
Change confusing 'type data' and 'state data' terminology for blocks and items
For blocks, we now use 'block-item state' and 'block-only state', which should be much clearer for people implementing custom stuff.
'block-item state', as the name suggests, sticks to the item when the block is acquired as an item.
'block-only state' applies only to the block and is discarded when the block is acquired as an item.

'type data' for items was also renamed, since 'type' is too ambiguous to be anything but super confusing.
2023-05-16 14:07:29 +01:00
platz1de
ccb22ceb3f
Fix flower pots being marked as pottable (#5747) 2023-05-16 12:31:30 +01:00
Dylan K. Taylor
1ba47802a8
Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2023-05-15 14:59:02 +01:00
Dylan K. Taylor
9d111e13f1
CONTRIBUTING: added table of in-house dependencies and which classes, functions or namespaces they contain 2023-05-15 14:58:31 +01:00
dependabot[bot]
44bc4d8c7c
Bump phpstan/phpstan from 1.10.14 to 1.10.15 (#5741)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.14 to 1.10.15.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.14...1.10.15)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  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-10 15:02:59 +01:00
IvanCraft623
30f1d3e016
Fix code style (#5740) 2023-05-10 13:41:25 +01:00
Dylan K. Taylor
7b1a1e5a18
BlockStateToObjectDeserializer: remove redundant helper 2023-05-08 22:16:55 +01:00
Dylan K. Taylor
1b452f3a88
BlockStateToObjectDeserializer: make flat colour block handling less repetetive 2023-05-08 21:38:58 +01:00
ipad54
fa719f37d5
Implement Cave Vines & Glow Berries (#5424) 2023-05-08 19:24:23 +01:00
Hugo_
d834266635
BlockGrowEvent: add player information for bonemeal usage (#5596)
this is in line with StructureGrowEvent, which also has a similar API.
2023-05-08 17:38:07 +01:00
Dylan K. Taylor
d317347a9b
WorldTimings: remove TODO
I tried this, and it didn't really provide any information that the tree table didn't already show.
2023-05-08 16:35:30 +01:00
Dylan K. Taylor
077fac84bf
Added aggregate timers for all world timings
this allows timings list view to display totals for these sections. It does make the tree view a bit more annoying in some cases though.
2023-05-08 16:27:46 +01:00
Dylan K. Taylor
6f0eb019d2
ItemIdMetaUpgrader: added some auxiliary methods 2023-05-07 19:28:07 +01:00
Dylan K. Taylor
fdb3a5b121
Fixed incorrect implementation of peak timings 2023-05-07 18:29:37 +01:00
Dylan K. Taylor
8e6c1762d7
Merge branch 'minor-next' into major-next 2023-05-06 18:27:06 +01:00
Dylan K. Taylor
e3bc36ab5b
Merge branch 'stable' into minor-next 2023-05-06 18:26:47 +01:00
Dylan K. Taylor
283ff28aa9
4.20.5 is next 2023-05-06 18:20:19 +01:00
Dylan K. Taylor
c3ceeeace7
Release 4.20.4 4.20.4 2023-05-06 18:20:18 +01:00
Dylan K. Taylor
aac4f6c0e1
Fixed all game modes allowing flight
moral of the story: do not trust that mojang things do what they say they do - the spectator ability layer always applies, regardless of whether the player is actually in spectator mode or not ...
2023-05-06 18:18:05 +01:00
Dylan K. Taylor
926f68d8c5
Move SkinAdapter under TypeConverter, remove SkinAdapterSingleton
this is legacy cruft from PM3, which didn't have TypeConverter or SingletonTrait.
2023-05-06 17:53:24 +01:00
Dylan K. Taylor
ed11fd5a83
CS again... 2023-05-06 17:51:00 +01:00
Dylan K. Taylor
e0a6ec0c24
Start deglobalizing TypeConverter
there's a bunch of places we can't reach with this right now:

- particles
- sounds
- tile NBT
- entity metadata
- crafting data cache
- chunk encoding
- world block update encoding

this is a work in progress, but ultimately we want to get rid of these singletons entirely.
2023-05-06 17:47:09 +01:00
Dylan K. Taylor
7cdf6b0946
Fixed merge error 2023-05-06 17:29:59 +01:00
Dylan K. Taylor
5c7f4570b4
Merge branch 'minor-next' into major-next 2023-05-06 17:20:37 +01:00
Dylan K. Taylor
bb60a9057f
Merge branch 'stable' into minor-next 2023-05-06 17:08:29 +01:00
Dylan K. Taylor
3b893961e4
4.20.4 is next 2023-05-06 17:01:49 +01:00
Dylan K. Taylor
325ffec1be
Release 4.20.3 4.20.3 2023-05-06 17:01:49 +01:00
Dylan K. Taylor
fa715a074a
Fixed TimingsHandler depth not getting reset when timings is disabled
When timings was disabled, internalStopTiming is not called, and timer depth is not decremented.
If timings is later reenabled, the next call to internalStartTiming will think the timer is already running, and won't generate any new records for the timer.
This has led to broken timings reports with missing Full Server Tick entries, amongst other things.
2023-05-06 16:56:39 +01:00
Dylan K. Taylor
4caa2c7690
NetworkSession: send FLYING flag on spectator ability layer
fixes #5722

I'm not very clear why this works. PM doesn't use real spectator mode yet (we're still using the faux spectator mode PM has had for years, because I haven't yet assessed how real spectator mode will affect stuff like block interactions), so this ability layer shouldn't have any effect.

thank you @Alemiz112
2023-05-06 15:54:23 +01:00
Dylan K. Taylor
d04da9b1d8
Reuse timings handlers for event handlers of the same events
due to direct repeated usage of registerEvent() with closures, we've seen some libraries like muqsit/SimplePacketHandler generate very large timings reports, because a new timings handler gets created every time a plugin registers or unregisters a new packet handler callback.

This change fixes the problem by ensuring that any handlers derived from the same function, handling the same event class, will share the same timer.
2023-05-06 15:42:52 +01:00
Dylan K. Taylor
8a374df801
BlockTranslator: remove useless call to generateDataFromStateId()
BlockStateDictionary doesn't retain BlockStateData anymore, so this optimisation is just wasting CPU cycles.
2023-05-05 17:02:50 +01:00
Dylan K. Taylor
02cf5ed388
RuntimeBlockMapping: lazy-load NBT blockstates
this saves a considerable amount of memory.

we don't actually need this state array in PM4 anyway, since we don't support the client-side chunk cache yet.
when the time comes to support it, it'll be much more practical to cache binary states and copy bytes anyway, instead of doing it the current way, which is both slow and memory-intensive.

Measured footprint change: 9 MB -> 400 KB.
2023-05-05 16:18:03 +01:00