aboutsummaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2020-04-13 10:53:10 +0200
committerGitHub <noreply@github.com>2020-04-13 10:53:10 +0200
commit27d611fe5561db20b380a16fdc6bcf1fefaf5d39 (patch)
treea44e2563389e9940b922c6350fdca45e900ea5b8 /builtin/game
parent0ac999ded725f8efcd26db284161683e37efeecf (diff)
downloadminetest-27d611fe5561db20b380a16fdc6bcf1fefaf5d39.tar.gz
minetest-27d611fe5561db20b380a16fdc6bcf1fefaf5d39.tar.bz2
minetest-27d611fe5561db20b380a16fdc6bcf1fefaf5d39.zip
Add default stack size setting (#8873)
New setting "default_stack_max" to alter the default stack sizes of all items when desired. Co-authored-by: Pascal Abresch <nep@packageloss.eu>
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/item.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua
index 513c3a5e1..3aaa71ef2 100644
--- a/builtin/game/item.lua
+++ b/builtin/game/item.lua
@@ -675,6 +675,8 @@ end
-- Item definition defaults
--
+local default_stack_max = tonumber(minetest.settings:get("default_stack_max")) or 99
+
core.nodedef_default = {
-- Item properties
type="node",
@@ -684,7 +686,7 @@ core.nodedef_default = {
inventory_image = "",
wield_image = "",
wield_scale = {x=1,y=1,z=1},
- stack_max = 99,
+ stack_max = default_stack_max,
usable = false,
liquids_pointable = false,
tool_capabilities = nil,
@@ -748,7 +750,7 @@ core.craftitemdef_default = {
inventory_image = "",
wield_image = "",
wield_scale = {x=1,y=1,z=1},
- stack_max = 99,
+ stack_max = default_stack_max,
liquids_pointable = false,
tool_capabilities = nil,
@@ -786,7 +788,7 @@ core.noneitemdef_default = { -- This is used for the hand and unknown items
inventory_image = "",
wield_image = "",
wield_scale = {x=1,y=1,z=1},
- stack_max = 99,
+ stack_max = default_stack_max,
liquids_pointable = false,
tool_capabilities = nil,