summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-06-20 05:20:25 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-06-20 17:01:54 -0400
commit731c7d133e59b2c4c30c626d4f10d4424f386c2f (patch)
tree71bcbddda8d3ebf30b378650dbcf782bf05fccb9
parentad8ab99bd845c8203fb00297fd60468fcaf942b6 (diff)
downloadunifieddyes-731c7d133e59b2c4c30c626d4f10d4424f386c2f.tar
unifieddyes-731c7d133e59b2c4c30c626d4f10d4424f386c2f.tar.gz
unifieddyes-731c7d133e59b2c4c30c626d4f10d4424f386c2f.tar.bz2
unifieddyes-731c7d133e59b2c4c30c626d4f10d4424f386c2f.tar.xz
unifieddyes-731c7d133e59b2c4c30c626d4f10d4424f386c2f.zip
disable old after_dig_node() callbacks
(don't split a digged node into neutral+dye)
-rw-r--r--init.lua26
1 files changed, 5 insertions, 21 deletions
diff --git a/init.lua b/init.lua
index f44b733..85f5380 100644
--- a/init.lua
+++ b/init.lua
@@ -145,11 +145,15 @@ local default_dyes = {
"yellow"
}
--- just a stub to keep old mods from crashing when expecting auto-coloring
+-- just stubs to keep old mods from crashing when expecting auto-coloring
+-- or getting back the dye on dig.
function unifieddyes.recolor_on_place(foo)
end
+function unifieddyes.after_dig_node(foo)
+end
+
-- this helper function registers all of the recipes needed to create colored
-- blocks with any of the dyes supported by that block's palette.
@@ -547,26 +551,6 @@ function unifieddyes.on_construct(pos)
meta:set_string("palette", "ext")
end
--- call this in your node's after_dig_node to get the last-used dye back.
-
-function unifieddyes.after_dig_node(pos, oldnode, oldmetadata, digger)
- local prevdye
-
- if oldmetadata and oldmetadata.fields then
- prevdye = oldmetadata.fields.dye
- end
-
- 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
- minetest.add_item(pos, prevdye)
- end
- end
-end
-
function unifieddyes.on_use(itemstack, player, pointed_thing)
local stackname = itemstack:get_name()
local playername = player:get_player_name()