Commit Graph

9 Commits

Author SHA1 Message Date
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
d4b7f66e15 Promote some constructors 2022-05-17 22:34:58 +01:00
c773e43eda Updated BedrockProtocol to pmmp/BedrockProtocol@97fa88e9ef 2021-10-23 01:16:45 +01:00
9b30c2feda Extract a DelegateInventory from EnderChestInventory 2021-06-26 21:01:40 +01:00
6fb364b16f Store ender chest viewer count on the tile, instead of relying on the inventory's viewer count (#4238)
Fixes #4021
2021-06-13 14:37:09 +01: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
b8645f5c15 Clean up EnderChestInventory implementation
now, EnderChestInventory is just a temporary window, much like anvil/enchanting windows. It provides a gateway to the player's PlayerEnderInventory.

This removes one of the remaining obstacles to disallowing null World in Position constructor.
2021-05-02 14:26:27 +01:00
f538440bce De-spaghettify the hierarchy for chest inventories 2021-04-30 13:44:39 +01:00
6dd31cc3f5 break cycle between block and inventory packages 2020-04-24 23:53:49 +01:00