Commit Graph

10 Commits

Author SHA1 Message Date
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
51a3043dfd PlayerInventory: fixed isHotbarSlot() returning bogus result for 9 2022-02-20 20:29:51 +00:00
e986a0a4f2 Replace disallowed operators in src/inventory/ 2022-01-20 19:20:32 +00:00
f909557529 Cleaned up implementations for EnderChestInventory/DoubleChestInventory
previously, these were forced to extend BaseInventory because of the amount of crap in Inventory's interface.
This meant that these inventories had their own slots storage, which would be _mostly_ unused because these inventories aren't real inventories, but rather just delegates.
This lead to a variety of bugs in the past, such as certain API methods on BaseInventory not working correctly for DoubleChestInventory in particular.

Now, BaseInventory just implements the functional part of the inventory implementation, leaving the storage system up to the implementation.
A SimpleInventory class is provided with a simple SplFixedArray storage backing, which is used by most inventories.
EnderChestInventory and DoubleChestInventory now extend BaseInventory directly, and implement custom methods for dealing with their delegates.
2021-05-09 20:51:16 +01:00
c61f66d973 Removed ext-ds dependency 2021-02-11 15:40:37 +00:00
c70c0b55df Separate held item index change listener logic from PlayerInventory 2021-01-12 16:44:25 +00:00
01c867b608 Human: make held item sync on inventory content change more consistent
before this change, setContents() wouldn't trigger a held item sync, nor would setItem(heldItemIndex, someItem).
2021-01-10 20:30:39 +00:00
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
f0505c0284 Remove dead comments from PlayerInventory and PlayerCursorInventory
these aren't overrides anymore.
2019-08-05 18:53:46 +01:00
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00