Closed fluxionary closed 10 months ago
This seems like a lot of extra code to fix a small bug 🤔
This seems like a lot of extra code to fix a small bug 🤔
if you've got a suggestion for how to get the proper functionality with less code, i'm all ears. i'm somewhat annoyed i had to copy most of that function myself, and upstream could possibly change in the future.
currently, there's logic errors in
unifieddyes.on_dig
. per the documentation,currently, that function sometimes returns
nil
on failure, sometimes returnsnil
on success, and sometimes returns the value ofminetest.dig_node
. this breaks some code i'm writing for my replacer redo, which attempts to not allow the replacer to change the colors of nodes. it also fails to do the other things thatminetest.dig_node
does, e.g. wear out the tool and call various callbacks.in this PR, i've copied out the code for
minetest.node_dig
into a separate function that differs only in that it doesn't ask the lua API to generate the drops, and instead just uses the item without thepalette_index
metadata.