Compare commits

..

10 Commits

Author SHA1 Message Date
Luke aka SwissalpS
4d20404380
bricks aren't ground content (#11)
Some checks failed
luacheck / luacheck (push) Has been cancelled
(at least IMO)
2024-03-01 15:18:06 +01:00
Niklp
1011023d6c
Use mod.conf and add luacheck (#10) 2023-10-01 11:11:01 +02:00
ROllerozxa
f341d63b01
Remove unused duplicate mortar textures (#9) 2022-05-29 21:18:31 +02:00
Vanessa Dannenberg
ef92eceeb6 Use Unified Dyes on_dig where needed (#7)
Requires Unified Dyes commit 9ff40a7f or later
2019-07-21 12:36:07 +02: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
Vanessa Ezekowitz
369295d516 use soft overlay instead of multi-layer mesh node 2017-06-16 17:14:13 -04:00
Vanessa Ezekowitz
f8a5b765ab don't set paramtype=light on clay block 2017-03-25 21:06:12 -04:00
10 changed files with 113 additions and 133 deletions

10
.github/workflows/luacheck.yml vendored Normal file
View File

@ -0,0 +1,10 @@
name: luacheck
on: [push, pull_request]
jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Luacheck
uses: lunarmodules/luacheck@master

9
.luacheckrc Normal file
View File

@ -0,0 +1,9 @@
read_globals = {
"minetest",
"unifieddyes",
"default"
}
globals = {
"unifiedbricks"
}

View File

@ -1,4 +0,0 @@
default
bucket
unifieddyes
vessels

View File

@ -1 +0,0 @@
This mod allows the user to re-color default bricks using Unified Dyes, and provides some pattern variations as well.

176
init.lua
View File

@ -16,7 +16,7 @@ minetest.register_alias("unifieddyes:lightgrey","unifieddyes:lightgrey_paint")
minetest.register_alias("unifieddyes:grey","unifieddyes:grey_paint")
minetest.register_alias("unifieddyes:darkgrey","unifieddyes:darkgrey_paint")
HUES = {
local HUES = {
"red",
"orange",
"yellow",
@ -35,25 +35,18 @@ HUES = {
"lightgrey",
"white"
}
TYPES = {
"clayblock_",
"clay_",
"brick_",
"brickblock_",
"multicolor_"
}
SATURATION = {
local SATURATION = {
"_s50",
""
}
DARKNESS = {
local DARKNESS = {
"dark_",
"medium_",
"",
"light_"
}
--formal versions
FORMALHUES = {
local FORMALHUES = {
"Red",
"Orange",
"Yellow",
@ -72,18 +65,11 @@ FORMALHUES = {
"Light grey",
"White"
}
FORMALTYPES = {
" clay",
" clay lump",
" brick",
" bricks",
" multicolor bricks"
}
FORMALSATURATION = {
local FORMALSATURATION = {
" (low saturation)",
""
}
FORMALDARKNESS = {
local FORMALDARKNESS = {
"Dark ",
"Medium ",
"Bright ",
@ -95,29 +81,25 @@ FORMALDARKNESS = {
minetest.register_node("unifiedbricks:brickblock", {
description = "Brick Block",
tiles = {
"unifiedbricks_brickblock.png",
{ name = "unifiedbricks_mortar.png", color = 0xffffffff },
"unifiedbricks_brickblock.png"
},
overlay_tiles = {
{ name = "unifiedbricks_mortar.png", color = "white" }
},
drawtype = "mesh",
mesh = "unifiedbricks_brick_block.obj",
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
is_ground_content = false,
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", {
@ -125,86 +107,75 @@ minetest.register_node("unifiedbricks:clayblock", {
tiles = {
"unifiedbricks_clayblock.png",
},
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
is_ground_content = false,
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", {
description = "Brick block (dark multicolor)",
tiles = {
"unifiedbricks_brickblock_multicolor_dark.png",
{ name = "unifiedbricks_mortar.png", color = 0xffffffff },
},
drawtype = "mesh",
mesh = "unifiedbricks_brick_block.obj",
overlay_tiles = {
{ name = "unifiedbricks_mortar.png", color = "white" }
},
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
is_ground_content = false,
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", {
description = "Brick block (medium multicolor)",
tiles = {
"unifiedbricks_brickblock_multicolor_medium.png",
{ name = "unifiedbricks_mortar.png", color = 0xffffffff },
"unifiedbricks_brickblock_multicolor_medium.png"
},
overlay_tiles = {
{ name = "unifiedbricks_mortar.png", color = "white" }
},
drawtype = "mesh",
mesh = "unifiedbricks_brick_block.obj",
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
is_ground_content = false,
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", {
description = "Brick block (light multicolor)",
tiles = {
"unifiedbricks_brickblock_multicolor_light.png",
{ name = "unifiedbricks_mortar.png", color = 0xffffffff },
"unifiedbricks_brickblock_multicolor_light.png"
},
overlay_tiles = {
{ name = "unifiedbricks_mortar.png", color = "white" }
},
drawtype = "mesh",
mesh = "unifiedbricks_brick_block.obj",
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
place_param2 = 240,
is_ground_content = true,
is_ground_content = false,
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( {
@ -240,6 +211,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)
@ -261,8 +287,8 @@ table.insert(unifiedbricks.old_static_list, "unifiedbricks:multicolor_lightgrey"
for i = 1,17 do
for j = 1,4 do
if i > 12 then
formalname = FORMALHUES[i]
name = HUES[i]
local formalname = FORMALHUES[i]
local name = HUES[i]
if j == 1 then
unifiedbricks.register_old_static_block(name, formalname, "clayblock")
elseif j == 4 then
@ -270,6 +296,7 @@ for i = 1,17 do
end
else
for k = 1,4 do
local formalname, name
if k == 4 then
formalname = FORMALDARKNESS[k] .. FORMALHUES[i]
name = DARKNESS[k] .. HUES[i]
@ -312,6 +339,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
@ -343,24 +371,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!")

View File

@ -1 +1,3 @@
name = unifiedbricks
description = This mod allows the user to re-color default bricks using Unified Dyes, and provides some pattern variations as well.
depends = default, bucket, unifieddyes, vessels

View File

@ -1,44 +0,0 @@
# Blender v2.72 (sub 0) OBJ File: 'unifiedbricks_brick_block.blend'
# www.blender.org
o Cube
v 0.496092 0.496092 0.496092
v 0.496092 0.496092 -0.496092
v -0.496092 0.496092 -0.496092
v -0.496092 0.496092 0.496092
v 0.496092 -0.496092 0.496092
v 0.496092 -0.496092 -0.496092
v -0.496092 -0.496092 -0.496092
v -0.496092 -0.496092 0.496092
v 0.499750 0.499750 0.499750
v 0.499750 0.499750 -0.499750
v -0.499750 0.499750 -0.499750
v -0.499750 0.499750 0.499750
v 0.499750 -0.499750 0.499750
v 0.499750 -0.499750 -0.499750
v -0.499750 -0.499750 -0.499750
v -0.499750 -0.499750 0.499750
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn -1.000000 0.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 0.000000 0.000000 -1.000000
vn 0.000000 0.000000 1.000000
g Cube_Cube_base
s off
f 8/1/1 7/2/1 6/3/1 5/4/1
f 4/2/2 3/3/2 7/4/2 8/1/2
f 1/3/3 2/4/3 3/1/3 4/2/3
f 2/2/4 1/3/4 5/4/4 6/1/4
f 3/2/5 2/3/5 6/4/5 7/1/5
f 1/2/6 4/3/6 8/4/6 5/1/6
g Cube_Cube_overlay
f 16/1/1 15/2/1 14/3/1 13/4/1
f 12/2/2 11/3/2 15/4/2 16/1/2
f 9/3/3 10/4/3 11/1/3 12/2/3
f 10/2/4 9/3/4 13/4/4 14/1/4
f 11/2/5 10/3/5 14/4/5 15/1/5
f 9/2/6 12/3/6 16/4/6 13/1/6

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 B

After

Width:  |  Height:  |  Size: 170 B