From 731c7d133e59b2c4c30c626d4f10d4424f386c2f Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Tue, 20 Jun 2017 05:20:25 -0400 Subject: disable old after_dig_node() callbacks (don't split a digged node into neutral+dye) --- init.lua | 26 +++++--------------------- 1 file 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() -- cgit v1.2.3