- Code: Select all
local DEFAULT_STACK_MAX = 128;
local function wrapRegFunc(funcName)
local wrapped = minetest[funcName];
minetest[funcName] =
function(name, def, ...)
if def.stack_max == nil then def.stack_max = DEFAULT_STACK_MAX; end;
return wrapped(name, def, ...);
end;
end;
wrapRegFunc('register_node');
wrapRegFunc('register_craftitem');
wrapRegFunc('register_tool');
for _, def in pairs(minetest.registered_items) do
if def.stack_max == nil then def.stack_max = DEFAULT_STACK_MAX; end;
end;