summaryrefslogtreecommitdiff
path: root/technic/technic/creative.lua
diff options
context:
space:
mode:
Diffstat (limited to 'technic/technic/creative.lua')
-rw-r--r--technic/technic/creative.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/technic/technic/creative.lua b/technic/technic/creative.lua
new file mode 100644
index 0000000..7b4c493
--- /dev/null
+++ b/technic/technic/creative.lua
@@ -0,0 +1,21 @@
+technic.creative_inventory_size = 0
+technic.creative_list = {}
+
+-- Create detached creative inventory after loading all mods
+minetest.after(0, function()
+ local inv = minetest.create_detached_inventory("technic_creative", {})
+ technic.creative_list = {}
+ for name,def in pairs(minetest.registered_items) do
+ if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0)
+ and def.description and def.description ~= "" then
+ table.insert(technic.creative_list, name)
+ end
+ end
+ table.sort(technic.creative_list)
+ --inv:set_size("main", #technic.creative_list)
+ --for _,itemstring in ipairs(technic.creative_list) do
+ -- local stack = ItemStack(itemstring)
+ -- inv:add_item("main", stack)
+ --end
+ --technic.creative_inventory_size = #technic.creative_list
+end)