Commit Graph

17950 Commits

Author SHA1 Message Date
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
4906f5bec2 ... 2024-12-07 16:08:54 +00:00
ef3d16597a Revert "Chest block now has responsibility for configuring double chest inventories"
This reverts commit 1d2b52732e.

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
b5a69c829d smh 2024-12-07 14:47:10 +00:00
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
15bb0c705c Remove CampfireInventory 2024-12-07 14:19:58 +00:00
76528b20c1 Remove dodgy code 2024-12-07 14:10:55 +00:00
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
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
ce4d3aef9e Rename Container(Trait) -> ContainerTile(Trait)
this allows introducing block variations of these without name conflicts
2024-12-06 15:34:32 +00:00
6578d65cd8 Merge branch 'major-next' into inventory-rework 2024-12-06 12:58:03 +00:00
6d2329128a Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12191303914
2024-12-06 01:38:37 +00:00
1481977f35 Create pr-stale.yml 2024-12-05 20:47:46 +00:00
8efdf501ad 5.23.2 is next
Commit created by: https://github.com/pmmp/RestrictedActions/actions/runs/12187209543
2024-12-05 20:05:36 +00:00
2b0daebc2a 5.23.1 (#6562) 5.23.1 2024-12-05 20:04:43 +00:00
6b2da15b80 Fixed signs 2024-12-05 19:58:52 +00:00
2ef02a2c5e Upgraded block consistency check to detect tile changes 2024-12-05 19:57:13 +00:00
07045dd424 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12184052098
2024-12-05 16:35:59 +00:00
c5b0df4578 Merge remote-tracking branch 'origin/minor-next' into major-next 2024-12-05 16:07:28 +00:00
15e8895e54 5.23.1 is next
Commit created by: https://github.com/pmmp/RestrictedActions/actions/runs/12183301507
2024-12-05 15:52:16 +00:00
ea8f971287 Release 5.23.0 (#6561) 5.23.0 2024-12-05 15:51:13 +00:00
62e1d87f5e Mention internal timings deprecations
plugins shouldn't be using these, but since it's not marked as internal, we can't be sure.
2024-12-05 15:47:34 +00:00
ea068d4907 Update 5.23.md 2024-12-05 15:01:49 +00:00
fa7bc78e7c Prepare 5.23.0 release 2024-12-05 14:29:17 +00:00
0aaf4238a8 more deprecations in line with major-next 2024-12-05 13:02:09 +00:00
35a90d24ec AsyncTask: deprecate progress update related stuff 2024-12-05 12:57:26 +00:00
5e9dbace90 Merge branch 'minor-next' into major-next 2024-12-05 10:13:24 +00:00
9a6e258b6c Merge branch 'stable' of github.com:pmmp/PocketMine-MP into minor-next 2024-12-05 10:13:06 +00:00
205aabe11f Fixed merge error 2024-12-04 15:27:09 +00:00
a1448bfb88 5.22.1 is next
Commit created by: https://github.com/pmmp/RestrictedActions/actions/runs/12160926590
2024-12-04 13:38:41 +00:00
ba6828c6bd Release 5.22.0 (Bedrock 1.21.50 support) (#6559)
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
5.22.0
2024-12-04 13:36:52 +00:00
3091e1325f Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12151373979
2024-12-04 01:39:59 +00:00
5fc96c393d Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12151373979
2024-12-04 01:39:58 +00:00
2d0321ff02 Switch back to official JsonMapper
the issues that led to the need for a fork have been addressed in the 5.0.0 release.
2024-12-03 15:19:38 +00:00
c56d4d3e3c dependabot: update github actions deps together, monthly 2024-12-03 14:56:22 +00:00
06028aac97 issues: don't recommend forums to get help 2024-12-03 02:07:58 +00:00
779e80a961 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12131296321
2024-12-03 01:39:33 +00:00
950f7ad7a4 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12131296321
2024-12-03 01:39:32 +00:00
49da50659f Bump docker/build-push-action from 6.9.0 to 6.10.0 (#6553) 2024-12-02 16:36:12 +00:00
007673cb96 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12111121061
2024-12-02 01:41:02 +00:00
ae9b4dbb05 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12111121061
2024-12-02 01:41:01 +00:00
fcef015f32 L link 2024-12-02 00:40:55 +00:00
0dae786a21 feat(Server): add a setter for maxPlayers (#6261) 2024-12-01 20:24:50 +00:00
f1a3b42620 Implement frost walker enchantment (#5497)
Co-authored-by: Dylan T. <dktapps@pmmp.io>
2024-12-01 19:46:38 +00:00
f3763ae691 Implement Recovery compass (#5502)
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2024-12-01 18:25:45 +00:00
12214792b3 Allow eating in creative & peaceful
closes #5923
closes #6056
2024-12-01 17:42:26 +00:00
93a9007f3c Added ClosureCommand (#6063)
this is intended to replace PluginCommand and CommandExecutor, both of which are overengineered and unfit for purpose.
Allowing a closure allows much greater flexibility.

We can't use this within the core yet, as plugins will expect PluginBase->getCommand() to return PluginCommand (with its associated setExecutor() and similar APIs).
However, I think this is useful enough to add by itself.
2024-12-01 15:10:07 +00:00
02d181d0c8 Merge branch 'minor-next' into major-next 2024-12-01 15:02:36 +00:00
a593180ef9 Deprecate some stuff 2024-12-01 15:01:41 +00:00
61560ec375 Support for collecting timings from threads, and implement async task timings (#6333)
The following callbacks can now be registered in timings, to allow threads to be notified of these events:
- Turning on/off (`TimingsHandler::getToggleCallbacks()->add(...)`)
- Reset (`TimingsHandler::getReloadCallbacks()->add(...)`)
- Collect (`TimingsHandler::getCollectCallbacks()->add(...)`)

Collect callbacks must return `list<Promise>`. The promises must be `resolve()`d with `list<string>` of printed timings records, as returned by `TimingsHandler::printCurrentThreadRecords()`. It's recommended to use 1 promise per thread.

A timings report will be produced once all promises have been resolved.

This system is used internally to collect timings for async tasks (closes #6166).

For timings viewer developers:
Timings format version has been bumped to 3 to accommodate this change. Timings groups should now include a `ThreadId`  at the end of timings group names to ensure that their record IDs are segregated correctly, as they could otherwise conflict between threads. The main thread is not required to specify a thread ID. See pmmp/timings@13cefa6279 for implementation examples.

New PHPStan error is caused by phpstan/phpstan#10924
2024-12-01 14:49:27 +00:00