Commit Graph

43 Commits

Author SHA1 Message Date
2ffc38c835 Implement campfire & soul campfire (#4696) 2024-07-07 15:01:34 -05:00
dd98e4aaed block: clean up unnecessary getter usages
with the assistance of a custom phpstan rule
this inconsistent mess has been bothering me for a long time
2023-11-14 12:47:33 +00:00
5a010e8213 Merge branch 'minor-next' into stable 2023-09-06 12:06:15 +01:00
ce04478395 Fix SmithingTableInventory size (#6035)
Since 1.20 SmithingTable has a new Template slot, size is now 3

Fix debug error from InventoryManager
2023-09-06 08:15:27 +01:00
1504fdca24 Use 'enchanting' terminology
'enchant' just didn't feel right, being a verb.
All these things pertain to the act of enchanting.

This is now also consistent with CraftingTransaction etc. The ship already sailed on EnchantInventory, which will have to be renamed at a later datte. However, that was already inconsistent with 'enchanting table', so that's the odd one out here.
2023-08-23 16:14:17 +01:00
bf668c0f6c Rename EnchantHelper related stuff
Perhaps this and EnchantOption should be called EnchantingHelper and EnchantingOption respectively. The terminology used is rather inconsistent, but 'enchantment' definitely isn't the right word here.
2023-08-23 16:07:02 +01:00
39867b97c5 Implement enchanting using enchanting tables (#5953)
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2023-08-15 17:28:26 +01:00
5c7f4570b4 Merge branch 'minor-next' into major-next 2023-05-06 17:20:37 +01:00
73bf5d4b29 DoubleChestInventory: specialize isSlotEmpty() and getMatchingItemCount() 2023-04-27 21:17:55 +01:00
33140482bb ItemTypeIds: added fromBlockTypeId() and toBlockTypeId()
this allows checking the type of a blockitem without being required to create a block to do it.
2023-03-02 15:28:50 +00:00
f6c9bf5cd1 Merge branch 'next-minor' into next-major 2022-07-20 20:55:33 +01:00
2940547026 Eliminate repeated calls to Position->getWorld()
as well as improving readability, it also improves performance in some areas.
2022-07-20 20:44:05 +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
af8f2c47f3 ShulkerBoxInventory: avoid usage of legacy ItemIds 2022-06-30 19:03:07 +01:00
aa9f8781ff Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
f2dc9187f0 Use covariant types for InventoryHolder and Container implementors 2022-06-05 18:49:48 +01:00
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
179cac45f5 Merge branch 'stable' into next-minor 2022-05-22 16:21:05 +01:00
a45a96b3ee ShulkerBoxInventory: fixed inappropriate usage of BlockLegacyIds when comparing item IDS 2022-05-21 15:40:25 +01:00
d4b7f66e15 Promote some constructors 2022-05-17 22:34:58 +01:00
1e59679ec2 Implemented Stonecutter (#4732) 2022-05-17 16:01:03 +01:00
72cff0ee11 Modernize property declarations in pocketmine\block namespace 2022-04-25 13:00:29 +01:00
79d1feff9c Replace disallowed operators in src/block/ 2022-01-20 16:57:09 +00:00
6d249026cc Merge branch 'legacy/pm3' into stable 2022-01-07 20:15:15 +00:00
09a2e006a8 CS AGAIN 2021-11-09 00:20:06 +00:00
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
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
c773e43eda Updated BedrockProtocol to pmmp/BedrockProtocol@97fa88e9ef 2021-10-23 01:16:45 +01:00
2e153624ad Anvil: actually add slot constants, this time 2021-09-03 12:44:41 +01:00
963f4a9cf3 Added constant slot IDs for Furnace, Enchanting, Anvil and Brewing Stand inventories 2021-09-03 12:16:07 +01:00
27e0ecf7ee Implemented Blast Furnace and Smoker (#4362) 2021-08-12 23:27:05 +01:00
9afc5be0f5 Shulker open/close sounds != shulker box open/close sounds 2021-07-10 19:59:59 +01:00
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
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
593a8ac529 Added Loom blocks
these don't support doing patterns yet, but their inventories work.
2021-04-29 19:51:09 +01:00
b2765f32e9 Implemented Barrels, closes #3672 2020-11-16 17:26:07 +00:00
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
670ad9eb9d Position: rename getWorldNonNull() to getWorld(), remove original getWorld() 2020-06-29 21:19:46 +01:00
6dd31cc3f5 break cycle between block and inventory packages 2020-04-24 23:53:49 +01:00