make homedecor game agnostic (#28)

* make materials.lua with hades, minetest game, farlands items

* make textures file for central handling

* make mods game agnostic

* take out the trash

* handle multiple seats in sofas

* add github luacheck workflow and various luacheck fixes

* add fluxionary scope creep

* fix devtest breaking right to a name policy

Co-authored-by: wsor4035 <24964441+wsor4035@users.noreply.github.com>
Co-authored-by: SFENCE <sfence.software@gmail.com>
This commit is contained in:
wsor4035 2022-05-03 15:21:14 -04:00 committed by GitHub
parent 3ba59dc2d5
commit 546cd7110f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
124 changed files with 2584 additions and 2597 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: ""

42
.luacheckrc Normal file
View File

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

8
README
View File

@ -1,8 +0,0 @@
This is what I consider to be a fairly feature-filled home decor modpack.
See the forum thread at
https://forum.minetest.net/viewtopic.php?f=11&t=2041 for details about
this modpack.
Dependencies: unifieddyes and a Minetest engine build newer than 2017-01-23.
Recommends: signs_lib, windmill, moreblocks, unified_inventory.

31
README.md Normal file
View File

@ -0,0 +1,31 @@
# Minetest Homedecor Modpack
[![ContentDB](https://content.minetest.net/packages/VanessaE/homedecor_modpack/shields/downloads/)](https://content.minetest.net/packages/VanessaE/homedecor_modpack/)
A fairly feature-filled home decor modpack that is game agnostic.
## About
first class support for:
* Minetest Game
* Farlands Reloaded
* Hades
* Mineclone2, Mineclone5
## Links
* [Github](https://github.com/mt-mods/homedecor_modpack)
* [Contentdb](https://content.minetest.net/packages/VanessaE/homedecor_modpack/)
* [Forums](https://forum.minetest.net/viewtopic.php?f=11&t=2041)
# Setup
required:
* [Unifieddyes](https://github.com/mt-mods/unifieddyes)
* [Basic Materials](https://github.com/mt-mods/basic_materials)
optional:
* [Sound Api](https://github.com/mt-mods/sound_api) - note: needed for sound support

View File

@ -1,21 +0,0 @@
unused_args = false
allow_defined_top = true
max_comment_line_length = 999
read_globals = {
"DIR_DELIM",
"minetest", "core",
"unpack",
"dump",
table = { fields = { "copy", "getn" } },
"vector", "nodeupdate",
"VoxelManip", "VoxelArea",
"PseudoRandom", "ItemStack",
"stairsplus",
"default",
"stairs",
}
globals = {
}

View File

@ -40,8 +40,10 @@ if not minetest.get_modpath("technic") then
description = S("Granite"),
tiles = { "technic_granite.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=1, dig_stone=2},
_sound_def = {
key = "node_sound_stone_defaults",
},
})
minetest.register_craft({
output = "technic:granite 9",

View File

@ -1,3 +1,3 @@
name = building_blocks
depends = default
optional_depends = moreblocks, gloopblocks, stairs
depends = homedecor_common
optional_depends = moreblocks, gloopblocks, stairs, default

View File

@ -21,8 +21,10 @@ building_blocks_stairs("building_blocks:grate", {
sunlight_propagates = true,
is_ground_content = true,
use_texture_alpha = "clip",
groups = {cracky=1},
sounds = default.node_sound_metal_defaults(),
groups = {cracky=1, dig_generic=3},
_sound_def = {
key = "node_sound_metal_defaults",
},
})
building_blocks_stairs("building_blocks:smoothglass", {
drawtype = "glasslike",
@ -33,7 +35,9 @@ building_blocks_stairs("building_blocks:smoothglass", {
is_ground_content = true,
use_texture_alpha = "clip",
groups = {snappy=3,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults(),
_sound_def = {
key = "node_sound_glass_defaults",
},
})
building_blocks_stairs("building_blocks:woodglass", {
drawtype = "glasslike",
@ -44,52 +48,68 @@ building_blocks_stairs("building_blocks:woodglass", {
is_ground_content = true,
use_texture_alpha = "clip",
groups = {snappy=3,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults(),
_sound_def = {
key = "node_sound_glass_defaults",
},
})
building_blocks_stairs("building_blocks:Adobe", {
tiles = {"building_blocks_Adobe.png"},
description = S("Adobe"),
is_ground_content = true,
groups = {crumbly=3},
sounds = default.node_sound_stone_defaults(),
groups = {crumbly=3, dig_stone=2},
_sound_def = {
key = "node_sound_stone_defaults",
},
})
local grasstex = {"[combine:16x16^[noalpha^[colorize:#006400"}
if minetest.get_modpath("default") then
grasstex = minetest.registered_nodes["default:dirt_with_grass"].tiles
end
building_blocks_stairs("building_blocks:fakegrass", {
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
tiles = grasstex,
description = S("Fake Grass"),
is_ground_content = true,
groups = {crumbly=3},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
groups = {crumbly=3, dig_sand=3},
_sound_def = {
key = "node_sound_dirt_defaults",
},
})
building_blocks_stairs("building_blocks:hardwood", {
tiles = {"building_blocks_hardwood.png"},
is_ground_content = true,
description = S("Hardwood"),
groups = {choppy=1,flammable=1},
sounds = default.node_sound_wood_defaults(),
groups = {choppy=1,flammable=1, dig_tree=1},
_sound_def = {
key = "node_sound_wood_defaults",
},
})
building_blocks_stairs("building_blocks:Roofing", {
tiles = {"building_blocks_Roofing.png"},
is_ground_content = true,
description = S("Roof block"),
groups = {snappy=3},
sounds = default.node_sound_stone_defaults(),
groups = {snappy=3, dig_generic=4},
_sound_def = {
key = "node_sound_stone_defaults",
},
})
building_blocks_stairs("building_blocks:Tar", {
description = S("Tar"),
tiles = {"building_blocks_tar.png"},
is_ground_content = true,
groups = {crumbly=1, tar_block = 1},
sounds = default.node_sound_stone_defaults(),
groups = {crumbly=1, tar_block = 1, dig_generic=4},
_sound_def = {
key = "node_sound_stone_defaults",
},
})
building_blocks_stairs("building_blocks:Marble", {
description = S("Marble"),
tiles = {"building_blocks_marble.png"},
is_ground_content = true,
groups = {cracky=3, marble = 1},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, marble = 1, dig_stone=2},
_sound_def = {
key = "node_sound_stone_defaults",
},
})
minetest.register_node("building_blocks:brobble_spread", {
@ -103,34 +123,37 @@ minetest.register_node("building_blocks:brobble_spread", {
walkable = false,
selection_box = {
type = "fixed",
-- but how to specify the dimensions for curved and sideways rails?
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
-- but how to specify the dimensions for curved and sideways rails?
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
sunlight_propagates = true,
is_ground_content = true,
groups = {crumbly=3},
groups = {crumbly=3, dig_generic=4},
})
if not minetest.get_modpath("moreblocks") or not minetest.get_modpath("gloopblocks") then
local graveltex = "[combine:16x16^[noalpha^[colorize:#3a3b3c"
if minetest.get_modpath("default") then
graveltex = "default_gravel.png"
end
minetest.register_node("building_blocks:gravel_spread", {
drawtype = "raillike",
description = S("Gravel Spread"),
tiles = {"default_gravel.png"},
tiles = {graveltex},
inventory_image = "building_blocks_gravel_spread_inv.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
-- but how to specify the dimensions for curved and sideways rails?
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
-- but how to specify the dimensions for curved and sideways rails?
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
sunlight_propagates = true,
is_ground_content = true,
groups = {crumbly=2},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.5},
dug = {name="default_gravel_footstep", gain=1.0},
}),
groups = {crumbly=2, dig_generic=4},
_sound_def = {
key = "node_sound_dirt_defaults",
},
})
end
@ -143,13 +166,15 @@ minetest.register_node("building_blocks:Tarmac_spread", {
walkable = false,
selection_box = {
type = "fixed",
-- but how to specify the dimensions for curved and sideways rails?
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
-- but how to specify the dimensions for curved and sideways rails?
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
sunlight_propagates = true,
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_dirt_defaults(),
groups = {cracky=3, dig_generic=4},
_sound_def = {
key = "node_sound_dirt_defaults",
},
})
minetest.register_node("building_blocks:terrycloth_towel", {
drawtype = "raillike",
@ -160,12 +185,12 @@ minetest.register_node("building_blocks:terrycloth_towel", {
walkable = false,
selection_box = {
type = "fixed",
-- but how to specify the dimensions for curved and sideways rails?
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
-- but how to specify the dimensions for curved and sideways rails?
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
sunlight_propagates = true,
is_ground_content = true,
groups = {crumbly=3},
groups = {crumbly=3, dig_generic=4},
})
minetest.register_node("building_blocks:BWtile", {
@ -188,7 +213,7 @@ minetest.register_node("building_blocks:BWtile", {
},
sunlight_propagates = true,
is_ground_content = true,
groups = {crumbly=3},
groups = {crumbly=3, dig_generic=4},
})
minetest.register_node("building_blocks:Fireplace", {
@ -201,9 +226,11 @@ minetest.register_node("building_blocks:Fireplace", {
},
paramtype = "light",
paramtype2 = "facedir",
light_source = default.LIGHT_MAX,
light_source = minetest.LIGHT_MAX,
sunlight_propagates = true,
is_ground_content = true,
groups = {cracky=2},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=2, dig_generic=4},
_sound_def = {
key = "node_sound_stone_defaults",
},
})

View File

@ -1,3 +1,5 @@
local materials = homedecor.materials
if minetest.get_modpath("moreblocks") then
minetest.register_craft({
output = 'building_blocks:sticks 2',
@ -20,15 +22,15 @@ end
minetest.register_craft({
output = 'building_blocks:Adobe 3',
recipe = {
{"default:sand"},
{"default:clay"},
{materials.sand},
{materials.clay_lump},
{"group:stick"},
}
})
minetest.register_craft({
output = 'building_blocks:brobble_spread 4',
recipe = {
{"default:brick", "default:cobble", "default:brick"},
{materials.brick, materials.cobble, materials.brick},
}
})
minetest.register_craft({
@ -42,20 +44,20 @@ minetest.register_craft({
output = 'building_blocks:fakegrass 2',
recipe = {
{'group:leaves'},
{"default:dirt"},
{materials.dirt},
}
})
minetest.register_craft({
output = 'building_blocks:Fireplace 1',
recipe = {
{"default:steel_ingot", "building_blocks:sticks", "default:steel_ingot"},
{materials.steel_ingot, "building_blocks:sticks", materials.steel_ingot},
}
})
minetest.register_craft({
output = 'building_blocks:grate 1',
recipe = {
{"default:steel_ingot", "default:steel_ingot"},
{"default:glass", "default:glass"},
{materials.steel_ingot, materials.steel_ingot},
{materials.glass_block, materials.glass_block},
}
})
@ -63,25 +65,27 @@ if not minetest.get_modpath("moreblocks") or not minetest.get_modpath("gloopbloc
minetest.register_craft({
output = 'building_blocks:gravel_spread 4',
recipe = {
{"default:gravel", "default:gravel", "default:gravel"},
{materials.gravel, materials.gravel, materials.gravel},
}
})
end
minetest.register_craft({
output = 'building_blocks:hardwood 2',
recipe = {
{"default:wood", "default:junglewood"},
{"default:junglewood", "default:wood"},
}
})
minetest.register_craft({
output = 'building_blocks:hardwood 2',
recipe = {
{"default:junglewood", "default:wood"},
{"default:wood", "default:junglewood"},
}
})
if minetest.get_modpath("default") then
minetest.register_craft({
output = 'building_blocks:hardwood 2',
recipe = {
{"default:wood", "default:junglewood"},
{"default:junglewood", "default:wood"},
}
})
minetest.register_craft({
output = 'building_blocks:hardwood 2',
recipe = {
{"default:junglewood", "default:wood"},
{"default:wood", "default:junglewood"},
}
})
end
minetest.register_craft({
output = 'building_blocks:knife 1',
recipe = {
@ -92,9 +96,9 @@ minetest.register_craft({
minetest.register_craft({
output = "building_blocks:Marble 9",
recipe = {
{"default:clay", "group:tar_block", "default:clay"},
{"group:tar_block","default:clay", "group:tar_block"},
{"default:clay", "group:tar_block","default:clay"},
{materials.clay_lump, "group:tar_block", materials.clay_lump},
{"group:tar_block",materials.clay_lump, "group:tar_block"},
{materials.clay_lump, "group:tar_block",materials.clay_lump},
}
})
minetest.register_craft({
@ -113,15 +117,15 @@ minetest.register_craft({
minetest.register_craft({
output = 'building_blocks:tar_base 4',
recipe = {
{"default:coal_lump", "default:gravel"},
{"default:gravel", "default:coal_lump"}
{materials.coal_lump, materials.gravel},
{materials.gravel, materials.coal_lump}
}
})
minetest.register_craft({
output = 'building_blocks:tar_base 4',
recipe = {
{"default:gravel", "default:coal_lump"},
{"default:coal_lump", "default:gravel"}
{materials.gravel, materials.coal_lump},
{materials.coal_lump, materials.gravel}
}
})
minetest.register_craft({
@ -140,14 +144,14 @@ minetest.register_craft({
output = 'building_blocks:woodglass 1',
recipe = {
{"group:wood"},
{"default:glass"},
{materials.glass_block},
}
})
minetest.register_craft({
type = "cooking",
output = "building_blocks:smoothglass",
recipe = "default:glass"
recipe = materials.glass_block
})
minetest.register_craft({
type = "cooking",

View File

@ -1,19 +0,0 @@
unused_args = false
allow_defined_top = true
max_comment_line_length = 999
read_globals = {
"DIR_DELIM",
"minetest", "core",
"unpack",
"dump",
table = { fields = { "copy", "getn" } },
"vector", "nodeupdate",
"VoxelManip", "VoxelArea",
"PseudoRandom", "ItemStack",
"default",
}
globals = {
}

View File

@ -142,7 +142,7 @@ minetest.register_node("fake_fire:ice_fire", {
drawtype = "plantlike",
paramtype = "light",
paramtype2 = "facedir",
groups = {dig_immediate=3, not_in_creative_inventory=1},
groups = {dig_immediate=3, not_in_creative_inventory=1, dig_generic=3},
sunlight_propagates = true,
buildable_to = true,
walkable = false,
@ -172,6 +172,8 @@ local sbox = {
fixed = { -8/16, -8/16, -8/16, 8/16, -6/16, 8/16},
}
local wtex = homedecor.textures.default_junglewood
minetest.register_node("fake_fire:fancy_fire", {
inventory_image = "fancy_fire_inv.png",
description = S("Fancy Fire"),
@ -189,7 +191,7 @@ minetest.register_node("fake_fire:fancy_fire", {
selection_box = sbox,
tiles = {
"basic_materials_concrete_block.png",
"default_junglewood.png",
wtex,
"fake_fire_empty_tile.png"
},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
@ -224,25 +226,41 @@ minetest.register_node("fake_fire:embers", {
aspect_w=16, aspect_h=16, length=2}},
},
light_source = 9,
groups = {crumbly=3},
groups = {crumbly=3, dig_stone=2},
paramtype = "light",
sounds = default.node_sound_dirt_defaults(),
_sound_def = {
key = "node_sound_dirt_defaults",
},
})
local sandstone_tex = "default_sandstone.png"
if not minetest.get_modpath("default") then
local sname = minetest.registered_nodes["mapgen_stone"].name
local names = sname:split(":")
local nitem = names[2] and string.gsub(names[2], "stone", "sandstone") or nil
if nitem and minetest.registered_nodes[names[1]..":"..nitem] then
sandstone_tex = minetest.registered_nodes[names[1]..":"..nitem].tiles[1]
else
sandstone_tex = "[combine:16x16^[noalpha^[colorize:#fefebe"
end
end
-- CHIMNEYS
local materials = {
{ "stone", S("Stone chimney top") },
{ "sandstone", S("Sandstone chimney top") },
{ "stone", S("Stone chimney top"), minetest.registered_nodes["mapgen_stone"].tiles[1] },
{ "sandstone", S("Sandstone chimney top"), sandstone_tex },
}
for _, mat in ipairs(materials) do
local name, desc = unpack(mat)
local name, desc, tex = unpack(mat)
minetest.register_node("fake_fire:chimney_top_"..name, {
description = desc,
tiles = {"default_"..name..".png^chimney_top.png", "default_"..name..".png"},
groups = {snappy=3},
tiles = {tex.."^chimney_top.png", tex},
groups = {snappy=3, dig_stone=2},
paramtype = "light",
sounds = default.node_sound_stone_defaults(),
_sound_def = {
key = "node_sound_stone_defaults",
},
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -258,37 +276,42 @@ for _, mat in ipairs(materials) do
end
})
minetest.register_craft({
type = "shapeless",
output = 'fake_fire:chimney_top_'..name,
recipe = {"default:torch", "stairs:slab_"..name}
})
if minetest.get_modpath("default") then
minetest.register_craft({
type = "shapeless",
output = 'fake_fire:chimney_top_'..name,
recipe = {"default:torch", "stairs:slab_"..name}
})
end
end
minetest.register_alias("fake_fire:flint_and_steel", "fire:flint_and_steel")
minetest.override_item("default:ice", {
on_ignite = function(pos, igniter)
local flame_pos = {x = pos.x, y = pos.y + 1, z = pos.z}
if minetest.get_node(flame_pos).name == "air" then
minetest.set_node(flame_pos, {name = "fake_fire:ice_fire"})
if minetest.get_modpath("default") then
minetest.override_item("default:ice", {
on_ignite = function(pos, igniter)
local flame_pos = {x = pos.x, y = pos.y + 1, z = pos.z}
if minetest.get_node(flame_pos).name == "air" then
minetest.set_node(flame_pos, {name = "fake_fire:ice_fire"})
end
end
end
})
})
end
-- CRAFTS
if minetest.get_modpath("default") then
minetest.register_craft({
type = "shapeless",
output = 'fake_fire:embers',
recipe = {"default:torch", "group:wood", "default:torch"}
})
minetest.register_craft({
type = "shapeless",
output = 'fake_fire:embers',
recipe = {"default:torch", "group:wood", "default:torch"}
})
minetest.register_craft({
type = "shapeless",
output = 'fake_fire:fancy_fire',
recipe = {"default:torch", "building_blocks:sticks", "default:torch" }
})
minetest.register_craft({
type = "shapeless",
output = 'fake_fire:fancy_fire',
recipe = {"default:torch", "building_blocks:sticks", "default:torch" }
})
end
-- ALIASES

View File

@ -1,2 +1,2 @@
name = fake_fire
depends = default, basic_materials
depends = homedecor_common

View File

@ -1,18 +0,0 @@
unused_args = false
allow_defined_top = true
max_comment_line_length = 999
read_globals = {
"DIR_DELIM",
"minetest", "core",
"unpack",
"dump",
table = { fields = { "copy", "getn" } },
"vector", "nodeupdate",
"VoxelManip", "VoxelArea",
"PseudoRandom", "ItemStack",
}
globals = {
}

View File

@ -1,14 +1,16 @@
minetest.override_item("default:bookshelf", {
drawtype = "mesh",
mesh = "homedecor_3d_bookshelf.obj",
tiles = {
"default_wood.png",
"default_wood.png^homedecor_3d_bookshelf_inside_back.png",
"homedecor_3d_bookshelf_books.png",
},
paramtype = "light",
paramtype2 = "facedir",
})
if minetest.get_modpath("default") then
minetest.override_item("default:bookshelf", {
drawtype = "mesh",
mesh = "homedecor_3d_bookshelf.obj",
tiles = {
"default_wood.png",
"default_wood.png^homedecor_3d_bookshelf_inside_back.png",
"homedecor_3d_bookshelf_books.png",
},
paramtype = "light",
paramtype2 = "facedir",
})
end
if minetest.get_modpath("vessels") then
minetest.override_item("vessels:shelf", {

View File

@ -1,4 +1,3 @@
name = homedecor_3d_extras
description = Homedecor Mod: 3d extras
depends = default
optional_depends = vessels, moreblocks, doors
optional_depends = vessels, moreblocks, doors, default

View File

@ -1,22 +0,0 @@
unused_args = false
allow_defined_top = true
max_comment_line_length = 999
read_globals = {
"DIR_DELIM",
"minetest", "core",
"unpack",
"dump",
table = { fields = { "copy", "getn" } },
"vector", "nodeupdate",
"VoxelManip", "VoxelArea",
"PseudoRandom", "ItemStack",
"default",
"homedecor",
"screwdriver",
"unifieddyes",
}
globals = {
}

View File

@ -2,7 +2,10 @@ local S = minetest.get_translator("homedecor_bathroom")
local sc_disallow = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil
minetest.register_node(":homedecor:bathroom_tiles_dark", {
local wood_tex = homedecor.textures.default_wood
local water_tex = homedecor.textures.water
homedecor.register("bathroom_tiles_dark", {
description = S("Bathroom/kitchen tiles (dark)"),
tiles = {
"homedecor_bathroom_tiles_bg.png"
@ -13,13 +16,24 @@ minetest.register_node(":homedecor:bathroom_tiles_dark", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, ud_param2_colorable = 1, dig_stone = 2},
_sound_def = {
key = "node_sound_stone_defaults",
},
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig,
crafts = {
{
output = "homedecor:bathroom_tiles_dark 4",
recipe = {
{ "group:marble", "group:marble", "" },
{ "group:marble", "group:marble", "dye_dark_grey" }
},
}
}
})
minetest.register_node(":homedecor:bathroom_tiles_medium", {
homedecor.register("bathroom_tiles_medium", {
description = S("Bathroom/kitchen tiles (medium)"),
tiles = {
"homedecor_bathroom_tiles_bg.png"
@ -30,13 +44,24 @@ minetest.register_node(":homedecor:bathroom_tiles_medium", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, ud_param2_colorable = 1, dig_stone = 2},
_sound_def = {
key = "node_sound_stone_defaults",
},
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig,
crafts = {
{
output = "homedecor:bathroom_tiles_medium 4",
recipe = {
{ "group:marble", "group:marble", "" },
{ "group:marble", "group:marble", "dye_grey" }
},
}
}
})
minetest.register_node(":homedecor:bathroom_tiles_light", {
homedecor.register("bathroom_tiles_light", {
description = S("Bathroom/kitchen tiles (light)"),
tiles = {
"homedecor_bathroom_tiles_bg.png"
@ -47,10 +72,21 @@ minetest.register_node(":homedecor:bathroom_tiles_light", {
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
groups = {cracky=3, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, ud_param2_colorable = 1, dig_stone = 2},
_sound_def = {
key = "node_sound_stone_defaults",
},
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig,
crafts = {
{
output = "homedecor:bathroom_tiles_light 4",
recipe = {
{ "group:marble", "group:marble" },
{ "group:marble", "group:marble" }
},
}
}
})
local tr_cbox = {
@ -63,20 +99,30 @@ homedecor.register("towel_rod", {
mesh = "homedecor_towel_rod.obj",
tiles = {
"homedecor_generic_terrycloth.png",
"default_wood.png",
wood_tex,
},
inventory_image = "homedecor_towel_rod_inv.png",
selection_box = tr_cbox,
walkable = false,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3},
sounds = default.node_sound_defaults(),
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,dig_tree=2},
_sound_def = {
key = "node_sound_defaults",
},
crafts = {
{
recipe = {
{ "group:wood", "group:stick", "group:wood" },
{ "", "building_blocks:terrycloth_towel", "" },
},
}
}
})
homedecor.register("medicine_cabinet", {
description = S("Medicine cabinet"),
mesh = "homedecor_medicine_cabinet.obj",
tiles = {
'default_wood.png',
wood_tex,
'homedecor_medicine_cabinet_mirror.png'
},
inventory_image = "homedecor_medicine_cabinet_inv.png",
@ -85,8 +131,10 @@ homedecor.register("medicine_cabinet", {
fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5}
},
walkable = false,
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
groups = { snappy = 3, dig_stone = 2 },
_sound_def = {
key = "node_sound_wood_defaults",
},
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "homedecor:medicine_cabinet_open"
minetest.swap_node(pos, node)
@ -99,12 +147,21 @@ homedecor.register("medicine_cabinet", {
inventory = {
size=6,
},
crafts = {
{
recipe = {
{ "group:stick", "glass_block", "group:stick" },
{ "group:stick", "glass_block", "group:stick" },
{ "group:stick", "glass_block", "group:stick" }
},
}
}
})
homedecor.register("medicine_cabinet_open", {
mesh = "homedecor_medicine_cabinet_open.obj",
tiles = {
'default_wood.png',
wood_tex,
'homedecor_medicine_cabinet_mirror.png',
'homedecor_medicine_cabinet_inside.png'
},
@ -113,7 +170,7 @@ homedecor.register("medicine_cabinet_open", {
fixed = {-0.3125, -0.1875, -0.25, 0.3125, 0.5, 0.5}
},
walkable = false,
groups = { snappy = 3, not_in_creative_inventory=1 },
groups = { snappy = 3, not_in_creative_inventory=1, dig_stone = 2 },
drop = "homedecor:medicine_cabinet",
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "homedecor:medicine_cabinet"
@ -151,12 +208,23 @@ homedecor.register("toilet", {
},
selection_box = toilet_sbox,
node_box = toilet_cbox,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, dig_stone = 2},
_sound_def = {
key = "node_sound_stone_defaults",
},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
node.name = "homedecor:toilet_open"
minetest.set_node(pos, node)
end
end,
crafts = {
{
recipe = {
{ "","","water_bucket"},
{ "group:marble","group:marble", "group:marble" },
{ "", "empty_bucket", "" },
},
}
}
})
homedecor.register("toilet_open", {
@ -165,15 +233,17 @@ homedecor.register("toilet_open", {
"building_blocks_marble.png",
"building_blocks_marble.png",
"building_blocks_marble.png",
"default_water.png",
water_tex,
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey }
},
selection_box = toilet_sbox,
collision_box = toilet_cbox,
drop = "homedecor:toilet",
use_texture_alpha = "blend",
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, dig_stone = 2},
_sound_def = {
key = "node_sound_stone_defaults",
},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
node.name = "homedecor:toilet"
minetest.set_node(pos, node)
@ -197,13 +267,24 @@ homedecor.register("toilet_paper", {
mesh = "homedecor_toilet_paper.obj",
tiles = {
"homedecor_generic_quilted_paper.png",
"default_wood.png"
wood_tex
},
inventory_image = "homedecor_toilet_paper_inv.png",
selection_box = tp_cbox,
walkable = false,
groups = {snappy=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_defaults(),
groups = {snappy=3,oddly_breakable_by_hand=3, dig_stone = 2},
_sound_def = {
key = "node_sound_defaults",
},
crafts = {
{
recipe = {
{ "", "paper", "paper" },
{ "group:wood", "group:stick", "paper" },
{ "", "paper", "paper" },
},
}
}
})
--Sink
@ -230,17 +311,27 @@ homedecor.register("sink", {
tiles = {
"building_blocks_marble.png",
"building_blocks_marble.png",
"default_water.png"
water_tex
},
use_texture_alpha = "blend",
inventory_image="homedecor_bathroom_sink_inv.png",
selection_box = sink_sbox,
collision_box = sink_cbox,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, dig_stone = 2},
_sound_def = {
key = "node_sound_stone_defaults",
},
on_destruct = function(pos)
homedecor.stop_particle_spawner({x=pos.x, y=pos.y+1, z=pos.z})
end
end,
crafts = {
{
recipe = {
{ "group:marble","empty_bucket", "group:marble" },
{ "", "group:marble", "" }
},
}
}
})
--Taps
@ -279,11 +370,20 @@ homedecor.register("taps", {
fixed = { -4/16, -7/16, 4/16, 4/16, -4/16, 8/16 },
},
walkable = false,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, dig_stone = 2},
_sound_def = {
key = "node_sound_stone_defaults",
},
on_rightclick = taps_on_rightclick,
on_destruct = homedecor.stop_particle_spawner,
on_rotate = sc_disallow or nil
on_rotate = sc_disallow or nil,
crafts = {
{
recipe = {
{ "steel_ingot","water_bucket", "steel_ingot" },
},
}
}
})
homedecor.register("taps_brass", {
@ -302,11 +402,20 @@ homedecor.register("taps_brass", {
fixed = { -4/16, -7/16, 4/16, 4/16, -4/16, 8/16 },
},
walkable = false,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, dig_stone = 2},
_sound_def = {
key = "node_sound_stone_defaults",
},
on_rightclick = taps_on_rightclick,
on_destruct = homedecor.stop_particle_spawner,
on_rotate = sc_disallow or nil,
crafts = {
{
recipe = {
{ "basic_materials:brass_ingot","water_bucket", "basic_materials:brass_ingot" },
},
}
}
})
--Shower Tray
@ -328,12 +437,21 @@ homedecor.register("shower_tray", {
},
},
selection_box = homedecor.nodebox.slab_y(0.1),
groups = {cracky=2},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=2, dig_stone = 2},
_sound_def = {
key = "node_sound_stone_defaults",
},
on_destruct = function(pos)
homedecor.stop_particle_spawner({x=pos.x, y=pos.y+2, z=pos.z}) -- the showerhead
homedecor.stop_particle_spawner({x=pos.x, y=pos.y+1, z=pos.z}) -- the taps, if any
end
end,
crafts = {
{
recipe = {
{ "group:marble","empty_bucket", "group:marble" },
},
}
}
})
--Shower Head
@ -353,7 +471,7 @@ homedecor.register("shower_head", {
},
inventory_image = "homedecor_shower_head_inv.png",
description = S("Shower Head"),
groups = {snappy=3},
groups = {snappy=3, dig_stone = 2},
selection_box = sh_cbox,
walkable = false,
on_rotate = sc_disallow or nil,
@ -376,7 +494,14 @@ homedecor.register("shower_head", {
end,
on_destruct = function(pos)
homedecor.stop_particle_spawner(pos)
end
end,
crafts = {
{
recipe = {
{"steel_ingot", "water_bucket"},
},
}
}
})
local tub_sbox = {
@ -412,10 +537,21 @@ homedecor.register("bathtub_clawfoot_brass_taps", {
"homedecor_bathtub_clawfoot_bottom_inside.png",
},
description = S("Bathtub, clawfoot, with brass taps"),
groups = {cracky=3},
groups = {cracky=3, dig_stone = 2},
selection_box = tub_sbox,
node_box = tub_cbox,
sounds = default.node_sound_stone_defaults(),
_sound_def = {
key = "node_sound_stone_defaults",
},
crafts = {
{
recipe = {
{ "homedecor:taps_brass", "", "" },
{ "group:marble", "", "group:marble" },
{ "steel_ingot", "group:marble", "steel_ingot"},
},
}
}
})
homedecor.register("bathtub_clawfoot_chrome_taps", {
@ -430,10 +566,21 @@ homedecor.register("bathtub_clawfoot_chrome_taps", {
"homedecor_bathtub_clawfoot_bottom_inside.png",
},
description = S("Bathtub, clawfoot, with chrome taps"),
groups = {cracky=3},
groups = {cracky=3, dig_stone = 2},
selection_box = tub_sbox,
node_box = tub_cbox,
sounds = default.node_sound_stone_defaults(),
_sound_def = {
key = "node_sound_stone_defaults",
},
crafts = {
{
recipe = {
{ "homedecor:taps", "", "" },
{ "group:marble", "", "group:marble" },
{"steel_ingot", "group:marble", "steel_ingot"},
},
}
}
})
local bs_cbox = {
@ -453,10 +600,21 @@ homedecor.register("bathroom_set", {
},
inventory_image = "homedecor_bathroom_set_inv.png",
description = S("Bathroom sundries set"),
groups = {snappy=3},
groups = {snappy=3, dig_stone = 2},
selection_box = bs_cbox,
walkable = false,
sounds = default.node_sound_glass_defaults(),
_sound_def = {
key = "node_sound_glass_defaults",
},
crafts = {
{
recipe = {
{ "", "homedecor:glass_table_small_round", "" },
{ "basic_materials:plastic_sheet", "homedecor:glass_table_small_round", "basic_materials:plastic_sheet" },
{ "group:stick", "basic_materials:plastic_sheet", "group:stick" }
},
}
}
})
-- aliases
@ -528,45 +686,7 @@ minetest.register_lbm({
end
})
-- crafting
minetest.register_craft({
output = "homedecor:towel_rod",
recipe = {
{ "group:wood", "group:stick", "group:wood" },
{ "", "building_blocks:terrycloth_towel", "" },
},
})
minetest.register_craft({
output = "homedecor:toilet_paper",
recipe = {
{ "", "default:paper", "default:paper" },
{ "group:wood", "group:stick", "default:paper" },
{ "", "default:paper", "default:paper" },
},
})
minetest.register_craft({
output = "homedecor:medicine_cabinet",
recipe = {
{ "group:stick", "default:glass", "group:stick" },
{ "group:stick", "default:glass", "group:stick" },
{ "group:stick", "default:glass", "group:stick" }
},
})
-- bathroom/kitchen tiles
minetest.register_craft( {
output = "homedecor:bathroom_tiles_light 4",
recipe = {
{ "group:marble", "group:marble" },
{ "group:marble", "group:marble" }
},
})
-- color crafting
unifieddyes.register_color_craft({
output = "homedecor:bathroom_tiles_light",
@ -579,14 +699,6 @@ unifieddyes.register_color_craft({
}
})
minetest.register_craft( {
output = "homedecor:bathroom_tiles_medium 4",
recipe = {
{ "group:marble", "group:marble", "" },
{ "group:marble", "group:marble", "dye:grey" }
},
})
unifieddyes.register_color_craft({
output = "homedecor:bathroom_tiles_medium",
palette = "extended",
@ -598,14 +710,6 @@ unifieddyes.register_color_craft({
}
})
minetest.register_craft( {
output = "homedecor:bathroom_tiles_dark 4",
recipe = {
{ "group:marble", "group:marble", "" },
{ "group:marble", "group:marble", "dye:dark_grey" }
},
})
unifieddyes.register_color_craft({
output = "homedecor:bathroom_tiles_dark",
palette = "extended",
@ -617,75 +721,3 @@ unifieddyes.register_color_craft({
}
})
minetest.register_craft({
output = "homedecor:bathroom_set",
recipe = {
{ "", "homedecor:glass_table_small_round", "" },
{ "basic_materials:plastic_sheet", "homedecor:glass_table_small_round", "basic_materials:plastic_sheet" },
{ "group:stick", "basic_materials:plastic_sheet", "group:stick" }
},
})
minetest.register_craft({
output = "homedecor:toilet",
recipe = {
{ "","","bucket:bucket_water"},
{ "group:marble","group:marble", "group:marble" },
{ "", "bucket:bucket_empty", "" },
},
})
minetest.register_craft({
output = "homedecor:sink",
recipe = {
{ "group:marble","bucket:bucket_empty", "group:marble" },
{ "", "group:marble", "" }
},
})
minetest.register_craft({
output = "homedecor:taps",
recipe = {
{ "default:steel_ingot","bucket:bucket_water", "default:steel_ingot" },
},
})
minetest.register_craft({
output = "homedecor:taps_brass",
recipe = {
{ "basic_materials:brass_ingot","bucket:bucket_water", "basic_materials:brass_ingot" },
},
})
minetest.register_craft({
output = "homedecor:shower_tray",
recipe = {
{ "group:marble","bucket:bucket_empty", "group:marble" },
},
})
minetest.register_craft({
output = "homedecor:shower_head",
recipe = {
{"default:steel_ingot", "bucket:bucket_water"},
},
})
minetest.register_craft({
output = "homedecor:bathtub_clawfoot_brass_taps",
recipe = {
{ "homedecor:taps_brass", "", "" },
{ "group:marble", "", "group:marble" },
{ "default:steel_ingot", "group:marble", "default:steel_ingot"},
},
})
minetest.register_craft({
output = "homedecor:bathtub_clawfoot_chrome_taps",
recipe = {
{ "homedecor:taps", "", "" },
{ "group:marble", "", "group:marble" },
{"default:steel_ingot", "group:marble", "default:steel_ingot"},
},
})

View File

@ -1,4 +1,4 @@
name = homedecor_bathroom
description = Homedecor mod: bathroom
depends = homedecor_common, default, basic_materials, unifieddyes, building_blocks
optional_depends = bucket, homedecor_fences, screwdriver
depends = homedecor_common
optional_depends = bucket, homedecor_fences, screwdriver, default, basic_materials, unifieddyes, building_blocks