fix several dye-handling bugs

This commit is contained in:
Vanessa Ezekowitz 2017-01-28 09:02:14 -05:00
parent aeb179a129
commit 2fcae9d17d
1 changed files with 4 additions and 2 deletions

View File

@ -221,8 +221,10 @@ function unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger)
if oldmetadata and oldmetadata.fields then
prevdye = oldmetadata.fields.dye
end
if not creative_mode and prevdye and minetest.registered_items[prevdye] then
local inv = digger:get_inventory()
local inv = digger:get_inventory()
if prevdye and not (inv:contains_item("main", prevdye) and creative_mode) and minetest.registered_items[prevdye] then
if inv:room_for_item("main", prevdye) then
inv:add_item("main", prevdye)
else