1
0
mirror of https://github.com/mt-mods/unifieddyes.git synced 2024-12-24 17:50:29 +01:00

fix several dye-handling bugs

This commit is contained in:
Vanessa Ezekowitz 2017-01-28 09:02:14 -05:00
parent aeb179a129
commit 2fcae9d17d

View File

@ -221,8 +221,10 @@ function unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger)
if oldmetadata and oldmetadata.fields then if oldmetadata and oldmetadata.fields then
prevdye = oldmetadata.fields.dye prevdye = oldmetadata.fields.dye
end 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 if inv:room_for_item("main", prevdye) then
inv:add_item("main", prevdye) inv:add_item("main", prevdye)
else else