From 15b6016f0f040e7f7e910c4b769717fd8becb24c Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Tue, 14 Mar 2017 01:59:32 -0400 Subject: [PATCH] on_construct for nodes that were 89-color or static, but now use an LBM to convert to the 256-color palette --- init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/init.lua b/init.lua index a713c45..cfce06b 100644 --- a/init.lua +++ b/init.lua @@ -473,6 +473,16 @@ function unifieddyes.getpaletteidx(color, palette_type) end end +-- if your node was once 89-color and uses an LBM to convert to the 256-color palette, +-- call this in that node def's on_construct: + +function unifieddyes.on_construct(pos) + local meta = minetest.get_meta(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