Compare commits

11 Commits

6 changed files with 51 additions and 37 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,3 +0,0 @@
default
unifieddyes
moreblocks?

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.

View File

@ -12,6 +12,11 @@ unifiedbricks.old_static_list = {}
unifiedbricks.old_static_list_formals = {}
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 = {
"red",
"orange",
@ -31,13 +36,6 @@ local HUES = {
"lightgrey",
"white"
}
local TYPES = {
"clayblock_",
"clay_",
"brick_",
"brickblock_",
"multicolor_"
}
local SATURATION = {
"_s50",
""
@ -68,13 +66,6 @@ local FORMALHUES = {
"Light grey",
"White"
}
local FORMALTYPES = {
" clay",
" clay lump",
" brick",
" bricks",
" multicolor bricks"
}
local FORMALSATURATION = {
" (low saturation)",
""
@ -101,11 +92,11 @@ local function get_class_shape(brick_type, name)
c = 11
elseif brick_type == "brick" then
c = 6
elseif brick_type == "brick_multi_dark" then
elseif brick_type == "brick_multicolor_dark" then
c = 22
elseif brick_type == "brick_multi_medium" then
elseif brick_type == "brick_multicolor_medium" then
c = 24
elseif brick_type == "brick_multi_light" then
elseif brick_type == "brick_multicolor_light" then
c = 23
end
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"
},
overlay_tiles = {
{ name = "unifiedbricks_mortar2.png", color = "white" }
{ name = "unifiedbricks_mortar.png", color = "white" }
},
paramtype = "light",
paramtype2 = "color",
@ -225,7 +216,7 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_medium", {
"unifiedbricks_brickblock_multicolor_medium.png"
},
overlay_tiles = {
{ name = "unifiedbricks_mortar3.png", color = "white" }
{ name = "unifiedbricks_mortar.png", color = "white" }
},
paramtype = "light",
paramtype2 = "color",
@ -260,7 +251,7 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_light", {
"unifiedbricks_brickblock_multicolor_light.png"
},
overlay_tiles = {
{ name = "unifiedbricks_mortar4.png", color = "white" }
{ name = "unifiedbricks_mortar.png", color = "white" }
},
paramtype = "light",
paramtype2 = "color",
@ -412,7 +403,7 @@ if minetest.get_modpath("moreblocks") then
substring_short = "bric",
substring_long = "brick",
},
brick_multi_dark = {
brick_multicolor_dark = {
name = "brickblock_multicolor_dark",
base_node = "unifiedbricks:brick_multicolor_dark",
base_name = "brick_multicolor_dark",
@ -423,7 +414,7 @@ if minetest.get_modpath("moreblocks") then
substring_short = "brick_multicolor_da",
substring_long = "brick_multicolor_dar",
},
brick_multi_medium = {
brick_multicolor_medium = {
name = "brickblock_multicolor_medium",
base_node = "unifiedbricks:brick_multicolor_medium",
base_name = "brick_multicolor_medium",
@ -434,7 +425,7 @@ if minetest.get_modpath("moreblocks") then
substring_short = "brick_multicolor_me",
substring_long = "brick_multicolor_med",
},
brick_multi_light = {
brick_multicolor_light = {
name = "brickblock_multicolor_light",
base_node = "unifiedbricks:brick_multicolor_light",
base_name = "brick_multicolor_light",
@ -452,8 +443,8 @@ if minetest.get_modpath("moreblocks") then
groups2.ud_param2_colorable = 1
groups2.not_in_creative_inventory=1
if brick_type == "brick_multi_dark" or brick_type == "brick_multi_medium" or
brick_type == "brick_multi_light" then
if brick_type == "brick_multicolor_dark" or brick_type == "brick_multicolor_medium" or
brick_type == "brick_multicolor_light" then
stairsplus:register_all(
"unifiedbricks",
@ -493,11 +484,9 @@ if minetest.get_modpath("moreblocks") then
for brick_type, def in pairs(brick_types) do
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
sub_type = "moreblocks:"
else
sub_type = "unifiedbricks:"
end
if chk == sub_type.."stair_"..def.substring_short
@ -511,11 +500,13 @@ if minetest.get_modpath("moreblocks") then
groups2.not_in_creative_inventory=1
local class, shape = get_class_shape(brick_type, i.name)
minetest.override_item(i.name, {
groups = groups2,
paramtype2 = "colorfacedir",
palette = "unifieddyes_palette_greys.png",
airbrush_replacement_node = "unifiedbricks:"..class.."_"..def.name.."_grey"..shape,
drop = sub_type..class.."_"..brick_type..shape, -- Fix drop
})
unifieddyes.register_color_craft({
@ -567,8 +558,8 @@ end
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
@ -576,6 +567,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]
@ -626,7 +618,9 @@ minetest.register_lbm({
colorclass == "micro" or colorclass == "slope" then
class = colorclass
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)
c = string.find(colshapetemp, "_") or 0
shape = string.sub(colshapetemp, c)
@ -659,6 +653,10 @@ minetest.register_lbm({
color = ""
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 })
end
})

View File

@ -1,3 +1,4 @@
name = unifiedbricks
depends = default,unifieddyes
optional_depends=moreblocks
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
optional_depends = moreblocks