Re-implement give_initial_stuff
authorPerttu Ahola <celeron55@gmail.com>
Sat, 26 Nov 2011 01:49:46 +0000 (03:49 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:53 +0000 (19:13 +0200)
data/mods/give_initial_stuff/init.lua [new file with mode: 0644]
src/defaultsettings.cpp

diff --git a/data/mods/give_initial_stuff/init.lua b/data/mods/give_initial_stuff/init.lua
new file mode 100644 (file)
index 0000000..bc99e21
--- /dev/null
@@ -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)
+
index 8cad23dcefd9adaf1c106a2aa66051494abfe2be..20a6dc0a8a71dcc689c2d8e7307a0f276d74b02c 100644 (file)
@@ -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");