summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2017-02-24 22:56:27 -0600
committercheapie <no-email-for-you@example.com>2017-02-24 22:56:27 -0600
commit1325ef53cd9aa5fa5be8c2e54da106a10eeb28d3 (patch)
treec6793019587492fe59d08c9c48fef006c56d2463
parente7a64c51ef4786982f4918aecc0799cd7f4f827f (diff)
downloadsolidcolor-1325ef53cd9aa5fa5be8c2e54da106a10eeb28d3.tar
solidcolor-1325ef53cd9aa5fa5be8c2e54da106a10eeb28d3.tar.gz
solidcolor-1325ef53cd9aa5fa5be8c2e54da106a10eeb28d3.tar.bz2
solidcolor-1325ef53cd9aa5fa5be8c2e54da106a10eeb28d3.tar.xz
solidcolor-1325ef53cd9aa5fa5be8c2e54da106a10eeb28d3.zip
MOAR COLORS!
-rw-r--r--init.lua21
1 files changed, 20 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 0334340..407fc61 100644
--- a/init.lua
+++ b/init.lua
@@ -5,8 +5,9 @@ minetest.register_node("solidcolor:block", {
groups = {dig_immediate=2,ud_param2_colorable=1},
sounds = (default and default.node_sound_stone_defaults()),
paramtype2 = "color",
- palette = "unifieddyes_palette.png",
+ palette = "unifieddyes_palette_extended.png",
after_dig_node = unifieddyes.after_dig_node,
+ place_param2 = 240,
})
minetest.register_craft( {
@@ -16,3 +17,21 @@ minetest.register_craft( {
{ "dye:white", "dye:white"},
},
})
+
+minetest.register_lbm({
+ name = "solidcolor:recolor",
+ label = "Convert to new palette",
+ nodenames = {"solidcolor:block"},
+ action = function(pos, node)
+ local meta = minetest.get_meta(pos)
+ if meta:get_string("palette") ~= "ext" then
+ if node.param2 == 0 then
+ node.param2 = 240
+ else
+ node.param2 = unifieddyes.convert_classic_palette[node.param2]
+ end
+ minetest.swap_node(pos,node)
+ meta:set_string("palette", "ext")
+ end
+ end
+})