20 Commits

Author SHA1 Message Date
Dylan K. Taylor
6d249026cc
Merge branch 'legacy/pm3' into stable 2022-01-07 20:15:15 +00:00
Dylan K. Taylor
09a2e006a8
CS AGAIN 2021-11-09 00:20:06 +00:00
Dylan K. Taylor
ab002ca06d
Improved handling of temporary inventory windows
evacuation behaviour is now consistent regardless of who is doing it
2021-11-08 23:36:58 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
c773e43eda
Updated BedrockProtocol to pmmp/BedrockProtocol@97fa88e9ef 2021-10-23 01:16:45 +01:00
Dylan K. Taylor
2e153624ad
Anvil: actually add slot constants, this time 2021-09-03 12:44:41 +01:00
Dylan K. Taylor
963f4a9cf3
Added constant slot IDs for Furnace, Enchanting, Anvil and Brewing Stand inventories 2021-09-03 12:16:07 +01:00
Dylan T
27e0ecf7ee
Implemented Blast Furnace and Smoker (#4362) 2021-08-12 23:27:05 +01:00
Dylan K. Taylor
9afc5be0f5
Shulker open/close sounds != shulker box open/close sounds 2021-07-10 19:59:59 +01:00
Aericio
fc090e238d
Add Shulker Boxes (#3678)
this implementation is working, although incomplete:

- The shulker close sound should not be played until the end of the shulker closing animation, which takes approximately 1 second.
- An open shulker box has a different collision box than a closed one - it should be +0.5 in whichever direction the shulker is facing. (During the animation, the bounding box also dynamically changes size - you can see this in vanilla by shooting an arrow into the top of an open shulkerbox facing UP, and then closing it - the arrow will fall and collide with the lid multiple times.

However, resolving both of these issues requires significant internal changes which are beyond the scope of this PR.
2021-07-10 19:48:38 +01:00
Dylan K. Taylor
9b30c2feda
Extract a DelegateInventory from EnderChestInventory 2021-06-26 21:01:40 +01:00
Jason
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
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
f538440bce
De-spaghettify the hierarchy for chest inventories 2021-04-30 13:44:39 +01:00
Dylan K. Taylor
593a8ac529
Added Loom blocks
these don't support doing patterns yet, but their inventories work.
2021-04-29 19:51:09 +01:00
Aericio
b2765f32e9 Implemented Barrels, closes #3672 2020-11-16 17:26:07 +00:00
Dylan K. Taylor
1cf3a500f8 Clean up ChestInventory handling
longer term I want to rip this crap out completely, but right now this provides minor maintainability benefits, while also making it slightly less nasty to deal with other containers which animate their blocks, such as barrels and shulker boxes.
2020-11-16 16:59:19 +00:00
Dylan K. Taylor
670ad9eb9d Position: rename getWorldNonNull() to getWorld(), remove original getWorld() 2020-06-29 21:19:46 +01:00
Dylan K. Taylor
6dd31cc3f5 break cycle between block and inventory packages 2020-04-24 23:53:49 +01:00