Compare commits

...

5 Commits

Author SHA1 Message Date
Vanessa Dannenberg d3c85314a7 use Unified Dyes on_dig where needed - requires Unified Dyes commit 9ff40a7f or later 2019-07-18 02:22:07 -04:00
Vanessa Dannenberg 4ef1892dbe get rid of old 89->256 LBM
(obsolete, and can't run anyway, UD doesn't support
the old 89-color palette anymore except in split mode)
2018-09-30 20:53:54 -07:00
Vanessa Dannenberg c227ceb798 Switch to colored itemstacks (#5)
with full crafting recipes
Requires Unified Dyes commit 2a816534 or later
2018-08-26 14:44:09 +02:00
Vanessa Dannenberg 49ded63965 exit conversion LBM gracefully if brick color can't be looked up 2018-05-12 08:57:39 -04:00
Vanessa Ezekowitz d77d445edf don't use texture alpha on brick blocks 2017-06-23 20:04:23 -04:00
1 changed files with 63 additions and 45 deletions

108
init.lua
View File

@ -100,25 +100,20 @@ minetest.register_node("unifiedbricks:brickblock", {
overlay_tiles = {
{ name = "unifiedbricks_mortar.png", color = "white" }
},
use_texture_alpha = true,
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
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_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
drop = "default:brick"
on_dig = unifieddyes.on_dig,
})
minetest.override_item("default:brick", {
ud_replacement_node = "unifiedbricks:brickblock",
palette = "unifieddyes_palette_extended.png",
airbrush_replacement_node = "unifiedbricks:brickblock",
groups = {cracky = 3, ud_param2_colorable = 1},
after_place_node = unifieddyes.recolor_on_place
})
minetest.register_node("unifiedbricks:clayblock", {
@ -128,23 +123,19 @@ minetest.register_node("unifiedbricks:clayblock", {
},
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
groups = {crumbly=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
sounds = default.node_sound_dirt_defaults({
footstep = "",
}),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
drop = "default:clay"
on_dig = unifieddyes.on_dig,
})
minetest.override_item("default:clay", {
ud_replacement_node = "unifiedbricks:clayblock",
palette = "unifieddyes_palette_extended.png",
airbrush_replacement_node = "unifiedbricks:clayblock",
groups = {crumbly = 3, ud_param2_colorable = 1},
after_place_node = unifieddyes.recolor_on_place,
})
minetest.register_node("unifiedbricks:brickblock_multicolor_dark", {
@ -155,17 +146,14 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_dark", {
overlay_tiles = {
{ name = "unifiedbricks_mortar2.png", color = "white" }
},
use_texture_alpha = true,
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
on_dig = unifieddyes.on_dig,
})
minetest.register_node("unifiedbricks:brickblock_multicolor_medium", {
@ -176,17 +164,14 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_medium", {
overlay_tiles = {
{ name = "unifiedbricks_mortar3.png", color = "white" }
},
use_texture_alpha = true,
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
on_dig = unifieddyes.on_dig,
})
minetest.register_node("unifiedbricks:brickblock_multicolor_light", {
@ -197,17 +182,14 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_light", {
overlay_tiles = {
{ name = "unifiedbricks_mortar4.png", color = "white" }
},
use_texture_alpha = true,
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
after_place_node = unifieddyes.recolor_on_place,
after_dig_node = unifieddyes.after_dig_node,
on_dig = unifieddyes.on_dig,
})
minetest.register_craft( {
@ -243,6 +225,61 @@ 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
unifiedbricks.register_old_static_block = function(name, formalname, blocktype)
@ -315,6 +352,7 @@ minetest.register_lbm({
if color2 == "_grey" then color2 = "grey" end
local paletteidx, hue = unifieddyes.getpaletteidx("unifieddyes:"..color2, "extended")
if not paletteidx or not hue then return end
if string.find(type, "multicolor") then
@ -346,24 +384,4 @@ 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 = 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!")