Replace minetest.env: with minetest.
[oweals/minetest_game.git] / mods / legacy / init.lua
index 7f9088ce092078318f34ea7ea62d085c2c4af5d2..10e32f1827a4266bf573a604e605ea7d30b4c6c7 100644 (file)
@@ -79,14 +79,14 @@ minetest.register_craftitem(":rat", {
        description = "Rat",
        inventory_image = "rat.png",
        on_drop = function(item, dropper, pos)
-               minetest.env:add_rat(pos)
+               minetest.add_rat(pos)
                item:take_item()
                return item
        end,
        on_place = function(item, dropped, pointed)
                pos = minetest.get_pointed_thing_position(pointed, true)
                if pos ~= nil then
-                       minetest.env:add_rat(pos)
+                       minetest.add_rat(pos)
                        item:take_item()
                        return item
                end
@@ -102,15 +102,16 @@ minetest.register_craftitem(":cooked_rat", {
 minetest.register_craftitem(":firefly", {
        description = "Firefly",
        inventory_image = "firefly.png",
+       groups = {not_in_creative_inventory=1},
        on_drop = function(item, dropper, pos)
-               minetest.env:add_firefly(pos)
+               minetest.add_firefly(pos)
                item:take_item()
                return item
        end,
        on_place = function(item, dropped, pointed)
                pos = minetest.get_pointed_thing_position(pointed, true)
                if pos ~= nil then
-                       minetest.env:add_firefly(pos)
+                       minetest.add_firefly(pos)
                        item:take_item()
                        return item
                end