diff options
author | cheapie <no-email-for-you@example.com> | 2017-02-24 22:56:10 -0600 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2017-02-24 22:56:10 -0600 |
commit | c4ed5a170545c4ef144bea7a12a13ac2404d8c90 (patch) | |
tree | b04e8117766c63f375e51f880fcd81dc2cd9155a | |
parent | 0f236dfc27fa3922a1e339510f03f5a233b535f3 (diff) | |
download | plasticbox-c4ed5a170545c4ef144bea7a12a13ac2404d8c90.tar plasticbox-c4ed5a170545c4ef144bea7a12a13ac2404d8c90.tar.gz plasticbox-c4ed5a170545c4ef144bea7a12a13ac2404d8c90.tar.bz2 plasticbox-c4ed5a170545c4ef144bea7a12a13ac2404d8c90.tar.xz plasticbox-c4ed5a170545c4ef144bea7a12a13ac2404d8c90.zip |
MOAR COLORS!
-rw-r--r-- | init.lua | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -5,8 +5,9 @@ minetest.register_node("plasticbox:plasticbox", { groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1}, sounds = 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, }) stairsplus:register_all("plasticbox", "plasticbox", "plasticbox:plasticbox", { @@ -70,3 +71,21 @@ minetest.register_lbm({ minetest.set_node(pos,node) end, }) + +minetest.register_lbm({ + name = "plasticbox:recolor", + label = "Convert to new palette", + nodenames = {"plasticbox:plasticbox"}, + 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 +}) |