Fix not_in_creative_inventory
authorRui914 <mrrst0914@gmail.com>
Fri, 17 Jul 2015 14:53:56 +0000 (23:53 +0900)
committerparamat <mat.gregory@virginmedia.com>
Fri, 17 Jul 2015 19:53:55 +0000 (20:53 +0100)
Update

mods/default/nodes.lua
mods/flowers/init.lua

index a9c60e9c7fb3cbccce2702121ac90a0fcc7a53bb..37f1ec8bb432937dafd81289a360316b010d662d 100644 (file)
@@ -946,7 +946,33 @@ for i=2,5 do
        })
 end
 
-for i = 1, 5 do
+minetest.register_node("default:dry_grass_1", {
+       description = "Dry Grass",
+       drawtype = "plantlike",
+       waving = 1,
+       tiles = {"default_dry_grass_1.png"},
+       inventory_image = "default_dry_grass_3.png",
+       wield_image = "default_dry_grass_3.png",
+       paramtype = "light",
+       sunlight_propagates = true,
+       walkable = false,
+       buildable_to = true,
+       groups = {snappy=3,flammable=3,flora=1,attached_node=1},
+       sounds = default.node_sound_leaves_defaults(),
+       selection_box = {
+               type = "fixed",
+               fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
+       },
+
+       on_place = function(itemstack, placer, pointed_thing)
+               -- place a random dry grass node
+               local stack = ItemStack("default:dry_grass_"..math.random(1,5))
+               local ret = minetest.item_place(stack, placer, pointed_thing)
+               return ItemStack("default:dry_grass_1 "..itemstack:get_count()-(1-ret:get_count()))
+       end,
+})
+
+for i=2,5 do
        minetest.register_node("default:dry_grass_"..i, {
                description = "Dry Grass",
                drawtype = "plantlike",
@@ -958,13 +984,7 @@ for i = 1, 5 do
                sunlight_propagates = true,
                walkable = false,
                buildable_to = true,
-               groups = {
-                       snappy = 3,
-                       flammable = 3,
-                       flora = 1,
-                       attached_node = 1,
-                       not_in_creative_inventory = 1
-               },
+               groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
                drop = "default:dry_grass_1",
                sounds = default.node_sound_leaves_defaults(),
                selection_box = {
index 2a3e064ab44de1e897b17bf19a73006412b726ae..b24e323a6af4c4e906ffc62906f3528e071dc55a 100644 (file)
@@ -74,7 +74,7 @@ for _, m in pairs(mushrooms_datas) do
                sunlight_propagates = true,
                walkable = false,
                buildable_to = true,
-               groups = {snappy=3,flammable=3,attached_node=1,not_in_creative_inventory=1},
+               groups = {snappy=3,flammable=3,attached_node=1},
                sounds = default.node_sound_leaves_defaults(),
                on_use = minetest.item_eat(nut),
                selection_box = {