forked from minetest-mods/unifiedbricks
Compare commits
11 Commits
304579a8ca
...
master
Author | SHA1 | Date | |
---|---|---|---|
552767bd6e | |||
4d20404380 | |||
919c6861e6 | |||
df984afcde | |||
05e03901ca | |||
1011023d6c | |||
a083365df9 | |||
f341d63b01 | |||
9d1ad53d75 | |||
4e596096fa | |||
f116c1d6cf |
10
.github/workflows/luacheck.yml
vendored
Normal file
10
.github/workflows/luacheck.yml
vendored
Normal 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
9
.luacheckrc
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
read_globals = {
|
||||||
|
"minetest",
|
||||||
|
"unifieddyes",
|
||||||
|
"default"
|
||||||
|
}
|
||||||
|
|
||||||
|
globals = {
|
||||||
|
"unifiedbricks"
|
||||||
|
}
|
@ -1,3 +0,0 @@
|
|||||||
default
|
|
||||||
unifieddyes
|
|
||||||
moreblocks?
|
|
@ -1 +0,0 @@
|
|||||||
This mod allows the user to re-color default bricks using Unified Dyes, and provides some pattern variations as well.
|
|
60
init.lua
60
init.lua
@ -12,6 +12,11 @@ unifiedbricks.old_static_list = {}
|
|||||||
unifiedbricks.old_static_list_formals = {}
|
unifiedbricks.old_static_list_formals = {}
|
||||||
unifiedbricks.old_colouredstonebrick_list = {}
|
unifiedbricks.old_colouredstonebrick_list = {}
|
||||||
|
|
||||||
|
minetest.register_alias("unifieddyes:white","unifieddyes:white_paint")
|
||||||
|
minetest.register_alias("unifieddyes:lightgrey","unifieddyes:lightgrey_paint")
|
||||||
|
minetest.register_alias("unifieddyes:grey","unifieddyes:grey_paint")
|
||||||
|
minetest.register_alias("unifieddyes:darkgrey","unifieddyes:darkgrey_paint")
|
||||||
|
|
||||||
local HUES = {
|
local HUES = {
|
||||||
"red",
|
"red",
|
||||||
"orange",
|
"orange",
|
||||||
@ -31,13 +36,6 @@ local HUES = {
|
|||||||
"lightgrey",
|
"lightgrey",
|
||||||
"white"
|
"white"
|
||||||
}
|
}
|
||||||
local TYPES = {
|
|
||||||
"clayblock_",
|
|
||||||
"clay_",
|
|
||||||
"brick_",
|
|
||||||
"brickblock_",
|
|
||||||
"multicolor_"
|
|
||||||
}
|
|
||||||
local SATURATION = {
|
local SATURATION = {
|
||||||
"_s50",
|
"_s50",
|
||||||
""
|
""
|
||||||
@ -68,13 +66,6 @@ local FORMALHUES = {
|
|||||||
"Light grey",
|
"Light grey",
|
||||||
"White"
|
"White"
|
||||||
}
|
}
|
||||||
local FORMALTYPES = {
|
|
||||||
" clay",
|
|
||||||
" clay lump",
|
|
||||||
" brick",
|
|
||||||
" bricks",
|
|
||||||
" multicolor bricks"
|
|
||||||
}
|
|
||||||
local FORMALSATURATION = {
|
local FORMALSATURATION = {
|
||||||
" (low saturation)",
|
" (low saturation)",
|
||||||
""
|
""
|
||||||
@ -101,11 +92,11 @@ local function get_class_shape(brick_type, name)
|
|||||||
c = 11
|
c = 11
|
||||||
elseif brick_type == "brick" then
|
elseif brick_type == "brick" then
|
||||||
c = 6
|
c = 6
|
||||||
elseif brick_type == "brick_multi_dark" then
|
elseif brick_type == "brick_multicolor_dark" then
|
||||||
c = 22
|
c = 22
|
||||||
elseif brick_type == "brick_multi_medium" then
|
elseif brick_type == "brick_multicolor_medium" then
|
||||||
c = 24
|
c = 24
|
||||||
elseif brick_type == "brick_multi_light" then
|
elseif brick_type == "brick_multicolor_light" then
|
||||||
c = 23
|
c = 23
|
||||||
end
|
end
|
||||||
local class = string.sub(name, a+1, b-1)
|
local class = string.sub(name, a+1, b-1)
|
||||||
@ -190,7 +181,7 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_dark", {
|
|||||||
"unifiedbricks_brickblock_multicolor_dark.png"
|
"unifiedbricks_brickblock_multicolor_dark.png"
|
||||||
},
|
},
|
||||||
overlay_tiles = {
|
overlay_tiles = {
|
||||||
{ name = "unifiedbricks_mortar2.png", color = "white" }
|
{ name = "unifiedbricks_mortar.png", color = "white" }
|
||||||
},
|
},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "color",
|
paramtype2 = "color",
|
||||||
@ -225,7 +216,7 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_medium", {
|
|||||||
"unifiedbricks_brickblock_multicolor_medium.png"
|
"unifiedbricks_brickblock_multicolor_medium.png"
|
||||||
},
|
},
|
||||||
overlay_tiles = {
|
overlay_tiles = {
|
||||||
{ name = "unifiedbricks_mortar3.png", color = "white" }
|
{ name = "unifiedbricks_mortar.png", color = "white" }
|
||||||
},
|
},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "color",
|
paramtype2 = "color",
|
||||||
@ -260,7 +251,7 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_light", {
|
|||||||
"unifiedbricks_brickblock_multicolor_light.png"
|
"unifiedbricks_brickblock_multicolor_light.png"
|
||||||
},
|
},
|
||||||
overlay_tiles = {
|
overlay_tiles = {
|
||||||
{ name = "unifiedbricks_mortar4.png", color = "white" }
|
{ name = "unifiedbricks_mortar.png", color = "white" }
|
||||||
},
|
},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "color",
|
paramtype2 = "color",
|
||||||
@ -412,7 +403,7 @@ if minetest.get_modpath("moreblocks") then
|
|||||||
substring_short = "bric",
|
substring_short = "bric",
|
||||||
substring_long = "brick",
|
substring_long = "brick",
|
||||||
},
|
},
|
||||||
brick_multi_dark = {
|
brick_multicolor_dark = {
|
||||||
name = "brickblock_multicolor_dark",
|
name = "brickblock_multicolor_dark",
|
||||||
base_node = "unifiedbricks:brick_multicolor_dark",
|
base_node = "unifiedbricks:brick_multicolor_dark",
|
||||||
base_name = "brick_multicolor_dark",
|
base_name = "brick_multicolor_dark",
|
||||||
@ -423,7 +414,7 @@ if minetest.get_modpath("moreblocks") then
|
|||||||
substring_short = "brick_multicolor_da",
|
substring_short = "brick_multicolor_da",
|
||||||
substring_long = "brick_multicolor_dar",
|
substring_long = "brick_multicolor_dar",
|
||||||
},
|
},
|
||||||
brick_multi_medium = {
|
brick_multicolor_medium = {
|
||||||
name = "brickblock_multicolor_medium",
|
name = "brickblock_multicolor_medium",
|
||||||
base_node = "unifiedbricks:brick_multicolor_medium",
|
base_node = "unifiedbricks:brick_multicolor_medium",
|
||||||
base_name = "brick_multicolor_medium",
|
base_name = "brick_multicolor_medium",
|
||||||
@ -434,7 +425,7 @@ if minetest.get_modpath("moreblocks") then
|
|||||||
substring_short = "brick_multicolor_me",
|
substring_short = "brick_multicolor_me",
|
||||||
substring_long = "brick_multicolor_med",
|
substring_long = "brick_multicolor_med",
|
||||||
},
|
},
|
||||||
brick_multi_light = {
|
brick_multicolor_light = {
|
||||||
name = "brickblock_multicolor_light",
|
name = "brickblock_multicolor_light",
|
||||||
base_node = "unifiedbricks:brick_multicolor_light",
|
base_node = "unifiedbricks:brick_multicolor_light",
|
||||||
base_name = "brick_multicolor_light",
|
base_name = "brick_multicolor_light",
|
||||||
@ -452,8 +443,8 @@ if minetest.get_modpath("moreblocks") then
|
|||||||
groups2.ud_param2_colorable = 1
|
groups2.ud_param2_colorable = 1
|
||||||
groups2.not_in_creative_inventory=1
|
groups2.not_in_creative_inventory=1
|
||||||
|
|
||||||
if brick_type == "brick_multi_dark" or brick_type == "brick_multi_medium" or
|
if brick_type == "brick_multicolor_dark" or brick_type == "brick_multicolor_medium" or
|
||||||
brick_type == "brick_multi_light" then
|
brick_type == "brick_multicolor_light" then
|
||||||
|
|
||||||
stairsplus:register_all(
|
stairsplus:register_all(
|
||||||
"unifiedbricks",
|
"unifiedbricks",
|
||||||
@ -493,11 +484,9 @@ if minetest.get_modpath("moreblocks") then
|
|||||||
for brick_type, def in pairs(brick_types) do
|
for brick_type, def in pairs(brick_types) do
|
||||||
|
|
||||||
local chk = string.sub(i.name, 1, def.substring_count)
|
local chk = string.sub(i.name, 1, def.substring_count)
|
||||||
local sub_type = ""
|
local sub_type = "unifiedbricks:"
|
||||||
if brick_type == "stonebrick" or brick_type == "brick" then
|
if brick_type == "stonebrick" or brick_type == "brick" then
|
||||||
sub_type = "moreblocks:"
|
sub_type = "moreblocks:"
|
||||||
else
|
|
||||||
sub_type = "unifiedbricks:"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if chk == sub_type.."stair_"..def.substring_short
|
if chk == sub_type.."stair_"..def.substring_short
|
||||||
@ -511,11 +500,13 @@ if minetest.get_modpath("moreblocks") then
|
|||||||
groups2.not_in_creative_inventory=1
|
groups2.not_in_creative_inventory=1
|
||||||
|
|
||||||
local class, shape = get_class_shape(brick_type, i.name)
|
local class, shape = get_class_shape(brick_type, i.name)
|
||||||
|
|
||||||
minetest.override_item(i.name, {
|
minetest.override_item(i.name, {
|
||||||
groups = groups2,
|
groups = groups2,
|
||||||
paramtype2 = "colorfacedir",
|
paramtype2 = "colorfacedir",
|
||||||
palette = "unifieddyes_palette_greys.png",
|
palette = "unifieddyes_palette_greys.png",
|
||||||
airbrush_replacement_node = "unifiedbricks:"..class.."_"..def.name.."_grey"..shape,
|
airbrush_replacement_node = "unifiedbricks:"..class.."_"..def.name.."_grey"..shape,
|
||||||
|
drop = sub_type..class.."_"..brick_type..shape, -- Fix drop
|
||||||
})
|
})
|
||||||
|
|
||||||
unifieddyes.register_color_craft({
|
unifieddyes.register_color_craft({
|
||||||
@ -567,8 +558,8 @@ end
|
|||||||
for i = 1,17 do
|
for i = 1,17 do
|
||||||
for j = 1,4 do
|
for j = 1,4 do
|
||||||
if i > 12 then
|
if i > 12 then
|
||||||
formalname = FORMALHUES[i]
|
local formalname = FORMALHUES[i]
|
||||||
name = HUES[i]
|
local name = HUES[i]
|
||||||
if j == 1 then
|
if j == 1 then
|
||||||
unifiedbricks.register_old_static_block(name, formalname, "clayblock")
|
unifiedbricks.register_old_static_block(name, formalname, "clayblock")
|
||||||
elseif j == 4 then
|
elseif j == 4 then
|
||||||
@ -576,6 +567,7 @@ for i = 1,17 do
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
for k = 1,4 do
|
for k = 1,4 do
|
||||||
|
local formalname, name
|
||||||
if k == 4 then
|
if k == 4 then
|
||||||
formalname = FORMALDARKNESS[k] .. FORMALHUES[i]
|
formalname = FORMALDARKNESS[k] .. FORMALHUES[i]
|
||||||
name = DARKNESS[k] .. HUES[i]
|
name = DARKNESS[k] .. HUES[i]
|
||||||
@ -626,7 +618,9 @@ minetest.register_lbm({
|
|||||||
colorclass == "micro" or colorclass == "slope" then
|
colorclass == "micro" or colorclass == "slope" then
|
||||||
class = colorclass
|
class = colorclass
|
||||||
local colorshape = string.sub(name, b+1)
|
local colorshape = string.sub(name, b+1)
|
||||||
local c,d = string.find(colorshape, "dark_") or 0,0
|
local c,d = string.find(colorshape, "dark_")
|
||||||
|
if not c then c = 0 end
|
||||||
|
if not d then d = 0 end
|
||||||
local colshapetemp = string.sub(colorshape, d+1)
|
local colshapetemp = string.sub(colorshape, d+1)
|
||||||
c = string.find(colshapetemp, "_") or 0
|
c = string.find(colshapetemp, "_") or 0
|
||||||
shape = string.sub(colshapetemp, c)
|
shape = string.sub(colshapetemp, c)
|
||||||
@ -659,6 +653,10 @@ minetest.register_lbm({
|
|||||||
color = ""
|
color = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if color == "_black" or color == "_white" or color == "_dark_grey" then
|
||||||
|
color = "_grey"
|
||||||
|
end
|
||||||
|
|
||||||
minetest.set_node(pos, { name = "unifiedbricks:"..class.."stonebrick"..color..shape, param2 = paletteidx+old_param2 })
|
minetest.set_node(pos, { name = "unifiedbricks:"..class.."stonebrick"..color..shape, param2 = paletteidx+old_param2 })
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
5
mod.conf
5
mod.conf
@ -1,3 +1,4 @@
|
|||||||
name = unifiedbricks
|
name = unifiedbricks
|
||||||
depends = default,unifieddyes
|
description = This mod allows the user to re-color default bricks using Unified Dyes, and provides some pattern variations as well.
|
||||||
optional_depends=moreblocks
|
depends = default, bucket, unifieddyes, vessels
|
||||||
|
optional_depends = moreblocks
|
||||||
|
Reference in New Issue
Block a user