From 08c9b6037dd671cf47a31f78176594dd49a24b33 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 26 Nov 2011 03:49:46 +0200 Subject: [PATCH] Re-implement give_initial_stuff --- data/mods/give_initial_stuff/init.lua | 12 ++++++++++++ src/defaultsettings.cpp | 1 + 2 files changed, 13 insertions(+) create mode 100644 data/mods/give_initial_stuff/init.lua diff --git a/data/mods/give_initial_stuff/init.lua b/data/mods/give_initial_stuff/init.lua new file mode 100644 index 000000000..bc99e2149 --- /dev/null +++ b/data/mods/give_initial_stuff/init.lua @@ -0,0 +1,12 @@ +minetest.register_on_newplayer(function(player) + print("on_newplayer") + if minetest.setting_getbool("give_initial_stuff") then + print("giving give_initial_stuff to player") + player:add_to_inventory('ToolItem "SteelPick" 0') + player:add_to_inventory('NodeItem "torch" 99') + player:add_to_inventory('ToolItem "SteelAxe" 0') + player:add_to_inventory('ToolItem "SteelShovel" 0') + player:add_to_inventory('NodeItem "cobble" 99') + end +end) + diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 8cad23dce..20a6dc0a8 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -89,6 +89,7 @@ void set_default_settings(Settings *settings) settings->setDefault("enable_damage", "true"); settings->setDefault("only_peaceful_mobs", "false"); settings->setDefault("fixed_map_seed", ""); + settings->setDefault("give_initial_stuff", "false"); settings->setDefault("default_password", ""); settings->setDefault("default_privs", "build, shout"); -- 2.25.1