-
Notifications
You must be signed in to change notification settings - Fork 25
API for backpacks #33
Comments
to be honest, this seems like a over complicated solution to just overriding the craft for bags
additionally as the bag is a craftitem you can just override pretty much every aspect of it (texture, groups, etc) |
solution for allowing completely custom backpacks to work while trying to remain as agnostic as possible would be changing https://github.com/minetest-mods/i3/blob/main/init.lua#L2956 to use |
Well.. I don't agree with having fixed bag sizes either 😊 What if I want to create a mega-backpack? Or a super tiny single-inventory-row satchel? Also: What if I want to limit the sorts of items that can be stored in it? Like a belt just for potions? Or a bag for food? If this metadata can be communicated with item groups or some other field on the item itself, by all means. But there is more that can be exposed here beyond changing the recipe. Fine with keeping the existing items as long as there is a way to remove them. |
|
@kilbith Perhaps this should stay open as a part two allowing mods to register additional group values as proposed here https://irc.minetest.net/minetest/2021-10-14#i_5886620 has not yet been implemented. Alternatively a new issue for this could be opened if you prefer? |
Current API fine as it is. |
The current backpack support is hard-coded and the recipes depend on minetest-game/farming for string. This seems out-of-place in what should be a generic inventory implementation.
Proposed solution:
i3.register_backpack(itemid, backpack_defn)
which takes an existing registered item and adds the backpack behaviour to it.backpack_defn
is a table with whatever properties make sense for a backpack (I imagine slot width and height, at a minimum).If desired, the existing backpacks could be extracted to a companion mod i3-backpacks which uses the new call. This would have the added benefit of serving as an example implementation.
The text was updated successfully, but these errors were encountered: