aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-12-02 12:43:57 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-12-02 12:43:57 +0200
commitb9e8e20c9cb87e441b3998b42f8d7f31c71f8a3f (patch)
tree9ff91e7afb0a90feb0c5380eee75dbfb51610b40 /data
parent932988af4650cdd844669d4cd238907409413db6 (diff)
downloadminetest-b9e8e20c9cb87e441b3998b42f8d7f31c71f8a3f.tar.gz
minetest-b9e8e20c9cb87e441b3998b42f8d7f31c71f8a3f.tar.bz2
minetest-b9e8e20c9cb87e441b3998b42f8d7f31c71f8a3f.zip
Script-defined creative inventory
Diffstat (limited to 'data')
-rw-r--r--data/builtin.lua10
-rw-r--r--data/mods/default/init.lua33
2 files changed, 43 insertions, 0 deletions
diff --git a/data/builtin.lua b/data/builtin.lua
index bfdb45d93..a9412a97d 100644
--- a/data/builtin.lua
+++ b/data/builtin.lua
@@ -328,6 +328,16 @@ minetest.craftitem_eat = function(hp_change)
end
--
+-- Creative inventory
+--
+
+minetest.creative_inventory = {}
+
+minetest.add_to_creative_inventory = function(itemstring)
+ table.insert(minetest.creative_inventory, itemstring)
+end
+
+--
-- Callback registration
--
diff --git a/data/mods/default/init.lua b/data/mods/default/init.lua
index 6b313f6b8..0ea6779c3 100644
--- a/data/mods/default/init.lua
+++ b/data/mods/default/init.lua
@@ -41,6 +41,7 @@
-- minetest.register_on_respawnplayer(func(ObjectRef))
-- ^ return true in func to disable regular player placement
-- minetest.register_on_chat_message(func(name, message))
+-- minetest.add_to_creative_inventory(itemstring)
-- minetest.setting_get(name) -> string or nil
-- minetest.setting_getbool(name) -> boolean value or nil
-- minetest.chat_send_all(text)
@@ -1344,6 +1345,38 @@ minetest.register_craftitem("apple_iron", {
print(dump(minetest.registered_craftitems))
+--
+-- Creative inventory
+--
+
+minetest.add_to_creative_inventory('tool MesePick 0')
+minetest.add_to_creative_inventory('tool SteelPick 0')
+minetest.add_to_creative_inventory('tool SteelAxe 0')
+minetest.add_to_creative_inventory('tool SteelShovel 0')
+
+minetest.add_to_creative_inventory('node torch 0')
+minetest.add_to_creative_inventory('node cobble 0')
+minetest.add_to_creative_inventory('node dirt 0')
+minetest.add_to_creative_inventory('node stone 0')
+minetest.add_to_creative_inventory('node sand 0')
+minetest.add_to_creative_inventory('node sandstone 0')
+minetest.add_to_creative_inventory('node clay 0')
+minetest.add_to_creative_inventory('node brick 0')
+minetest.add_to_creative_inventory('node tree 0')
+minetest.add_to_creative_inventory('node leaves 0')
+minetest.add_to_creative_inventory('node cactus 0')
+minetest.add_to_creative_inventory('node papyrus 0')
+minetest.add_to_creative_inventory('node bookshelf 0')
+minetest.add_to_creative_inventory('node glass 0')
+minetest.add_to_creative_inventory('node fence 0')
+minetest.add_to_creative_inventory('node rail 0')
+minetest.add_to_creative_inventory('node mese 0')
+minetest.add_to_creative_inventory('node chest 0')
+minetest.add_to_creative_inventory('node furnace 0')
+minetest.add_to_creative_inventory('node sign_wall 0')
+minetest.add_to_creative_inventory('node water_source 0')
+minetest.add_to_creative_inventory('node lava_source 0')
+minetest.add_to_creative_inventory('node ladder 0')
--
-- Some common functions