forked from minetest-mods/unifiedbricks
Compare commits
1 Commits
ef92eceeb6
...
nalc-1.0
Author | SHA1 | Date | |
---|---|---|---|
c2eacb1b5e |
106
init.lua
106
init.lua
@ -103,17 +103,21 @@ minetest.register_node("unifiedbricks:brickblock", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "color",
|
paramtype2 = "color",
|
||||||
palette = "unifieddyes_palette_extended.png",
|
palette = "unifieddyes_palette_extended.png",
|
||||||
|
place_param2 = 240,
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {cracky=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
|
groups = {cracky=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
on_construct = unifieddyes.on_construct,
|
on_construct = unifieddyes.on_construct,
|
||||||
on_dig = unifieddyes.on_dig,
|
after_place_node = unifieddyes.recolor_on_place,
|
||||||
|
after_dig_node = unifieddyes.after_dig_node,
|
||||||
|
drop = "default:brick"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.override_item("default:brick", {
|
minetest.override_item("default:brick", {
|
||||||
|
ud_replacement_node = "unifiedbricks:brickblock",
|
||||||
palette = "unifieddyes_palette_extended.png",
|
palette = "unifieddyes_palette_extended.png",
|
||||||
airbrush_replacement_node = "unifiedbricks:brickblock",
|
|
||||||
groups = {cracky = 3, ud_param2_colorable = 1},
|
groups = {cracky = 3, ud_param2_colorable = 1},
|
||||||
|
after_place_node = unifieddyes.recolor_on_place
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("unifiedbricks:clayblock", {
|
minetest.register_node("unifiedbricks:clayblock", {
|
||||||
@ -123,19 +127,23 @@ minetest.register_node("unifiedbricks:clayblock", {
|
|||||||
},
|
},
|
||||||
paramtype2 = "color",
|
paramtype2 = "color",
|
||||||
palette = "unifieddyes_palette_extended.png",
|
palette = "unifieddyes_palette_extended.png",
|
||||||
|
place_param2 = 240,
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {crumbly=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
|
groups = {crumbly=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
|
||||||
sounds = default.node_sound_dirt_defaults({
|
sounds = default.node_sound_dirt_defaults({
|
||||||
footstep = "",
|
footstep = "",
|
||||||
}),
|
}),
|
||||||
on_construct = unifieddyes.on_construct,
|
on_construct = unifieddyes.on_construct,
|
||||||
on_dig = unifieddyes.on_dig,
|
after_place_node = unifieddyes.recolor_on_place,
|
||||||
|
after_dig_node = unifieddyes.after_dig_node,
|
||||||
|
drop = "default:clay"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.override_item("default:clay", {
|
minetest.override_item("default:clay", {
|
||||||
|
ud_replacement_node = "unifiedbricks:clayblock",
|
||||||
palette = "unifieddyes_palette_extended.png",
|
palette = "unifieddyes_palette_extended.png",
|
||||||
airbrush_replacement_node = "unifiedbricks:clayblock",
|
|
||||||
groups = {crumbly = 3, ud_param2_colorable = 1},
|
groups = {crumbly = 3, ud_param2_colorable = 1},
|
||||||
|
after_place_node = unifieddyes.recolor_on_place,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("unifiedbricks:brickblock_multicolor_dark", {
|
minetest.register_node("unifiedbricks:brickblock_multicolor_dark", {
|
||||||
@ -149,11 +157,14 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_dark", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "color",
|
paramtype2 = "color",
|
||||||
palette = "unifieddyes_palette_extended.png",
|
palette = "unifieddyes_palette_extended.png",
|
||||||
|
place_param2 = 240,
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {cracky=3, ud_param2_colorable = 1},
|
groups = {cracky=3, ud_param2_colorable = 1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
on_construct = unifieddyes.on_construct,
|
on_construct = unifieddyes.on_construct,
|
||||||
on_dig = unifieddyes.on_dig,
|
after_place_node = unifieddyes.recolor_on_place,
|
||||||
|
after_dig_node = unifieddyes.after_dig_node,
|
||||||
|
drop = "unifiedbricks:brickblock_multicolor_dark"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("unifiedbricks:brickblock_multicolor_medium", {
|
minetest.register_node("unifiedbricks:brickblock_multicolor_medium", {
|
||||||
@ -167,11 +178,14 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_medium", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "color",
|
paramtype2 = "color",
|
||||||
palette = "unifieddyes_palette_extended.png",
|
palette = "unifieddyes_palette_extended.png",
|
||||||
|
place_param2 = 240,
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {cracky=3, ud_param2_colorable = 1},
|
groups = {cracky=3, ud_param2_colorable = 1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
on_construct = unifieddyes.on_construct,
|
on_construct = unifieddyes.on_construct,
|
||||||
on_dig = unifieddyes.on_dig,
|
after_place_node = unifieddyes.recolor_on_place,
|
||||||
|
after_dig_node = unifieddyes.after_dig_node,
|
||||||
|
drop = "unifiedbricks:brickblock_multicolor_medium"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("unifiedbricks:brickblock_multicolor_light", {
|
minetest.register_node("unifiedbricks:brickblock_multicolor_light", {
|
||||||
@ -185,11 +199,14 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_light", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "color",
|
paramtype2 = "color",
|
||||||
palette = "unifieddyes_palette_extended.png",
|
palette = "unifieddyes_palette_extended.png",
|
||||||
|
place_param2 = 240,
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {cracky=3, ud_param2_colorable = 1},
|
groups = {cracky=3, ud_param2_colorable = 1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
on_construct = unifieddyes.on_construct,
|
on_construct = unifieddyes.on_construct,
|
||||||
on_dig = unifieddyes.on_dig,
|
after_place_node = unifieddyes.recolor_on_place,
|
||||||
|
after_dig_node = unifieddyes.after_dig_node,
|
||||||
|
drop ="unifiedbricks:brickblock_multicolor_light"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
@ -225,61 +242,6 @@ minetest.register_craft( {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
unifieddyes.register_color_craft({
|
|
||||||
output = "unifiedbricks:brickblock",
|
|
||||||
palette = "extended",
|
|
||||||
neutral_node = "default:brick",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {
|
|
||||||
"NEUTRAL_NODE",
|
|
||||||
"MAIN_DYE"
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
unifieddyes.register_color_craft({
|
|
||||||
output = "unifiedbricks:clayblock",
|
|
||||||
palette = "extended",
|
|
||||||
neutral_node = "default:clay",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {
|
|
||||||
"NEUTRAL_NODE",
|
|
||||||
"MAIN_DYE"
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
unifieddyes.register_color_craft({
|
|
||||||
output = "unifiedbricks:brickblock_multicolor_dark",
|
|
||||||
palette = "extended",
|
|
||||||
neutral_node = "unifiedbricks:brickblock_multicolor_dark",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {
|
|
||||||
"NEUTRAL_NODE",
|
|
||||||
"MAIN_DYE"
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
unifieddyes.register_color_craft({
|
|
||||||
output = "unifiedbricks:brickblock_multicolor_medium",
|
|
||||||
palette = "extended",
|
|
||||||
neutral_node = "unifiedbricks:brickblock_multicolor_medium",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {
|
|
||||||
"NEUTRAL_NODE",
|
|
||||||
"MAIN_DYE"
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
unifieddyes.register_color_craft({
|
|
||||||
output = "unifiedbricks:brickblock_multicolor_light",
|
|
||||||
palette = "extended",
|
|
||||||
neutral_node = "unifiedbricks:brickblock_multicolor_light",
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {
|
|
||||||
"NEUTRAL_NODE",
|
|
||||||
"MAIN_DYE"
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
-- static nodes
|
-- static nodes
|
||||||
|
|
||||||
unifiedbricks.register_old_static_block = function(name, formalname, blocktype)
|
unifiedbricks.register_old_static_block = function(name, formalname, blocktype)
|
||||||
@ -384,4 +346,24 @@ minetest.register_lbm({
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_lbm({
|
||||||
|
name = "unifiedbricks:recolor_bricks",
|
||||||
|
label = "Convert 89-color bricks to use UD extended palette",
|
||||||
|
run_at_every_load = false,
|
||||||
|
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
|
||||||
|
minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] })
|
||||||
|
meta:set_string("palette", "ext")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
print("[UnifiedBricks] Loaded!")
|
print("[UnifiedBricks] Loaded!")
|
||||||
|
Reference in New Issue
Block a user