1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2025-09-07 19:25:28 +02:00

Compare commits

...

27 Commits

Author SHA1 Message Date
5c6a994698 Merge branch 'nalc-1.2' of yunohost:nalc/homedecor_modpack into nalc-1.2 2019-05-26 19:11:29 +02:00
1eec6e3615 Merge branch 'master' into nalc-1.2 2019-05-26 19:07:00 +02:00
Vanessa Dannenberg
7cdfc3b49c move wall switch up a bit (almost centered now) 2019-05-26 02:17:21 -04:00
Vanessa Dannenberg
bf7e47342f remove "on" switch from creative inv
add proper "receiver" group
remove color from switch buttons
2019-05-26 01:59:14 -04:00
Vanessa Dannenberg
b85278fbaa make wall switch work (mesecons) 2019-05-26 01:33:22 -04:00
Vanessa Dannenberg
cacf04e2d1 Add mesecons support for the rest of the other relevant lights
Each light connects only according to what sides make sense.

For example:

* a plasma lamp cube or large lattice lamp will connect from all 6 sides
* a ground lantern will only connect from its NSEW sides, not its top or
  bottom
* a glowlight slab, glowlight cube, or lattice cube uses the same rules as
  mesecons lamps, so its four edges and it back/bottom, whatever its
  orientation, but not its top/front.
* a (kitchen) ceiling lamp, and a (hanging, exterior) ceiling lantern will
  only connect from the top.

Rope lights are defined as a conductor, just like a mesecons wire,
so if mesecons is present, they will default to off unless powered by
a mesecons wire/switch/etc.

You can still right-click-toggle individual segments on/off.

Ceiling rope light connection rules are a little funky, but they work
(I wanted them to only connect from the top, but I couldn't get it
just right).  Floor-orientation connections are straightforward.
2019-05-26 00:44:37 -04:00
Vanessa Dannenberg
07141bff47 fill-out mesecons support for first few lights,
also removed debug prints

Lights are forced-on when placed, and remain so
until they receive a mesecons "off" signal.

Lights can be toggled on/off independent of the
mesecon signal state by right click, which will
persist until the next signal transition,
which will change the light to follow.
2019-05-25 22:51:49 -04:00
Vanessa Dannenberg
542f688c09 fix global warnings 2019-05-25 21:46:08 -04:00
Vanessa Dannenberg
fee09943e3 mesecons support, wip 2019-05-25 21:35:38 -04:00
Vanessa Dannenberg
bed4d1e6f8 make table- and standing-lamps return "hi"
brightness version, instead of "off".  do
the same for their crafts.
2019-05-25 20:59:19 -04:00
Vanessa Dannenberg
798ff29b0a add drops 2019-05-25 20:50:30 -04:00
Vanessa Dannenberg
7491fd4aa8 Allow most light sources to be toggled on/off
with right-click.

Rework glowlight slab and cube textures, simplify,
use overlays and compositing, so that the bulk
of the light can switch between a dark, matte surface,
and a bright surface with central glare gradient, and
so that the surface and eging respond to param2 color.

Tweak all other relevant nodes so that their light
source changes to a darkened (or even translucent
texture) when off.

On/off switching doesn't affect things like oil lamps,
candles, chandeliers, etc.  Just basically the stuff
that would be electric-powered in real life.

If in a protected area, only that area's owner can
turn the light on/off.
2019-05-25 19:35:14 -04:00
0753606eb0 Merge branch 'master' into nalc-1.2 2019-05-25 15:36:01 +02:00
Vanessa Dannenberg
7ab149275b Add "rope" lighting 2019-05-25 02:34:50 -04:00
Vanessa Dannenberg
c6ef999591 re-add fan blades
(lost during The Big Split)
2019-05-25 01:10:29 -04:00
Vanessa Dannenberg
a9cfef8fba give bathtub some rough collision info
allow showerhead to be turned on when placed 2m above the tub
(must be on the same end as the taps)
2019-05-25 00:59:51 -04:00
Vanessa Dannenberg
9d64af85ca convert doors over to use minetest_game doors API
simplify gates code a bit
2019-05-25 00:11:54 -04:00
Vanessa Dannenberg
712ca909ca Multiple related changes:
remove duplicate dishwasher recipe
more kitchen depends fixes
fix wrong brass taps recipe (ref technic brass, need basic_materials brass)
re-add missing bathroom items recipes
re-add missing stading- and table-lamp recipes
add alternate dishwasher recipe
add recipes for "half-doors"
change light bath tiles recipe (don't need white dye for base node, now)
move japanese wall parts to homedecor_misc, make _doors opt depend on that
2019-05-24 20:40:44 -04:00
778b5493c7 Merge branch 'master' into nalc-1.2 2019-05-09 22:11:30 +02:00
fb0ca9a15c Supprime 2 dossiers non supprimés par le merge précédent 2019-05-04 20:45:50 +02:00
1520d27a73 Merge branch 'master' into nalc-1.2 2019-05-04 19:25:15 +02:00
Vanessa Dannenberg
32fc5dc49b bad modpath check (leftover from The Big Split); fixes #12
also added optdepend on kitchen stuff (for the recipe)
2019-05-04 13:10:03 -04:00
Vanessa Dannenberg
854e96d4c0 add "light" to lava lamp desc. 2019-05-03 12:06:43 -04:00
Vanessa Dannenberg
6e61cc4ad8 move sounds to their correct folders 2019-05-02 18:40:25 -04:00
Vanessa Dannenberg
2ee1cd6887 Make sure all "lanterns" and "lamps" have "light" in their descriptions also
(for easier searching in sfinv and unified inv)
2019-05-02 18:36:36 -04:00
5d4c64d3b2 Corrige problème de stack des lampes dans inventaire après récolte.
L'auteur du mod a oublié de définir la variable drop des objets
concernés :
- homedecor:glowlight_half,
- homedecor:glowlight_quarter,
- homedecor:glowlight_small_cube,
- homedecor:standing_lamp_off,
- homedecor:desk_lamp.
2019-04-07 14:04:00 +02:00
sys4-fr
4eb9ffb088 Ajoute messages de chargement des mods dans le journal "action" 2018-12-25 17:41:16 +01:00
87 changed files with 1317 additions and 818 deletions

View File

@@ -5,3 +5,6 @@ dofile(modpath.."/alias.lua")
dofile(modpath.."/node_stairs.lua")
dofile(modpath.."/others.lua")
dofile(modpath.."/recipes.lua")
minetest.log("action", "[building_blocks] loaded.")

View File

@@ -97,3 +97,5 @@ dofile(MODPATH.."/computers.lua")
dofile(MODPATH.."/miscitems.lua")
dofile(MODPATH.."/recipes.lua")
dofile(MODPATH.."/tetris.lua")
minetest.log("action", "[computer] loaded.")

View File

@@ -214,3 +214,5 @@ minetest.register_alias("fake_fire:smokeless_ice_fire", "fake_fire:ice_fire")
minetest.register_alias("fake_fire:smokeless_chimney_top_stone", "fake_fire:chimney_top_stone")
minetest.register_alias("fake_fire:smokeless_chimney_top_sandstone", "fake_fire:chimney_top_sandstone")
minetest.register_alias("fake_fire:flint", "fake_fire:flint_and_steel")
minetest.log("action", "[fake_fire] loaded.")

View File

@@ -89,3 +89,5 @@ if minetest.get_modpath("moreblocks") then
}
})
end
minetest.log("action", "[homedecor_3d_extra] loaded.")

View File

@@ -3,3 +3,5 @@ default
basic_materials
unifieddyes
building_blocks
bucket?
homedecor_fences?

View File

@@ -347,7 +347,10 @@ homedecor.register("shower_head", {
on_rotate = screwdriver.disallow,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local below = minetest.get_node_or_nil({x=pos.x, y=pos.y-2.0, z=pos.z})
if below and below.name == "homedecor:shower_tray" then
if below and (
below.name == "homedecor:shower_tray" or
below.name == "homedecor:bathtub_clawfoot_brass_taps" or
below.name == "homedecor:bathtub_clawfoot_chrome_taps" ) then
local particledef = {
outlet = { x = 0, y = -0.42, z = 0.1 },
velocity_x = { min = -0.15, max = 0.15 },
@@ -364,6 +367,27 @@ homedecor.register("shower_head", {
end
})
local tub_sbox = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 1.5, 0.3125, 0.5 },
}
local tub_cbox = {
type = "fixed",
fixed = {
{-0.4375, -0.0625, -0.5, 1.4375, 0.5, -0.4375}, -- NodeBox1
{-0.4375, -0.0625, 0.4375, 1.4375, 0.5, 0.5}, -- NodeBox2
{-0.5, 0.1875, -0.4375, -0.4375, 0.5, 0.4375}, -- NodeBox3
{1.4375, -0.0625, -0.4375, 1.5, 0.5, 0.4375}, -- NodeBox4
{-0.3125, -0.3125, -0.4375, -0.125, -0.0625, 0.4375}, -- NodeBox5
{1.375, -0.3125, -0.4375, 1.4375, -0.0625, 0.4375}, -- NodeBox6
{-0.125, -0.3125, 0.375, 1.375, -0.0625, 0.4375}, -- NodeBox7
{-0.125, -0.3125, -0.4375, 1.375, -0.0625, -0.375}, -- NodeBox8
{-0.125, -0.5, -0.375, 1.375, -0.3125, 0.375}, -- NodeBox9
{-0.4375, -0.0625, -0.4375, -0.3125, 0.1875, 0.4375}, -- NodeBox10
}
}
homedecor.register("bathtub_clawfoot_brass_taps", {
drawtype = "mesh",
mesh = "homedecor_bathtub_clawfoot.obj",
@@ -377,10 +401,8 @@ homedecor.register("bathtub_clawfoot_brass_taps", {
},
description = S("Bathtub, clawfoot, with brass taps"),
groups = {cracky=3},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 1.5, 0.3125, 0.5 },
},
selection_box = tub_sbox,
node_box = tub_cbox,
sounds = default.node_sound_stone_defaults(),
})
@@ -397,10 +419,8 @@ homedecor.register("bathtub_clawfoot_chrome_taps", {
},
description = S("Bathtub, clawfoot, with chrome taps"),
groups = {cracky=3},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 1.5, 0.3125, 0.5 },
},
selection_box = tub_sbox,
node_box = tub_cbox,
sounds = default.node_sound_stone_defaults(),
})
@@ -531,8 +551,8 @@ minetest.register_craft({
minetest.register_craft( {
output = "homedecor:bathroom_tiles_light 4",
recipe = {
{ "group:marble", "group:marble", "" },
{ "group:marble", "group:marble", "dye:white" }
{ "group:marble", "group:marble" },
{ "group:marble", "group:marble" }
},
})
@@ -593,3 +613,67 @@ minetest.register_craft({
{ "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

@@ -143,7 +143,19 @@ homedecor.register("radiator", {
})
-- crafting
minetest.register_craftitem(":homedecor:fan_blades", {
description = S("Fan blades"),
inventory_image = "homedecor_fan_blades.png"
})
minetest.register_craft( {
output = "homedecor:fan_blades 2",
recipe = {
{ "", "basic_materials:plastic_sheet", "" },
{ "", "default:steel_ingot", "" },
{ "basic_materials:plastic_sheet", "", "basic_materials:plastic_sheet" }
},
})
minetest.register_craft({
output = "homedecor:air_conditioner",

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

View File

@@ -77,6 +77,6 @@ dofile(modpath.."/mt_game_beds_functions.lua")
dofile(modpath.."/sit.lua")
dofile(modpath.."/crafts.lua")
if minetest.settings:get_bool("log_mod") then
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "[HomeDecor API] " .. S("Loaded!"))
end

View File

@@ -1,4 +1,5 @@
homedecor_common
homedecor_misc?
default
basic_materials
dye

View File

@@ -2,293 +2,139 @@
local S = homedecor.gettext
local function N_(x) return x end
-- new doors using minetest_game doors API
local m_rules
if minetest.global_exists("mesecon") then
m_rules = mesecon and mesecon.rules and mesecon.rules.pplate
end
-- doors
local function isSolid(pos, adjust)
local adj = {x = adjust[1], y = adjust[2], z = adjust[3]}
local node = minetest.get_node(vector.add(pos,adj))
if node then
local idef = minetest.registered_nodes[minetest.get_node(vector.add(pos,adj)).name]
if idef then
return idef.walkable
end
end
return false
end
local function countSolids(pos,node,level)
local solids = 0
for x = -1, 1 do
for z = -1, 1 do
local y = (node.param2 == 5) and -level or level
-- special cases when x == z == 0
if x == 0 and z == 0 then
if level == 1 then
-- when looking past the trap door, cannot be solid in center
if isSolid(pos,{x,y,z}) then
return false
end
-- no else. it doesn't matter if x == y == z is solid, that's us.
end
elseif isSolid(pos,{x,y,z}) then
solids = solids + 1
end
end
end
return solids
end
local function calculateClosed(pos)
local node = minetest.get_node(pos)
-- the door is considered closed if it is closing off something.
local direction = node.param2 % 6
local isTrap = direction == 0 or direction == 5
if isTrap then
-- the trap door is considered closed when all nodes on its sides are solid
-- or all nodes in the 3x3 above/below it are solid except the center
for level = 0, 1 do
local solids = countSolids(pos,node,level)
if solids == 8 then
return true
end
end
return false
else
-- the door is considered closed when the nodes on its sides are solid
-- or the 3 nodes in its facing direction are solid nonsolid solid
-- if the door has two levels (i.e. not a gate) then this must
-- be true for the top node as well.
-- sorry I dunno the math to figure whether to x or z
if direction == 1 or direction == 2 then
if isSolid(pos,{0,0,-1}) and isSolid(pos,{0,0,1}) then
if string.find(node.name,'_bottom_') then
return calculateClosed({x=pos.x,y=pos.y+1,z=pos.z})
else
return true
end
end
local x = (direction == 1) and 1 or -1
if isSolid(pos,{x,0,-1}) and not isSolid(pos,{x,0,0}) and isSolid(pos,{x,0,1}) then
if string.find(node.name,'_bottom_') then
return calculateClosed({x=pos.x,y=pos.y+1,z=pos.z})
else
return true
end
end
return false
else
-- direction == 3 or 4
if isSolid(pos,{-1,0,0}) and isSolid(pos,{1,0,0}) then
if string.find(node.name,'_bottom_') then
return calculateClosed({x=pos.x,y=pos.y+1,z=pos.z})
else
return true
end
end
local z = (direction == 3) and 1 or -1
if isSolid(pos,{-1,0,z}) and not isSolid(pos,{0,0,z}) and isSolid(pos,{1,0,z}) then
if string.find(node.name,'_bottom_') then
return calculateClosed({x=pos.x,y=pos.y+1,z=pos.z})
else
return true
end
end
return false
end
end
end
-- isClosed flag, is 0 or 1 0 = open, 1 = closed
local function getClosed(pos)
local isClosed = minetest.get_meta(pos):get_string('closed')
if isClosed=='' then
return calculateClosed(pos)
else
isClosed = tonumber(isClosed)
-- may be closed or open (1 or 0)
return isClosed == 1
end
end
local function addDoorNode(pos,def,isClosed)
minetest.set_node(pos, def)
minetest.get_meta(pos):set_int('closed', isClosed and 1 or 0)
end
local door_model_list = {
{ name = "closet_mahogany",
description = N_("Mahogany Closet Door (@1 opening)"),
mesh = "homedecor_door_closet.obj"
},
{ name = "closet_oak",
description = N_("Oak Closet Door (@1 opening)"),
mesh = "homedecor_door_closet.obj"
local door_list = {
{ name = "wood_plain",
description = "Plain Wooden Door",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_wood_defaults(),
open = "homedecor_door_open",
close = "homedecor_door_close",
}
},
{ name = "exterior_fancy",
description = N_("Fancy Wood/Glass Door (@1 opening)"),
mesh = "homedecor_door_fancy.obj",
tiles = {
"homedecor_door_exterior_fancy.png",
"homedecor_door_exterior_fancy_insert.png"
description = "Fancy Wood/Glass Door",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_wood_defaults(),
open = "homedecor_door_open",
close = "homedecor_door_close",
},
usealpha = true
backface = true,
alpha = true
},
{ name = "wood_glass_oak",
description = N_("Glass and Wood, Oak-colored (@1 opening)"),
mesh = "homedecor_door_wood_glass.obj",
tiles = {
"homedecor_door_wood_glass_oak.png",
"homedecor_door_wood_glass_insert.png",
}
description = "Glass and Wood, Oak-colored",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_glass_defaults(),
},
},
{ name = "wood_glass_mahogany",
description = N_("Glass and Wood, Mahogany-colored (@1 opening)"),
mesh = "homedecor_door_wood_glass.obj",
tiles = {
"homedecor_door_wood_glass_mahogany.png",
"homedecor_door_wood_glass_insert.png",
}
description = "Glass and Wood, Mahogany-colored",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_glass_defaults(),
},
},
{ name = "wood_glass_white",
description = N_("Glass and Wood, White (@1 opening)"),
mesh = "homedecor_door_wood_glass.obj",
tiles = {
"homedecor_door_wood_glass_white.png",
"homedecor_door_wood_glass_insert.png",
}
},
{ name = "wood_plain",
description = N_("Plain Wooden Door (@1 opening)"),
mesh = "homedecor_door_plain.obj"
description = "Glass and Wood, White",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_glass_defaults(),
},
},
{ name = "bedroom",
description = N_("White Bedroom Door (@1 opening)"),
mesh = "homedecor_door_plain.obj"
description = "White Bedroom Door",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_wood_defaults(),
open = "homedecor_door_open",
close = "homedecor_door_close",
}
},
{ name = "wrought_iron",
description = N_("Wrought Iron Gate/Door (@1 opening)"),
mesh = "homedecor_door_wrought_iron.obj"
description = "Wrought Iron Gate/Door",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_metal_defaults(),
open = "doors_steel_door_open",
close = "doors_steel_door_close",
},
backface = true,
},
{ name = "woodglass",
description = N_("Wooden door with glass insert (@1 opening)"),
mesh = "homedecor_door_woodglass_typea.obj",
tiles = {
"homedecor_door_woodglass_typea.png",
"homedecor_door_woodglass_typea_insert.png",
description = "Wooden door with glass insert",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_wood_defaults(),
open = "homedecor_door_open",
close = "homedecor_door_close",
},
usealpha = true
backface = true,
alpha = true
},
{ name = "woodglass2",
description = N_("Wooden door with glass insert, type 2 (@1 opening)"),
mesh = "homedecor_door_plain.obj",
usealpha = true
description = "Wooden door with glass insert, type 2",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_wood_defaults(),
open = "homedecor_door_open",
close = "homedecor_door_close",
},
backface = true,
alpha = true
},
{ name = "closet_mahogany",
description = "Mahogany Closet Door",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_wood_defaults(),
}
},
{ name = "closet_oak",
description = "Oak Closet Door",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_wood_defaults(),
}
},
}
local def_selbox = {
type = "fixed",
fixed = { -0.5, -0.5, 0.375, 0.5, 1.5, 0.5 }
}
local old_doors = {}
local sides = { N_("left"), N_("right") }
for i, side in ipairs(sides) do
for _, door_model in ipairs(door_model_list) do
local doorname = door_model.name
local selbox = door_model.selectbox or def_selbox
local colbox = door_model.collisionbox or door_model.selectbox or def_selbox
local mesh = door_model.mesh
local groups = {snappy = 3}
if side == "right" then
mesh = string.gsub(door_model.mesh, ".obj", "_right.obj")
groups = {snappy = 3, not_in_creative_inventory = 1}
end
minetest.register_node(":homedecor:door_"..doorname.."_"..side, {
description = S(door_model.description, S(side)),
drawtype = "mesh",
mesh = mesh,
tiles = door_model.tiles or { "homedecor_door_"..doorname..".png" },
inventory_image = "homedecor_door_"..doorname.."_inv.png",
wield_image = "homedecor_door_"..doorname.."_inv.png",
paramtype = "light",
paramtype2 = "facedir",
groups = groups,
sounds = default.node_sound_wood_defaults(),
use_texture_alpha = door_model.usealpha,
selection_box = selbox,
collision_box = colbox,
on_rotate = screwdriver.rotate_simple,
on_place = function(itemstack, placer, pointed_thing)
return homedecor.stack_wing(itemstack, placer, pointed_thing,
"homedecor:door_"..doorname.."_left", "air",
"homedecor:door_"..doorname.."_right", "air")
end,
on_construct = function(pos)
minetest.get_meta(pos):set_int("closed", 1)
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
homedecor.flip_door(pos, node, clicker, doorname, side)
return itemstack
end,
-- both left and right doors may be used for open or closed doors
-- so they have to have both action_on and action_off and just
-- check when that action is invoked if to continue
on_punch = function(pos, node, puncher)
minetest.get_meta(pos):set_string('closed',nil)
end,
drop = "homedecor:door_"..doorname.."_left",
mesecons = {
effector = {
rules = m_rules,
action_on = function(pos,node)
local isClosed = getClosed(pos)
if isClosed then
homedecor.flip_door(pos,node,nil,doorname,side,isClosed)
end
end,
action_off = function(pos,node)
local isClosed = getClosed(pos)
if not isClosed then
homedecor.flip_door(pos,node,nil,doorname,side,isClosed)
end
end
}
}
for _, door in ipairs(door_list) do
doors.register(door.name, {
tiles = {{ name = "homedecor_door_"..door.name..".png", backface_culling = door.backface }},
description = door.description,
inventory_image = "homedecor_door_"..door.name.."_inv.png",
groups = table.copy(door.groups),
sounds = door.sounds.main,
sound_open = door.sounds.open,
sound_close = door.sounds.close
})
if door.alpha then
minetest.override_item("doors:"..door.name.."_a", {
use_texture_apha = true
})
minetest.register_alias("homedecor:door_"..doorname.."_top_"..side, "air")
minetest.register_alias("homedecor:door_"..doorname.."_bottom_"..side, "homedecor:door_"..doorname.."_"..side)
end
minetest.register_alias("homedecor:door_wood_glass_top_"..side, "air")
minetest.register_alias("homedecor:door_wood_glass_bottom_"..side, "homedecor:door_wood_glass_oak_"..side)
minetest.override_item("doors:"..door.name.."_b", {
use_texture_apha = true
})
end
old_doors[#old_doors + 1] = "homedecor:door_"..door.name.."_left"
old_doors[#old_doors + 1] = "homedecor:door_"..door.name.."_right"
end
-- Gates
@@ -451,56 +297,11 @@ minetest.register_alias("homedecor:fence_picket_gate_closed", "homedecor:g
minetest.register_alias("homedecor:fence_picket_gate_white_open", "homedecor:gate_picket_white_open")
minetest.register_alias("homedecor:fence_picket_gate_white_closed", "homedecor:gate_picket_white_closed")
-- to open a door, you switch left for right and subtract from param2, or vice versa right for left
-- that is to say open "right" doors become left door nodes, and open left doors right door nodes.
-- also adjusting param2 so the node is at 90 degrees.
function homedecor.flip_door(pos, node, player, name, side, isClosed)
if isClosed == nil then
isClosed = getClosed(pos)
end
-- this is where we swap the isClosed status!
-- i.e. if isClosed, we're adding an open door
-- and if not isClosed, a closed door
isClosed = not isClosed
local rside
local nfdir
local ofdir = node.param2 or 0
if side == "left" then
rside = "right"
nfdir=ofdir - 1
if nfdir < 0 then nfdir = 3 end
else
rside = "left"
nfdir=ofdir + 1
if nfdir > 3 then nfdir = 0 end
end
local sound = isClosed and 'close' or 'open'
minetest.sound_play("homedecor_door_"..sound, {
pos=pos,
max_hear_distance = 5,
gain = 2,
})
-- XXX: does the top half have to remember open/closed too?
minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_"..name.."_top_"..rside, param2=nfdir})
addDoorNode(pos,{ name = "homedecor:door_"..name.."_bottom_"..rside, param2=nfdir },isClosed)
end
function homedecor.flip_gate(pos, node, player, gate, oc)
local isClosed = getClosed(pos);
minetest.sound_play("homedecor_gate_open_close", {
pos=pos,
max_hear_distance = 5,
gain = 2,
})
local fdir = node.param2 or 0
-- since right facing gates use "open" nodes for closed, we need an
-- isClosed flag to tell if it's "really" closed.
local gateresult
if oc == "closed" then
gateresult = "homedecor:gate_"..gate.."_open"
@@ -508,12 +309,14 @@ function homedecor.flip_gate(pos, node, player, gate, oc)
gateresult = "homedecor:gate_"..gate.."_closed"
end
local def = {name=gateresult, param2=fdir}
addDoorNode(pos, def, isClosed)
minetest.set_node(pos, {name = gateresult, param2 = fdir})
minetest.sound_play("homedecor_gate_open_close", {
pos=pos,
max_hear_distance = 5,
gain = 2,
})
-- the following opens and closes gates below and above in sync with this one
-- (without three gate open/close sounds)
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local below = {x=pos.x, y=pos.y-1, z=pos.z}
@@ -521,69 +324,15 @@ function homedecor.flip_gate(pos, node, player, gate, oc)
local nodebelow = minetest.get_node(below)
if string.find(nodeabove.name, "homedecor:gate_"..gate) then
addDoorNode(above, def, isClosed)
minetest.set_node(above, {name = gateresult, param2 = fdir})
end
if string.find(nodebelow.name, "homedecor:gate_"..gate) then
addDoorNode(below, def, isClosed)
minetest.set_node(below, {name = gateresult, param2 = fdir})
end
end
-- Japanese-style wood/paper wall pieces and door
local jp_cbox = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0.5, 0.0625},
}
minetest.register_node(":homedecor:japanese_wall_top", {
description = S("Japanese wall (top)"),
drawtype = "mesh",
mesh = "homedecor_wall_japanese_top.obj",
tiles = {
homedecor.lux_wood,
"homedecor_japanese_paper.png"
},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
selection_box = jp_cbox,
collision_box = jp_cbox,
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node(":homedecor:japanese_wall_middle", {
description = S("Japanese wall"),
drawtype = "mesh",
mesh = "homedecor_wall_japanese_middle.obj",
tiles = {
homedecor.lux_wood,
"homedecor_japanese_paper.png"
},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
selection_box = jp_cbox,
collision_box = jp_cbox,
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node(":homedecor:japanese_wall_bottom", {
description = S("Japanese wall (bottom)"),
drawtype = "mesh",
mesh = "homedecor_wall_japanese_bottom.obj",
tiles = {
homedecor.lux_wood,
"homedecor_japanese_paper.png"
},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
selection_box = jp_cbox,
collision_box = jp_cbox,
sounds = default.node_sound_wood_defaults(),
})
-- Japanese-style wood/paper door
homedecor.register("door_japanese_closed", {
description = S("Japanese-style door"),
inventory_image = "homedecor_door_japanese_inv.png",
@@ -636,6 +385,44 @@ homedecor.register("door_japanese_open", {
-- crafting
-- half-doors
minetest.register_craft( {
type = "shapeless",
output = "homedecor:gate_half_door_closed 4",
recipe = {
"homedecor:door_wood_plain_left",
"homedecor:door_wood_plain_left"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:gate_half_door_closed 4",
recipe = {
"homedecor:door_wood_plain_right",
"homedecor:door_wood_plain_right"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:gate_half_door_white_closed 4",
recipe = {
"homedecor:door_bedroom_left",
"homedecor:door_bedroom_left"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:gate_half_door_white_closed 4",
recipe = {
"homedecor:door_bedroom_right",
"homedecor:door_bedroom_right"
},
})
-- Gates
minetest.register_craft( {
@@ -882,3 +669,25 @@ minetest.register_alias("homedecor:jpn_door_bottom_open", "homedecor:door_japane
minetest.register_alias("homedecor:door_glass_right", "doors:door_glass_b")
minetest.register_alias("homedecor:door_glass_left", "doors:door_glass_a")
-- flip old homedecor doors around, since they use minetest_game doors API now
minetest.register_lbm({
name = ":homedecor:convert_doors",
label = "Convert Homedecor doors to mtg doors API",
nodenames = old_doors,
run_at_every_load = false,
action = function(pos, node)
-- old doors param2: N=0, E=1, S=2, W=3
local newparam2 = (node.param2 + 2) % 4
local e = string.find(node.name, "_", -7)
local dir = string.sub(node.name, e+1)
local newname = "doors:"..string.sub(node.name, 16, e-1)
if dir == "right" then
minetest.set_node(pos, {name = newname.."_a", param2 = newparam2 })
else
minetest.set_node(pos, {name = newname.."_b", param2 = newparam2 })
end
minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "doors:hidden"})
end
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -1,3 +1,5 @@
homedecor_common
default
basic_materials
mesecons?
mesecons_receiver?

View File

@@ -1,6 +1,40 @@
local S = homedecor.gettext
function homedecor.toggle_switch(pos, node, clicker, itemstack, pointed_thing)
if minetest.is_protected(pos, clicker:get_player_name()) then
minetest.record_protection_violation(pos,
sender:get_player_name())
return false
end
local sep = string.find(node.name, "_o", -5)
local onoff = string.sub(node.name, sep + 1)
local newname = string.sub(node.name, 1, sep - 1)..((onoff == "off") and "_on" or "_off")
minetest.swap_node(pos, {name = newname, param2 = node.param2})
return true
end
local on_rc
local switch_receptor
if minetest.get_modpath("mesecons") then
on_rc = function(pos, node, clicker, itemstack, pointed_thing)
local t = homedecor.toggle_switch(pos, node, clicker, itemstack, pointed_thing)
if not t then return end
if string.find(node.name, "_on", -5) then
mesecon.receptor_off(pos, mesecon.rules.buttonlike_get(node))
else
mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node))
end
end
switch_receptor = {
receptor = {
state = mesecon.state[onoff],
rules = mesecon.rules.buttonlike_get
}
}
end
homedecor.register("power_outlet", {
description = S("Power Outlet"),
tiles = {
@@ -28,35 +62,52 @@ homedecor.register("power_outlet", {
walkable = false
})
homedecor.register("light_switch", {
description = S("Light switch"),
tiles = {
"homedecor_light_switch_edges.png",
"homedecor_light_switch_edges.png",
"homedecor_light_switch_edges.png",
"homedecor_light_switch_edges.png",
"homedecor_light_switch_back.png",
"homedecor_light_switch_front.png"
},
inventory_image = "homedecor_light_switch_inv.png",
node_box = {
type = "fixed",
fixed = {
{ -0.125, -0.5, 0.4375, 0.125, -0.1875, 0.5 },
{ -0.03125, -0.3125, 0.40625, 0.03125, -0.25, 0.5 },
for _, onoff in ipairs ({"on", "off"}) do
}
},
selection_box = {
type = "fixed",
fixed = {
{ -0.1875, -0.5625, 0.375, 0.1875, -0.1250, 0.5 },
}
},
groups = {cracky=3,dig_immediate=2},
walkable = false
})
local model = {
{ -0.125, -0.1875, 0.4375, 0.125, 0.125, 0.5 },
{ -0.03125, 0, 0.40625, 0.03125, 0.0625, 0.5 },
}
if onoff == "on" then
model = {
{ -0.125, -0.1875, 0.4375, 0.125, 0.125, 0.5 },
{ -0.03125, -0.125, 0.40625, 0.03125, -0.0625, 0.5 },
}
end
homedecor.register("light_switch_"..onoff, {
description = S("Light switch"),
tiles = {
"homedecor_light_switch_edges.png",
"homedecor_light_switch_edges.png",
"homedecor_light_switch_edges.png",
"homedecor_light_switch_edges.png",
"homedecor_light_switch_back.png",
"homedecor_light_switch_front_"..onoff..".png"
},
inventory_image = "homedecor_light_switch_inv.png",
node_box = {
type = "fixed",
fixed = model
},
selection_box = {
type = "fixed",
fixed = {
{ -0.1875, -0.25, 0.375, 0.1875, 0.1875, 0.5 },
}
},
groups = {cracky=3, dig_immediate=2, mesecon_needs_receiver=1, not_in_creative_inventory = (onoff == "on") and 1 or nil},
walkable = false,
drop = {
items = {
{items = {"homedecor:light_switch_off"}, inherit_color = true },
}
},
mesecons = switch_receptor,
on_rightclick = on_rc
})
end
homedecor.register("doorbell", {
tiles = { "homedecor_doorbell.png" },
@@ -92,7 +143,7 @@ minetest.register_craft( {
})
minetest.register_craft( {
output = "homedecor:light_switch",
output = "homedecor:light_switch_off",
recipe = {
{"", "basic_materials:plastic_sheet", "basic_materials:copper_strip"},
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:copper_strip"},
@@ -106,3 +157,7 @@ minetest.register_craft( {
{ "homedecor:light_switch", "basic_materials:energy_crystal_simple", "homedecor:speaker_driver" }
},
})
-- aliases
minetest.register_alias("homedecor:light_switch", "homedecor:light_switch_on")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

View File

@@ -425,13 +425,12 @@ minetest.register_craft({
}
})
minetest.register_craft( {
output = "homedecor:dishwasher",
recipe = {
{ "basic_materials:ic", "homedecor:fence_chainlink", "default:steel_ingot", },
{ "default:steel_ingot", "homedecor:shower_head", "basic_materials:motor" },
{ "default:steel_ingot", "basic_materials:heating_element", "bucket:bucket_water" }
{ "basic_materials:ic", "building_blocks:slab_grate_1", "default:steel_ingot", },
{ "default:steel_ingot", "homedecor:shower_head", "basic_materials:motor" },
{ "default:steel_ingot", "basic_materials:heating_element", "bucket:bucket_water" }
},
})
@@ -517,6 +516,15 @@ minetest.register_craft( {
},
})
minetest.register_craft( {
output = "homedecor:kitchen_faucet",
recipe = {
{ "default:steel_ingot","" },
{ "", "default:steel_ingot" },
{ "", "homedecor:taps" }
},
})
minetest.register_craft( {
output = "homedecor:cutlery_set",
recipe = {

View File

@@ -6,3 +6,4 @@ creative
moreblocks?
building_blocks?
darkage?
mesecons?

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

View File

Before

Width:  |  Height:  |  Size: 204 B

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

View File

Before

Width:  |  Height:  |  Size: 423 B

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

View File

@@ -999,3 +999,58 @@ unifieddyes.register_color_craft({
"MAIN_DYE",
}
})
-- Japanese-style wood/paper wall pieces and door
local jp_cbox = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0.5, 0.0625},
}
minetest.register_node(":homedecor:japanese_wall_top", {
description = S("Japanese wall (top)"),
drawtype = "mesh",
mesh = "homedecor_wall_japanese_top.obj",
tiles = {
homedecor.lux_wood,
"homedecor_japanese_paper.png"
},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
selection_box = jp_cbox,
collision_box = jp_cbox,
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node(":homedecor:japanese_wall_middle", {
description = S("Japanese wall"),
drawtype = "mesh",
mesh = "homedecor_wall_japanese_middle.obj",
tiles = {
homedecor.lux_wood,
"homedecor_japanese_paper.png"
},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
selection_box = jp_cbox,
collision_box = jp_cbox,
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node(":homedecor:japanese_wall_bottom", {
description = S("Japanese wall (bottom)"),
drawtype = "mesh",
mesh = "homedecor_wall_japanese_bottom.obj",
tiles = {
homedecor.lux_wood,
"homedecor_japanese_paper.png"
},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
selection_box = jp_cbox,
collision_box = jp_cbox,
sounds = default.node_sound_wood_defaults(),
})

View File

@@ -1,4 +1,5 @@
homedecor_common
default
homedecor_kitchen?
homedecor_misc?
skinsdb?

View File

@@ -1,4 +1,4 @@
modpath = minetest.get_modpath("homedecor")
modpath = minetest.get_modpath("homedecor_wardrobe")
screwdriver = screwdriver or {}

View File

@@ -126,3 +126,5 @@ function inbox.get_inbox_insert_formspec(pos)
"listring[]"
return formspec
end
minetest.log("action", "[inbox] loaded.")

View File

@@ -300,3 +300,5 @@ if minetest.get_modpath("mesecons_mvps") then
mesecon.register_mvps_stopper("itemframes:frame")
mesecon.register_mvps_stopper("itemframes:pedestal")
end
minetest.log("action", "[itemframes] loaded.")

View File

@@ -4,7 +4,7 @@ local S = homedecor.gettext
lavalamp = {}
minetest.register_node("lavalamp:lavalamp", {
description = S("Lava Lamp"),
description = S("Lava Lamp/Light"),
drawtype = "mesh",
mesh = "lavalamp.obj",
tiles = {
@@ -46,7 +46,7 @@ minetest.register_node("lavalamp:lavalamp", {
})
minetest.register_node("lavalamp:lavalamp_off", {
description = S("Lava Lamp (off)"),
description = S("Lava Lamp/Light (off)"),
drawtype = "mesh",
mesh = "lavalamp.obj",
tiles = {

View File

@@ -73,3 +73,5 @@ dofile(minetest.get_modpath("lrfurn").."/sofas.lua")
dofile(minetest.get_modpath("lrfurn").."/armchairs.lua")
dofile(minetest.get_modpath("lrfurn").."/coffeetable.lua")
dofile(minetest.get_modpath("lrfurn").."/endtable.lua")
minetest.log("action", "[lrfurn] loaded.")

View File

@@ -186,3 +186,5 @@ minetest.register_craft({
{'group:stick', 'default:coal_lump', 'group:stick'},
}
})
minetest.log("action", "[plasmascreen] loaded.")