Compare commits

...

3 Commits

Author SHA1 Message Date
f4db7d0fb1 add a global .luacheckrc 2022-03-29 07:58:15 +02:00
3ba59dc2d5 fix almost all warning spam (#26) 2022-03-29 07:44:05 +02:00
2f0e52f978 add skinsdb hand support for wardrobe skins (#24)
* add skinsdb hand support for wardrobe skins

* add compatibility to previous skinsdb version
2022-03-06 12:20:18 -05:00
11 changed files with 101 additions and 29 deletions

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

@ -0,0 +1,11 @@
name: luacheck
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: Roang-zero1/factorio-mod-luacheck@master
with:
luacheckrc_url: ""

38
.luacheckrc Normal file
View File

@ -0,0 +1,38 @@
unused_args = false
globals = {
"homedecor",
"homedecor_lighting",
"homedecor_windows_and_treatments",
"homedecor_roofing",
"homedecor_misc",
"homedecor_exterior",
"homedecor_electrical",
"lavalamp",
"lrfurn",
"signs_lib",
-- mod-deps
"armor"
}
read_globals = {
"minetest", "core",
"vector", "ItemStack",
-- Stdlib
string = {fields = {"split", "trim"}},
table = {fields = {"copy", "getn"}},
-- mod-deps
"default",
"unifieddyes",
"player_api",
"screwdriver",
"hopper",
"mesecon",
"skins",
"homedecor_doors_and_gates",
"stairsplus",
"creative"
}

View File

@ -171,6 +171,7 @@ homedecor.register("toilet_open", {
selection_box = toilet_sbox,
collision_box = toilet_cbox,
drop = "homedecor:toilet",
use_texture_alpha = "blend",
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
@ -231,6 +232,7 @@ homedecor.register("sink", {
"building_blocks_marble.png",
"default_water.png"
},
use_texture_alpha = "blend",
inventory_image="homedecor_bathroom_sink_inv.png",
selection_box = sink_sbox,
collision_box = sink_cbox,

View File

@ -102,7 +102,7 @@ local function generate_door(def)
local door = doors.get(pos)
if door then door:close() end
end,
rules = mesecon and mesecon.rules.pplate or nil
rules = minetest.global_exists("mesecon") and mesecon.rules.pplate or nil
}
},
}

View File

@ -86,6 +86,7 @@ homedecor.register_furnace("microwave_oven", {
output_width = 2,
cook_speed = 1.5,
extra_nodedef_fields = {
use_texture_alpha = "clip",
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.125, 0.5, 0.125, 0.5 },
@ -178,7 +179,7 @@ for _, mat in ipairs(counter_materials) do
.."{homedecor_kitchen_cabinet_front.png"
.."{"..ic_cabinet_sides,
mesh = "homedecor_kitchen_cabinet.obj",
paramtype2 = "wallmounted",
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
airbrush_replacement_node = "homedecor:kitchen_cabinet_colored"..material,
place_param2 = 0,
@ -238,7 +239,7 @@ for _, mat in ipairs(counter_materials) do
.."{homedecor_kitchen_cabinet_front_with_drawers.png"
.."{"..ic_cabinet_sides,
mesh = "homedecor_kitchen_cabinet.obj",
paramtype2 = "wallmounted",
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
airbrush_replacement_node = "homedecor:kitchen_cabinet_colored_with_drawers"..material,
groups = { snappy = 3, ud_param2_colorable = 1},
@ -282,8 +283,10 @@ for _, mat in ipairs(counter_materials) do
end
})
homedecor.kitchen_convert_nodes[#homedecor.kitchen_convert_nodes + 1] = "homedecor:kitchen_cabinet"..material
homedecor.kitchen_convert_nodes[#homedecor.kitchen_convert_nodes + 1] = "homedecor:kitchen_cabinet"..material.."_locked"
homedecor.kitchen_convert_nodes[#homedecor.kitchen_convert_nodes + 1] =
"homedecor:kitchen_cabinet"..material
homedecor.kitchen_convert_nodes[#homedecor.kitchen_convert_nodes + 1] =
"homedecor:kitchen_cabinet"..material.."_locked"
end
@ -300,7 +303,7 @@ homedecor.register("kitchen_cabinet_colorable_half", {
'homedecor_kitchen_cabinet_front_half.png^homedecor_kitchen_cabinet_half_bevel.png'
},
mesh = "homedecor_kitchen_cabinet_half.obj",
paramtype2 = "wallmounted",
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
airbrush_replacement_node = "homedecor:kitchen_cabinet_colored_half",
place_param2 = 0,
@ -363,7 +366,7 @@ homedecor.register("kitchen_cabinet_colorable_with_sink", {
.."{homedecor_kitchen_sink_top.png"
.."{homedecor_kitchen_cabinet_front.png"
.."{"..ic_cabinet_sides,
paramtype2 = "wallmounted",
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
airbrush_replacement_node = "homedecor:kitchen_cabinet_colored_with_sink",
place_param2 = 0,

View File

@ -263,7 +263,7 @@ for brightness_level = 0, 14 do
description = S("Thick Glowlight"),
tiles = tiles,
overlay_tiles = overlay,
use_texture_alpha = true,
use_texture_alpha = "blend",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "colorwallmounted",
@ -329,7 +329,7 @@ for brightness_level = 0, 14 do
description = S("Thin Glowlight"),
tiles = tiles,
overlay_tiles = overlay,
use_texture_alpha = true,
use_texture_alpha = "blend",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "colorwallmounted",
@ -396,7 +396,7 @@ for brightness_level = 0, 14 do
description = S("Small Glowlight Cube"),
tiles = tiles,
overlay_tiles = overlay,
use_texture_alpha = true,
use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "colorwallmounted",
drawtype = "nodebox",
@ -448,7 +448,7 @@ for brightness_level = 0, 14 do
"default_gold_block.png",
lighttex
},
use_texture_alpha = true,
use_texture_alpha = "blend",
light_source = brightness_level,
sunlight_propagates = true,
groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory = nici},
@ -473,7 +473,7 @@ for brightness_level = 0, 14 do
description = S("Ground Lantern/Light"),
mesh = "homedecor_ground_lantern.obj",
tiles = { gen_ls_tex_yellow, "homedecor_generic_metal_wrought_iron.png" },
use_texture_alpha = true,
use_texture_alpha = "blend",
inventory_image = "homedecor_ground_lantern_inv.png",
wield_image = "homedecor_ground_lantern_inv.png",
groups = {snappy=3, not_in_creative_inventory = nici},
@ -500,7 +500,7 @@ for brightness_level = 0, 14 do
description = S("Hanging Lantern/Light"),
mesh = "homedecor_hanging_lantern.obj",
tiles = { "homedecor_generic_metal_wrought_iron.png", gen_ls_tex_yellow },
use_texture_alpha = true,
use_texture_alpha = "blend",
inventory_image = "homedecor_hanging_lantern_inv.png",
wield_image = "homedecor_hanging_lantern_inv.png",
groups = {snappy=3, not_in_creative_inventory = nici},
@ -527,7 +527,7 @@ for brightness_level = 0, 14 do
drawtype = "mesh",
mesh = "homedecor_ceiling_lantern.obj",
tiles = { gen_ls_tex_yellow, "homedecor_generic_metal_wrought_iron.png" },
use_texture_alpha = true,
use_texture_alpha = "blend",
inventory_image = "homedecor_ceiling_lantern_inv.png",
description = S("Ceiling Lantern/Light"),
groups = {snappy=3, not_in_creative_inventory = nici},
@ -549,6 +549,7 @@ for brightness_level = 0, 14 do
homedecor.register("lattice_lantern_large_"..brightness_level, {
description = S("Lattice lantern/Light (large)"),
tiles = { gen_ls_tex_yellow.."^homedecor_lattice_lantern_large_overlay.png" },
use_texture_alpha = "clip",
groups = { snappy = 3, not_in_creative_inventory = nici },
light_source = brightness_level,
sounds = default.node_sound_glass_defaults(),
@ -590,6 +591,7 @@ for brightness_level = 0, 14 do
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
},
use_texture_alpha = "clip",
groups = { snappy = 3, not_in_creative_inventory = nici },
light_source = brightness_level,
sounds = default.node_sound_glass_defaults(),
@ -792,7 +794,7 @@ for _, light_brightn_name in ipairs({"off", "on"}) do
fixed = { -0.1875, -0.5, -0.1875, 0.1875, 0, 0.1875 }
},
walkable = false,
use_texture_alpha = true,
use_texture_alpha = "blend",
light_source = onflag and (default.LIGHT_MAX - 5) or nil,
sunlight_propagates = true,
groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory = nici},
@ -916,7 +918,7 @@ for _, light_brightn_name in ipairs({"off", "on"}) do
gen_ls_tex_yellow,
"homedecor_generic_metal_wrought_iron.png"
},
use_texture_alpha = true,
use_texture_alpha = "blend",
inventory_image = "homedecor_wall_lamp_inv.png",
groups = {snappy=3, not_in_creative_inventory = nici},
light_source = onflag and (default.LIGHT_MAX - 3) or nil,
@ -954,6 +956,7 @@ homedecor.register("candle", {
inventory_image = "homedecor_candle_inv.png",
selection_box = tc_cbox,
walkable = false,
use_texture_alpha = "clip",
groups = { snappy = 3 },
light_source = default.LIGHT_MAX-4,
})
@ -975,6 +978,7 @@ homedecor.register("candle_thin", {
inventory_image = "homedecor_candle_thin_inv.png",
selection_box = c_cbox,
walkable = false,
use_texture_alpha = "clip",
groups = { snappy = 3 },
light_source = default.LIGHT_MAX-4,
})
@ -997,6 +1001,7 @@ homedecor.register("candlestick_wrought_iron", {
inventory_image = "homedecor_candlestick_wrought_iron_inv.png",
selection_box = cs_cbox,
walkable = false,
use_texture_alpha = "clip",
groups = { snappy = 3 },
light_source = default.LIGHT_MAX-4,
})
@ -1012,6 +1017,7 @@ homedecor.register("candlestick_brass", {
inventory_image = "homedecor_candlestick_brass_inv.png",
selection_box = cs_cbox,
walkable = false,
use_texture_alpha = "clip",
groups = { snappy = 3 },
light_source = default.LIGHT_MAX-4,
})
@ -1031,6 +1037,7 @@ homedecor.register("wall_sconce", {
fixed = { -0.1875, -0.25, 0.3125, 0.1875, 0.25, 0.5 }
},
walkable = false,
use_texture_alpha = "clip",
groups = { snappy = 3 },
light_source = default.LIGHT_MAX-4,
})
@ -1053,7 +1060,7 @@ homedecor.register("oil_lamp", {
{ name = "homedecor_generic_metal.png", color = 0xffa00000 },
"homedecor_oil_lamp_glass.png",
},
use_texture_alpha = true,
use_texture_alpha = "blend",
inventory_image = "homedecor_oil_lamp_inv.png",
selection_box = ol_cbox,
walkable = false,
@ -1132,6 +1139,7 @@ minetest.register_node(":homedecor:chandelier_steel", {
},
drawtype = "mesh",
mesh = "homedecor_chandelier.obj",
use_texture_alpha = "clip",
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
@ -1158,6 +1166,7 @@ minetest.register_node(":homedecor:chandelier_brass", {
},
drawtype = "mesh",
mesh = "homedecor_chandelier.obj",
use_texture_alpha = "clip",
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
@ -1186,6 +1195,7 @@ homedecor.register("torch_wall", {
type = "fixed",
fixed = { -0.15, -0.45, 0.15, 0.15,0.35, 0.5 },
},
use_texture_alpha = "clip",
groups = {cracky=3},
})

View File

@ -112,6 +112,7 @@ for _, f in ipairs(flowers_list) do
"flowers_"..flower..".png"
},
walkable = false,
use_texture_alpha = "clip",
groups = {snappy = 3},
sounds = default.node_sound_glass_defaults(),
selection_box = {
@ -183,7 +184,7 @@ homedecor.register("fishtank", {
"homedecor_fishtank_water_top.png",
"homedecor_fishtank_sides.png",
},
use_texture_alpha = true,
use_texture_alpha = "blend",
selection_box = ft_cbox,
collision_box = ft_cbox,
groups = {cracky=3,oddly_breakable_by_hand=3},
@ -206,7 +207,7 @@ homedecor.register("fishtank_lighted", {
"homedecor_fishtank_sides_lighted.png",
},
light_source = default.LIGHT_MAX-4,
use_texture_alpha = true,
use_texture_alpha = "blend",
selection_box = ft_cbox,
collision_box = ft_cbox,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
@ -225,6 +226,7 @@ homedecor.register("cardboard_box_big", {
'homedecor_cardbox_big_tb.png',
'homedecor_cardbox_big_sides.png',
},
use_texture_alpha = "clip",
groups = { snappy = 3 },
infotext=S("Cardboard box"),
inventory = {
@ -245,6 +247,7 @@ homedecor.register("cardboard_box", {
{-0.3125, -0.5, -0.3125, 0.3125, 0, 0.3125},
}
},
use_texture_alpha = "clip",
groups = { snappy = 3 },
infotext=S("Cardboard box"),
inventory = {
@ -366,6 +369,7 @@ homedecor.register("skateboard", {
tiles = { "homedecor_skateboard.png" },
inventory_image = "homedecor_skateboard_inv.png",
description = S("Skateboard"),
use_texture_alpha = "clip",
groups = {snappy=3},
selection_box = skate_cbox,
walkable = false,

View File

@ -19,7 +19,7 @@ local tabletop_materials = {
}
}
leg_materials = {
local leg_materials = {
{ "brass", S("brass") },
{ "wrought_iron", S("wrought iron") },
{ "wood", S("wood") }
@ -55,7 +55,7 @@ local tables_cbox = {
}
for i, mat in ipairs(tabletop_materials) do
local m, small_s, small_r, large = unpack(mat)
local m = unpack(mat)
local s
if m == "glass" then
@ -101,7 +101,7 @@ for i, mat in ipairs(tabletop_materials) do
})
for _, l in ipairs(leg_materials) do
local leg_mat, desc = unpack(l)
local leg_mat = unpack(l)
homedecor.register(string.format("%s_table_%s_with_%s_legs", m, shape, leg_mat), {
description = string.format("%s %s table with %s legs", shape, m, leg_mat),

View File

@ -1,5 +1,5 @@
local S = minetest.get_translator("homedecor_wardrobe")
modpath = minetest.get_modpath("homedecor_wardrobe")
local modpath = minetest.get_modpath("homedecor_wardrobe")
local wd_cbox = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5}}
@ -26,6 +26,9 @@ if skinsdb_mod_path then
skin_obj:set_preview("homedecor_clothes_"..skin_name.."_preview.png")
skin_obj:set_texture("homedecor_clothes_"..skin_name..".png")
if skin_obj.set_hand_from_texture then
skin_obj:set_hand_from_texture()
end
skin_obj:set_meta("name", S("Wardrobe").." "..skin_name)
skin_obj:set_meta("author", 'Calinou and Jordach')
skin_obj:set_meta("license", 'CC-by-SA-4.0')

View File

@ -12,7 +12,7 @@ homedecor.register("window_quartered", {
"homedecor_window_quartered.png",
"homedecor_window_quartered.png"
},
use_texture_alpha = true,
use_texture_alpha = "blend",
groups = {snappy=3},
sounds = default.node_sound_glass_defaults(),
node_box = {
@ -43,7 +43,7 @@ homedecor.register("window_plain", {
"homedecor_window_frame.png",
"homedecor_window_frame.png"
},
use_texture_alpha = true,
use_texture_alpha = "blend",
groups = {snappy=3},
sounds = default.node_sound_glass_defaults(),
node_box = {
@ -105,7 +105,7 @@ minetest.register_node(":homedecor:curtain_closed", {
tiles = { "homedecor_curtain.png" },
inventory_image = "homedecor_curtain.png",
drawtype = 'signlike',
use_texture_alpha = true,
use_texture_alpha = "blend",
walkable = false,
groups = { snappy = 3, ud_param2_colorable = 1, not_in_creative_inventory=1 },
sounds = default.node_sound_leaves_defaults(),
@ -128,7 +128,7 @@ minetest.register_node(":homedecor:curtain_open", {
tiles = { "homedecor_curtain_open.png" },
inventory_image = "homedecor_curtain_open.png",
drawtype = 'signlike',
use_texture_alpha = true,
use_texture_alpha = "blend",
walkable = false,
groups = { snappy = 3, ud_param2_colorable = 1 },
sounds = default.node_sound_leaves_defaults(),
@ -179,6 +179,7 @@ homedecor.register("window_flowerbox", {
},
inventory_image = "homedecor_flowerbox_inv.png",
sounds = default.node_sound_stone_defaults(),
use_texture_alpha = "clip",
groups = { snappy = 3 },
node_box = {
type = "fixed",
@ -195,7 +196,7 @@ homedecor.register("stained_glass", {
tiles = {"homedecor_stained_glass.png"},
inventory_image = "homedecor_stained_glass.png",
groups = {snappy=3},
use_texture_alpha = true,
use_texture_alpha = "blend",
light_source = 3,
sounds = default.node_sound_glass_defaults(),
node_box = {

View File

@ -22,7 +22,7 @@ minetest.register_node("lavalamp:lavalamp", {
},
},
},
use_texture_alpha = true,
use_texture_alpha = "blend",
inventory_image = "lavalamp_lamp_inv.png",
paramtype = "light",
paramtype2 = "color",