summaryrefslogtreecommitdiff
path: root/coloredwood
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-02-04 20:11:09 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-02-04 20:11:09 -0500
commit921c05da0d057469032fe9aced321503f1f0d498 (patch)
tree7e7d75b4a15cee7984d98f9da2230d74b19aea96 /coloredwood
parenteba6f42678dbdb4837a30908b0627bee6f35440a (diff)
downloaddreambuilder_modpack-921c05da0d057469032fe9aced321503f1f0d498.tar
dreambuilder_modpack-921c05da0d057469032fe9aced321503f1f0d498.tar.gz
dreambuilder_modpack-921c05da0d057469032fe9aced321503f1f0d498.tar.bz2
dreambuilder_modpack-921c05da0d057469032fe9aced321503f1f0d498.tar.xz
dreambuilder_modpack-921c05da0d057469032fe9aced321503f1f0d498.zip
updated several mods to use newer unified dyes API
blox, bobblocks, coloredwood, framedglass, homedecor, ilights, plasticbox, stained_glass, unifiedbricks, and of course unified dyes.
Diffstat (limited to 'coloredwood')
-rw-r--r--coloredwood/init.lua56
1 files changed, 14 insertions, 42 deletions
diff --git a/coloredwood/init.lua b/coloredwood/init.lua
index c83f236..d4c48c5 100644
--- a/coloredwood/init.lua
+++ b/coloredwood/init.lua
@@ -152,13 +152,10 @@ for _, color in ipairs(coloredwood.hues_plus_greys) do
palette = "unifieddyes_palette_"..color.."s.png",
walkable = true,
sunlight_propagates = false,
- groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1},
+ ud_replacement_node = "coloredwood:wood_"..color,
+ groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
after_dig_node = unifieddyes.after_dig_node,
- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
- unifieddyes.on_rightclick(pos, node, clicker,
- itemstack, pointed_thing, "coloredwood:wood_"..color, true)
- end,
drop = "default:wood"
})
@@ -178,12 +175,8 @@ for _, color in ipairs(coloredwood.hues_plus_greys) do
paramtype = "light",
paramtype2 = "colorfacedir",
palette = "unifieddyes_palette_"..color.."s.png",
- groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1},
- after_dig_node = unifieddyes.after_dig_node,
- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
- unifieddyes.on_rightclick(pos, node, clicker,
- itemstack, pointed_thing, nil, true)
- end
+ groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1, ud_param2_colorable = 1},
+ after_dig_node = unifieddyes.after_dig_node
}
)
end
@@ -198,25 +191,12 @@ end
or string.find(i.name, "moreblocks:slab_wood")
or string.find(i.name, "moreblocks:panel_wood")
or string.find(i.name, "moreblocks:micro_wood")
- or string.find(i.name, "moreblocks:slope_wood")
- then
-
+ or string.find(i.name, "moreblocks:slope_wood") then
+ local s1, s2 = is_stairsplus(i.name)
minetest.override_item(i.name, {
- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
- local wield = itemstack:get_name()
- local newnode = nil
- if string.find(wield, "dye:") or string.find(wield, "unifieddyes:") then
- local s1, s2 = is_stairsplus(i.name)
- local paletteidx, hue = unifieddyes.getpaletteidx(wield, true)
- if hue ~= 0 then
- newnode = "coloredwood:"..s1.."_wood_"..coloredwood.hues[hue]..s2
- else
- newnode = "coloredwood:"..s1.."_wood_grey"..s2
- end
- end
- unifieddyes.on_rightclick(pos, node, clicker,
- itemstack, pointed_thing, newnode, true)
- end,
+ ud_replacement_node = "coloredwood:"..s1.."_wood_grey",
+ paramtype2 = "colorfacedir",
+ groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, ud_param2_colorable = 1},
})
end
end
@@ -243,10 +223,8 @@ end
minetest.override_item("default:wood", {
paramtype2 = "colorfacedir",
- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
- unifieddyes.on_rightclick(pos, node, clicker,
- itemstack, pointed_thing, "coloredwood:wood_grey", true)
- end
+ ud_replacement_node = "coloredwood:wood_grey",
+ groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, ud_param2_colorable = 1},
})
minetest.register_node("coloredwood:fence", {
@@ -257,25 +235,19 @@ minetest.register_node("coloredwood:fence", {
paramtype2 = "color",
palette = "unifieddyes_palette.png",
walkable = true,
- groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
+ groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
},
after_dig_node = unifieddyes.after_dig_node,
- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
- unifieddyes.on_rightclick(pos, node, clicker,
- itemstack, pointed_thing, "coloredwood:fence")
- end,
drop = "default:fence_wood"
})
minetest.override_item("default:fence_wood", {
- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
- unifieddyes.on_rightclick(pos, node, clicker,
- itemstack, pointed_thing, "coloredwood:fence")
- end
+ ud_replacement_node = "coloredwood:fence",
+ groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, ud_param2_colorable = 1}
})
-- ============================