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 customise stack max #1843
Conversation
Stacks with 3200 items on them look okay, according to Megaf. |
👍 🐈 |
This shouldn't be done by a user setting. Some games may not want users to control it. |
minetest.nodedef_default.stack_max = 123 Only affects items registered after this statement. Remember craftdef_default and others. |
I would like this, so that I can change Carbone's stack limit to 100 as it more dividers than 99. |
👍 |
👍 🐶 |
👍 |
minetest.nodedef_default.stack_max and minetest.craftitemdef_default.stack_max are not documented anywhere. Are those an official API? |
Yes, the API docs need to be updated if this is to be merged |
They're not an official API, they're just objects in builtin which can be modified by mods. |
914b705
to
eeaf870
Compare
I support this. As a default that is, for items which don't specify their own stack max. Each item should be able to define its own within the node definition... I assume this is already possible? |
Yes. Items will still be able to use stack_max in their definition. If they don't use stack_max in their definition, then this setting will be used, or 99 if the setting is not set. |
Have read all of it and still didn't get, can I or cannot prevent players from making their inventory bigger w/o asking a server to? Example: So, I'm officially the first one who DOES care for stack_max value be equal amongst magichet players. |
👍 Definitely should be added. |
4aiman: It's a server-side setting. |
I hadn't looked at the commit itself - too busy with translation :) 👍 from me then :) |
👍 |
1 similar comment
👍 |
I will rebase soon. |
@rubenwardy BTW what is rebasing? I'm new to github. |
This code is a few months old, and since then the Minetest code has changed. Rebasing, in this context, is updating my code to work with the latest Minetest code. |
Ah. OK. |
Rebased. |
just a question before i give you my +1, what happens if i reduce the max number and have greater stacks ? |
You don't lose any items. They keep in the too large stacks until you break For an example, try /giveme stone 200 in current upstream master.
|
Ok then you have my +1 |
I don't like that setting this in a mod only affects future registered nodes. If a mod wants to change stack_max, then it would need to go through all already registered nodes (from the game) and call override_item on them, which is quite ugly. |
In the current upstream you'd need to do exactly the same thing.
This pull request is aimed towards end-users and subgames. Mods can use the
method that they've used all along.
|
@PilzAdam That could be fixed by using metatables, if they aren't used already. IIRC kaeza wrote a patch for that... |
Closing as it doesn't look like it's going to be merged |
Why didn't this get merged? It had an overwhelming amount of 👍s ! |
Oh, nvm. |
eg:
in minetest.conf.
To add this to a subgame:
You should add the line to minetest.conf in your game's directory.
However, sometimes you may not want players to be able to override it.
To stop this, add the following lines before any items are defined: