18090 Commits

Author SHA1 Message Date
pmmp-admin-bot[bot]
1ff0988e75 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12440895736
2024-12-21 01:22:54 +00:00
dependabot[bot]
506cfe0362
Bump build/php from 5016e0a to b1eaaa4 (#6579)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `5016e0a` to `b1eaaa4`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](5016e0a3d5...b1eaaa48ec)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-20 10:39:39 +00:00
pmmp-admin-bot[bot]
47a1aa6470 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12423751811
2024-12-20 01:24:32 +00:00
Dylan K. Taylor
fea17fa4a9
RakLibServer: disable GC
GC is not required for RakLib as it doesn't generate any unmanaged cycles.
Cycles in general do exist (e.g. Server <-> ServerSession), but these are
explicitly cleaned up, so GC wouldn't have any useful work to do.
2024-12-19 20:33:40 +00:00
Dylan K. Taylor
3e69ee87e4
Remove deprecated stuff
except Permission subscriptions; turns out we still need those
perhaps they should be marked @internal
2024-12-19 00:14:18 +00:00
pmmp-admin-bot[bot]
a2a2ec9d8b Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12364667325
2024-12-17 01:39:12 +00:00
Dylan T.
aee358d329
This timings handler management is a crap design
This has bitten me on the ass so many times now
2024-12-16 03:11:07 +00:00
pmmp-admin-bot[bot]
3a0f15ef0d Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12344337356
2024-12-16 01:42:31 +00:00
Dylan K. Taylor
80899ea72c
Make sure timings are counted under the proper parents 2024-12-15 21:34:16 +00:00
Dylan K. Taylor
42f90e94ff
AsyncWorker now manually triggers GC at the end of each task run, similar to the main thread
this avoids costly GC runs during hot code.
2024-12-15 21:25:32 +00:00
Dylan K. Taylor
8f536e6f21
always the CS 2024-12-15 20:46:10 +00:00
Dylan K. Taylor
45482e868d
Fixed AsyncWorker GC not getting re-enabled after memory dump
async workers still use automatic GC for now. We should probably switch to manual GC at some point, but it's not a priority right now.
2024-12-15 20:45:51 +00:00
Dylan K. Taylor
742aa46b88
Separate memory dumping utilities from MemoryManager 2024-12-15 20:44:00 +00:00
Dylan K. Taylor
cf1b360a62
World: Prevent block cache from getting too big
This has been a long-standing issue since at least 2016, and probably longer.
Heavy use of getBlock(At) could cause the cache to blow up and use all available memory.

Recently, it's become clear that unmanaged cache size is also a problem for GC, because
the large number of objects blows up the GC root buffer. At first, this causes more frequent
GC runs; later, the frequency of GC runs drops, but the performance cost of them goes up
substantially because of the sheer number of objects. We can avoid this by trimming the
cache when we detect that it's exceeded limits.

I've implemented this in such a way that failing to update blockCacheSize in new code
won't have lasting impacts, since the cache count will be recalculated during scheduled
cache cleaning anyway.

Closes #152.
2024-12-15 18:40:32 +00:00
Dylan K. Taylor
0aa6cde259
Remove stupid MemoryManager settings
No one in their right mind is going to change the defaults for these anyway.

All this crap does is overwhelm users with stuff they don't understand.
Most of this stuff has no business being modified by non-developers anyway.
2024-12-15 16:41:54 +00:00
Dylan T.
8f8fe948c1
MemoryManager: Control when cycle garbage collection is run (#6554)
This PR replicates the mechanism by which PHP's own GC is triggered: using a dynamically adjusted threshold based on the number of roots and the number of destroyed cycles. This approach was chosen to minimize behavioural changes.

This currently only applies to the main thread. Doing this for other threads is a bit more complicated (and in the case of RakLib, possibly not necessary anyway).

By doing this, we can get more accurate performance profiling. Instead of GC happening in random pathways and throwing off GC numbers, we trigger it in a predictable place, where timings can record it.

This change may also produce minor performance improvements in code touching lots of objects (such as `CraftingDataPacket` encoding`), which previously might've triggered multiple GC runs within a single tick. Now that GC runs wait for `MemoryManager`, it can touch as many objects as it wants during a tick without paying a performance penalty.

While working on this change I came across a number of issues that should probably be addressed in the future:

1) Objects like Server, World and Player that can't possibly be GC'd repeatedly end up in the GC root buffer because the refcounts fluctuate frequently. Because of the dependency chains in these objects, they all drag each other into GC, causing an almost guaranteed parasitic performance cost to GC. This is discussed in php/php-src#17131, as the proper solution to this is probably generational GC, or perhaps some way to explicitly mark objects to be ignored by GC.
2) World's `blockCache` blows up the GC root threshold due to poor size management. This leads to infrequent, but extremely expensive GC runs due to the sheer number of objects being scanned. We could avoid a lot of this cost by managing caches like this more effectively.
3) StringToItemParser and many of the pocketmine\data classes which make heavy use of closures are afflicted by thousands of reference cycles. This doesn't present a major performance issue in most cases because the cycles are simple, but this could easily be fixed with some simple refactors.
2024-12-15 16:26:39 +00:00
Dylan K. Taylor
7a2427ace2
Merge branch 'minor-next' of github.com:pmmp/PocketMine-MP into major-next 2024-12-14 02:40:03 +00:00
ipad54
b10caf7437
Remove tool tier of some blocks to match vanilla (#6573) 2024-12-13 21:54:48 +00:00
ipad54
de66d84d29
Implement new 1.20 and 1.21 records (#6572) 2024-12-13 21:10:34 +03:00
pmmp-admin-bot[bot]
f82c8dd3d3 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12307996607
2024-12-13 01:40:43 +00:00
pmmp-admin-bot[bot]
636f562bcf Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12307996607
2024-12-13 01:40:42 +00:00
ipad54
42094e6768
Implement resin blocks & items (#6571) 2024-12-12 23:21:41 +03:00
ipad54
b341078765
Implement new pale oak blocks (#6570) 2024-12-12 17:53:52 +03:00
Dylan T.
f7687af337
Fixed draft release being created on release publish 2024-12-12 13:44:15 +00:00
pmmp-admin-bot[bot]
851bbd7384 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12268005529
2024-12-11 01:40:03 +00:00
Dylan K. Taylor
ba93665fe7
TextFormat: reduce hella duplicated code in toHTML() 2024-12-10 14:11:11 +00:00
Maxence
6817215683
TextFormat: Added new material colours for armor trims (#5838)
Unfortunately, these new formatting codes conflict with the Java strikethrough and underline, so we can't support these anymore.

A TextFormat::javaToBedrock() is provided to strip these codes, or (if these formats become supported via different codes) to convert them to Bedrock variants.

Co-authored-by: Dylan T. <dktapps@pmmp.io>
2024-12-10 13:40:03 +00:00
pmmp-admin-bot[bot]
1ee52b69b0 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12247725255
2024-12-10 01:41:10 +00:00
pmmp-admin-bot[bot]
67b9d6222d 5.23.3 is next
Commit created by: https://github.com/pmmp/RestrictedActions/actions/runs/12240364052
2024-12-09 16:52:50 +00:00
Dylan T.
6f197bc1bb
5.23.2 (#6569) 5.23.2 2024-12-09 16:51:41 +00:00
Dylan K. Taylor
bba525da02
Remove dead PHPStan ignored errors 2024-12-09 16:44:25 +00:00
Dylan K. Taylor
ad6d34f1a6
Remove legacy make-release script
we no longer use this release workflow, all releases should now be done via pull request
2024-12-09 16:44:07 +00:00
Dylan K. Taylor
a8eaa43bc8
Recombine release workflows
having two different workflows able to trigger releases is a pain for build number continuity.
perhaps longer term we should source the build number a different way, but these workflows needed restructuring anyway.
2024-12-09 16:36:26 +00:00
dependabot[bot]
fe7c282052
Bump pocketmine/locale-data in the production-patch-updates group (#6568) 2024-12-09 12:03:09 +00:00
pmmp-admin-bot[bot]
851f7a9d80 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12227347339
2024-12-09 01:42:26 +00:00
Dylan T.
45917d495c
Fixed CrashDump incorrectly detecting phar core crashes as plugin crashes (#6564)
fixes #6563

Since #6217 was merged, \pocketmine\PATH no longer includes the path of the original phar.
This means that the frame originating from the phar stub would not get its path cleaned up,
leading to it being incorrectly detected as a plugin frame.

We should probably explore better methods of detecting plugin crashes in the future; however
this fix should solve the immediate issue.
2024-12-08 16:52:33 +00:00
Dylan K. Taylor
0fe786af4d
Rename CombinedInventory -> CombinedInventoryProxy 2024-12-08 16:28:00 +00:00
Dylan K. Taylor
9949e3815f
CombinedInventory now propagates updates if its backing inventories were directly modified
this was always lacking with DoubleChestInventory and is a major factor in it being basically useless for custom use cases.
2024-12-08 16:15:43 +00:00
Dylan K. Taylor
3ee78e20a5
BlockInventoryTrait: include a Block ref instead of Position 2024-12-07 19:28:10 +00:00
Dylan K. Taylor
9e6e5082cd
stfu 2024-12-07 18:55:09 +00:00
Dylan K. Taylor
699a85a5d6
Replace DoubleChestInventory with a more generic CombinedInventory
this could be used for a bunch of different things aside from double chests
since the DoubleChestInventory no longer references anything specific about chests,
I figured it was time to generalize this.
2024-12-07 18:51:25 +00:00
Dylan K. Taylor
4906f5bec2
... 2024-12-07 16:08:54 +00:00
Dylan K. Taylor
ef3d16597a
Revert "Chest block now has responsibility for configuring double chest inventories"
This reverts commit 1d2b52732e3c475ddc2bab4e45726d22850e3d5c.

I hadn't considered that the likes of plugins and hoppers need to be
able to interact with double chest inventories as well as players.

If we were to move this logic to the Block side, we'd have to expose
APIs on the Chest block to get the correct inventory lazily. I'm not
sure I want to commit to having getInventory() on the block right now,
as we can't guarantee it's available (see problems around Campfire
inventory on the block).

Short term, it'll probably be better to just expose the logic in
block\Chest for deciding which side the inventories should be on.
2024-12-07 16:04:50 +00:00
Dylan K. Taylor
b5a69c829d
smh 2024-12-07 14:47:10 +00:00
Dylan K. Taylor
b76db739fd
Campfire block's inventory is now null if it hasn't been set in the world
having this created by the block was unreliable anyway. If items were set into the block's created inventory before setting the block in the world, the campfire contents would get overridden when the block was next run through readStateFromWorld() anyway.

There needs to be a deeper exploration of how to handle blocks with inventories without requiring plugins to interact with tiles. For now, this isn't the worst solution, but it's not the best either.
2024-12-07 14:45:57 +00:00
Dylan K. Taylor
15bb0c705c
Remove CampfireInventory 2024-12-07 14:19:58 +00:00
Dylan K. Taylor
76528b20c1
Remove dodgy code 2024-12-07 14:10:55 +00:00
Dylan K. Taylor
4850bd5538
Allow blocks to respond to the contents of their containers being updated
turns out relying on scheduled updates for this was a bad idea, since it causes a lot of unnecessary code to run every tick, as well as being problematic for campfire, which doesn't have any blockstates to compare against.
2024-12-06 17:46:11 +00:00
Dylan K. Taylor
40574be333
Shift inventory management responsibility to World
this removes a bunch of problematic Position usages from Tile, as well as getting rid of a bunch of code duplication.
2024-12-06 16:14:41 +00:00
Dylan K. Taylor
ce4d3aef9e
Rename Container(Trait) -> ContainerTile(Trait)
this allows introducing block variations of these without name conflicts
2024-12-06 15:34:32 +00:00