update blocs, bobblocks, coloredwood, technic, homedecor, plasticbox,

solidcolor, stainedglass, unifiedbricks, and unified dyes
This commit is contained in:
Vanessa Ezekowitz 2017-03-14 02:21:47 -04:00
parent 6885943d04
commit b9beea1673
13 changed files with 111 additions and 67 deletions

View File

@ -116,6 +116,7 @@ for _, nodeclass in ipairs(NodeClass) do
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -134,6 +135,7 @@ for _, nodeclass in ipairs(NodeClass) do
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -152,6 +154,7 @@ for _, nodeclass in ipairs(NodeClass) do
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -172,6 +175,7 @@ minetest.register_node("blox:wood_tinted", {
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -185,6 +189,7 @@ minetest.register_node("blox:stone_square", {
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -198,6 +203,7 @@ minetest.register_node("blox:cobble_tinted", {
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
drop = "default:cobble"
})
@ -212,6 +218,7 @@ minetest.register_node("blox:stone_tinted", {
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
drop = "default:cobble"
})

View File

@ -52,6 +52,7 @@ minetest.register_node("bobblocks:block", {
}
},
on_rightclick = bobblocks.update_bobblock,
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -72,6 +73,7 @@ minetest.register_node("bobblocks:block_off", {
}
},
on_rightclick = bobblocks.update_bobblock,
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -96,6 +98,7 @@ minetest.register_node("bobblocks:pole", {
}
},
on_rightclick = bobblocks.update_bobblock,
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -120,6 +123,7 @@ minetest.register_node("bobblocks:pole_off", {
}
},
on_rightclick = bobblocks.update_bobblock,
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -155,6 +159,7 @@ minetest.register_node("bobblocks:wavyblock", {
}
},
on_rightclick = bobblocks.update_bobblock,
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -176,6 +181,7 @@ minetest.register_node("bobblocks:wavyblock_off", {
}
},
on_rightclick = bobblocks.update_bobblock,
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -192,6 +198,7 @@ minetest.register_node("bobblocks:wavypole", {
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, ud_param2_colorable = 1},
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
--light_source = LIGHT_MAX-0,
})

View File

@ -142,7 +142,6 @@ local function is_stairsplus(name, colorized)
shape = string.sub(name, b+5) -- everything after "_wood_" is the shape
end
end
print(name, class, shape)
return class, shape
end

View File

@ -1,6 +1,6 @@
default
technic_worldgen
concrete
unifieddyes
unifieddyes?
intllib?
moreblocks?

View File

@ -102,72 +102,77 @@ if minetest.get_modpath("moreblocks") then
end
minetest.register_node(":technic:insulator_clip", {
description = "Insulator/cable clip",
drawtype = "mesh",
mesh = "technic_insulator_clip.obj",
tiles = {"technic_insulator_clip.png"},
is_ground_content = false,
groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
after_place_node = unifieddyes.fix_rotation,
after_dig_node = unifieddyes.after_dig_node,
})
if minetest.get_modpath("unifieddyes") then
minetest.register_node(":technic:insulator_clip_fencepost", {
description = "Insulator/cable clip",
tiles = {"technic_insulator_clip.png"},
is_ground_content = false,
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
after_dig_node = unifieddyes.after_dig_node,
drawtype = "nodebox",
node_box = {
type = "connected",
fixed = {
{ -0.25, 0.75, -0.25, 0.25, 1.25, 0.25 }, -- the clip on top
{ -0.125, 0.6875, -0.125, 0.125, 0.75, 0.125 },
{ -0.1875, 0.625, -0.1875, 0.1875, 0.6875, 0.1875 },
{ -0.125, 0.5625, -0.125, 0.125, 0.625, 0.125 },
{ -0.1875, 0.5, -0.1875, 0.1875, 0.5625, 0.1875 },
{ -0.125, 0.4375, -0.125, 0.125, 0.5, 0.125 },
{ -0.1875, 0.375, -0.1875, 0.1875, 0.4375, 0.1875 },
{ -0.125, -0.5, -0.125, 0.125, 0.375, 0.125 }, -- the post, slightly short
minetest.register_node(":technic:insulator_clip", {
description = "Insulator/cable clip",
drawtype = "mesh",
mesh = "technic_insulator_clip.obj",
tiles = {"technic_insulator_clip.png"},
is_ground_content = false,
groups = {choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
after_place_node = unifieddyes.fix_rotation,
after_dig_node = unifieddyes.after_dig_node,
})
minetest.register_node(":technic:insulator_clip_fencepost", {
description = "Insulator/cable clip",
tiles = {"technic_insulator_clip.png"},
is_ground_content = false,
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
drawtype = "nodebox",
node_box = {
type = "connected",
fixed = {
{ -0.25, 0.75, -0.25, 0.25, 1.25, 0.25 }, -- the clip on top
{ -0.125, 0.6875, -0.125, 0.125, 0.75, 0.125 },
{ -0.1875, 0.625, -0.1875, 0.1875, 0.6875, 0.1875 },
{ -0.125, 0.5625, -0.125, 0.125, 0.625, 0.125 },
{ -0.1875, 0.5, -0.1875, 0.1875, 0.5625, 0.1875 },
{ -0.125, 0.4375, -0.125, 0.125, 0.5, 0.125 },
{ -0.1875, 0.375, -0.1875, 0.1875, 0.4375, 0.1875 },
{ -0.125, -0.5, -0.125, 0.125, 0.375, 0.125 }, -- the post, slightly short
},
-- connect_top =
-- connect_bottom =
connect_front = {{-1/16,3/16,-1/2,1/16,5/16,-1/8},
{-1/16,-5/16,-1/2,1/16,-3/16,-1/8}},
connect_left = {{-1/2,3/16,-1/16,-1/8,5/16,1/16},
{-1/2,-5/16,-1/16,-1/8,-3/16,1/16}},
connect_back = {{-1/16,3/16,1/8,1/16,5/16,1/2},
{-1/16,-5/16,1/8,1/16,-3/16,1/2}},
connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16},
{1/8,-5/16,-1/16,1/2,-3/16,1/16}},
},
-- connect_top =
-- connect_bottom =
connect_front = {{-1/16,3/16,-1/2,1/16,5/16,-1/8},
{-1/16,-5/16,-1/2,1/16,-3/16,-1/8}},
connect_left = {{-1/2,3/16,-1/16,-1/8,5/16,1/16},
{-1/2,-5/16,-1/16,-1/8,-3/16,1/16}},
connect_back = {{-1/16,3/16,1/8,1/16,5/16,1/2},
{-1/16,-5/16,1/8,1/16,-3/16,1/2}},
connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16},
{1/8,-5/16,-1/16,1/2,-3/16,1/16}},
},
connects_to = {"group:fence", "group:wood", "group:tree"},
groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
place_param2 = 171 -- medium amber, low saturation, closest color to default:wood
})
connects_to = {"group:fence", "group:wood", "group:tree"},
groups = {fence=1, choppy=1, snappy=1, oddly_breakable_by_hand=1, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
place_param2 = 171 -- medium amber, low saturation, closest color to default:wood
})
minetest.register_craft({
output = "technic:insulator_clip",
recipe = {
{ "", "dye:white", ""},
{ "", "technic:raw_latex", ""},
{ "technic:raw_latex", "default:stone", "technic:raw_latex"},
}
})
minetest.register_craft({
output = "technic:insulator_clip",
recipe = {
{ "", "dye:white", ""},
{ "", "technic:raw_latex", ""},
{ "technic:raw_latex", "default:stone", "technic:raw_latex"},
}
})
minetest.register_craft({
output = "technic:insulator_clip_fencepost 2",
recipe = {
{ "", "dye:white", ""},
{ "", "technic:raw_latex", ""},
{ "technic:raw_latex", "default:fence_wood", "technic:raw_latex"},
}
})
minetest.register_craft({
output = "technic:insulator_clip_fencepost 2",
recipe = {
{ "", "dye:white", ""},
{ "", "technic:raw_latex", ""},
{ "technic:raw_latex", "default:fence_wood", "technic:raw_latex"},
}
})
end

View File

@ -15,6 +15,7 @@ minetest.register_node("homedecor:bathroom_tiles_dark", {
place_param2 = 240,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -32,6 +33,7 @@ minetest.register_node("homedecor:bathroom_tiles_medium", {
place_param2 = 240,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -49,6 +51,7 @@ minetest.register_node("homedecor:bathroom_tiles_light", {
place_param2 = 240,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})

View File

@ -428,6 +428,7 @@ local function reg_lamp(suffix, nxt, light, brightness)
node.name = "homedecor:table_lamp_"..repl[suffix]
minetest.set_node(pos, node)
end,
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node
})
@ -457,6 +458,7 @@ local function reg_lamp(suffix, nxt, light, brightness)
node.name = "homedecor:standing_lamp_"..repl[suffix]
minetest.set_node(pos, node)
end,
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
expand = { top="placeholder" },
})

View File

@ -33,6 +33,7 @@ minetest.register_node("lavalamp:lavalamp", {
},
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, ud_param2_colorable = 1},
sounds = default.node_sound_glass_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
node.name = "lavalamp:lavalamp_off"
@ -62,6 +63,7 @@ minetest.register_node("lavalamp:lavalamp_off", {
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "lavalamp:lavalamp",
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
node.name = "lavalamp:lavalamp"

View File

@ -8,6 +8,7 @@ minetest.register_node("plasticbox:plasticbox", {
palette = "unifieddyes_palette_extended.png",
after_dig_node = unifieddyes.after_dig_node,
place_param2 = 240,
on_construct = unifieddyes.on_construct,
})
stairsplus:register_all("plasticbox", "plasticbox", "plasticbox:plasticbox", {

View File

@ -8,6 +8,7 @@ minetest.register_node("solidcolor:block", {
palette = "unifieddyes_palette_extended.png",
after_dig_node = unifieddyes.after_dig_node,
place_param2 = 240,
on_construct = unifieddyes.on_construct,
})
minetest.register_craft( {

View File

@ -55,6 +55,7 @@ minetest.register_node("stained_glass:stained_glass", {
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
sounds = default.node_sound_glass_defaults(),
drop = "moreblocks:super_glow_glass",
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
drop = "moreblocks:super_glow_glass"
})
@ -84,6 +85,7 @@ minetest.register_node("stained_glass:stained_trap_glass", {
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
sounds = default.node_sound_glass_defaults(),
drop = "moreblocks:trap_super_glow_glass",
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
drop = "moreblocks:trap_super_glow_glass"
})

View File

@ -107,6 +107,7 @@ minetest.register_node("unifiedbricks:brickblock", {
is_ground_content = true,
groups = {cracky=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
drop = "default:brick"
})
@ -131,6 +132,7 @@ minetest.register_node("unifiedbricks:clayblock", {
sounds = default.node_sound_dirt_defaults({
footstep = "",
}),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
drop = "default:clay"
})
@ -156,6 +158,7 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_dark", {
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
})
@ -174,6 +177,7 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_medium", {
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
})
@ -192,6 +196,7 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_light", {
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_dig_node = unifieddyes.after_dig_node,
})

View File

@ -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