Creative: Automatic item colorization for creative mode
authorDániel Juhász <juhdanad@gmail.com>
Sat, 22 Apr 2017 12:34:51 +0000 (14:34 +0200)
committerparamat <mat.gregory@virginmedia.com>
Sun, 23 Apr 2017 22:05:06 +0000 (23:05 +0100)
mods/creative/init.lua

index f9047189561c5a07416fe83ff6114c6821795d9b..bba9b34eea1aafeea6aa0dc8973f18b84ffe5ead 100644 (file)
@@ -55,8 +55,7 @@ function minetest.handle_node_drops(pos, drops, digger)
        local inv = digger:get_inventory()
        if inv then
                for _, item in ipairs(drops) do
-                       item = ItemStack(item):get_name()
-                       if not inv:contains_item("main", item) then
+                       if not inv:contains_item("main", item, true) then
                                inv:add_item("main", item)
                        end
                end