Commit Graph

92 Commits

Author SHA1 Message Date
2b7510945a First look at ItemStackRequest usage (very unstable) 2022-08-18 17:38:57 +01:00
e90abecf38 Rewrite InventoryManager handling of complex mapped inventories
this turned out to be necessary when dealing with the ItemStackRequest system.
2022-08-17 14:42:30 +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
e040c2b281 InventoryManager: fixed windows not opening when the server removes windows
closes #5094
2022-06-05 16:03:24 +01:00
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
86efa0aae6 Merge remote-tracking branch 'origin/stable' into next-minor 2022-05-20 17:49:04 +01:00
554f96bc24 InventoryManager: Defer opening new windows to the client until the window close handshake has been completed
fixes #5021 and probably a bunch of other inventory related glitches

When the server initiates a window close, it does so by sending a ContainerClose to the client, which causes the
client to behave as if it initiated the close itself. It responds by sending a ContainerClose back to the server,
which the server is then expected to respond to.

Sending the client a new window before sending this final response creates buggy behaviour on the client, which
is problematic when switching windows. Therefore, we defer sending any new windows until after the client
responds to our window close instruction, so that we can complete the window handshake correctly.

This is a pile of complicated garbage that only exists because Mojang overengineered the process of opening and
closing inventory windows.
2022-05-20 16:54:15 +01:00
6eac2ea7a5 Modernize private property declarations in src/network 2022-05-17 21:22:33 +01:00
1e59679ec2 Implemented Stonecutter (#4732) 2022-05-17 16:01:03 +01:00
4e777572c9 fix CS 2022-03-23 13:28:21 +00:00
90a8595a40 Check for mismatched inventory slot predictions in transactions
this should limit the problems caused by mismatched gameplay features that result in ghost items, such as #4896.
2022-03-22 17:42:19 +00:00
3232a83965 InventoryManager: beware possible crash due to invalid items 2022-02-22 16:50:36 +00:00
4f25ab10e9 InventoryManager: Do not sync slots the client correctly predicted during using items
closes #4825
2022-02-22 16:46:23 +00:00
be1996752a Replace disallowed operators in src/network/ 2022-01-20 19:11:32 +00:00
6fdcfb01c8 Seal up main inventory open/close logic inside InventoryManager where it belongs 2021-11-08 22:58:06 +00:00
45edb94607 Crafting tables now work the same way as anvils and enchanting tables
Removing almost all special-case logic for crafting tables.
2021-11-07 16:20:07 +00:00
e131c2cefa Drop pocketmine/spl 2021-11-02 16:08:29 +00:00
88b7389080 InventoryManager: reduce code duplication 2021-10-29 15:37:52 +01:00
c773e43eda Updated BedrockProtocol to pmmp/BedrockProtocol@97fa88e9ef 2021-10-23 01:16:45 +01:00
58bc9332cd Workaround for offhand sync (#4359)
fixes #4231
2021-08-12 23:27:53 +01:00
27e0ecf7ee Implemented Blast Furnace and Smoker (#4362) 2021-08-12 23:27:05 +01:00
b8ebf8936e InventoryManager: fix container open callbacks not working
this was reported to me on socials by multiple different people, but nobody reported an issue so I almost forgot. >.<
2021-06-26 21:21:23 +01:00
652de2632a Rough OffHand implementation
this doesn't do stuff like taking arrows from offhand yet.
2021-05-05 14:46:51 +01:00
593a8ac529 Added Loom blocks
these don't support doing patterns yet, but their inventories work.
2021-04-29 19:51:09 +01:00
8364bc51ac ... 2021-04-27 14:47:11 +01:00
7ce77713dd InventoryManager: add a mechanism to allow plugins to inject their own container open packet creators
closes #4008
2021-04-27 14:40:43 +01:00
1e6d97a157 Merge branch 'stable' 2021-04-07 21:25:39 +01:00
a7dbc2c77b Merge tag '3.17.7' 2021-03-14 19:29:32 +00:00
c70c0b55df Separate held item index change listener logic from PlayerInventory 2021-01-12 16:44:25 +00:00
af1fe7c293 Merge branch 'stable' 2020-11-21 21:13:48 +00:00
d7f7e1c4ff InventoryManager: remove useless repeated code 2020-10-06 18:14:46 +01:00
7e6adc41f0 Merge 1.16 support into PM4 (with changes) 2020-06-26 22:21:09 +01:00
0397204c68 network/mcpe: imports cleanup 2020-04-27 12:56:28 +01:00
6dd31cc3f5 break cycle between block and inventory packages 2020-04-24 23:53:49 +01:00
08ac6a3c43 Convert CreativeInventory to singleton 2020-04-24 00:38:18 +01:00
18d48869a0 the great airgapping of recipes and itemstacks 2020-04-23 14:11:48 +01:00
95eddbdd74 InventoryManager: move add/remove logic to separate functions 2020-02-12 17:36:29 +00:00
55e3b9ed91 InventoryManager: avoid feedback loop when closing inventory 2020-02-12 16:35:57 +00:00
4014f9a4f2 InventoryManager: be aware of client-side state when syncing slots
this eliminates feedback loops during client-initiated slot changes, and also makes it possible to have a SlotChangeAction anonymous from its initiator.
2020-02-11 21:12:18 +00:00
c85c1c3c3f Merge commit '82d9e481d2a0a389fbbc6dfd3672fc366127febc' 2019-12-11 23:06:35 +00:00
399f9242e0 InventoryManager: avoid use of PlayerHotbarPacket
it doesn't work so well when the selected slot is empty.
2019-08-10 18:09:38 +01:00
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00