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 customise stack max #1843

Closed
wants to merge 1 commit into from

Conversation

rubenwardy
Copy link
Member

eg:

default_stack_max = 34

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:

minetest.nodedef_default.stack_max      = 123
minetest.craftitemdef_default.stack_max = 123

@rubenwardy
Copy link
Member Author

Stacks with 3200 items on them look okay, according to Megaf.

@SmallJoker
Copy link
Member

👍 🐈

@PilzAdam
Copy link
Contributor

This shouldn't be done by a user setting. Some games may not want users to control it.

@rubenwardy
Copy link
Member Author

minetest.nodedef_default.stack_max = 123

Only affects items registered after this statement. Remember craftdef_default and others.

@Calinou
Copy link
Member

Calinou commented Nov 16, 2014

I would like this, so that I can change Carbone's stack limit to 100 as it more dividers than 99.

@Zeno-
Copy link
Contributor

Zeno- commented Nov 18, 2014

👍

@Megaf
Copy link
Contributor

Megaf commented Nov 18, 2014

👍 🐶

@Amaz1
Copy link
Contributor

Amaz1 commented Nov 18, 2014

👍

@celeron55
Copy link
Member

minetest.nodedef_default.stack_max and minetest.craftitemdef_default.stack_max are not documented anywhere. Are those an official API?

@Zeno-
Copy link
Contributor

Zeno- commented Nov 26, 2014

Yes, the API docs need to be updated if this is to be merged

@rubenwardy
Copy link
Member Author

They're not an official API, they're just objects in builtin which can be modified by mods.

@MirceaKitsune
Copy link
Contributor

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?

@rubenwardy
Copy link
Member Author

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.

@4aiman
Copy link
Contributor

4aiman commented Dec 15, 2014

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:
Magichet shrinks the inventory of a player if he/she has reincarnated w/o using a reincarnator.
If this is to be merged, then would players be able to redefine stack_max locally in order to compensate the lack of free slots to some degree?

So, I'm officially the first one who DOES care for stack_max value be equal amongst magichet players.

@p5yk0g3n3s1s
Copy link

👍 Definitely should be added.

@celeron55
Copy link
Member

4aiman: It's a server-side setting.

@4aiman
Copy link
Contributor

4aiman commented Dec 16, 2014

I hadn't looked at the commit itself - too busy with translation :)
Thanks for clarifying this, celeron55!

👍 from me then :)

@ShadowNinja ShadowNinja added the Rebase needed The PR needs to be rebased by its author. label Dec 19, 2014
@C1ffisme
Copy link

C1ffisme commented Feb 8, 2015

👍

1 similar comment
@TheShadowZone12
Copy link

👍

@rubenwardy
Copy link
Member Author

I will rebase soon.

@C1ffisme
Copy link

C1ffisme commented Feb 9, 2015

@rubenwardy BTW what is rebasing? I'm new to github.

@rubenwardy
Copy link
Member Author

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.

@C1ffisme
Copy link

C1ffisme commented Feb 9, 2015

Ah. OK.

@rubenwardy
Copy link
Member Author

Rebased.

@Zeno- Zeno- removed the Rebase needed The PR needs to be rebased by its author. label Feb 10, 2015
@nerzhul
Copy link
Member

nerzhul commented Feb 16, 2015

just a question before i give you my +1, what happens if i reduce the max number and have greater stacks ?

@rubenwardy
Copy link
Member Author

You don't lose any items. They keep in the too large stacks until you break
the stack up by taking items off. (For example if the new stack Max is 50,
you will still have above 50 stacks in the inventory, but you can't add to
them, only take off of them of move them.)

For an example, try /giveme stone 200 in current upstream master.
On 16 Feb 2015 15:03, "nerzhul" notifications@github.com wrote:

just a question before i give you my +1, what happens if i reduce the max
number and have greater stacks ?


Reply to this email directly or view it on GitHub
#1843 (comment).

@nerzhul
Copy link
Member

nerzhul commented Feb 16, 2015

Ok then you have my +1

@PilzAdam
Copy link
Contributor

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.

@rubenwardy
Copy link
Member Author

rubenwardy commented Feb 16, 2015 via email

@ShadowNinja
Copy link
Member

@PilzAdam That could be fixed by using metatables, if they aren't used already. IIRC kaeza wrote a patch for that...

@rubenwardy
Copy link
Member Author

Closing as it doesn't look like it's going to be merged

@benrob0329
Copy link
Member

Why didn't this get merged? It had an overwhelming amount of 👍s !

@benrob0329
Copy link
Member

Oh, nvm.

@rubenwardy rubenwardy deleted the stack_max branch January 18, 2017 00:12
@ghost ghost mentioned this pull request Apr 9, 2018
@rubenwardy rubenwardy restored the stack_max branch April 9, 2018 15:46
@rubenwardy rubenwardy deleted the stack_max branch April 9, 2018 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet