Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add setting to allow bags to stack #241

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fluxionary
Copy link

this is a redo of #237 as a defaullt-off setting.

@SmallJoker
Copy link
Member

You could make this more generic by using stack_max to allow any stack size.

@fluxionary
Copy link
Author

You could make this more generic by using stack_max to allow any stack size.

if someone has a use-case for that, that'd be easy to add on in the future.

@SmallJoker
Copy link
Member

SmallJoker commented Dec 29, 2023

@fluxionary Which would add yet another setting which could be avoided right now in the first place.

Similar to your approach of using the default stack size, someone else might prefer to have stacks of 10 or 20. I am certain someone will come up with that request sooner or later.

@Bastrabun
Copy link

Bastrabun commented Feb 23, 2024

Please also disallow put when a bag is already present. That's not necessary when the stacksize is one, but any stacksize above 1 will cause more than one bag placeable in the bags inv.

diff --git a/bags.lua b/bags.lua
index f6d4da6..8936ebc 100644
--- a/bags.lua
+++ b/bags.lua
@@ -195,7 +195,9 @@ minetest.register_on_joinplayer(function(player)
                        if not new_slots then
                                return 0 -- ItemStack is not a bag.
                        end
-
+                       if not inv:is_empty(listname) then
+                               return 0 -- Disallow put when bag present
+                       end
:...skipping...
diff --git a/bags.lua b/bags.lua
index f6d4da6..8936ebc 100644
--- a/bags.lua
+++ b/bags.lua

For my reference 852

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants