From 3df8bf273543a1805b44029611b48bf001e6e407 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 24 Feb 2017 20:59:08 -0500 Subject: [PATCH] use new Unified Dyes "extended" palette requires unified dyes commit d2819353 or newer --- init.lua | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index a4c9758..3f9d0fb 100644 --- a/init.lua +++ b/init.lua @@ -102,7 +102,7 @@ minetest.register_node("unifiedbricks:brickblock", { mesh = "unifiedbricks_brick_block.obj", paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", is_ground_content = true, groups = {cracky=3, not_in_creative_inventory=1, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), @@ -122,7 +122,7 @@ minetest.register_node("unifiedbricks:clayblock", { }, paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", is_ground_content = true, groups = {crumbly=3, not_in_creative_inventory=1, ud_param2_colorable = 1}, sounds = default.node_sound_dirt_defaults({ @@ -147,7 +147,7 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_dark", { mesh = "unifiedbricks_brick_block.obj", paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", is_ground_content = true, groups = {cracky=3, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), @@ -164,7 +164,7 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_medium", { mesh = "unifiedbricks_brick_block.obj", paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", is_ground_content = true, groups = {cracky=3, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), @@ -181,7 +181,7 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_light", { mesh = "unifiedbricks_brick_block.obj", paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", is_ground_content = true, groups = {cracky=3, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), @@ -326,4 +326,25 @@ minetest.register_lbm({ end }) +minetest.register_lbm({ + name = "unifiedbricks:recolor_bricks", + label = "Convert 89-color bricks to use UD extended palette", + run_at_every_load = true, + nodenames = { + "unifiedbricks:clayblock", + "unifiedbricks:brickblock", + "unifiedbricks:brickblock_multicolor_dark", + "unifiedbricks:brickblock_multicolor_medium", + "unifiedbricks:brickblock_multicolor_light", + }, + action = function(pos, node) + local meta = minetest.get_meta(pos) + if meta:get_string("palette") ~= "ext" then + print(node.param2.." --> "..unifieddyes.convert_classic_palette[node.param2]) + minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] }) + meta:set_string("palette", "ext") + end + end +}) + print("[UnifiedBricks] Loaded!")