Deprecate minetest.add_to_creative_inventory and use group not_in_creative_inventory...
authorPerttu Ahola <celeron55@gmail.com>
Wed, 25 Jul 2012 14:59:37 +0000 (17:59 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Wed, 25 Jul 2012 15:05:31 +0000 (18:05 +0300)
builtin/deprecated.lua
builtin/misc_register.lua
games/minimal/mods/default/init.lua

index d41e2c44c53b28efa81e34167ca90b7893d1d6b3..405ce3b09fbcddc3ecc47f37a2b6a38090037fc2 100644 (file)
@@ -20,3 +20,7 @@ minetest.node_metadata_inventory_move_allow_all = function()
        minetest.log("info", "WARNING: minetest.node_metadata_inventory_move_allow_all is obsolete and does nothing.")
 end
 
+minetest.add_to_creative_inventory = function(itemstring)
+       minetest.log('info', "WARNING: minetest.add_to_creative_inventory: This function is deprecated and does nothing.")
+end
+
index 18ef227556baf709eb8b8770f41bc1e8185c730d..4894e71bc198f0b6aa4758b4124ecb3975402492 100644 (file)
@@ -244,6 +244,7 @@ minetest.register_item(":unknown", {
        inventory_image = "unknown_item.png",
        on_place = minetest.item_place,
        on_drop = minetest.item_drop,
+       groups = {not_in_creative_inventory=1},
 })
 
 minetest.register_node(":air", {
@@ -258,6 +259,7 @@ minetest.register_node(":air", {
        diggable = false,
        buildable_to = true,
        air_equivalent = true,
+       groups = {not_in_creative_inventory=1},
 })
 
 minetest.register_node(":ignore", {
@@ -272,23 +274,15 @@ minetest.register_node(":ignore", {
        diggable = false,
        buildable_to = true, -- A way to remove accidentally placed ignores
        air_equivalent = true,
+       groups = {not_in_creative_inventory=1},
 })
 
 -- The hand (bare definition)
 minetest.register_item(":", {
        type = "none",
+       groups = {not_in_creative_inventory=1},
 })
 
---
--- Creative inventory
---
-
-minetest.creative_inventory = {}
-
-minetest.add_to_creative_inventory = function(itemstring)
-       table.insert(minetest.creative_inventory, itemstring)
-end
-
 --
 -- Callback registration
 --
index ce7f01def0a9ebd8b80c9c36d9ac0079e3cf07cb..5c84afaa1cfb438d42d6e8e8ce9499da0bc8327a 100644 (file)
@@ -1563,40 +1563,6 @@ minetest.register_craftitem("default:scorched_stuff", {
        inventory_image = "default_scorched_stuff.png",
 })
 
---
--- Creative inventory
---
-
-minetest.add_to_creative_inventory('default:pick_mese')
-minetest.add_to_creative_inventory('default:pick_steel')
-minetest.add_to_creative_inventory('default:axe_steel')
-minetest.add_to_creative_inventory('default:shovel_steel')
-
-minetest.add_to_creative_inventory('default:torch')
-minetest.add_to_creative_inventory('default:cobble')
-minetest.add_to_creative_inventory('default:dirt')
-minetest.add_to_creative_inventory('default:stone')
-minetest.add_to_creative_inventory('default:sand')
-minetest.add_to_creative_inventory('default:sandstone')
-minetest.add_to_creative_inventory('default:clay')
-minetest.add_to_creative_inventory('default:brick')
-minetest.add_to_creative_inventory('default:tree')
-minetest.add_to_creative_inventory('default:wood')
-minetest.add_to_creative_inventory('default:leaves')
-minetest.add_to_creative_inventory('default:cactus')
-minetest.add_to_creative_inventory('default:papyrus')
-minetest.add_to_creative_inventory('default:bookshelf')
-minetest.add_to_creative_inventory('default:glass')
-minetest.add_to_creative_inventory('default:fence_wood')
-minetest.add_to_creative_inventory('default:rail')
-minetest.add_to_creative_inventory('default:mese')
-minetest.add_to_creative_inventory('default:chest')
-minetest.add_to_creative_inventory('default:furnace')
-minetest.add_to_creative_inventory('default:sign_wall')
-minetest.add_to_creative_inventory('default:water_source')
-minetest.add_to_creative_inventory('default:lava_source')
-minetest.add_to_creative_inventory('default:ladder')
-
 --
 -- Aliases for the current map generator outputs
 --