Commit Graph

10 Commits

Author SHA1 Message Date
3c6b0993cc Finally deal with APIs on container and menu blocks
Two main interfaces are introduced:
- Container (chest, furnace, etc)
- MenuAccessor (includes Containers but also anvils, crafting tables etc. which are not containers)

Containers have inventories, locks, and everything from MenuAccessor
MenuAccessors have obstruction checks, and openToUnchecked() for plugins to use

I opted not to include precondition checks in openTo() because it's possible
to replicate those using the provided APIs if desired.
2025-08-30 23:38:07 +01:00
496ab808a8 First step towards standardised opening logic for containers and menu blocks
we'll want to introduce interfaces for these, but getting the code deduplicated is enough to start with.
2025-08-30 21:35:42 +01:00
174dfd1ecd Merge branch 'major-next' into inventory-rework 2025-08-30 20:10:47 +01:00
6f6b23d4e4 Integrate dev-major-next version of pocketmine/math
this is a reduced version compared to the original, due to the difficulty of getting rid of Facing values internally.
2025-08-29 21:47:20 +01:00
ce55183d71 ... 2025-04-30 19:52:49 +01:00
3ee78e20a5 BlockInventoryTrait: include a Block ref instead of Position 2024-12-07 19:28:10 +00:00
fe1a8d98e7 namespace tidy 2024-11-24 23:29:13 +00:00
45a4282e8b First look: Split up Inventory & InventoryWindow
this unblocks a variety of changes, such as positionless tiles, enhanced APIs on Blocks for inventories, and also eliminates a bunch of cyclic references within the core code.

linked to #5033
2024-11-24 21:40:47 +00:00
d0ff6d2e36 Enable various types of interaction to return items to the player, without needing to have a bunch of boilerplate creative mode and held item checks
it became glaringly obvious that this was needed because of #4827 and #4868.

this is further needed with the addition of cauldrons.
2022-07-16 19:50:33 +01:00
eb8fb63409 Added cartography and smithing tables
these have working inventories, and their crafting menus will 'just work' once the items for the associated recipes have been implemented (maps, netherite).
2022-07-14 18:01:47 +01:00