Compare commits
1 Commits
2020-06-04
...
2018-11-26
Author | SHA1 | Date | |
---|---|---|---|
400113b8e4 |
@ -1,4 +1,4 @@
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
if minetest.get_modpath("moreblocks") or minetest.get_modpath("stairs") then
|
||||
minetest.register_alias("building_blocks:slab_tar", "stairs:slab_Tar")
|
||||
|
@ -1,5 +1,5 @@
|
||||
default
|
||||
homedecor_common
|
||||
homedecor_i18n
|
||||
moreblocks?
|
||||
gloopblocks?
|
||||
stairs?
|
||||
|
@ -1,4 +1,4 @@
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
local modpath = minetest.get_modpath("building_blocks")
|
||||
|
||||
dofile(modpath.."/alias.lua")
|
||||
|
@ -1,4 +1,4 @@
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local stairs_groups_names = {"cracky","choppy","flammable","crumbly","snappy"}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
minetest.register_craftitem("building_blocks:sticks", {
|
||||
description = S("Small bundle of sticks"),
|
||||
|
@ -1,4 +1,4 @@
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
if minetest.get_modpath("moreblocks") then
|
||||
minetest.register_craft({
|
||||
|
Before Width: | Height: | Size: 450 B After Width: | Height: | Size: 499 B |
@ -1,5 +1,5 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
-- Amiga 500 lookalike
|
||||
computer.register("computer:shefriendSOO", {
|
||||
@ -258,6 +258,33 @@ minetest.register_node("computer:tower", {
|
||||
|
||||
minetest.register_alias("computer:tower_on", "computer:tower")
|
||||
|
||||
-- Printer/scaner combo
|
||||
minetest.register_node("computer:printer", {
|
||||
description = S("Printer-Scanner Combo"),
|
||||
inventory_image = "computer_printer_inv.png",
|
||||
tiles = {"computer_printer_t.png","computer_printer_bt.png","computer_printer_l.png",
|
||||
"computer_printer_r.png","computer_printer_b.png","computer_printer_f.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
groups = {snappy=3},
|
||||
sound = default.node_sound_wood_defaults(),
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.3125, -0.125, 0.4375, -0.0625, 0.375},
|
||||
{-0.4375, -0.5, -0.125, 0.4375, -0.4375, 0.375},
|
||||
{-0.4375, -0.5, -0.125, -0.25, -0.0625, 0.375},
|
||||
{0.25, -0.5, -0.125, 0.4375, -0.0625, 0.375},
|
||||
{-0.4375, -0.5, -0.0625, 0.4375, -0.0625, 0.375},
|
||||
{-0.375, -0.4375, 0.25, 0.375, -0.0625, 0.4375},
|
||||
{-0.25, -0.25, 0.4375, 0.25, 0.0625, 0.5},
|
||||
{-0.25, -0.481132, -0.3125, 0.25, -0.4375, 0}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
--Rack Server
|
||||
minetest.register_node("computer:server", {
|
||||
drawtype = "nodebox",
|
||||
|
@ -1,4 +1,2 @@
|
||||
default
|
||||
homedecor_common
|
||||
basic_materials
|
||||
unifieddyes
|
||||
homedecor_i18n
|
||||
|
@ -94,6 +94,6 @@ end
|
||||
|
||||
local MODPATH = minetest.get_modpath("computer")
|
||||
dofile(MODPATH.."/computers.lua")
|
||||
dofile(MODPATH.."/printers.lua")
|
||||
dofile(MODPATH.."/miscitems.lua")
|
||||
dofile(MODPATH.."/recipes.lua")
|
||||
dofile(MODPATH.."/tetris.lua")
|
||||
|
68
computer/miscitems.lua
Normal file
@ -0,0 +1,68 @@
|
||||
-- Copyright (C) 2012-2013 Diego Martínez <kaeza@users.sf.net>
|
||||
|
||||
-- This file defines some items in order to not have to depend on other mods.
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
if (not minetest.get_modpath("homedecor")) then
|
||||
|
||||
minetest.register_craftitem(":basic_materials:plastic_sheet", {
|
||||
description = S("Plastic sheet"),
|
||||
inventory_image = "homedecor_plastic_sheeting.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem(":homedecor:plastic_base", {
|
||||
description = S("Unprocessed Plastic base"),
|
||||
wield_image = "homedecor_plastic_base.png",
|
||||
inventory_image = "homedecor_plastic_base_inv.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'homedecor:plastic_base 6',
|
||||
recipe = { "default:junglegrass",
|
||||
"default:junglegrass",
|
||||
"default:junglegrass"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'homedecor:plastic_base 3',
|
||||
recipe = { "default:dry_shrub",
|
||||
"default:dry_shrub",
|
||||
"default:dry_shrub"
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'homedecor:plastic_base 4',
|
||||
recipe = { "default:leaves",
|
||||
"default:leaves",
|
||||
"default:leaves",
|
||||
"default:leaves",
|
||||
"default:leaves",
|
||||
"default:leaves"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "basic_materials:plastic_sheet",
|
||||
recipe = "homedecor:plastic_base",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'fuel',
|
||||
recipe = 'homedecor:plastic_base',
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'fuel',
|
||||
recipe = 'basic_materials:plastic_sheet',
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
end -- not homedecor
|
@ -1,61 +0,0 @@
|
||||
-- Printers of some kind or another
|
||||
|
||||
local S = homedecor.gettext
|
||||
|
||||
minetest.register_node("computer:printer", {
|
||||
description = S("Printer-Scanner Combo"),
|
||||
inventory_image = "computer_printer_inv.png",
|
||||
tiles = {"computer_printer_t.png","computer_printer_bt.png","computer_printer_l.png",
|
||||
"computer_printer_r.png","computer_printer_b.png","computer_printer_f.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = true,
|
||||
groups = {snappy=3},
|
||||
sound = default.node_sound_wood_defaults(),
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.3125, -0.125, 0.4375, -0.0625, 0.375},
|
||||
{-0.4375, -0.5, -0.125, 0.4375, -0.4375, 0.375},
|
||||
{-0.4375, -0.5, -0.125, -0.25, -0.0625, 0.375},
|
||||
{0.25, -0.5, -0.125, 0.4375, -0.0625, 0.375},
|
||||
{-0.4375, -0.5, -0.0625, 0.4375, -0.0625, 0.375},
|
||||
{-0.375, -0.4375, 0.25, 0.375, -0.0625, 0.4375},
|
||||
{-0.25, -0.25, 0.4375, 0.25, 0.0625, 0.5},
|
||||
{-0.25, -0.481132, -0.3125, 0.25, -0.4375, 0}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- "bedflinger" style 3D Printer (Prusa i3 or equivalent)
|
||||
|
||||
local cbox = {
|
||||
type = "fixed",
|
||||
fixed = {-0.25, -0.25, -0.5, 0.3, 0.3, 0.25 }
|
||||
}
|
||||
|
||||
minetest.register_node("computer:3dprinter_bedflinger", {
|
||||
description = S('3D Printer ("bedflinger")'),
|
||||
inventory_image = "computer_3dprinter_bedflinger_inv.png",
|
||||
tiles = {
|
||||
{ name = "computer_3dprinter_bedflinger.png", color = 0xffffffff },
|
||||
"computer_3dprinter_filament.png"
|
||||
},
|
||||
paramtype = "light",
|
||||
walkable = true,
|
||||
groups = {snappy=3, ud_param2_colorable = 1},
|
||||
sound = default.node_sound_wood_defaults(),
|
||||
drawtype = "mesh",
|
||||
mesh = "computer_3dprinter_bedflinger.obj",
|
||||
paramtype2 = "colorwallmounted",
|
||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||
selection_box = cbox,
|
||||
collision_box = cbox,
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
|
||||
end,
|
||||
on_dig = unifieddyes.on_dig,
|
||||
on_rotate = unifieddyes.fix_after_screwdriver_nsew,
|
||||
})
|
||||
|
@ -1,4 +1,5 @@
|
||||
local S = homedecor.gettext
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local shapes = {
|
||||
{ { x = {0, 1, 0, 1}, y = {0, 0, 1, 1} } },
|
||||
@ -219,10 +220,10 @@ local function step(pos, fields)
|
||||
if fields then
|
||||
if fields.new then
|
||||
new_game(pos)
|
||||
elseif t then
|
||||
else
|
||||
key(fields)
|
||||
end
|
||||
elseif t then
|
||||
else
|
||||
run = tick()
|
||||
end
|
||||
|
||||
|
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 216 B |
@ -1,2 +1,2 @@
|
||||
default
|
||||
homedecor_common
|
||||
homedecor
|
||||
|
@ -1,82 +1,9 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
screwdriver = screwdriver or {}
|
||||
|
||||
local function fire_particles_on(pos) -- 3 layers of fire
|
||||
local meta = minetest.get_meta(pos)
|
||||
local id = minetest.add_particlespawner({ -- 1 layer big particles fire
|
||||
amount = 9,
|
||||
time = 0,
|
||||
minpos = {x = pos.x - 0.2, y = pos.y - 0.4, z = pos.z - 0.2},
|
||||
maxpos = {x = pos.x + 0.2, y = pos.y - 0.1, z = pos.z + 0.2},
|
||||
minvel = {x= 0, y= 0, z= 0},
|
||||
maxvel = {x= 0, y= 0.1, z= 0},
|
||||
minacc = {x= 0, y= 0, z= 0},
|
||||
maxacc = {x= 0, y= 0.7, z= 0},
|
||||
minexptime = 0.5,
|
||||
maxexptime = 0.7,
|
||||
minsize = 2,
|
||||
maxsize = 5,
|
||||
collisiondetection = false,
|
||||
vertical = true,
|
||||
texture = "fake_fire_particle_anim_fire.png",
|
||||
animation = {type="vertical_frames", aspect_w=16, aspect_h=16, length = 0.8,},
|
||||
})
|
||||
meta:set_int("layer_1", id)
|
||||
|
||||
local id = minetest.add_particlespawner({ -- 2 layer smol particles fire
|
||||
amount = 1,
|
||||
time = 0,
|
||||
minpos = {x = pos.x - 0.1, y = pos.y, z = pos.z - 0.1},
|
||||
maxpos = {x = pos.x + 0.1, y = pos.y + 0.4, z = pos.z + 0.1},
|
||||
minvel = {x= 0, y= 0, z= 0},
|
||||
maxvel = {x= 0, y= 0.1, z= 0},
|
||||
minacc = {x= 0, y= 0, z= 0},
|
||||
maxacc = {x= 0, y= 1, z= 0},
|
||||
minexptime = 0.4,
|
||||
maxexptime = 0.6,
|
||||
minsize = 0.5,
|
||||
maxsize = 0.7,
|
||||
collisiondetection = false,
|
||||
vertical = true,
|
||||
texture = "fake_fire_particle_anim_fire.png",
|
||||
animation = {type="vertical_frames", aspect_w=16, aspect_h=16, length = 0.7,},
|
||||
})
|
||||
meta:set_int("layer_2", id)
|
||||
|
||||
local id = minetest.add_particlespawner({ --3 layer smoke
|
||||
amount = 1,
|
||||
time = 0,
|
||||
minpos = {x = pos.x - 0.1, y = pos.y - 0.2, z = pos.z - 0.1},
|
||||
maxpos = {x = pos.x + 0.2, y = pos.y + 0.4, z = pos.z + 0.2},
|
||||
minvel = {x= 0, y= 0, z= 0},
|
||||
maxvel = {x= 0, y= 0.1, z= 0},
|
||||
minacc = {x= 0, y= 0, z= 0},
|
||||
maxacc = {x= 0, y= 1, z= 0},
|
||||
minexptime = 0.6,
|
||||
maxexptime = 0.8,
|
||||
minsize = 2,
|
||||
maxsize = 4,
|
||||
collisiondetection = true,
|
||||
vertical = true,
|
||||
texture = "fake_fire_particle_anim_smoke.png",
|
||||
animation = {type="vertical_frames", aspect_w=16, aspect_h=16, length = 0.9,},
|
||||
})
|
||||
meta:set_int("layer_3", id)
|
||||
end
|
||||
|
||||
local function fire_particles_off(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local id_1 = meta:get_int("layer_1");
|
||||
local id_2 = meta:get_int("layer_2");
|
||||
local id_3 = meta:get_int("layer_3");
|
||||
minetest.delete_particlespawner(id_1)
|
||||
minetest.delete_particlespawner(id_2)
|
||||
minetest.delete_particlespawner(id_3)
|
||||
end
|
||||
|
||||
local function start_fire_effects(pos, node, clicker, chimney)
|
||||
local function start_smoke(pos, node, clicker, chimney)
|
||||
local this_spawner_meta = minetest.get_meta(pos)
|
||||
local id = this_spawner_meta:get_int("smoky")
|
||||
local s_handle = this_spawner_meta:get_int("sound")
|
||||
@ -114,7 +41,7 @@ local function start_fire_effects(pos, node, clicker, chimney)
|
||||
max_hear_distance = 5,
|
||||
loop = true
|
||||
})
|
||||
fire_particles_on(pos)
|
||||
this_spawner_meta:set_int("smoky", id)
|
||||
this_spawner_meta:set_int("sound", s_handle)
|
||||
end
|
||||
end
|
||||
@ -156,7 +83,7 @@ minetest.register_node("fake_fire:ice_fire", {
|
||||
aspect_w=16, aspect_h=16, length=1.5}},
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
start_fire_effects(pos, node, clicker)
|
||||
start_smoke(pos, node, clicker)
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = function (pos)
|
||||
@ -170,54 +97,42 @@ minetest.register_node("fake_fire:ice_fire", {
|
||||
|
||||
minetest.register_alias("fake_fire:fake_fire", "fire:permanent_flame")
|
||||
|
||||
local sbox = {
|
||||
type = 'fixed',
|
||||
fixed = { -8/16, -8/16, -8/16, 8/16, -6/16, 8/16},
|
||||
}
|
||||
|
||||
minetest.register_node("fake_fire:fancy_fire", {
|
||||
inventory_image = "fancy_fire_inv.png",
|
||||
description = S("Fancy Fire"),
|
||||
drawtype = "mesh",
|
||||
mesh = "fancy_fire.obj",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {oddly_breakable_by_hand=3, flammable=0},
|
||||
sunlight_propagates = true,
|
||||
light_source = 13,
|
||||
walkable = false,
|
||||
buildable_to = false,
|
||||
damage_per_second = 3,
|
||||
selection_box = sbox,
|
||||
tiles = {
|
||||
"basic_materials_concrete_block.png",
|
||||
"default_junglewood.png",
|
||||
"fake_fire_empty_tile.png"
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
fire_particles_on(pos)
|
||||
return itemstack
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
fire_particles_on(pos)
|
||||
end,
|
||||
on_destruct = function(pos, oldnode, oldmetadata, digger)
|
||||
fire_particles_off(pos)
|
||||
minetest.sound_play("fire_extinguish", {
|
||||
pos = pos, max_hear_distance = 5
|
||||
})
|
||||
end,
|
||||
drop = {
|
||||
max_items = 3,
|
||||
items = {
|
||||
{
|
||||
items = { "default:torch", "default:torch", "building_blocks:sticks" },
|
||||
rarity = 1,
|
||||
inventory_image = "fancy_fire_inv.png",
|
||||
description = S("Fancy Fire"),
|
||||
drawtype = "mesh",
|
||||
mesh = "fancy_fire.obj",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {dig_immediate=3},
|
||||
sunlight_propagates = true,
|
||||
light_source = 14,
|
||||
walkable = false,
|
||||
damage_per_second = 4,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
tiles = {
|
||||
{name="fake_fire_animated.png",
|
||||
animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='fake_fire_logs.png'}},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
start_smoke(pos, node, clicker)
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = function (pos)
|
||||
stop_smoke(pos)
|
||||
minetest.sound_play("fire_extinguish", {
|
||||
pos = pos, max_hear_distance = 5
|
||||
})
|
||||
end,
|
||||
drop = {
|
||||
max_items = 3,
|
||||
items = {
|
||||
{
|
||||
items = { "default:torch", "default:torch", "building_blocks:sticks" },
|
||||
rarity = 1,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
-- EMBERS
|
||||
minetest.register_node("fake_fire:embers", {
|
||||
@ -253,7 +168,7 @@ for _, mat in ipairs(materials) do
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local chimney = 1
|
||||
start_fire_effects(pos, node, clicker, chimney)
|
||||
start_smoke(pos, node, clicker, chimney)
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = function (pos)
|
||||
@ -294,22 +209,8 @@ minetest.register_craft({
|
||||
})
|
||||
|
||||
-- ALIASES
|
||||
|
||||
minetest.register_alias("fake_fire:smokeless_fire", "fake_fire:fake_fire")
|
||||
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")
|
||||
|
||||
-- OTHER
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "fake_fire:reload_particles",
|
||||
label = "restart fire particles on reload",
|
||||
nodenames = {"fake_fire:fancy_fire"},
|
||||
run_at_every_load = true,
|
||||
action = function(pos, node)
|
||||
fire_particles_off(pos)
|
||||
fire_particles_on(pos)
|
||||
end
|
||||
})
|
||||
|
Before Width: | Height: | Size: 68 B |
BIN
fake_fire/textures/fake_fire_logs.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 275 B |
166
homedecor/bathroom_furniture.lua
Normal file
@ -0,0 +1,166 @@
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
minetest.register_node("homedecor:bathroom_tiles_dark", {
|
||||
description = S("Bathroom/kitchen tiles (dark)"),
|
||||
tiles = {
|
||||
"homedecor_bathroom_tiles_bg.png"
|
||||
},
|
||||
overlay_tiles = {
|
||||
{ name = "homedecor_bathroom_tiles_fg.png", color = 0xff606060 },
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
groups = {cracky=3, ud_param2_colorable = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_construct = unifieddyes.on_construct,
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:bathroom_tiles_medium", {
|
||||
description = S("Bathroom/kitchen tiles (medium)"),
|
||||
tiles = {
|
||||
"homedecor_bathroom_tiles_bg.png"
|
||||
},
|
||||
overlay_tiles = {
|
||||
{ name = "homedecor_bathroom_tiles_fg.png", color = 0xffc0c0c0 },
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
groups = {cracky=3, ud_param2_colorable = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_construct = unifieddyes.on_construct,
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:bathroom_tiles_light", {
|
||||
description = S("Bathroom/kitchen tiles (light)"),
|
||||
tiles = {
|
||||
"homedecor_bathroom_tiles_bg.png"
|
||||
},
|
||||
overlay_tiles = {
|
||||
{ name = "homedecor_bathroom_tiles_fg.png", color = 0xffffffff },
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
groups = {cracky=3, ud_param2_colorable = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_construct = unifieddyes.on_construct,
|
||||
})
|
||||
|
||||
local tr_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.375, -0.3125, 0.25, 0.375, 0.375, 0.5 }
|
||||
}
|
||||
|
||||
homedecor.register("towel_rod", {
|
||||
description = S("Towel rod with towel"),
|
||||
mesh = "homedecor_towel_rod.obj",
|
||||
tiles = {
|
||||
"homedecor_generic_terrycloth.png",
|
||||
"default_wood.png",
|
||||
},
|
||||
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(),
|
||||
})
|
||||
|
||||
homedecor.register("medicine_cabinet", {
|
||||
description = S("Medicine cabinet"),
|
||||
mesh = "homedecor_medicine_cabinet.obj",
|
||||
tiles = {
|
||||
'default_wood.png',
|
||||
'homedecor_medicine_cabinet_mirror.png'
|
||||
},
|
||||
inventory_image = "homedecor_medicine_cabinet_inv.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5}
|
||||
},
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_punch = function(pos, node, puncher, pointed_thing)
|
||||
node.name = "homedecor:medicine_cabinet_open"
|
||||
minetest.swap_node(pos, node)
|
||||
end,
|
||||
infotext=S("Medicine cabinet"),
|
||||
inventory = {
|
||||
size=6,
|
||||
},
|
||||
})
|
||||
|
||||
homedecor.register("medicine_cabinet_open", {
|
||||
mesh = "homedecor_medicine_cabinet_open.obj",
|
||||
tiles = {
|
||||
'default_wood.png',
|
||||
'homedecor_medicine_cabinet_mirror.png',
|
||||
'homedecor_medicine_cabinet_inside.png'
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3125, -0.1875, -0.25, 0.3125, 0.5, 0.5}
|
||||
},
|
||||
walkable = false,
|
||||
groups = { snappy = 3, not_in_creative_inventory=1 },
|
||||
drop = "homedecor:medicine_cabinet",
|
||||
on_punch = function(pos, node, puncher, pointed_thing)
|
||||
node.name = "homedecor:medicine_cabinet"
|
||||
minetest.swap_node(pos, node)
|
||||
end,
|
||||
})
|
||||
|
||||
-- convert old static nodes
|
||||
|
||||
homedecor.old_static_bathroom_tiles = {
|
||||
"homedecor:tiles_1",
|
||||
"homedecor:tiles_2",
|
||||
"homedecor:tiles_3",
|
||||
"homedecor:tiles_4",
|
||||
"homedecor:tiles_red",
|
||||
"homedecor:tiles_tan",
|
||||
"homedecor:tiles_yellow",
|
||||
"homedecor:tiles_green",
|
||||
"homedecor:tiles_blue"
|
||||
}
|
||||
|
||||
local old_to_color = {
|
||||
"light_grey",
|
||||
"grey",
|
||||
"black",
|
||||
"black"
|
||||
}
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "homedecor:convert_bathroom_tiles",
|
||||
label = "Convert bathroom tiles to use param2 color",
|
||||
run_at_every_load = false,
|
||||
nodenames = homedecor.old_static_bathroom_tiles,
|
||||
action = function(pos, node)
|
||||
local name = node.name
|
||||
local newname = "homedecor:bathroom_tiles_light"
|
||||
local a = string.find(name, "_")
|
||||
local color = string.sub(name, a + 1)
|
||||
|
||||
if color == "tan" then
|
||||
color = "yellow_s50"
|
||||
elseif color == "1" or color == "2" or color == "3" or color == "4" then
|
||||
if color == "4" then
|
||||
newname = "homedecor:bathroom_tiles_medium"
|
||||
end
|
||||
color = old_to_color[tonumber(color)]
|
||||
elseif color ~= "yellow" then
|
||||
color = color.."_s50"
|
||||
end
|
||||
|
||||
local paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "extended")
|
||||
|
||||
minetest.set_node(pos, { name = newname, param2 = paletteidx })
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("dye", "unifieddyes:"..color)
|
||||
meta:set_string("palette", "ext")
|
||||
end
|
||||
})
|
326
homedecor/bathroom_sanitation.lua
Normal file
@ -0,0 +1,326 @@
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local toilet_sbox = {
|
||||
type = "fixed",
|
||||
fixed = { -6/16, -8/16, -8/16, 6/16, 9/16, 8/16 },
|
||||
}
|
||||
|
||||
local toilet_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-6/16, -8/16, -8/16, 6/16, 1/16, 8/16 },
|
||||
{-6/16, -8/16, 4/16, 6/16, 9/16, 8/16 }
|
||||
}
|
||||
}
|
||||
|
||||
homedecor.register("toilet", {
|
||||
description = S("Toilet"),
|
||||
mesh = "homedecor_toilet_closed.obj",
|
||||
tiles = {
|
||||
"homedecor_marble.png",
|
||||
"homedecor_marble.png",
|
||||
"homedecor_marble.png",
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey }
|
||||
},
|
||||
selection_box = toilet_sbox,
|
||||
node_box = toilet_cbox,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
node.name = "homedecor:toilet_open"
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
})
|
||||
|
||||
homedecor.register("toilet_open", {
|
||||
mesh = "homedecor_toilet_open.obj",
|
||||
tiles = {
|
||||
"homedecor_marble.png",
|
||||
"homedecor_marble.png",
|
||||
"homedecor_marble.png",
|
||||
"default_water.png",
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey }
|
||||
},
|
||||
selection_box = toilet_sbox,
|
||||
collision_box = toilet_cbox,
|
||||
drop = "homedecor:toilet",
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
node.name = "homedecor:toilet"
|
||||
minetest.set_node(pos, node)
|
||||
minetest.sound_play("homedecor_toilet_flush", {
|
||||
pos=pos,
|
||||
max_hear_distance = 5,
|
||||
gain = 1,
|
||||
})
|
||||
end
|
||||
})
|
||||
|
||||
-- toilet paper :-)
|
||||
|
||||
local tp_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, 0.125, 0.0625, 0.1875, 0.4375, 0.5 }
|
||||
}
|
||||
|
||||
homedecor.register("toilet_paper", {
|
||||
description = S("Toilet paper"),
|
||||
mesh = "homedecor_toilet_paper.obj",
|
||||
tiles = {
|
||||
"homedecor_generic_quilted_paper.png",
|
||||
"default_wood.png"
|
||||
},
|
||||
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(),
|
||||
})
|
||||
|
||||
--Sink
|
||||
|
||||
local sink_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -5/16, -8/16, 1/16, 5/16, 8/16, 8/16 }
|
||||
}
|
||||
|
||||
homedecor.register("sink", {
|
||||
description = S("Bathroom Sink"),
|
||||
mesh = "homedecor_bathroom_sink.obj",
|
||||
tiles = {
|
||||
"homedecor_marble.png",
|
||||
"homedecor_marble.png",
|
||||
"default_water.png"
|
||||
},
|
||||
inventory_image="homedecor_bathroom_sink_inv.png",
|
||||
selection_box = sink_cbox,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -5/16, 5/16, 1/16, -4/16, 8/16, 8/16 },
|
||||
{ 5/16, 5/16, 1/16, 4/16, 8/16, 8/16 },
|
||||
{ -5/16, 5/16, 1/16, 5/16, 8/16, 2/16 },
|
||||
{ -5/16, 5/16, 6/16, 5/16, 8/16, 8/16 },
|
||||
{ -4/16, -8/16, 1/16, 4/16, 5/16, 6/16 }
|
||||
}
|
||||
},
|
||||
on_destruct = function(pos)
|
||||
homedecor.stop_particle_spawner({x=pos.x, y=pos.y+1, z=pos.z})
|
||||
end
|
||||
})
|
||||
|
||||
--Taps
|
||||
|
||||
local function taps_on_rightclick(pos, node, clicker, itemstack, pointed_thing)
|
||||
local below = minetest.get_node_or_nil({x=pos.x, y=pos.y-1, z=pos.z})
|
||||
if below and
|
||||
below.name == "homedecor:shower_tray" or
|
||||
below.name == "homedecor:sink" or
|
||||
below.name == "homedecor:kitchen_cabinet_with_sink" or
|
||||
below.name == "homedecor:kitchen_cabinet_with_sink_locked" then
|
||||
local particledef = {
|
||||
outlet = { x = 0, y = -0.44, z = 0.28 },
|
||||
velocity_x = { min = -0.1, max = 0.1 },
|
||||
velocity_y = -0.3,
|
||||
velocity_z = { min = -0.1, max = 0 },
|
||||
spread = 0
|
||||
}
|
||||
homedecor.start_particle_spawner(pos, node, particledef, "homedecor_faucet")
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
homedecor.register("taps", {
|
||||
description = S("Bathroom taps/faucet"),
|
||||
mesh = "homedecor_bathroom_faucet.obj",
|
||||
tiles = {
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
|
||||
"homedecor_generic_metal_bright.png",
|
||||
"homedecor_generic_metal.png",
|
||||
"homedecor_generic_metal_bright.png"
|
||||
},
|
||||
inventory_image = "3dforniture_taps_inv.png",
|
||||
wield_image = "3dforniture_taps_inv.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -4/16, -7/16, 4/16, 4/16, -4/16, 8/16 },
|
||||
},
|
||||
walkable = false,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_rightclick = taps_on_rightclick,
|
||||
on_destruct = homedecor.stop_particle_spawner,
|
||||
on_rotate = screwdriver.disallow
|
||||
})
|
||||
|
||||
homedecor.register("taps_brass", {
|
||||
description = S("Bathroom taps/faucet (brass)"),
|
||||
mesh = "homedecor_bathroom_faucet.obj",
|
||||
tiles = {
|
||||
"homedecor_generic_metal_brass.png",
|
||||
"homedecor_generic_metal_brass.png",
|
||||
"homedecor_generic_metal.png",
|
||||
"homedecor_generic_metal_brass.png"
|
||||
},
|
||||
inventory_image = "3dforniture_taps_brass_inv.png",
|
||||
wield_image = "3dforniture_taps_brass_inv.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -4/16, -7/16, 4/16, 4/16, -4/16, 8/16 },
|
||||
},
|
||||
walkable = false,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_rightclick = taps_on_rightclick,
|
||||
on_destruct = homedecor.stop_particle_spawner,
|
||||
on_rotate = screwdriver.disallow
|
||||
})
|
||||
|
||||
--Shower Tray
|
||||
|
||||
homedecor.register("shower_tray", {
|
||||
description = S("Shower Tray"),
|
||||
tiles = {
|
||||
"forniture_marble_base_ducha_top.png",
|
||||
"homedecor_marble.png"
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.5, -0.5, -0.5, 0.5, -0.45, 0.5 },
|
||||
{ -0.5, -0.45, -0.5, 0.5, -0.4, -0.45 },
|
||||
{ -0.5, -0.45, 0.45, 0.5, -0.4, 0.5 },
|
||||
{ -0.5, -0.45, -0.45, -0.45, -0.4, 0.45 },
|
||||
{ 0.45, -0.45, -0.45, 0.5, -0.4, 0.45 }
|
||||
},
|
||||
},
|
||||
selection_box = homedecor.nodebox.slab_y(0.1),
|
||||
groups = {cracky=2},
|
||||
sounds = default.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
|
||||
})
|
||||
|
||||
--Shower Head
|
||||
|
||||
|
||||
local sh_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.2, -0.4, -0.05, 0.2, 0.1, 0.5 }
|
||||
}
|
||||
|
||||
homedecor.register("shower_head", {
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_shower_head.obj",
|
||||
tiles = {
|
||||
"homedecor_generic_metal.png",
|
||||
"homedecor_shower_head.png"
|
||||
},
|
||||
inventory_image = "homedecor_shower_head_inv.png",
|
||||
description = S("Shower Head"),
|
||||
groups = {snappy=3},
|
||||
selection_box = sh_cbox,
|
||||
walkable = false,
|
||||
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
|
||||
local particledef = {
|
||||
outlet = { x = 0, y = -0.42, z = 0.1 },
|
||||
velocity_x = { min = -0.15, max = 0.15 },
|
||||
velocity_y = -2,
|
||||
velocity_z = { min = -0.3, max = 0.1 },
|
||||
spread = 0.12
|
||||
}
|
||||
homedecor.start_particle_spawner(pos, node, particledef, "homedecor_shower")
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = function(pos)
|
||||
homedecor.stop_particle_spawner(pos)
|
||||
end
|
||||
})
|
||||
|
||||
homedecor.register("bathtub_clawfoot_brass_taps", {
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_bathtub_clawfoot.obj",
|
||||
tiles = {
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
|
||||
"homedecor_generic_metal_bright.png",
|
||||
"homedecor_generic_metal_bright.png",
|
||||
"homedecor_generic_metal_brass.png",
|
||||
"homedecor_marble.png",
|
||||
"homedecor_bathtub_clawfoot_bottom_inside.png",
|
||||
},
|
||||
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 },
|
||||
},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
homedecor.register("bathtub_clawfoot_chrome_taps", {
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_bathtub_clawfoot.obj",
|
||||
tiles = {
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
|
||||
"homedecor_generic_metal_bright.png",
|
||||
"homedecor_generic_metal_bright.png",
|
||||
"homedecor_generic_metal_bright.png",
|
||||
"homedecor_marble.png",
|
||||
"homedecor_bathtub_clawfoot_bottom_inside.png",
|
||||
},
|
||||
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 },
|
||||
},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
local bs_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -8/16, -8/16, 1/16, 8/16, 8/16, 8/16 }
|
||||
}
|
||||
|
||||
homedecor.register("bathroom_set", {
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_bathroom_set.obj",
|
||||
tiles = {
|
||||
"homedecor_bathroom_set_mirror.png",
|
||||
"homedecor_bathroom_set_tray.png",
|
||||
"homedecor_bathroom_set_toothbrush.png",
|
||||
"homedecor_bathroom_set_cup.png",
|
||||
"homedecor_bathroom_set_toothpaste.png",
|
||||
},
|
||||
inventory_image = "homedecor_bathroom_set_inv.png",
|
||||
description = S("Bathroom sundries set"),
|
||||
groups = {snappy=3},
|
||||
selection_box = bs_cbox,
|
||||
walkable = false,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_alias("3dforniture:toilet", "homedecor:toilet")
|
||||
minetest.register_alias("3dforniture:toilet_open", "homedecor:toilet_open")
|
||||
minetest.register_alias("3dforniture:sink", "homedecor:sink")
|
||||
minetest.register_alias("3dforniture:taps", "homedecor:taps")
|
||||
minetest.register_alias("3dforniture:shower_tray", "homedecor:shower_tray")
|
||||
minetest.register_alias("3dforniture:shower_head", "homedecor:shower_head")
|
||||
minetest.register_alias("3dforniture:table_lamp", "homedecor:table_lamp_off")
|
||||
|
||||
minetest.register_alias("toilet", "homedecor:toilet")
|
||||
minetest.register_alias("sink", "homedecor:sink")
|
||||
minetest.register_alias("taps", "homedecor:taps")
|
||||
minetest.register_alias("shower_tray", "homedecor:shower_tray")
|
||||
minetest.register_alias("shower_head", "homedecor:shower_head")
|
||||
minetest.register_alias("table_lamp", "homedecor:table_lamp_off")
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local function N_(x) return x end
|
||||
|
||||
@ -59,7 +59,6 @@ homedecor.register("bed_regular", {
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
homedecor.unextend_bed(pos)
|
||||
end,
|
||||
on_dig = unifieddyes.on_dig,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local itemname = itemstack:get_name()
|
||||
if itemname == "homedecor:bed_regular" then
|
||||
@ -93,7 +92,6 @@ homedecor.register("bed_extended", {
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
homedecor.unextend_bed(pos)
|
||||
end,
|
||||
on_dig = unifieddyes.on_dig,
|
||||
-- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
-- homedecor.beds_on_rightclick(pos, node, clicker)
|
||||
-- return itemstack
|
||||
@ -130,7 +128,6 @@ homedecor.register("bed_kingsize", {
|
||||
inv:add_item("main", "homedecor:bed_regular 2")
|
||||
end
|
||||
end,
|
||||
on_dig = unifieddyes.on_dig,
|
||||
-- on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
-- homedecor.beds_on_rightclick(pos, node, clicker)
|
||||
-- return itemstack
|
||||
@ -223,7 +220,7 @@ for _, color in ipairs(bedcolors) do
|
||||
end
|
||||
|
||||
minetest.register_lbm({
|
||||
name = ":homedecor:convert_beds",
|
||||
name = "homedecor:convert_beds",
|
||||
label = "Convert homedecor static bed nodes to use param2 color",
|
||||
run_at_every_load = false,
|
||||
nodenames = homedecor.old_bed_nodes,
|
||||
@ -268,126 +265,3 @@ minetest.register_lbm({
|
||||
meta:set_string("dye", "unifieddyes:"..color)
|
||||
end
|
||||
})
|
||||
|
||||
-- crafting
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:nightstand_oak_one_drawer",
|
||||
recipe = {
|
||||
{ "homedecor:drawer_small" },
|
||||
{ "group:wood" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:nightstand_oak_one_drawer",
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:nightstand_oak_two_drawers",
|
||||
recipe = {
|
||||
{ "homedecor:drawer_small" },
|
||||
{ "homedecor:drawer_small" },
|
||||
{ "group:wood" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:nightstand_oak_two_drawers",
|
||||
recipe = {
|
||||
{ "homedecor:nightstand_oak_one_drawer" },
|
||||
{ "homedecor:drawer_small" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:nightstand_oak_two_drawers",
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
--
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:nightstand_mahogany_one_drawer",
|
||||
recipe = {
|
||||
"homedecor:nightstand_oak_one_drawer",
|
||||
"dye:brown",
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:nightstand_mahogany_one_drawer",
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:nightstand_mahogany_two_drawers",
|
||||
recipe = {
|
||||
"homedecor:nightstand_oak_two_drawers",
|
||||
"dye:brown",
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:nightstand_mahogany_two_drawers",
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:bed_regular",
|
||||
recipe = {
|
||||
{ "group:stick", "", "group:stick" },
|
||||
{ "wool:white", "wool:white", "wool:white" },
|
||||
{ "group:wood", "", "group:wood" },
|
||||
},
|
||||
})
|
||||
|
||||
unifieddyes.register_color_craft({
|
||||
output = "homedecor:bed_regular",
|
||||
palette = "wallmounted",
|
||||
type = "shapeless",
|
||||
neutral_node = "homedecor:bed_regular",
|
||||
recipe = {
|
||||
"NEUTRAL_NODE",
|
||||
"MAIN_DYE"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:bed_kingsize",
|
||||
recipe = {
|
||||
{ "homedecor:bed_regular", "homedecor:bed_regular" }
|
||||
},
|
||||
})
|
||||
|
||||
unifieddyes.register_color_craft({
|
||||
output = "homedecor:bed_kingsize",
|
||||
palette = "wallmounted",
|
||||
type = "shapeless",
|
||||
neutral_node = "homedecor:bed_kingsize",
|
||||
recipe = {
|
||||
"NEUTRAL_NODE",
|
||||
"MAIN_DYE"
|
||||
}
|
||||
})
|
||||
|
||||
unifieddyes.register_color_craft({
|
||||
output = "homedecor:bed_kingsize",
|
||||
palette = "wallmounted",
|
||||
type = "shapeless",
|
||||
neutral_node = "homedecor:bed_regular",
|
||||
recipe = {
|
||||
"NEUTRAL_NODE",
|
||||
"NEUTRAL_NODE",
|
||||
"MAIN_DYE"
|
||||
}
|
||||
})
|
@ -1,4 +1,4 @@
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local function N_(x) return x end
|
||||
|
||||
@ -183,30 +183,5 @@ minetest.register_on_player_receive_fields(function(player, form_name, fields)
|
||||
return true
|
||||
end)
|
||||
|
||||
-- crafting
|
||||
|
||||
|
||||
local bookcolors = {
|
||||
"red",
|
||||
"green",
|
||||
"blue",
|
||||
"violet",
|
||||
"grey",
|
||||
"brown"
|
||||
}
|
||||
|
||||
for _, color in ipairs(bookcolors) do
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "homedecor:book_"..color,
|
||||
recipe = {
|
||||
"dye:"..color,
|
||||
"default:book"
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
-- aliases
|
||||
|
||||
minetest.register_alias("homedecor:book", "homedecor:book_grey")
|
||||
minetest.register_alias("homedecor:book_open", "homedecor:book_open_grey")
|
@ -1,6 +1,6 @@
|
||||
-- Nodes that would affect the local temperature e.g. fans, heater, A/C
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
homedecor.register("air_conditioner", {
|
||||
description = S("Air Conditioner"),
|
||||
@ -16,7 +16,7 @@ homedecor.register("air_conditioner", {
|
||||
|
||||
-- fans
|
||||
|
||||
minetest.register_entity(":homedecor:mesh_desk_fan", {
|
||||
minetest.register_entity("homedecor:mesh_desk_fan", {
|
||||
collisionbox = homedecor.nodebox.null,
|
||||
visual = "mesh",
|
||||
mesh = "homedecor_desk_fan.b3d",
|
||||
@ -141,81 +141,3 @@ homedecor.register("radiator", {
|
||||
collision_box = r_cbox,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
-- 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",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "building_blocks:grate", "default:steel_ingot" },
|
||||
{ "default:steel_ingot", "homedecor:fan_blades", "basic_materials:motor" },
|
||||
{ "default:steel_ingot", "basic_materials:motor", "default:steel_ingot" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:air_conditioner",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "building_blocks:grate", "default:steel_ingot" },
|
||||
{ "default:steel_ingot", "basic_materials:motor", "default:steel_ingot" },
|
||||
{ "default:steel_ingot", "basic_materials:motor", "default:steel_ingot" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:ceiling_fan",
|
||||
recipe = {
|
||||
{ "basic_materials:motor" },
|
||||
{ "homedecor:fan_blades" },
|
||||
{ "homedecor:glowlight_small_cube" }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:ceiling_fan",
|
||||
recipe = {
|
||||
{ "basic_materials:motor" },
|
||||
{ "homedecor:fan_blades" },
|
||||
{ "homedecor:glowlight_small_cube" }
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:desk_fan",
|
||||
recipe = {
|
||||
{"default:steel_ingot", "homedecor:fan_blades", "basic_materials:motor"},
|
||||
{"", "default:steel_ingot", ""}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:space_heater",
|
||||
recipe = {
|
||||
{"basic_materials:plastic_sheet", "basic_materials:heating_element", "basic_materials:plastic_sheet"},
|
||||
{"basic_materials:plastic_sheet", "homedecor:fan_blades", "basic_materials:motor"},
|
||||
{"basic_materials:plastic_sheet", "basic_materials:heating_element", "basic_materials:plastic_sheet"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:radiator",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "basic_materials:heating_element", "default:steel_ingot" },
|
||||
{ "basic_materials:ic", "basic_materials:heating_element", "" },
|
||||
{ "default:steel_ingot", "basic_materials:heating_element", "default:steel_ingot" }
|
||||
},
|
||||
})
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local clock_sbox = {
|
||||
type = "fixed",
|
||||
@ -97,55 +97,5 @@ homedecor.register("grandfather_clock", {
|
||||
on_rotate = screwdriver.rotate_simple
|
||||
})
|
||||
|
||||
-- crafting
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:analog_clock_plastic 2",
|
||||
recipe = {
|
||||
{ "basic_materials:plastic_sheet", "dye:black", "basic_materials:plastic_sheet" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:ic", "basic_materials:plastic_sheet" },
|
||||
{ "basic_materials:plastic_sheet", "dye:black", "basic_materials:plastic_sheet" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:analog_clock_wood 2",
|
||||
recipe = {
|
||||
{ "group:stick", "dye:black", "group:stick" },
|
||||
{ "group:stick", "basic_materials:ic", "group:stick" },
|
||||
{ "group:stick", "dye:black", "group:stick" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:digital_clock 2",
|
||||
recipe = {
|
||||
{ "basic_materials:plastic_sheet", "default:paper", "basic_materials:plastic_sheet" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:ic", "basic_materials:plastic_sheet" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:energy_crystal_simple", "basic_materials:plastic_sheet" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:alarm_clock",
|
||||
recipe = {
|
||||
{ "basic_materials:plastic_sheet", "homedecor:speaker_driver", "basic_materials:plastic_sheet" },
|
||||
{ "basic_materials:plastic_sheet", "homedecor:digital_clock", "basic_materials:plastic_sheet" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:energy_crystal_simple", "basic_materials:plastic_sheet" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:grandfather_clock",
|
||||
recipe = {
|
||||
{ "building_blocks:slab_hardwood","homedecor:analog_clock_wood","building_blocks:slab_hardwood" },
|
||||
{ "building_blocks:slab_hardwood","basic_materials:brass_ingot","building_blocks:slab_hardwood" },
|
||||
{ "building_blocks:slab_hardwood","basic_materials:brass_ingot","building_blocks:slab_hardwood" }
|
||||
},
|
||||
})
|
||||
|
||||
-- aliases
|
||||
|
||||
minetest.register_alias("homedecor:grandfather_clock_bottom", "homedecor:grandfather_clock")
|
||||
minetest.register_alias("homedecor:grandfather_clock_top", "air")
|
@ -1,7 +1,7 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
minetest.register_node(":homedecor:cobweb_corner", {
|
||||
minetest.register_node("homedecor:cobweb_corner", {
|
||||
description = S("Cobweb"),
|
||||
drawtype = "torchlike",
|
||||
tiles = { "homedecor_cobweb_torchlike.png" },
|
||||
@ -25,7 +25,7 @@ minetest.register_node(":homedecor:cobweb_corner", {
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node(":homedecor:cobweb_centered", {
|
||||
minetest.register_node("homedecor:cobweb_centered", {
|
||||
description = S("Cobweb"),
|
||||
drawtype = "nodebox",
|
||||
tiles = { "homedecor_cobweb.png" },
|
||||
@ -52,7 +52,7 @@ minetest.register_node(":homedecor:cobweb_centered", {
|
||||
drop = "homedecor:cobweb_corner"
|
||||
})
|
||||
|
||||
minetest.register_node(":homedecor:cobweb_flat", {
|
||||
minetest.register_node("homedecor:cobweb_flat", {
|
||||
description = S("Cobweb"),
|
||||
drawtype = "nodebox",
|
||||
tiles = { "homedecor_cobweb.png" },
|
||||
@ -79,7 +79,7 @@ minetest.register_node(":homedecor:cobweb_flat", {
|
||||
drop = "homedecor:cobweb_corner"
|
||||
})
|
||||
|
||||
minetest.register_node(":homedecor:cobweb_plantlike", {
|
||||
minetest.register_node("homedecor:cobweb_plantlike", {
|
||||
description = S("Cobweb"),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "homedecor_cobweb_plantlike.png" },
|
||||
@ -158,13 +158,13 @@ function homedecor.rotate_cobweb(pos)
|
||||
|
||||
end
|
||||
|
||||
-- crafting
|
||||
-- convert existing cobwebs
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:cobweb_corner 5",
|
||||
recipe = {
|
||||
{ "farming:string", "", "farming:string" },
|
||||
{ "", "farming:string", "" },
|
||||
{ "farming:string", "", "farming:string" }
|
||||
},
|
||||
minetest.register_abm({
|
||||
nodenames = { "homedecor:cobweb" },
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
homedecor.rotate_cobweb(pos)
|
||||
end
|
||||
})
|
@ -1,11 +1,8 @@
|
||||
Most code and textures by Vanessa Ezekowitz.
|
||||
Most code and all textures by Vanessa Ezekowitz.
|
||||
|
||||
Some code copied and modified from the game's default mods (especially
|
||||
doors) and ironzorg's flowers mod.
|
||||
|
||||
Whatever is stated here applies to all homedecor modpack components, as
|
||||
appropriate.
|
||||
|
||||
Licenses:
|
||||
* Door open/close sound by Slanesh on freesound.org
|
||||
http://freesound.org/people/Slanesh/sounds/31768/
|
||||
@ -17,4 +14,3 @@ Licenses:
|
||||
http://www.freesfx.co.uk/sfx/book?p=3
|
||||
* Phone ringing sound by andyt's on http://www.freesfx.co.uk/
|
||||
http://www.freesfx.co.uk/sfx/phone?p=5
|
||||
|
3033
homedecor/crafts.lua
Normal file
19
homedecor/depends.txt
Normal file
@ -0,0 +1,19 @@
|
||||
default
|
||||
basic_materials
|
||||
unifieddyes
|
||||
homedecor_i18n
|
||||
creative
|
||||
currency?
|
||||
building_blocks?
|
||||
signs_lib?
|
||||
moreblocks?
|
||||
technic?
|
||||
dye?
|
||||
bees?
|
||||
bucket?
|
||||
beds?
|
||||
flowers?
|
||||
3d_armor?
|
||||
skinsdb?
|
||||
mesecons?
|
||||
darkage?
|
662
homedecor/doors_and_gates.lua
Normal file
@ -0,0 +1,662 @@
|
||||
-- Node definitions for Homedecor doors
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local function N_(x) return x end
|
||||
|
||||
local m_rules = mesecon and mesecon.rules and mesecon.rules.pplate
|
||||
|
||||
-- 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"
|
||||
},
|
||||
|
||||
{ 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"
|
||||
},
|
||||
usealpha = 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",
|
||||
}
|
||||
},
|
||||
|
||||
{ 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",
|
||||
}
|
||||
},
|
||||
|
||||
{ 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"
|
||||
},
|
||||
|
||||
{ name = "bedroom",
|
||||
description = N_("White Bedroom Door (@1 opening)"),
|
||||
mesh = "homedecor_door_plain.obj"
|
||||
},
|
||||
|
||||
{ name = "wrought_iron",
|
||||
description = N_("Wrought Iron Gate/Door (@1 opening)"),
|
||||
mesh = "homedecor_door_wrought_iron.obj"
|
||||
},
|
||||
|
||||
{ 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",
|
||||
},
|
||||
usealpha = true
|
||||
},
|
||||
|
||||
{ name = "woodglass2",
|
||||
description = N_("Wooden door with glass insert, type 2 (@1 opening)"),
|
||||
mesh = "homedecor_door_plain.obj",
|
||||
usealpha = true
|
||||
},
|
||||
}
|
||||
|
||||
local def_selbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, 0.375, 0.5, 1.5, 0.5 }
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
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)
|
||||
|
||||
end
|
||||
|
||||
-- Gates
|
||||
|
||||
local gate_list = {
|
||||
{ "picket", S("Unpainted Picket Fence Gate") },
|
||||
{ "picket_white", S("White Picket Fence Gate") },
|
||||
{ "barbed_wire", S("Barbed Wire Fence Gate") },
|
||||
{ "chainlink", S("Chainlink Fence Gate") },
|
||||
{ "half_door", S("\"Half\" Door") },
|
||||
{ "half_door_white", S("\"Half\" Door (white)") }
|
||||
}
|
||||
|
||||
local gate_models_closed = {
|
||||
{{ -0.5, -0.5, 0.498, 0.5, 0.5, 0.498 }},
|
||||
|
||||
{{ -0.5, -0.5, 0.498, 0.5, 0.5, 0.498 }},
|
||||
|
||||
{{ -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, -- left post
|
||||
{ 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
|
||||
{ -8/16, 7/16, 13/32, 8/16, 8/16, 15/32 }, -- top piece
|
||||
{ -8/16, -8/16, 13/32, 8/16, -7/16, 15/32 }, -- bottom piece
|
||||
{ -6/16, -8/16, 7/16, 6/16, 8/16, 7/16 }}, -- the wire
|
||||
|
||||
{{ -8/16, -8/16, 6/16, -7/16, 8/16, 8/16 }, -- left post
|
||||
{ 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
|
||||
{ -8/16, 7/16, 13/32, 8/16, 8/16, 15/32 }, -- top piece
|
||||
{ -8/16, -8/16, 13/32, 8/16, -7/16, 15/32 }, -- bottom piece
|
||||
{ -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }, -- the chainlink itself
|
||||
{ -8/16, -3/16, 6/16, -6/16, 3/16, 8/16 }}, -- the lump representing the lock
|
||||
|
||||
{{ -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, -- the whole door :P
|
||||
|
||||
{{ -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, -- the whole door :P
|
||||
|
||||
}
|
||||
|
||||
local gate_models_open = {
|
||||
{{ 0.498, -0.5, -0.5, 0.498, 0.5, 0.5 }},
|
||||
|
||||
{{ 0.498, -0.5, -0.5, 0.498, 0.5, 0.5 }},
|
||||
|
||||
{{ 6/16, -8/16, -8/16, 8/16, 8/16, -6/16 }, -- left post
|
||||
{ 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
|
||||
{ 13/32, 7/16, -8/16, 15/32, 8/16, 8/16 }, -- top piece
|
||||
{ 13/32, -8/16, -8/16, 15/32, -7/16, 8/16 }, -- bottom piece
|
||||
{ 7/16, -8/16, -6/16, 7/16, 8/16, 6/16 }}, -- the wire
|
||||
|
||||
{{ 6/16, -8/16, -8/16, 8/16, 8/16, -7/16 }, -- left post
|
||||
{ 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
|
||||
{ 13/32, 7/16, -8/16, 15/32, 8/16, 8/16 }, -- top piece
|
||||
{ 13/32, -8/16, -8/16, 15/32, -7/16, 8/16 }, -- bottom piece
|
||||
{ 7/16, -8/16, -8/16, 7/16, 8/16, 8/16 }, -- the chainlink itself
|
||||
{ 6/16, -3/16, -8/16, 8/16, 3/16, -6/16 }}, -- the lump representing the lock
|
||||
|
||||
{{ 6/16, -8/16, -8/16, 8/16, 8/16, 8/16 }}, -- the whole door :P
|
||||
|
||||
{{ 6/16, -8/16, -8/16, 8/16, 8/16, 8/16 }}, -- the whole door :P
|
||||
}
|
||||
|
||||
for i, g in ipairs(gate_list) do
|
||||
|
||||
local gate, gatedesc = unpack(g)
|
||||
|
||||
local tiles = {
|
||||
"homedecor_gate_"..gate.."_tb.png",
|
||||
"homedecor_gate_"..gate.."_tb.png",
|
||||
"homedecor_gate_"..gate.."_lr.png",
|
||||
"homedecor_gate_"..gate.."_lr.png",
|
||||
"homedecor_gate_"..gate.."_fb.png^[transformFX",
|
||||
"homedecor_gate_"..gate.."_fb.png"
|
||||
}
|
||||
|
||||
if gate == "barbed_wire" then
|
||||
tiles = {
|
||||
"homedecor_gate_barbed_wire_edges.png",
|
||||
"homedecor_gate_barbed_wire_edges.png",
|
||||
"homedecor_gate_barbed_wire_edges.png",
|
||||
"homedecor_gate_barbed_wire_edges.png",
|
||||
"homedecor_gate_barbed_wire_fb.png^[transformFX",
|
||||
"homedecor_gate_barbed_wire_fb.png"
|
||||
}
|
||||
end
|
||||
|
||||
if gate == "picket" or gate == "picket_white" then
|
||||
tiles = {
|
||||
"homedecor_blanktile.png",
|
||||
"homedecor_blanktile.png",
|
||||
"homedecor_blanktile.png",
|
||||
"homedecor_blanktile.png",
|
||||
"homedecor_gate_"..gate.."_back.png",
|
||||
"homedecor_gate_"..gate.."_front.png"
|
||||
}
|
||||
end
|
||||
|
||||
local def = {
|
||||
drawtype = "nodebox",
|
||||
description = gatedesc,
|
||||
tiles = tiles,
|
||||
paramtype = "light",
|
||||
groups = {snappy=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype2 = "facedir",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = gate_models_closed[i]
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
homedecor.flip_gate(pos, node, clicker, gate, "closed")
|
||||
return itemstack
|
||||
end,
|
||||
mesecons = {
|
||||
effector = {
|
||||
rules = m_rules,
|
||||
action_on = function(pos,node) homedecor.flip_gate(pos,node,nil,gate, "closed") end
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-- gates when placed default to closed, closed.
|
||||
|
||||
minetest.register_node("homedecor:gate_"..gate.."_closed", def)
|
||||
|
||||
-- this is either a terrible idea or a great one
|
||||
def = table.copy(def)
|
||||
def.groups.not_in_creative_inventory = 1
|
||||
def.selection_box.fixed = { 0.4, -0.5, -0.5, 0.5, 0.5, 0.5 }
|
||||
def.node_box.fixed = gate_models_open[i]
|
||||
def.tiles = {
|
||||
tiles[1].."^[transformR90",
|
||||
tiles[2].."^[transformR270",
|
||||
tiles[6],
|
||||
tiles[5],
|
||||
tiles[4],
|
||||
tiles[3]
|
||||
}
|
||||
def.drop = "homedecor:gate_"..gate.."_closed"
|
||||
def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
homedecor.flip_gate(pos, node, clicker, gate, "open")
|
||||
return itemstack
|
||||
end
|
||||
def.mesecons.effector = {
|
||||
rules = m_rules,
|
||||
action_off = function(pos,node) homedecor.flip_gate(pos,node,nil,gate, "open") end
|
||||
}
|
||||
|
||||
minetest.register_node("homedecor:gate_"..gate.."_open", def)
|
||||
end
|
||||
|
||||
minetest.register_alias("homedecor:fence_barbed_wire_gate_open", "homedecor:gate_barbed_wire_open")
|
||||
minetest.register_alias("homedecor:fence_barbed_wire_gate_closed", "homedecor:gate_barbed_wire_closed")
|
||||
minetest.register_alias("homedecor:fence_chainlink_gate_open", "homedecor:gate_chainlink_open")
|
||||
minetest.register_alias("homedecor:fence_chainlink_gate_closed", "homedecor:gate_chainlink_closed")
|
||||
minetest.register_alias("homedecor:fence_picket_gate_open", "homedecor:gate_picket_open")
|
||||
minetest.register_alias("homedecor:fence_picket_gate_closed", "homedecor:gate_picket_closed")
|
||||
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"
|
||||
else
|
||||
gateresult = "homedecor:gate_"..gate.."_closed"
|
||||
end
|
||||
|
||||
local def = {name=gateresult, param2=fdir}
|
||||
|
||||
addDoorNode(pos, def, isClosed)
|
||||
|
||||
-- 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}
|
||||
local nodeabove = minetest.get_node(above)
|
||||
local nodebelow = minetest.get_node(below)
|
||||
|
||||
if string.find(nodeabove.name, "homedecor:gate_"..gate) then
|
||||
addDoorNode(above, def, isClosed)
|
||||
end
|
||||
|
||||
if string.find(nodebelow.name, "homedecor:gate_"..gate) then
|
||||
addDoorNode(below, def, isClosed)
|
||||
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(),
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:tatami_mat", {
|
||||
tiles = {
|
||||
"homedecor_tatami.png",
|
||||
"homedecor_tatami.png",
|
||||
"homedecor_tatami.png",
|
||||
"homedecor_tatami.png",
|
||||
"homedecor_tatami.png",
|
||||
"homedecor_tatami.png"
|
||||
},
|
||||
description = S("Japanese tatami"),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
groups = {snappy=3},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
homedecor.register("door_japanese_closed", {
|
||||
description = S("Japanese-style door"),
|
||||
inventory_image = "homedecor_door_japanese_inv.png",
|
||||
tiles = {
|
||||
homedecor.lux_wood,
|
||||
"homedecor_japanese_paper.png"
|
||||
},
|
||||
mesh = "homedecor_door_japanese_closed.obj",
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0, 0.5, 1.5, 0.0625},
|
||||
},
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.0625, 0.5, 1.5, 0},
|
||||
},
|
||||
expand = { top = "placeholder" },
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
minetest.set_node(pos, {name = "homedecor:door_japanese_open", param2 = node.param2})
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
homedecor.register("door_japanese_open", {
|
||||
tiles = {
|
||||
homedecor.lux_wood,
|
||||
"homedecor_japanese_paper.png"
|
||||
},
|
||||
mesh = "homedecor_door_japanese_open.obj",
|
||||
groups = { snappy = 3, not_in_creative_inventory = 1 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_rotate = screwdriver.disallow,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1.5, -0.5, -0.0625, 0.5, 1.5, 0},
|
||||
},
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1.5, -0.5, -0.0625, -0.5, 1.5, 0},
|
||||
},
|
||||
expand = { top = "placeholder" },
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
minetest.set_node(pos, {name = "homedecor:door_japanese_closed", param2 = node.param2})
|
||||
return itemstack
|
||||
end,
|
||||
drop = "homedecor:door_japanese_closed",
|
||||
})
|
||||
|
||||
minetest.register_alias("homedecor:jpn_door_top", "air")
|
||||
minetest.register_alias("homedecor:jpn_door_bottom", "homedecor:door_japanese_closed")
|
||||
|
||||
minetest.register_alias("homedecor:jpn_door_top_open", "air")
|
||||
minetest.register_alias("homedecor:jpn_door_bottom_open", "homedecor:door_japanese_open")
|
||||
|
||||
minetest.register_alias("homedecor:door_glass_right", "doors:door_glass_b")
|
||||
minetest.register_alias("homedecor:door_glass_left", "doors:door_glass_a")
|
81
homedecor/electrics.lua
Normal file
@ -0,0 +1,81 @@
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
homedecor.register("power_outlet", {
|
||||
description = S("Power Outlet"),
|
||||
tiles = {
|
||||
"homedecor_outlet_edges.png",
|
||||
"homedecor_outlet_edges.png",
|
||||
"homedecor_outlet_edges.png",
|
||||
"homedecor_outlet_edges.png",
|
||||
"homedecor_outlet_back.png",
|
||||
"homedecor_outlet_edges.png"
|
||||
},
|
||||
inventory_image = "homedecor_outlet_inv.png",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.125, -0.3125, 0.4375, 0.125, 0, 0.5},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.1875, -0.375, 0.375, 0.1875, 0.0625, 0.5},
|
||||
}
|
||||
},
|
||||
groups = {cracky=3,dig_immediate=2},
|
||||
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 },
|
||||
|
||||
}
|
||||
},
|
||||
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
|
||||
})
|
||||
|
||||
|
||||
homedecor.register("doorbell", {
|
||||
tiles = { "homedecor_doorbell.png" },
|
||||
inventory_image = "homedecor_doorbell_inv.png",
|
||||
description = S("Doorbell"),
|
||||
groups = {snappy=3},
|
||||
walkable = false,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.0625, 0, 0.46875, 0.0625, 0.1875, 0.5}, -- NodeBox1
|
||||
{-0.03125, 0.0625, 0.45, 0.03125, 0.125, 0.4675}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
minetest.sound_play("homedecor_doorbell", {
|
||||
pos = pos,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 15
|
||||
})
|
||||
end
|
||||
})
|
143
homedecor/electronics.lua
Normal file
@ -0,0 +1,143 @@
|
||||
-- Various home electronics
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
homedecor.register("speaker", {
|
||||
description = S("Large Stereo Speaker"),
|
||||
mesh="homedecor_speaker_large.obj",
|
||||
tiles = {
|
||||
"homedecor_speaker_sides.png",
|
||||
"homedecor_speaker_front.png"
|
||||
},
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
minetest.set_node(pos, {name = "homedecor:speaker_open", param2 = node.param2})
|
||||
end
|
||||
})
|
||||
|
||||
homedecor.register("speaker_open", {
|
||||
description = S("Large Stereo Speaker, open front"),
|
||||
mesh="homedecor_speaker_large_open.obj",
|
||||
tiles = {
|
||||
"homedecor_speaker_sides.png",
|
||||
"homedecor_speaker_driver.png",
|
||||
"homedecor_speaker_open_front.png",
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_black }
|
||||
},
|
||||
groups = { snappy = 3, not_in_creative_inventory=1 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
minetest.set_node(pos, {name = "homedecor:speaker", param2 = node.param2})
|
||||
end
|
||||
})
|
||||
|
||||
local spk_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -3/16, -8/16, 1/16, 3/16, -2/16, 7/16 }
|
||||
}
|
||||
|
||||
homedecor.register("speaker_small", {
|
||||
description = S("Small Surround Speaker"),
|
||||
mesh="homedecor_speaker_small.obj",
|
||||
tiles = {
|
||||
"homedecor_speaker_sides.png",
|
||||
"homedecor_speaker_front.png"
|
||||
},
|
||||
selection_box = spk_cbox,
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
homedecor.register("stereo", {
|
||||
description = S("Stereo Receiver"),
|
||||
tiles = { 'homedecor_stereo_top.png',
|
||||
'homedecor_stereo_bottom.png',
|
||||
'homedecor_stereo_left.png^[transformFX',
|
||||
'homedecor_stereo_left.png',
|
||||
'homedecor_stereo_back.png',
|
||||
'homedecor_stereo_front.png'},
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
homedecor.register("projection_screen", {
|
||||
description = S("Projection Screen Material"),
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_projection_screen.png' },
|
||||
wield_image = 'homedecor_projection_screen_inv.png',
|
||||
inventory_image = 'homedecor_projection_screen_inv.png',
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
paramtype2 = 'wallmounted',
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
--wall_side = = <default>
|
||||
},
|
||||
})
|
||||
|
||||
homedecor.register("television", {
|
||||
description = S("Small CRT Television"),
|
||||
tiles = { 'homedecor_television_top.png',
|
||||
'homedecor_television_bottom.png',
|
||||
'homedecor_television_left.png^[transformFX',
|
||||
'homedecor_television_left.png',
|
||||
'homedecor_television_back.png',
|
||||
{ name="homedecor_television_front_animated.png",
|
||||
animation={
|
||||
type="vertical_frames",
|
||||
aspect_w=16,
|
||||
aspect_h=16,
|
||||
length=80.0
|
||||
}
|
||||
}
|
||||
},
|
||||
light_source = default.LIGHT_MAX - 1,
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
homedecor.register("dvd_vcr", {
|
||||
description = S("DVD and VCR"),
|
||||
tiles = {
|
||||
"homedecor_dvdvcr_top.png",
|
||||
"homedecor_dvdvcr_bottom.png",
|
||||
"homedecor_dvdvcr_sides.png",
|
||||
"homedecor_dvdvcr_sides.png^[transformFX",
|
||||
"homedecor_dvdvcr_back.png",
|
||||
"homedecor_dvdvcr_front.png",
|
||||
},
|
||||
inventory_image = "homedecor_dvdvcr_inv.png",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125, -0.5, -0.25, 0.3125, -0.375, 0.1875},
|
||||
{-0.25, -0.5, -0.25, 0.25, -0.1875, 0.125},
|
||||
}
|
||||
},
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
local tel_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.1875, 0.25, -0.21, 0.15 }
|
||||
}
|
||||
|
||||
homedecor.register("telephone", {
|
||||
mesh = "homedecor_telephone.obj",
|
||||
tiles = {
|
||||
"homedecor_telephone_dial.png",
|
||||
"homedecor_telephone_base.png",
|
||||
"homedecor_telephone_handset.png",
|
||||
"homedecor_telephone_cord.png",
|
||||
},
|
||||
inventory_image = "homedecor_telephone_inv.png",
|
||||
description = S("Telephone"),
|
||||
groups = {snappy=3},
|
||||
selection_box = tel_cbox,
|
||||
walkable = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local function N_(x) return x end
|
||||
|
||||
@ -34,6 +34,99 @@ homedecor.register("barbecue", {
|
||||
|
||||
minetest.register_alias("homedecor:barbecue_meat", "air")
|
||||
|
||||
local bl1_sbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.25, 1.5, 0.5, 0.5 }
|
||||
}
|
||||
|
||||
local bl1_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.25, 1.5, 0, 0.5 },
|
||||
{-0.5, -0.5, 0.45, 1.5, 0.5, 0.5 },
|
||||
}
|
||||
}
|
||||
|
||||
homedecor.register("bench_large_1", {
|
||||
mesh = "homedecor_bench_large_1.obj",
|
||||
tiles = {
|
||||
"homedecor_generic_wood_old.png",
|
||||
"homedecor_generic_metal_wrought_iron.png"
|
||||
},
|
||||
description = S("Garden Bench (style 1)"),
|
||||
inventory_image = "homedecor_bench_large_1_inv.png",
|
||||
groups = { snappy = 3 },
|
||||
expand = { right="placeholder" },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
selection_box = bl1_sbox,
|
||||
node_box = bl1_cbox,
|
||||
on_rotate = screwdriver.disallow
|
||||
})
|
||||
|
||||
minetest.register_alias("homedecor:bench_large_1_left", "homedecor:bench_large_1")
|
||||
minetest.register_alias("homedecor:bench_large_1_right", "air")
|
||||
|
||||
local bl2_sbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.25, 1.5, 0.5, 0.5 }
|
||||
}
|
||||
|
||||
local bl2_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.25, 1.5, 0, 0.5 },
|
||||
{-0.5, -0.5, 0.45, 1.5, 0.5, 0.5 },
|
||||
}
|
||||
}
|
||||
|
||||
homedecor.register("bench_large_2", {
|
||||
description = S("Garden Bench (style 2)"),
|
||||
mesh = "homedecor_bench_large_2.obj",
|
||||
tiles = { "homedecor_generic_wood_old.png" },
|
||||
inventory_image = "homedecor_bench_large_2_inv.png",
|
||||
groups = {snappy=3},
|
||||
selection_box = bl2_sbox,
|
||||
node_box = bl2_cbox,
|
||||
expand = { right="placeholder" },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_rotate = screwdriver.disallow
|
||||
})
|
||||
|
||||
minetest.register_alias("homedecor:bench_large_2_left", "homedecor:bench_large_2")
|
||||
minetest.register_alias("homedecor:bench_large_2_right", "air")
|
||||
|
||||
local dc_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 1 }
|
||||
}
|
||||
|
||||
homedecor.register("deckchair", {
|
||||
mesh = "homedecor_deckchair.obj",
|
||||
tiles = {"homedecor_deckchair.png"},
|
||||
description = S("Deck Chair"),
|
||||
groups = { snappy = 3 },
|
||||
expand = { forward="placeholder" },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
selection_box = dc_cbox,
|
||||
collision_box = dc_cbox,
|
||||
on_rotate = screwdriver.disallow
|
||||
})
|
||||
|
||||
minetest.register_alias("homedecor:deckchair_foot", "homedecor:deckchair")
|
||||
minetest.register_alias("homedecor:deckchair_head", "air")
|
||||
|
||||
homedecor.register("deckchair_striped_blue", {
|
||||
mesh = "homedecor_deckchair.obj",
|
||||
tiles = {"homedecor_deckchair_striped_blue.png"},
|
||||
description = S("Deck Chair (blue striped)"),
|
||||
groups = { snappy = 3 },
|
||||
expand = { forward="placeholder" },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
selection_box = dc_cbox,
|
||||
collision_box = dc_cbox,
|
||||
on_rotate = screwdriver.disallow
|
||||
})
|
||||
|
||||
homedecor.register("doghouse", {
|
||||
mesh = "homedecor_doghouse.obj",
|
||||
tiles = {
|
||||
@ -54,6 +147,21 @@ homedecor.register("doghouse", {
|
||||
minetest.register_alias("homedecor:doghouse_roof", "air")
|
||||
minetest.register_alias("homedecor:doghouse_base", "homedecor:doghouse")
|
||||
|
||||
homedecor.register("simple_bench", {
|
||||
tiles = { "homedecor_generic_wood_old.png" },
|
||||
description = S("Simple Bench"),
|
||||
groups = {snappy=3},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.15, 0, 0.5, -0.05, 0.4},
|
||||
{-0.4, -0.5, 0.1, -0.3, -0.15, 0.3},
|
||||
{ 0.3, -0.5, 0.1, 0.4, -0.15, 0.3},
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
homedecor.register("stonepath", {
|
||||
description = S("Garden stone path"),
|
||||
tiles = {
|
||||
@ -259,7 +367,7 @@ homedecor.shrub_colors = {
|
||||
local shrub_cbox = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
|
||||
|
||||
for _, color in ipairs(homedecor.shrub_colors) do
|
||||
minetest.register_node(":homedecor:shrubbery_large_"..color, {
|
||||
minetest.register_node("homedecor:shrubbery_large_"..color, {
|
||||
description = S("Shrubbery (large, @1)", S(color)),
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_cube.obj",
|
||||
@ -270,7 +378,7 @@ for _, color in ipairs(homedecor.shrub_colors) do
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node(":homedecor:shrubbery_"..color, {
|
||||
minetest.register_node("homedecor:shrubbery_"..color, {
|
||||
description = S("Shrubbery (@1)", S(color)),
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_shrubbery.obj",
|
||||
@ -288,186 +396,6 @@ for _, color in ipairs(homedecor.shrub_colors) do
|
||||
})
|
||||
end
|
||||
|
||||
-- crafting
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:chimney 2",
|
||||
recipe = {
|
||||
{ "default:clay_brick", "", "default:clay_brick" },
|
||||
{ "default:clay_brick", "", "default:clay_brick" },
|
||||
{ "default:clay_brick", "", "default:clay_brick" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:doghouse",
|
||||
recipe = {
|
||||
{"homedecor:shingles_terracotta", "homedecor:shingles_terracotta", "homedecor:shingles_terracotta"},
|
||||
{"group:wood", "", "group:wood"},
|
||||
{"group:wood", "building_blocks:terrycloth_towel", "group:wood"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:well",
|
||||
recipe = {
|
||||
{ "homedecor:shingles_wood", "homedecor:shingles_wood", "homedecor:shingles_wood" },
|
||||
{ "group:wood", "group:stick", "group:wood" },
|
||||
{ "group:stone", "", "group:stone" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:stonepath 16",
|
||||
recipe = {
|
||||
{ "stairs:slab_stone","","stairs:slab_stone" },
|
||||
{ "","stairs:slab_stone","" },
|
||||
{ "stairs:slab_stone","","stairs:slab_stone" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:stonepath 16",
|
||||
recipe = {
|
||||
{ "moreblocks:slab_stone","","moreblocks:slab_stone" },
|
||||
{ "","moreblocks:slab_stone","" },
|
||||
{ "moreblocks:slab_stone","","moreblocks:slab_stone" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:stonepath 3",
|
||||
recipe = {
|
||||
{ "moreblocks:micro_stone_1","","moreblocks:micro_stone_1" },
|
||||
{ "","moreblocks:micro_stone_1","" },
|
||||
{ "moreblocks:micro_stone_1","","moreblocks:micro_stone_1" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:barbecue",
|
||||
recipe = {
|
||||
{ "","homedecor:fence_chainlink","" },
|
||||
{ "default:steel_ingot","fake_fire:embers","default:steel_ingot" },
|
||||
{ "basic_materials:steel_bar","default:steel_ingot","basic_materials:steel_bar" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:swing",
|
||||
recipe = {
|
||||
{ "farming:string","","farming:string" },
|
||||
{ "farming:string","","farming:string" },
|
||||
{ "farming:string","stairs:slab_wood","farming:string" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:swing",
|
||||
recipe = {
|
||||
{ "farming:string","","farming:string" },
|
||||
{ "farming:string","","farming:string" },
|
||||
{ "farming:string","moreblocks:slab_wood","farming:string" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:swing",
|
||||
recipe = {
|
||||
{ "farming:string","","farming:string" },
|
||||
{ "farming:string","","farming:string" },
|
||||
{ "farming:string","moreblocks:panel_wood_1","farming:string" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:lattice_wood 8",
|
||||
recipe = {
|
||||
{"group:stick", "group:wood", "group:stick"},
|
||||
{"group:wood", "", "group:wood"},
|
||||
{"group:stick", "group:wood", "group:stick"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:lattice_white_wood 8",
|
||||
recipe = {
|
||||
{"group:stick", "group:wood", "group:stick"},
|
||||
{"group:wood", "dye:white", "group:wood"},
|
||||
{"group:stick", "group:wood", "group:stick"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:lattice_wood_vegetal 8",
|
||||
recipe = {
|
||||
{"group:stick", "group:wood", "group:stick"},
|
||||
{"group:wood", "group:leaves", "group:wood"},
|
||||
{"group:stick", "group:wood", "group:stick"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:lattice_white_wood_vegetal 8",
|
||||
recipe = {
|
||||
{"group:stick", "group:wood", "group:stick"},
|
||||
{"group:wood", "group:leaves", "group:wood"},
|
||||
{"group:stick", "dye:white", "group:stick"},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:shrubbery_green 3",
|
||||
recipe = {
|
||||
{ "group:leaves", "group:leaves", "group:leaves" },
|
||||
{ "group:leaves", "group:leaves", "group:leaves" },
|
||||
{ "group:stick", "group:stick", "group:stick" }
|
||||
}
|
||||
})
|
||||
|
||||
for _, color in ipairs(homedecor.shrub_colors) do
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "homedecor:shrubbery_large_"..color,
|
||||
recipe = {
|
||||
"homedecor:shrubbery_"..color
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "homedecor:shrubbery_"..color,
|
||||
recipe = {
|
||||
"homedecor:shrubbery_large_"..color
|
||||
}
|
||||
})
|
||||
|
||||
if color ~= "green" then
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "homedecor:shrubbery_large_"..color,
|
||||
recipe = {
|
||||
"homedecor:shrubbery_large_green",
|
||||
"dye:"..color
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "homedecor:shrubbery_"..color,
|
||||
recipe = {
|
||||
"homedecor:shrubbery_green",
|
||||
"dye:"..color
|
||||
}
|
||||
})
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
-- aliases
|
||||
|
||||
minetest.register_alias("homedecor:well_top", "air")
|
||||
minetest.register_alias("homedecor:well_base", "homedecor:well")
|
||||
|
@ -1,6 +1,20 @@
|
||||
-- This file adds fences of various types
|
||||
|
||||
local S = homedecor.gettext
|
||||
local signs_modpath = minetest.get_modpath("signs_lib")
|
||||
|
||||
local sign_post_model = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.25, -0.1875, 0.4375, 0.375, -0.125},
|
||||
{-0.125, -0.5, -0.125, 0.125, 0.5, 0.125},
|
||||
}
|
||||
}
|
||||
|
||||
if signs_modpath then
|
||||
sign_post_model = signs_lib.sign_post_model.nodebox
|
||||
end
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local materials = {
|
||||
{ S("brass"), "brass" },
|
||||
@ -9,17 +23,43 @@ local materials = {
|
||||
|
||||
for _, m in ipairs(materials) do
|
||||
|
||||
local desc, name = unpack(m)
|
||||
local desc, name = unpack(m)
|
||||
|
||||
homedecor.register("fence_"..name, {
|
||||
description = S("Fence/railing (@1)", desc),
|
||||
drawtype = "fencelike",
|
||||
tiles = {"homedecor_generic_metal_"..name..".png"},
|
||||
inventory_image = "homedecor_fence_"..name..".png",
|
||||
selection_box = homedecor.nodebox.bar_y(1/7),
|
||||
groups = {snappy=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
homedecor.register("fence_"..name, {
|
||||
description = S("Fence/railing (@1)", desc),
|
||||
drawtype = "fencelike",
|
||||
tiles = {"homedecor_generic_metal_"..name..".png"},
|
||||
inventory_image = "homedecor_fence_"..name..".png",
|
||||
selection_box = homedecor.nodebox.bar_y(1/7),
|
||||
groups = {snappy=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
-- brass/wrought iron with signs:
|
||||
|
||||
homedecor.register("fence_"..name.."_with_sign", {
|
||||
description = S("Fence/railing with sign (@1)", desc),
|
||||
tiles = {
|
||||
"homedecor_sign_"..name.."_post_top.png",
|
||||
"homedecor_sign_"..name.."_post_bottom.png",
|
||||
"homedecor_sign_"..name.."_post_side.png",
|
||||
"homedecor_sign_"..name.."_post_side.png",
|
||||
"homedecor_sign_"..name.."_post_back.png",
|
||||
"homedecor_sign_"..name.."_post_front.png",
|
||||
},
|
||||
wield_image = "homedecor_sign_"..name.."_post.png",
|
||||
node_box = sign_post_model,
|
||||
groups = {snappy=3,not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sunlight_propagates = true,
|
||||
drop = {
|
||||
max_items = 2,
|
||||
items = {
|
||||
{ items = { "default:sign_wall" }},
|
||||
{ items = { "homedecor:fence_"..name }},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
@ -263,193 +303,7 @@ homedecor.register("fence_wrought_iron_2_corner", {
|
||||
},
|
||||
})
|
||||
|
||||
-- insert the old wood signs-on-metal-fences into signs_lib's conversion LBM
|
||||
if minetest.get_modpath("signs_lib") then
|
||||
table.insert(signs_lib.old_fenceposts_with_signs, "homedecor:fence_brass_with_sign")
|
||||
signs_lib.old_fenceposts["homedecor:fence_brass_with_sign"] = "homedecor:fence_brass"
|
||||
signs_lib.old_fenceposts_replacement_signs["homedecor:fence_brass_with_sign"] = "default:sign_wall_wood_onpole"
|
||||
|
||||
table.insert(signs_lib.old_fenceposts_with_signs, "homedecor:fence_wrought_iron_with_sign")
|
||||
signs_lib.old_fenceposts["homedecor:fence_wrought_iron_with_sign"] = "homedecor:fence_wrought_iron"
|
||||
signs_lib.old_fenceposts_replacement_signs["homedecor:fence_wrought_iron_with_sign"] = "default:sign_wall_wood_onpole"
|
||||
if signs_modpath then
|
||||
signs_lib.register_fence_with_sign("homedecor:fence_brass", "homedecor:fence_brass_with_sign")
|
||||
signs_lib.register_fence_with_sign("homedecor:fence_wrought_iron", "homedecor:fence_wrought_iron_with_sign")
|
||||
end
|
||||
|
||||
-- crafting
|
||||
|
||||
-- Brass/wrought iron fences
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:fence_brass 6",
|
||||
recipe = {
|
||||
{ "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" },
|
||||
{ "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:fence_wrought_iron 6",
|
||||
recipe = {
|
||||
{ "default:iron_lump","default:iron_lump","default:iron_lump" },
|
||||
{ "default:iron_lump","default:iron_lump","default:iron_lump" },
|
||||
},
|
||||
})
|
||||
|
||||
-- other types of fences
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:fence_wrought_iron_2 4",
|
||||
recipe = {
|
||||
{ "homedecor:pole_wrought_iron", "default:iron_lump" },
|
||||
{ "homedecor:pole_wrought_iron", "default:iron_lump" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:fence_wrought_iron_2_corner",
|
||||
recipe = {
|
||||
"homedecor:fence_wrought_iron_2",
|
||||
"homedecor:fence_wrought_iron_2"
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:fence_wrought_iron_2 2",
|
||||
recipe = {
|
||||
"homedecor:fence_wrought_iron_2_corner",
|
||||
},
|
||||
})
|
||||
|
||||
--
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:fence_picket 6",
|
||||
recipe = {
|
||||
{ "group:stick", "group:stick", "group:stick" },
|
||||
{ "group:stick", "", "group:stick" },
|
||||
{ "group:stick", "group:stick", "group:stick" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:fence_picket_corner",
|
||||
recipe = {
|
||||
"homedecor:fence_picket",
|
||||
"homedecor:fence_picket"
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:fence_picket 2",
|
||||
recipe = {
|
||||
"homedecor:fence_picket_corner"
|
||||
},
|
||||
})
|
||||
|
||||
--
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:fence_picket_white 6",
|
||||
recipe = {
|
||||
{ "group:stick", "group:stick", "group:stick" },
|
||||
{ "group:stick", "dye:white", "group:stick" },
|
||||
{ "group:stick", "group:stick", "group:stick" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:fence_picket_corner_white",
|
||||
recipe = {
|
||||
"homedecor:fence_picket_white",
|
||||
"homedecor:fence_picket_white"
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:fence_picket_white 2",
|
||||
recipe = {
|
||||
"homedecor:fence_picket_corner_white"
|
||||
},
|
||||
})
|
||||
|
||||
--
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:fence_privacy 6",
|
||||
recipe = {
|
||||
{ "group:wood", "group:stick", "group:wood" },
|
||||
{ "group:wood", "", "group:wood" },
|
||||
{ "group:wood", "group:stick", "group:wood" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:fence_privacy_corner",
|
||||
recipe = {
|
||||
"homedecor:fence_privacy",
|
||||
"homedecor:fence_privacy"
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:fence_privacy 2",
|
||||
recipe = {
|
||||
"homedecor:fence_privacy_corner"
|
||||
},
|
||||
})
|
||||
|
||||
--
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:fence_barbed_wire 6",
|
||||
recipe = {
|
||||
{ "group:stick", "basic_materials:steel_wire", "group:stick" },
|
||||
{ "group:stick", "", "group:stick" },
|
||||
{ "group:stick", "basic_materials:steel_wire", "group:stick" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:fence_barbed_wire_corner",
|
||||
recipe = { "homedecor:fence_barbed_wire", "homedecor:fence_barbed_wire" },
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:fence_barbed_wire 2",
|
||||
recipe = { "homedecor:fence_barbed_wire_corner" },
|
||||
})
|
||||
|
||||
--
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:fence_chainlink 9",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
|
||||
{ "basic_materials:steel_wire", "basic_materials:steel_wire", "default:steel_ingot" },
|
||||
{ "basic_materials:steel_wire", "basic_materials:steel_wire", "default:steel_ingot" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:fence_chainlink_corner",
|
||||
recipe = { "homedecor:fence_chainlink", "homedecor:fence_chainlink" },
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:fence_chainlink 2",
|
||||
recipe = { "homedecor:fence_chainlink_corner" },
|
||||
})
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
homedecor.register("coatrack_wallmount", {
|
||||
tiles = { homedecor.plain_wood },
|
||||
@ -67,55 +67,3 @@ for _, mat in ipairs(mat_colors) do
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- crafting
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:welcome_mat_grey 2",
|
||||
recipe = {
|
||||
{ "", "dye:black", "" },
|
||||
{ "wool:grey", "wool:grey", "wool:grey" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:welcome_mat_brown 2",
|
||||
recipe = {
|
||||
{ "", "dye:black", "" },
|
||||
{ "wool:brown", "wool:brown", "wool:brown" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:welcome_mat_green 2",
|
||||
recipe = {
|
||||
{ "", "dye:white", "" },
|
||||
{ "wool:dark_green", "wool:dark_green", "wool:dark_green" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:welcome_mat_green 2",
|
||||
recipe = {
|
||||
{ "", "dye:white", "" },
|
||||
{ "dye:black", "dye:black", "dye:black" },
|
||||
{ "wool:green", "wool:green", "wool:green" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:coat_tree",
|
||||
recipe = {
|
||||
{ "group:stick", "group:stick", "group:stick" },
|
||||
{ "", "group:stick", "" },
|
||||
{ "", "group:wood", "" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:coatrack_wallmount",
|
||||
recipe = {
|
||||
{ "group:stick", "homedecor:curtainrod_wood", "group:stick" },
|
||||
},
|
||||
})
|
246
homedecor/furniture.lua
Normal file
@ -0,0 +1,246 @@
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local table_colors = {
|
||||
{ "", S("Table"), homedecor.plain_wood },
|
||||
{ "_mahogany", S("Mahogany Table"), homedecor.mahogany_wood },
|
||||
{ "_white", S("White Table"), homedecor.white_wood }
|
||||
}
|
||||
|
||||
for _, t in ipairs(table_colors) do
|
||||
local suffix, desc, texture = unpack(t)
|
||||
|
||||
homedecor.register("table"..suffix, {
|
||||
description = desc,
|
||||
tiles = { texture },
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.4, -0.5, -0.4, -0.3, 0.4, -0.3 },
|
||||
{ 0.3, -0.5, -0.4, 0.4, 0.4, -0.3 },
|
||||
{ -0.4, -0.5, 0.3, -0.3, 0.4, 0.4 },
|
||||
{ 0.3, -0.5, 0.3, 0.4, 0.4, 0.4 },
|
||||
{ -0.5, 0.4, -0.5, 0.5, 0.5, 0.5 },
|
||||
{ -0.4, -0.2, -0.3, -0.3, -0.1, 0.3 },
|
||||
{ 0.3, -0.2, -0.4, 0.4, -0.1, 0.3 },
|
||||
{ -0.3, -0.2, -0.4, 0.4, -0.1, -0.3 },
|
||||
{ -0.3, -0.2, 0.3, 0.3, -0.1, 0.4 },
|
||||
},
|
||||
},
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
local kc_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.3125 },
|
||||
}
|
||||
|
||||
local ac_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0, 0.5 },
|
||||
{-0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
|
||||
}
|
||||
}
|
||||
|
||||
homedecor.register("kitchen_chair_wood", {
|
||||
description = S("Kitchen chair"),
|
||||
mesh = "homedecor_kitchen_chair.obj",
|
||||
tiles = {
|
||||
homedecor.plain_wood,
|
||||
homedecor.plain_wood
|
||||
},
|
||||
inventory_image = "homedecor_chair_wood_inv.png",
|
||||
paramtype2 = "wallmounted",
|
||||
selection_box = kc_cbox,
|
||||
collision_box = kc_cbox,
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_place_node = unifieddyes.fix_rotation_nsew,
|
||||
on_rotate = unifieddyes.fix_after_screwdriver_nsew,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
pos.y = pos.y+0 -- where do I put my ass ?
|
||||
homedecor.sit(pos, node, clicker)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
homedecor.register("kitchen_chair_padded", {
|
||||
description = S("Kitchen chair"),
|
||||
mesh = "homedecor_kitchen_chair.obj",
|
||||
tiles = {
|
||||
homedecor.plain_wood,
|
||||
"wool_white.png",
|
||||
},
|
||||
inventory_image = "homedecor_chair_padded_inv.png",
|
||||
paramtype2 = "colorwallmounted",
|
||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||
selection_box = kc_cbox,
|
||||
collision_box = kc_cbox,
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, ud_param2_colorable = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
|
||||
end,
|
||||
on_rotate = unifieddyes.fix_after_screwdriver_nsew,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
pos.y = pos.y+0 -- where do I put my ass ?
|
||||
homedecor.sit(pos, node, clicker)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
homedecor.register("armchair", {
|
||||
description = S("Armchair"),
|
||||
mesh = "forniture_armchair.obj",
|
||||
tiles = {
|
||||
"wool_white.png",
|
||||
{ name = "wool_dark_grey.png", color = 0xffffffff },
|
||||
{ name = "default_wood.png", color = 0xffffffff }
|
||||
},
|
||||
inventory_image = "homedecor_armchair_inv.png",
|
||||
paramtype2 = "colorwallmounted",
|
||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||
groups = {snappy=3, ud_param2_colorable = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = ac_cbox,
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
|
||||
end,
|
||||
on_rotate = unifieddyes.fix_after_screwdriver_nsew,
|
||||
})
|
||||
|
||||
local ob_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }
|
||||
}
|
||||
|
||||
minetest.register_node(":homedecor:openframe_bookshelf", {
|
||||
description = S("Bookshelf (open-frame)"),
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_openframe_bookshelf.obj",
|
||||
tiles = {
|
||||
"homedecor_openframe_bookshelf_books.png",
|
||||
"default_wood.png"
|
||||
},
|
||||
groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
selection_box = ob_cbox,
|
||||
collision_box = ob_cbox,
|
||||
})
|
||||
|
||||
homedecor.register("wall_shelf", {
|
||||
description = S("Wall Shelf"),
|
||||
tiles = {
|
||||
"homedecor_wood_table_large_edges.png",
|
||||
},
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, 0.4, 0.47, 0.5, 0.47, 0.5},
|
||||
{-0.5, 0.47, -0.1875, 0.5, 0.5, 0.5}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
-- Aliases for 3dforniture mod.
|
||||
|
||||
minetest.register_alias("3dforniture:table", "homedecor:table")
|
||||
minetest.register_alias("3dforniture:chair", "homedecor:chair")
|
||||
minetest.register_alias("3dforniture:armchair", "homedecor:armchair_black")
|
||||
minetest.register_alias("homedecor:armchair", "homedecor:armchair_black")
|
||||
|
||||
minetest.register_alias('table', 'homedecor:table')
|
||||
minetest.register_alias('chair', 'homedecor:chair')
|
||||
minetest.register_alias('armchair', 'homedecor:armchair')
|
||||
|
||||
-- conversion to param2 colorization
|
||||
|
||||
homedecor.old_static_chairs = {}
|
||||
|
||||
local chair_colors = {
|
||||
"black",
|
||||
"brown",
|
||||
"blue",
|
||||
"cyan",
|
||||
"dark_grey",
|
||||
"dark_green",
|
||||
"green",
|
||||
"grey",
|
||||
"magenta",
|
||||
"orange",
|
||||
"pink",
|
||||
"red",
|
||||
"violet",
|
||||
"white",
|
||||
"yellow",
|
||||
}
|
||||
|
||||
for _, color in ipairs(chair_colors) do
|
||||
table.insert(homedecor.old_static_chairs, "homedecor:chair_"..color)
|
||||
table.insert(homedecor.old_static_chairs, "homedecor:armchair_"..color)
|
||||
end
|
||||
table.insert(homedecor.old_static_chairs, "homedecor:chair")
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "homedecor:convert_chairs",
|
||||
label = "Convert homedecor chairs to use param2 color",
|
||||
run_at_every_load = false,
|
||||
nodenames = homedecor.old_static_chairs,
|
||||
action = function(pos, node)
|
||||
local name = node.name
|
||||
local paletteidx = 0
|
||||
local color
|
||||
local a,b = string.find(name, "_")
|
||||
|
||||
if a then
|
||||
color = string.sub(name, a+1)
|
||||
|
||||
if color == "blue" then
|
||||
color = "medium_blue"
|
||||
elseif color == "violet" then
|
||||
color = "medium_violet"
|
||||
elseif color == "red" then
|
||||
color = "medium_red"
|
||||
elseif color == "black" then
|
||||
color = "dark_grey"
|
||||
end
|
||||
|
||||
paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted")
|
||||
end
|
||||
|
||||
local old_fdir = math.floor(node.param2 % 32)
|
||||
local new_fdir = 3
|
||||
|
||||
if old_fdir == 0 then
|
||||
new_fdir = 3
|
||||
elseif old_fdir == 1 then
|
||||
new_fdir = 4
|
||||
elseif old_fdir == 2 then
|
||||
new_fdir = 2
|
||||
elseif old_fdir == 3 then
|
||||
new_fdir = 5
|
||||
end
|
||||
|
||||
local param2 = paletteidx + new_fdir
|
||||
local newname = "homedecor:armchair"
|
||||
|
||||
if node.name == "homedecor:chair" then
|
||||
newname = "homedecor:kitchen_chair_wood"
|
||||
elseif string.find(node.name, "homedecor:chair_") then
|
||||
newname = "homedecor:kitchen_chair_padded"
|
||||
end
|
||||
|
||||
minetest.set_node(pos, { name = newname, param2 = param2 })
|
||||
local meta = minetest.get_meta(pos)
|
||||
if color then
|
||||
meta:set_string("dye", "unifieddyes:"..color)
|
||||
end
|
||||
end
|
||||
})
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
homedecor.register("bars", {
|
||||
description = S("Bars"),
|
||||
@ -58,10 +58,61 @@ homedecor.register("chains", {
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
homedecor.register("torch_wall", {
|
||||
description = S("Wall Torch"),
|
||||
mesh = "forniture_torch.obj",
|
||||
tiles = {
|
||||
{
|
||||
name="forniture_torch_flame.png",
|
||||
animation={
|
||||
type="vertical_frames",
|
||||
aspect_w=40,
|
||||
aspect_h=40,
|
||||
length=1.0,
|
||||
},
|
||||
},
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_black },
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
|
||||
"forniture_coal.png",
|
||||
},
|
||||
inventory_image="forniture_torch_inv.png",
|
||||
walkable = false,
|
||||
light_source = 14,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.15, -0.45, 0.15, 0.15,0.35, 0.5 },
|
||||
},
|
||||
groups = {cracky=3},
|
||||
})
|
||||
|
||||
local wl_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.2, -0.5, 0, 0.2, 0.5, 0.5 },
|
||||
}
|
||||
|
||||
homedecor.register("wall_lamp", {
|
||||
description = S("Wall Lamp"),
|
||||
mesh = "homedecor_wall_lamp.obj",
|
||||
tiles = {
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
|
||||
homedecor.lux_wood,
|
||||
"homedecor_light.png",
|
||||
"homedecor_generic_metal_wrought_iron.png"
|
||||
},
|
||||
use_texture_alpha = true,
|
||||
inventory_image = "homedecor_wall_lamp_inv.png",
|
||||
groups = {snappy=3},
|
||||
light_source = 11,
|
||||
selection_box = wl_cbox,
|
||||
walkable = false
|
||||
})
|
||||
|
||||
minetest.register_alias("3dforniture:bars", "homedecor:bars")
|
||||
minetest.register_alias("3dforniture:L_binding_bars", "homedecor:L_binding_bars")
|
||||
minetest.register_alias("3dforniture:chains", "homedecor:chains")
|
||||
minetest.register_alias("3dforniture:torch_wall", "homedecor:torch_wall")
|
||||
|
||||
minetest.register_alias('bars', 'homedecor:bars')
|
||||
minetest.register_alias('binding_bars', 'homedecor:L_binding_bars')
|
||||
minetest.register_alias('chains', 'homedecor:chains')
|
||||
minetest.register_alias('torch_wall', 'homedecor:torch_wall')
|
@ -1,79 +1,4 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
|
||||
local table_colors = {
|
||||
{ "", S("Table"), homedecor.plain_wood },
|
||||
{ "_mahogany", S("Mahogany Table"), homedecor.mahogany_wood },
|
||||
{ "_white", S("White Table"), homedecor.white_wood }
|
||||
}
|
||||
|
||||
for _, t in ipairs(table_colors) do
|
||||
local suffix, desc, texture = unpack(t)
|
||||
|
||||
homedecor.register("table"..suffix, {
|
||||
description = desc,
|
||||
tiles = { texture },
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.4, -0.5, -0.4, -0.3, 0.4, -0.3 },
|
||||
{ 0.3, -0.5, -0.4, 0.4, 0.4, -0.3 },
|
||||
{ -0.4, -0.5, 0.3, -0.3, 0.4, 0.4 },
|
||||
{ 0.3, -0.5, 0.3, 0.4, 0.4, 0.4 },
|
||||
{ -0.5, 0.4, -0.5, 0.5, 0.5, 0.5 },
|
||||
{ -0.4, -0.2, -0.3, -0.3, -0.1, 0.3 },
|
||||
{ 0.3, -0.2, -0.4, 0.4, -0.1, 0.3 },
|
||||
{ -0.3, -0.2, -0.4, 0.4, -0.1, -0.3 },
|
||||
{ -0.3, -0.2, 0.3, 0.3, -0.1, 0.4 },
|
||||
},
|
||||
},
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
|
||||
local ob_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }
|
||||
}
|
||||
|
||||
minetest.register_node(":homedecor:openframe_bookshelf", {
|
||||
description = S("Bookshelf (open-frame)"),
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_openframe_bookshelf.obj",
|
||||
tiles = {
|
||||
"homedecor_openframe_bookshelf_books.png",
|
||||
"default_wood.png"
|
||||
},
|
||||
groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
selection_box = ob_cbox,
|
||||
collision_box = ob_cbox,
|
||||
})
|
||||
|
||||
homedecor.register("wall_shelf", {
|
||||
description = S("Wall Shelf"),
|
||||
tiles = {
|
||||
"default_wood.png",
|
||||
},
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, 0.4, 0.47, 0.5, 0.47, 0.5},
|
||||
{-0.5, 0.47, -0.1875, 0.5, 0.5, 0.5}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
-- Crafts
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:table",
|
||||
recipe = {
|
||||
@ -127,6 +52,73 @@ minetest.register_craft({
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:kitchen_chair_wood 2",
|
||||
recipe = {
|
||||
{ "group:stick",""},
|
||||
{ "group:wood","group:wood" },
|
||||
{ "group:stick","group:stick" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:armchair 2",
|
||||
recipe = {
|
||||
{ "wool:white",""},
|
||||
{ "group:wood","group:wood" },
|
||||
{ "wool:white","wool:white" },
|
||||
},
|
||||
})
|
||||
|
||||
unifieddyes.register_color_craft({
|
||||
output = "homedecor:armchair",
|
||||
palette = "wallmounted",
|
||||
type = "shapeless",
|
||||
neutral_node = "homedecor:armchair",
|
||||
recipe = {
|
||||
"NEUTRAL_NODE",
|
||||
"MAIN_DYE"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "homedecor:kitchen_chair_padded",
|
||||
recipe = {
|
||||
"homedecor:kitchen_chair_wood",
|
||||
"wool:white",
|
||||
},
|
||||
})
|
||||
|
||||
unifieddyes.register_color_craft({
|
||||
output = "homedecor:kitchen_chair_padded",
|
||||
palette = "wallmounted",
|
||||
type = "shapeless",
|
||||
neutral_node = "homedecor:kitchen_chair_padded",
|
||||
recipe = {
|
||||
"NEUTRAL_NODE",
|
||||
"MAIN_DYE"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:kitchen_chair_wood",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:kitchen_chair_padded",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:armchair",
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:standing_lamp_off",
|
||||
recipe = {
|
||||
@ -286,8 +278,3 @@ minetest.register_craft({
|
||||
{ "default:steel_ingot" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Aliases for 3dforniture mod.
|
||||
|
||||
minetest.register_alias("3dforniture:table", "homedecor:table")
|
||||
minetest.register_alias('table', 'homedecor:table')
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local cutlery_cbox = {
|
||||
type = "fixed",
|
||||
@ -104,6 +104,22 @@ homedecor.register("wine_rack", {
|
||||
sounds = default.node_sound_defaults(),
|
||||
})
|
||||
|
||||
homedecor.register("dartboard", {
|
||||
description = S("Dartboard"),
|
||||
mesh = "homedecor_dartboard.obj",
|
||||
tiles = { "homedecor_dartboard.png" },
|
||||
inventory_image = "homedecor_dartboard_inv.png",
|
||||
wield_image = "homedecor_dartboard_inv.png",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {choppy=2,dig_immediate=2,attached_node=1},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
homedecor.register("beer_tap", {
|
||||
description = S("Beer tap"),
|
||||
mesh = "homedecor_beer_taps.obj",
|
||||
@ -164,7 +180,18 @@ homedecor.register("beer_mug", {
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
local inv = user:get_inventory()
|
||||
if not creative.is_enabled_for(user:get_player_name()) then
|
||||
minetest.do_item_eat(2, "vessels:drinking_glass 1", itemstack, user, pointed_thing)
|
||||
if inv:room_for_item("main", "vessels:drinking_glass 1") then
|
||||
inv:add_item("main", "vessels:drinking_glass 1")
|
||||
else
|
||||
local pos = user:get_pos()
|
||||
local dir = user:get_look_dir()
|
||||
local fdir = minetest.dir_to_facedir(dir)
|
||||
local pos_fwd = { x = pos.x + homedecor.fdir_to_fwd[fdir+1][1],
|
||||
y = pos.y + 1,
|
||||
z = pos.z + homedecor.fdir_to_fwd[fdir+1][2] }
|
||||
minetest.add_item(pos_fwd, "vessels:drinking_glass 1")
|
||||
end
|
||||
minetest.do_item_eat(2, nil, itemstack, user, pointed_thing)
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
@ -209,218 +236,3 @@ homedecor.register("soda_machine", {
|
||||
})
|
||||
|
||||
minetest.register_alias("homedecor:coin", "currency:minegeld_cent_25")
|
||||
|
||||
-- coffee!
|
||||
-- coffee!
|
||||
-- coffee!
|
||||
|
||||
local cm_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ 0, -8/16, 0, 7/16, 3/16, 8/16 },
|
||||
{ -4/16, -8/16, -6/16, -1/16, -5/16, -3/16 }
|
||||
}
|
||||
}
|
||||
|
||||
homedecor.register("coffee_maker", {
|
||||
mesh = "homedecor_coffeemaker.obj",
|
||||
tiles = {
|
||||
"homedecor_coffeemaker_decanter.png",
|
||||
"homedecor_coffeemaker_cup.png",
|
||||
"homedecor_coffeemaker_case.png",
|
||||
},
|
||||
description = S("Coffee Maker"),
|
||||
inventory_image = "homedecor_coffeemaker_inv.png",
|
||||
walkable = false,
|
||||
groups = {snappy=3},
|
||||
selection_box = cm_cbox,
|
||||
node_box = cm_cbox,
|
||||
on_rotate = screwdriver.disallow
|
||||
})
|
||||
|
||||
homedecor.register("toaster", {
|
||||
description = S("Toaster"),
|
||||
tiles = { "homedecor_toaster_sides.png" },
|
||||
inventory_image = "homedecor_toaster_inv.png",
|
||||
walkable = false,
|
||||
groups = { snappy=3 },
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.0625, -0.5, -0.125, 0.125, -0.3125, 0.125}, -- NodeBox1
|
||||
},
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local fdir = node.param2
|
||||
minetest.set_node(pos, { name = "homedecor:toaster_loaf", param2 = fdir })
|
||||
minetest.sound_play("toaster", {
|
||||
pos = pos,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 5
|
||||
})
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
homedecor.register("toaster_loaf", {
|
||||
tiles = {
|
||||
"homedecor_toaster_toploaf.png",
|
||||
"homedecor_toaster_sides.png",
|
||||
"homedecor_toaster_sides.png",
|
||||
"homedecor_toaster_sides.png",
|
||||
"homedecor_toaster_sides.png",
|
||||
"homedecor_toaster_sides.png"
|
||||
},
|
||||
walkable = false,
|
||||
groups = { snappy=3, not_in_creative_inventory=1 },
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.0625, -0.5, -0.125, 0.125, -0.3125, 0.125}, -- NodeBox1
|
||||
{-0.03125, -0.3125, -0.0935, 0, -0.25, 0.0935}, -- NodeBox2
|
||||
{0.0625, -0.3125, -0.0935, 0.0935, -0.25, 0.0935}, -- NodeBox3
|
||||
},
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local fdir = node.param2
|
||||
minetest.set_node(pos, { name = "homedecor:toaster", param2 = fdir })
|
||||
return itemstack
|
||||
end,
|
||||
drop = "homedecor:toaster"
|
||||
})
|
||||
|
||||
local fdir_to_steampos = {
|
||||
x = { 0.15, 0.275, -0.15, -0.275 },
|
||||
z = { 0.275, -0.15, -0.275, 0.15 }
|
||||
}
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = "homedecor:coffee_maker",
|
||||
label = "sfx",
|
||||
interval = 2,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
local fdir = node.param2
|
||||
if fdir and fdir < 4 then
|
||||
|
||||
local steamx = fdir_to_steampos.x[fdir + 1]
|
||||
local steamz = fdir_to_steampos.z[fdir + 1]
|
||||
|
||||
minetest.add_particlespawner({
|
||||
amount = 1,
|
||||
time = 1,
|
||||
minpos = {x=pos.x - steamx, y=pos.y - 0.35, z=pos.z - steamz},
|
||||
maxpos = {x=pos.x - steamx, y=pos.y - 0.35, z=pos.z - steamz},
|
||||
minvel = {x=-0.003, y=0.01, z=-0.003},
|
||||
maxvel = {x=0.003, y=0.01, z=-0.003},
|
||||
minacc = {x=0.0,y=-0.0,z=-0.0},
|
||||
maxacc = {x=0.0,y=0.003,z=-0.0},
|
||||
minexptime = 2,
|
||||
maxexptime = 5,
|
||||
minsize = 1,
|
||||
maxsize = 1.2,
|
||||
collisiondetection = false,
|
||||
texture = "homedecor_steam.png",
|
||||
})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- crafting
|
||||
|
||||
minetest.register_craftitem(":homedecor:soda_can", {
|
||||
description = S("Soda Can"),
|
||||
inventory_image = "homedecor_soda_can.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:bottle_green",
|
||||
recipe = {
|
||||
{ "vessels:glass_bottle", "dye:green" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:bottle_brown",
|
||||
recipe = {
|
||||
{ "vessels:glass_bottle", "dye:brown" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:coffee_maker",
|
||||
recipe = {
|
||||
{"basic_materials:plastic_sheet", "bucket:bucket_water", "basic_materials:plastic_sheet"},
|
||||
{"basic_materials:plastic_sheet", "default:glass", "basic_materials:plastic_sheet"},
|
||||
{"basic_materials:plastic_sheet", "basic_materials:heating_element", "basic_materials:plastic_sheet"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:toaster",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "basic_materials:heating_element", "default:steel_ingot" },
|
||||
{ "default:steel_ingot", "basic_materials:heating_element", "default:steel_ingot" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:beer_tap",
|
||||
recipe = {
|
||||
{ "group:stick","default:steel_ingot","group:stick" },
|
||||
{ "homedecor:kitchen_faucet","default:steel_ingot","homedecor:kitchen_faucet" },
|
||||
{ "default:steel_ingot","default:steel_ingot","default:steel_ingot" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "homedecor:4_bottles_brown",
|
||||
recipe = {
|
||||
"homedecor:bottle_brown",
|
||||
"homedecor:bottle_brown",
|
||||
"homedecor:bottle_brown",
|
||||
"homedecor:bottle_brown"
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "homedecor:4_bottles_green",
|
||||
recipe = {
|
||||
"homedecor:bottle_green",
|
||||
"homedecor:bottle_green",
|
||||
"homedecor:bottle_green",
|
||||
"homedecor:bottle_green"
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "homedecor:4_bottles_multi",
|
||||
recipe = {
|
||||
"homedecor:bottle_brown",
|
||||
"homedecor:bottle_brown",
|
||||
"homedecor:bottle_green",
|
||||
"homedecor:bottle_green",
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:wine_rack",
|
||||
recipe = {
|
||||
{ "homedecor:4_bottles_brown", "group:wood", "homedecor:4_bottles_brown" },
|
||||
{ "homedecor:4_bottles_brown", "group:wood", "homedecor:4_bottles_brown" },
|
||||
{ "homedecor:4_bottles_brown", "group:wood", "homedecor:4_bottles_brown" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:soda_machine",
|
||||
recipe = {
|
||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "dye:red", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:copperblock", "default:steel_ingot"},
|
||||
},
|
||||
})
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
-- vectors to place one node next to or behind another
|
||||
|
@ -1,6 +1,6 @@
|
||||
-- This code supplies an oven/stove. Basically it's just a copy of the default furnace with different textures.
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local function swap_node(pos, name)
|
||||
local node = minetest.get_node(pos)
|
||||
@ -80,7 +80,7 @@ local furnace_can_dig = function(pos,player)
|
||||
end
|
||||
|
||||
function homedecor.register_furnace(name, furnacedef)
|
||||
furnacedef.fire_fg = furnacedef.fire_fg or "default_furnace_fire_fg.png"
|
||||
furnacedef.fire_fg = furnacedef.fire_bg or "default_furnace_fire_fg.png"
|
||||
furnacedef.fire_bg = furnacedef.fire_bg or "default_furnace_fire_bg.png"
|
||||
|
||||
furnacedef.output_slots = furnacedef.output_slots or 4
|
24
homedecor/handlers/init.lua
Normal file
@ -0,0 +1,24 @@
|
||||
local handlerpath = homedecor.modpath .. "/handlers/"
|
||||
|
||||
-- nodebox arithmetics and helpers
|
||||
-- (please keep non-generic nodeboxes with their node definition)
|
||||
dofile(handlerpath.."nodeboxes.lua")
|
||||
|
||||
-- expand and unexpand decor
|
||||
dofile(handlerpath.."expansion.lua")
|
||||
|
||||
-- register nodes that cook stuff
|
||||
dofile(handlerpath.."furnaces.lua")
|
||||
|
||||
-- inventory related functionality, like initialization, ownership and spawning locked versions
|
||||
dofile(handlerpath.."inventory.lua")
|
||||
|
||||
-- glue it all together into a registration function
|
||||
dofile(handlerpath.."registration.lua")
|
||||
|
||||
-- some nodes have particle spawners
|
||||
dofile(handlerpath.."water_particles.lua")
|
||||
|
||||
|
||||
dofile(handlerpath.."mt_game_beds_functions.lua")
|
||||
dofile(handlerpath.."sit.lua")
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local default_can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos)
|
@ -91,5 +91,5 @@ function homedecor.register(name, original_def)
|
||||
end
|
||||
|
||||
-- register the actual minetest node
|
||||
minetest.register_node(":homedecor:" .. name, def)
|
||||
minetest.register_node("homedecor:" .. name, def)
|
||||
end
|
@ -71,7 +71,6 @@ function homedecor.start_particle_spawner(pos, node, particledef, soundname)
|
||||
amount = 60,
|
||||
time = 0,
|
||||
collisiondetection = true,
|
||||
collision_removal = particledef.die_on_collision,
|
||||
minpos = {x=pos.x - minx, y=pos.y + outlety, z=pos.z - minz},
|
||||
maxpos = {x=pos.x - maxx, y=pos.y + outlety, z=pos.z - maxz},
|
||||
minvel = {x = minvelx, y = velocityy, z = minvelz},
|
@ -1,16 +1,19 @@
|
||||
-- Home Decor API/functions, and common textures and models
|
||||
-- by VanessaE
|
||||
-- Home Decor mod by VanessaE
|
||||
--
|
||||
-- Mostly my own code, with bits and pieces lifted from Minetest's default
|
||||
-- lua files and from ironzorg's flowers mod. Many thanks to GloopMaster
|
||||
-- for helping me figure out the inventories used in the nightstands/dressers.
|
||||
--
|
||||
-- The code for ovens, nightstands, refrigerators are basically modified
|
||||
-- copies of the code for chests and furnaces.
|
||||
|
||||
local modpath = minetest.get_modpath("homedecor_common")
|
||||
local modpath = minetest.get_modpath("homedecor")
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
homedecor = {}
|
||||
homedecor.modpath = modpath
|
||||
|
||||
-- Intllib support
|
||||
homedecor.gettext, homedecor.ngettext = dofile(modpath.."/intllib.lua")
|
||||
|
||||
local S = homedecor.gettext
|
||||
|
||||
-- Determine if the item being pointed at is the underside of a node (e.g a ceiling)
|
||||
function homedecor.find_ceiling(itemstack, placer, pointed_thing)
|
||||
-- most of this is copied from the rotate-and-place function in builtin
|
||||
@ -67,16 +70,55 @@ homedecor.color_dark_grey = 0xff606060
|
||||
homedecor.color_med_grey = 0xffa0a0a0
|
||||
|
||||
-- load different handler subsystems
|
||||
dofile(modpath.."/nodeboxes.lua")
|
||||
dofile(modpath.."/expansion.lua")
|
||||
dofile(modpath.."/furnaces.lua")
|
||||
dofile(modpath.."/inventory.lua")
|
||||
dofile(modpath.."/registration.lua")
|
||||
dofile(modpath.."/water_particles.lua")
|
||||
dofile(modpath.."/mt_game_beds_functions.lua")
|
||||
dofile(modpath.."/sit.lua")
|
||||
dofile(modpath.."/handlers/init.lua")
|
||||
|
||||
-- load various other components
|
||||
dofile(modpath.."/misc-nodes.lua") -- the catch-all for all misc nodes
|
||||
dofile(modpath.."/tables.lua")
|
||||
dofile(modpath.."/electronics.lua")
|
||||
dofile(modpath.."/shutters.lua")
|
||||
|
||||
dofile(modpath.."/roofing.lua")
|
||||
|
||||
dofile(modpath.."/foyer.lua")
|
||||
|
||||
dofile(modpath.."/doors_and_gates.lua")
|
||||
|
||||
dofile(modpath.."/fences.lua")
|
||||
|
||||
dofile(modpath.."/lighting.lua")
|
||||
|
||||
dofile(modpath.."/kitchen_appliances.lua")
|
||||
dofile(modpath.."/kitchen_furniture.lua")
|
||||
dofile(modpath.."/gastronomy.lua")
|
||||
|
||||
dofile(modpath.."/bathroom_furniture.lua")
|
||||
dofile(modpath.."/bathroom_sanitation.lua")
|
||||
|
||||
dofile(modpath.."/bedroom.lua")
|
||||
|
||||
dofile(modpath.."/laundry.lua")
|
||||
|
||||
dofile(modpath.."/office.lua")
|
||||
|
||||
dofile(modpath.."/clocks.lua")
|
||||
dofile(modpath.."/electrics.lua")
|
||||
|
||||
dofile(modpath.."/window_treatments.lua")
|
||||
|
||||
dofile(modpath.."/furniture.lua")
|
||||
dofile(modpath.."/furniture_medieval.lua")
|
||||
dofile(modpath.."/furniture_recipes.lua")
|
||||
dofile(modpath.."/climate-control.lua")
|
||||
|
||||
dofile(modpath.."/cobweb.lua")
|
||||
dofile(modpath.."/books.lua")
|
||||
dofile(modpath.."/exterior.lua")
|
||||
dofile(modpath.."/trash_cans.lua")
|
||||
dofile(modpath.."/wardrobe.lua")
|
||||
|
||||
dofile(modpath.."/crafts.lua")
|
||||
|
||||
if minetest.settings:get_bool("log_mod") then
|
||||
minetest.log("action", "[HomeDecor API] " .. S("Loaded!"))
|
||||
minetest.log("action", "[HomeDecor] " .. S("Loaded!"))
|
||||
end
|
256
homedecor/kitchen_appliances.lua
Normal file
@ -0,0 +1,256 @@
|
||||
-- This file supplies refrigerators
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local function N_(x) return x end
|
||||
|
||||
-- steel-textured fridge
|
||||
homedecor.register("refrigerator_steel", {
|
||||
mesh = "homedecor_refrigerator.obj",
|
||||
tiles = { "homedecor_refrigerator_steel.png" },
|
||||
inventory_image = "homedecor_refrigerator_steel_inv.png",
|
||||
description = S("Refrigerator (stainless steel)"),
|
||||
groups = {snappy=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
selection_box = homedecor.nodebox.slab_y(2),
|
||||
collision_box = homedecor.nodebox.slab_y(2),
|
||||
expand = { top="placeholder" },
|
||||
infotext=S("Refrigerator"),
|
||||
inventory = {
|
||||
size=50,
|
||||
lockable=true,
|
||||
},
|
||||
on_rotate = screwdriver.rotate_simple
|
||||
})
|
||||
|
||||
-- white, enameled fridge
|
||||
homedecor.register("refrigerator_white", {
|
||||
mesh = "homedecor_refrigerator.obj",
|
||||
tiles = { "homedecor_refrigerator_white.png" },
|
||||
inventory_image = "homedecor_refrigerator_white_inv.png",
|
||||
description = S("Refrigerator"),
|
||||
groups = {snappy=3},
|
||||
selection_box = homedecor.nodebox.slab_y(2),
|
||||
collision_box = homedecor.nodebox.slab_y(2),
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
expand = { top="placeholder" },
|
||||
infotext=S("Refrigerator"),
|
||||
inventory = {
|
||||
size=50,
|
||||
lockable=true,
|
||||
},
|
||||
on_rotate = screwdriver.rotate_simple
|
||||
})
|
||||
|
||||
minetest.register_alias("homedecor:refrigerator_white_bottom", "homedecor:refrigerator_white")
|
||||
minetest.register_alias("homedecor:refrigerator_white_top", "air")
|
||||
|
||||
minetest.register_alias("homedecor:refrigerator_steel_bottom", "homedecor:refrigerator_steel")
|
||||
minetest.register_alias("homedecor:refrigerator_steel_top", "air")
|
||||
|
||||
minetest.register_alias("homedecor:refrigerator_white_bottom_locked", "homedecor:refrigerator_white_locked")
|
||||
minetest.register_alias("homedecor:refrigerator_white_top_locked", "air")
|
||||
minetest.register_alias("homedecor:refrigerator_locked", "homedecor:refrigerator_white_locked")
|
||||
|
||||
minetest.register_alias("homedecor:refrigerator_steel_bottom_locked", "homedecor:refrigerator_steel_locked")
|
||||
minetest.register_alias("homedecor:refrigerator_steel_top_locked", "air")
|
||||
|
||||
-- kitchen "furnaces"
|
||||
homedecor.register_furnace("oven", {
|
||||
description = S("Oven"),
|
||||
tile_format = "homedecor_oven_%s%s.png",
|
||||
output_slots = 4,
|
||||
output_width = 2,
|
||||
cook_speed = 1.25,
|
||||
})
|
||||
|
||||
homedecor.register_furnace("oven_steel", {
|
||||
description = S("Oven (stainless steel)"),
|
||||
tile_format = "homedecor_oven_steel_%s%s.png",
|
||||
output_slots = 4,
|
||||
output_width = 2,
|
||||
cook_speed = 1.25,
|
||||
})
|
||||
|
||||
homedecor.register_furnace("microwave_oven", {
|
||||
description = S("Microwave Oven"),
|
||||
tiles = {
|
||||
"homedecor_microwave_top.png", "homedecor_microwave_top.png^[transformR180",
|
||||
"homedecor_microwave_top.png^[transformR270", "homedecor_microwave_top.png^[transformR90",
|
||||
"homedecor_microwave_top.png^[transformR180", "homedecor_microwave_front.png"
|
||||
},
|
||||
tiles_active = {
|
||||
"homedecor_microwave_top.png", "homedecor_microwave_top.png^[transformR180",
|
||||
"homedecor_microwave_top.png^[transformR270", "homedecor_microwave_top.png^[transformR90",
|
||||
"homedecor_microwave_top.png^[transformR180", "homedecor_microwave_front_active.png"
|
||||
},
|
||||
output_slots = 2,
|
||||
output_width = 2,
|
||||
cook_speed = 1.5,
|
||||
extra_nodedef_fields = {
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.125, 0.5, 0.125, 0.5 },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- coffee!
|
||||
-- coffee!
|
||||
-- coffee!
|
||||
|
||||
local cm_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ 0, -8/16, 0, 7/16, 3/16, 8/16 },
|
||||
{ -4/16, -8/16, -6/16, -1/16, -5/16, -3/16 }
|
||||
}
|
||||
}
|
||||
|
||||
homedecor.register("coffee_maker", {
|
||||
mesh = "homedecor_coffeemaker.obj",
|
||||
tiles = {
|
||||
"homedecor_coffeemaker_decanter.png",
|
||||
"homedecor_coffeemaker_cup.png",
|
||||
"homedecor_coffeemaker_case.png",
|
||||
},
|
||||
description = S("Coffee Maker"),
|
||||
inventory_image = "homedecor_coffeemaker_inv.png",
|
||||
walkable = false,
|
||||
groups = {snappy=3},
|
||||
selection_box = cm_cbox,
|
||||
node_box = cm_cbox,
|
||||
on_rotate = screwdriver.disallow
|
||||
})
|
||||
|
||||
local fdir_to_steampos = {
|
||||
x = { 0.15, 0.275, -0.15, -0.275 },
|
||||
z = { 0.275, -0.15, -0.275, 0.15 }
|
||||
}
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = "homedecor:coffee_maker",
|
||||
label = "sfx",
|
||||
interval = 2,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
local fdir = node.param2
|
||||
if fdir and fdir < 4 then
|
||||
|
||||
local steamx = fdir_to_steampos.x[fdir + 1]
|
||||
local steamz = fdir_to_steampos.z[fdir + 1]
|
||||
|
||||
minetest.add_particlespawner({
|
||||
amount = 1,
|
||||
time = 1,
|
||||
minpos = {x=pos.x - steamx, y=pos.y - 0.35, z=pos.z - steamz},
|
||||
maxpos = {x=pos.x - steamx, y=pos.y - 0.35, z=pos.z - steamz},
|
||||
minvel = {x=-0.003, y=0.01, z=-0.003},
|
||||
maxvel = {x=0.003, y=0.01, z=-0.003},
|
||||
minacc = {x=0.0,y=-0.0,z=-0.0},
|
||||
maxacc = {x=0.0,y=0.003,z=-0.0},
|
||||
minexptime = 2,
|
||||
maxexptime = 5,
|
||||
minsize = 1,
|
||||
maxsize = 1.2,
|
||||
collisiondetection = false,
|
||||
texture = "homedecor_steam.png",
|
||||
})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
homedecor.register("toaster", {
|
||||
description = S("Toaster"),
|
||||
tiles = { "homedecor_toaster_sides.png" },
|
||||
inventory_image = "homedecor_toaster_inv.png",
|
||||
walkable = false,
|
||||
groups = { snappy=3 },
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.0625, -0.5, -0.125, 0.125, -0.3125, 0.125}, -- NodeBox1
|
||||
},
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local fdir = node.param2
|
||||
minetest.set_node(pos, { name = "homedecor:toaster_loaf", param2 = fdir })
|
||||
minetest.sound_play("toaster", {
|
||||
pos = pos,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 5
|
||||
})
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
homedecor.register("toaster_loaf", {
|
||||
tiles = {
|
||||
"homedecor_toaster_toploaf.png",
|
||||
"homedecor_toaster_sides.png",
|
||||
"homedecor_toaster_sides.png",
|
||||
"homedecor_toaster_sides.png",
|
||||
"homedecor_toaster_sides.png",
|
||||
"homedecor_toaster_sides.png"
|
||||
},
|
||||
walkable = false,
|
||||
groups = { snappy=3, not_in_creative_inventory=1 },
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.0625, -0.5, -0.125, 0.125, -0.3125, 0.125}, -- NodeBox1
|
||||
{-0.03125, -0.3125, -0.0935, 0, -0.25, 0.0935}, -- NodeBox2
|
||||
{0.0625, -0.3125, -0.0935, 0.0935, -0.25, 0.0935}, -- NodeBox3
|
||||
},
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local fdir = node.param2
|
||||
minetest.set_node(pos, { name = "homedecor:toaster", param2 = fdir })
|
||||
return itemstack
|
||||
end,
|
||||
drop = "homedecor:toaster"
|
||||
})
|
||||
|
||||
|
||||
homedecor.register("dishwasher", {
|
||||
description = S("Dishwasher"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"homedecor_dishwasher_top.png",
|
||||
"homedecor_dishwasher_bottom.png",
|
||||
"homedecor_dishwasher_sides.png",
|
||||
"homedecor_dishwasher_sides.png^[transformFX",
|
||||
"homedecor_dishwasher_back.png",
|
||||
"homedecor_dishwasher_front.png"
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.4375},
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.1875, 0.1875},
|
||||
{-0.4375, -0.5, -0.5, 0.4375, 0.4375, 0.4375},
|
||||
}
|
||||
},
|
||||
selection_box = { type = "regular" },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
groups = { snappy = 3 },
|
||||
})
|
||||
|
||||
local materials = { N_("granite"), N_("marble"), N_("steel"), N_("wood") }
|
||||
|
||||
for _, m in ipairs(materials) do
|
||||
homedecor.register("dishwasher_"..m, {
|
||||
description = S("Dishwasher (@1)", S(m)),
|
||||
tiles = {
|
||||
"homedecor_kitchen_cabinet_top_"..m..".png",
|
||||
"homedecor_dishwasher_bottom.png",
|
||||
"homedecor_dishwasher_sides.png",
|
||||
"homedecor_dishwasher_sides.png^[transformFX",
|
||||
"homedecor_dishwasher_back.png",
|
||||
"homedecor_dishwasher_front.png"
|
||||
},
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
end
|
157
homedecor/kitchen_furniture.lua
Normal file
@ -0,0 +1,157 @@
|
||||
-- This file supplies Kitchen cabinets and kitchen sink
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local cabinet_sides = "(default_wood.png^[transformR90)^homedecor_kitchen_cabinet_bevel.png"
|
||||
local cabinet_bottom = "(default_wood.png^[colorize:#000000:100)^(homedecor_kitchen_cabinet_bevel.png^[colorize:#46321580)"
|
||||
|
||||
local function N_(x) return x end
|
||||
|
||||
local counter_materials = { "", N_("granite"), N_("marble"), N_("steel") }
|
||||
|
||||
for _, mat in ipairs(counter_materials) do
|
||||
|
||||
local desc = S("Kitchen Cabinet")
|
||||
local material = ""
|
||||
|
||||
if mat ~= "" then
|
||||
desc = S("Kitchen Cabinet (@1 top)", S(mat))
|
||||
material = "_"..mat
|
||||
end
|
||||
|
||||
homedecor.register("kitchen_cabinet"..material, {
|
||||
description = desc,
|
||||
tiles = { 'homedecor_kitchen_cabinet_top'..material..'.png',
|
||||
cabinet_bottom,
|
||||
cabinet_sides,
|
||||
cabinet_sides,
|
||||
cabinet_sides,
|
||||
'homedecor_kitchen_cabinet_front.png'},
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
infotext=S("Kitchen Cabinet"),
|
||||
inventory = {
|
||||
size=24,
|
||||
lockable=true,
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
local kitchen_cabinet_half_box = homedecor.nodebox.slab_y(0.5, 0.5)
|
||||
homedecor.register("kitchen_cabinet_half", {
|
||||
description = S('Half-height Kitchen Cabinet (on ceiling)'),
|
||||
tiles = {
|
||||
cabinet_sides,
|
||||
cabinet_bottom,
|
||||
cabinet_sides,
|
||||
cabinet_sides,
|
||||
cabinet_sides,
|
||||
'homedecor_kitchen_cabinet_front_half.png'
|
||||
},
|
||||
selection_box = kitchen_cabinet_half_box,
|
||||
node_box = kitchen_cabinet_half_box,
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
infotext=S("Kitchen Cabinet"),
|
||||
inventory = {
|
||||
size=12,
|
||||
lockable=true,
|
||||
},
|
||||
})
|
||||
|
||||
homedecor.register("kitchen_cabinet_with_sink", {
|
||||
description = S("Kitchen Cabinet with sink"),
|
||||
mesh = "homedecor_kitchen_sink.obj",
|
||||
tiles = {
|
||||
"homedecor_kitchen_sink_top.png",
|
||||
"homedecor_kitchen_cabinet_front.png",
|
||||
cabinet_sides,
|
||||
cabinet_bottom
|
||||
},
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
infotext=S("Under-sink cabinet"),
|
||||
inventory = {
|
||||
size=16,
|
||||
lockable=true,
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -8/16, -8/16, -8/16, 8/16, 6/16, 8/16 },
|
||||
{ -8/16, 6/16, -8/16, -6/16, 8/16, 8/16 },
|
||||
{ 6/16, 6/16, -8/16, 8/16, 8/16, 8/16 },
|
||||
{ -8/16, 6/16, -8/16, 8/16, 8/16, -6/16 },
|
||||
{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 },
|
||||
}
|
||||
},
|
||||
on_destruct = function(pos)
|
||||
homedecor.stop_particle_spawner({x=pos.x, y=pos.y+1, z=pos.z})
|
||||
end
|
||||
})
|
||||
|
||||
local cp_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.375, -0.5, -0.5, 0.375, -0.3125, 0.3125 }
|
||||
}
|
||||
|
||||
homedecor.register("copper_pans", {
|
||||
description = S("Copper pans"),
|
||||
mesh = "homedecor_copper_pans.obj",
|
||||
tiles = { "homedecor_polished_copper.png" },
|
||||
inventory_image = "homedecor_copper_pans_inv.png",
|
||||
groups = { snappy=3 },
|
||||
selection_box = cp_cbox,
|
||||
walkable = false,
|
||||
on_place = minetest.rotate_node
|
||||
})
|
||||
|
||||
local kf_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -2/16, -8/16, 1/16, 2/16, -1/16, 8/16 }
|
||||
}
|
||||
|
||||
homedecor.register("kitchen_faucet", {
|
||||
mesh = "homedecor_kitchen_faucet.obj",
|
||||
tiles = { "homedecor_generic_metal_bright.png" },
|
||||
inventory_image = "homedecor_kitchen_faucet_inv.png",
|
||||
description = S("Kitchen Faucet"),
|
||||
groups = {snappy=3},
|
||||
selection_box = kf_cbox,
|
||||
walkable = false,
|
||||
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-1, z=pos.z})
|
||||
if below and
|
||||
below.name == "homedecor:sink" or
|
||||
below.name == "homedecor:kitchen_cabinet_with_sink" or
|
||||
below.name == "homedecor:kitchen_cabinet_with_sink_locked" then
|
||||
local particledef = {
|
||||
outlet = { x = 0, y = -0.19, z = 0.13 },
|
||||
velocity_x = { min = -0.05, max = 0.05 },
|
||||
velocity_y = -0.3,
|
||||
velocity_z = { min = -0.1, max = 0 },
|
||||
spread = 0
|
||||
}
|
||||
homedecor.start_particle_spawner(pos, node, particledef, "homedecor_faucet")
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = homedecor.stop_particle_spawner
|
||||
})
|
||||
|
||||
homedecor.register("paper_towel", {
|
||||
mesh = "homedecor_paper_towel.obj",
|
||||
tiles = {
|
||||
"homedecor_generic_quilted_paper.png",
|
||||
"default_wood.png"
|
||||
},
|
||||
inventory_image = "homedecor_paper_towel_inv.png",
|
||||
description = S("Paper towels"),
|
||||
groups = { snappy=3 },
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.4375, 0.125, 0.0625, 0.4375, 0.4375, 0.5 }
|
||||
},
|
||||
})
|
61
homedecor/laundry.lua
Normal file
@ -0,0 +1,61 @@
|
||||
-- laundry devices
|
||||
|
||||
homedecor.register("washing_machine", {
|
||||
description = "Washing Machine",
|
||||
tiles = {
|
||||
"homedecor_washing_machine_top.png",
|
||||
"homedecor_washing_machine_bottom.png",
|
||||
"homedecor_washing_machine_sides.png",
|
||||
"homedecor_washing_machine_sides.png^[transformFX",
|
||||
"homedecor_washing_machine_back.png",
|
||||
"homedecor_washing_machine_front.png"
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.375, 0.375},
|
||||
{-0.5, -0.5, 0.3125, 0.5, 0.5, 0.5},
|
||||
}
|
||||
},
|
||||
selection_box = { type = "regular" },
|
||||
groups = { snappy = 3 },
|
||||
})
|
||||
|
||||
homedecor.register("dryer", {
|
||||
description = "Tumble dryer",
|
||||
tiles = {
|
||||
"homedecor_dryer_top.png",
|
||||
"homedecor_dryer_bottom.png",
|
||||
"homedecor_dryer_sides.png",
|
||||
"homedecor_dryer_sides.png^[transformFX",
|
||||
"homedecor_dryer_back.png",
|
||||
"homedecor_dryer_front.png"
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.375, 0.375},
|
||||
{-0.5, -0.5, 0.3125, 0.5, 0.5, 0.5},
|
||||
}
|
||||
},
|
||||
selection_box = { type = "regular" },
|
||||
groups = { snappy = 3 },
|
||||
})
|
||||
|
||||
local ib_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -6/16, -8/16, -4/16, 17/16, 4/16, 4/16 }
|
||||
}
|
||||
|
||||
homedecor.register("ironing_board", {
|
||||
description = "Ironing board",
|
||||
mesh = "homedecor_ironing_board.obj",
|
||||
tiles = {
|
||||
"wool_grey.png",
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
|
||||
},
|
||||
expand = {right = "placeholder"},
|
||||
groups = { snappy = 3 },
|
||||
selection_box = ib_cbox,
|
||||
collision_box = ib_cbox
|
||||
})
|
882
homedecor/lighting.lua
Normal file
@ -0,0 +1,882 @@
|
||||
-- This file supplies glowlights
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local glowlight_nodebox = {
|
||||
half = homedecor.nodebox.slab_y(1/2),
|
||||
quarter = homedecor.nodebox.slab_y(1/4),
|
||||
small_cube = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
|
||||
},
|
||||
}
|
||||
|
||||
minetest.register_node("homedecor:glowlight_half", {
|
||||
description = S("Thick Glowlight"),
|
||||
tiles = {
|
||||
"homedecor_glowlight_top.png",
|
||||
"homedecor_glowlight_bottom.png",
|
||||
"homedecor_glowlight_thick_sides.png",
|
||||
"homedecor_glowlight_thick_sides.png",
|
||||
"homedecor_glowlight_thick_sides.png",
|
||||
"homedecor_glowlight_thick_sides.png"
|
||||
},
|
||||
overlay_tiles = {
|
||||
{ name = "homedecor_glowlight_top_overlay.png", color = "white"},
|
||||
"",
|
||||
{ name = "homedecor_glowlight_thick_sides_overlay.png", color = "white"},
|
||||
{ name = "homedecor_glowlight_thick_sides_overlay.png", color = "white"},
|
||||
{ name = "homedecor_glowlight_thick_sides_overlay.png", color = "white"},
|
||||
{ name = "homedecor_glowlight_thick_sides_overlay.png", color = "white"},
|
||||
},
|
||||
use_texture_alpha = true,
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "colorwallmounted",
|
||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
wall_top = { -0.5, 0, -0.5, 0.5, 0.5, 0.5 },
|
||||
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 },
|
||||
wall_side = { -0.5, -0.5, -0.5, 0, 0.5, 0.5 }
|
||||
},
|
||||
node_box = glowlight_nodebox.half,
|
||||
groups = { snappy = 3, ud_param2_colorable = 1 },
|
||||
light_source = default.LIGHT_MAX,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:glowlight_quarter", {
|
||||
description = S("Thin Glowlight"),
|
||||
tiles = {
|
||||
"homedecor_glowlight_top.png",
|
||||
"homedecor_glowlight_bottom.png",
|
||||
"homedecor_glowlight_thin_sides.png",
|
||||
"homedecor_glowlight_thin_sides.png",
|
||||
"homedecor_glowlight_thin_sides.png",
|
||||
"homedecor_glowlight_thin_sides.png"
|
||||
},
|
||||
overlay_tiles = {
|
||||
{ name = "homedecor_glowlight_top_overlay.png", color = "white"},
|
||||
"",
|
||||
{ name = "homedecor_glowlight_thin_sides_overlay.png", color = "white"},
|
||||
{ name = "homedecor_glowlight_thin_sides_overlay.png", color = "white"},
|
||||
{ name = "homedecor_glowlight_thin_sides_overlay.png", color = "white"},
|
||||
{ name = "homedecor_glowlight_thin_sides_overlay.png", color = "white"},
|
||||
},
|
||||
use_texture_alpha = true,
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "colorwallmounted",
|
||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
wall_top = { -0.5, 0.25, -0.5, 0.5, 0.5, 0.5 },
|
||||
wall_bottom = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 },
|
||||
wall_side = { -0.5, -0.5, -0.5, -0.25, 0.5, 0.5 }
|
||||
},
|
||||
node_box = glowlight_nodebox.quarter,
|
||||
groups = { snappy = 3, ud_param2_colorable = 1 },
|
||||
light_source = default.LIGHT_MAX-1,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:glowlight_small_cube", {
|
||||
description = S("Small Glowlight Cube"),
|
||||
tiles = {
|
||||
"homedecor_glowlight_cube_tb.png",
|
||||
"homedecor_glowlight_cube_tb.png",
|
||||
"homedecor_glowlight_cube_sides.png",
|
||||
"homedecor_glowlight_cube_sides.png",
|
||||
"homedecor_glowlight_cube_sides.png",
|
||||
"homedecor_glowlight_cube_sides.png"
|
||||
},
|
||||
overlay_tiles = {
|
||||
{ name = "homedecor_glowlight_cube_tb_overlay.png", color = "white"},
|
||||
{ name = "homedecor_glowlight_cube_tb_overlay.png", color = "white"},
|
||||
{ name = "homedecor_glowlight_cube_sides_overlay.png", color = "white"},
|
||||
{ name = "homedecor_glowlight_cube_sides_overlay.png", color = "white"},
|
||||
{ name = "homedecor_glowlight_cube_sides_overlay.png", color = "white"},
|
||||
{ name = "homedecor_glowlight_cube_sides_overlay.png", color = "white"},
|
||||
},
|
||||
use_texture_alpha = true,
|
||||
paramtype = "light",
|
||||
paramtype2 = "colorwallmounted",
|
||||
drawtype = "nodebox",
|
||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
wall_top = { -0.25, 0, -0.25, 0.25, 0.5, 0.25 },
|
||||
wall_bottom = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 },
|
||||
wall_side = { -0.5, -0.25, -0.25, 0, 0.25, 0.25 }
|
||||
},
|
||||
node_box = glowlight_nodebox.small_cube,
|
||||
groups = { snappy = 3, ud_param2_colorable = 1 },
|
||||
light_source = default.LIGHT_MAX-1,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
|
||||
end,
|
||||
})
|
||||
|
||||
homedecor.register("plasma_lamp", {
|
||||
description = S("Plasma Lamp"),
|
||||
drawtype = "mesh",
|
||||
mesh = "plasma_lamp.obj",
|
||||
tiles = {
|
||||
"default_gold_block.png",
|
||||
{
|
||||
name="homedecor_plasma_storm.png",
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0},
|
||||
}
|
||||
},
|
||||
use_texture_alpha = true,
|
||||
light_source = default.LIGHT_MAX - 1,
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky=3,oddly_breakable_by_hand=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
homedecor.register("plasma_ball", {
|
||||
description = S("Plasma Ball"),
|
||||
mesh = "homedecor_plasma_ball.obj",
|
||||
tiles = {
|
||||
{ name = "homedecor_generic_plastic.png", color = homedecor.color_black },
|
||||
{
|
||||
name = "homedecor_plasma_ball_streamers.png",
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0},
|
||||
},
|
||||
"homedecor_plasma_ball_glass.png"
|
||||
},
|
||||
inventory_image = "homedecor_plasma_ball_inv.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.1875, -0.5, -0.1875, 0.1875, 0, 0.1875 }
|
||||
},
|
||||
walkable = false,
|
||||
use_texture_alpha = true,
|
||||
light_source = default.LIGHT_MAX - 5,
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky=3,oddly_breakable_by_hand=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
local tc_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.1875, -0.5, -0.1875, 0.1875, 0.375, 0.1875 },
|
||||
}
|
||||
}
|
||||
|
||||
homedecor.register("candle", {
|
||||
description = S("Thick Candle"),
|
||||
mesh = "homedecor_candle_thick.obj",
|
||||
tiles = {
|
||||
'homedecor_candle_sides.png',
|
||||
{name="homedecor_candle_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
||||
},
|
||||
inventory_image = "homedecor_candle_inv.png",
|
||||
selection_box = tc_cbox,
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
light_source = default.LIGHT_MAX-4,
|
||||
})
|
||||
|
||||
local c_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.125, -0.5, -0.125, 0.125, 0.05, 0.125 },
|
||||
}
|
||||
}
|
||||
|
||||
homedecor.register("candle_thin", {
|
||||
description = S("Thin Candle"),
|
||||
mesh = "homedecor_candle_thin.obj",
|
||||
tiles = {
|
||||
'homedecor_candle_sides.png',
|
||||
{name="homedecor_candle_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
||||
},
|
||||
inventory_image = "homedecor_candle_thin_inv.png",
|
||||
selection_box = c_cbox,
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
light_source = default.LIGHT_MAX-4,
|
||||
})
|
||||
|
||||
local cs_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.15625, -0.5, -0.15625, 0.15625, 0.3125, 0.15625 },
|
||||
}
|
||||
}
|
||||
|
||||
homedecor.register("candlestick_wrought_iron", {
|
||||
description = S("Candlestick (wrought iron)"),
|
||||
mesh = "homedecor_candlestick.obj",
|
||||
tiles = {
|
||||
"homedecor_candle_sides.png",
|
||||
{name="homedecor_candle_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
||||
"homedecor_generic_metal_wrought_iron.png",
|
||||
},
|
||||
inventory_image = "homedecor_candlestick_wrought_iron_inv.png",
|
||||
selection_box = cs_cbox,
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
light_source = default.LIGHT_MAX-4,
|
||||
})
|
||||
|
||||
homedecor.register("candlestick_brass", {
|
||||
description = S("Candlestick (brass)"),
|
||||
mesh = "homedecor_candlestick.obj",
|
||||
tiles = {
|
||||
"homedecor_candle_sides.png",
|
||||
{name="homedecor_candle_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
||||
"homedecor_generic_metal_brass.png",
|
||||
},
|
||||
inventory_image = "homedecor_candlestick_brass_inv.png",
|
||||
selection_box = cs_cbox,
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
light_source = default.LIGHT_MAX-4,
|
||||
})
|
||||
|
||||
homedecor.register("wall_sconce", {
|
||||
description = S("Wall sconce"),
|
||||
mesh = "homedecor_wall_sconce.obj",
|
||||
tiles = {
|
||||
'homedecor_candle_sides.png',
|
||||
{name="homedecor_candle_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
||||
'homedecor_wall_sconce_back.png',
|
||||
'homedecor_generic_metal_wrought_iron.png',
|
||||
},
|
||||
inventory_image = "homedecor_wall_sconce_inv.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.1875, -0.25, 0.3125, 0.1875, 0.25, 0.5 }
|
||||
},
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
light_source = default.LIGHT_MAX-4,
|
||||
})
|
||||
|
||||
local ol_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -5/16, -8/16, -3/16, 5/16, 4/16, 3/16 },
|
||||
}
|
||||
}
|
||||
|
||||
homedecor.register("oil_lamp", {
|
||||
description = S("Oil lamp (hurricane)"),
|
||||
mesh = "homedecor_oil_lamp.obj",
|
||||
tiles = {
|
||||
"homedecor_generic_metal_brass.png",
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_black },
|
||||
{ name = "homedecor_generic_metal.png", color = 0xffa00000 },
|
||||
"homedecor_oil_lamp_wick.png",
|
||||
{ name = "homedecor_generic_metal.png", color = 0xffa00000 },
|
||||
"homedecor_oil_lamp_glass.png",
|
||||
},
|
||||
use_texture_alpha = true,
|
||||
inventory_image = "homedecor_oil_lamp_inv.png",
|
||||
selection_box = ol_cbox,
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
light_source = default.LIGHT_MAX-3,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
homedecor.register("oil_lamp_tabletop", {
|
||||
description = S("Oil Lamp (tabletop)"),
|
||||
mesh = "homedecor_oil_lamp_tabletop.obj",
|
||||
tiles = {"homedecor_oil_lamp_tabletop.png"},
|
||||
inventory_image = "homedecor_oil_lamp_tabletop_inv.png",
|
||||
selection_box = ol_cbox,
|
||||
collision_box = ol_cbox,
|
||||
groups = { snappy = 3 },
|
||||
light_source = default.LIGHT_MAX-3,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
local gl_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0.45, 0.25 },
|
||||
}
|
||||
|
||||
minetest.register_alias("homedecor:wall_lantern", "homedecor:ground_lantern")
|
||||
|
||||
homedecor.register("ground_lantern", {
|
||||
description = S("Ground Lantern"),
|
||||
mesh = "homedecor_ground_lantern.obj",
|
||||
tiles = { "homedecor_light.png", "homedecor_generic_metal_wrought_iron.png" },
|
||||
use_texture_alpha = true,
|
||||
inventory_image = "homedecor_ground_lantern_inv.png",
|
||||
wield_image = "homedecor_ground_lantern_inv.png",
|
||||
groups = {snappy=3},
|
||||
light_source = 11,
|
||||
selection_box = gl_cbox,
|
||||
walkable = false
|
||||
})
|
||||
|
||||
local hl_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.2, 0.25, 0.5, 0.5 },
|
||||
}
|
||||
|
||||
homedecor.register("hanging_lantern", {
|
||||
description = S("Hanging Lantern"),
|
||||
mesh = "homedecor_hanging_lantern.obj",
|
||||
tiles = { "homedecor_generic_metal_wrought_iron.png", "homedecor_light.png" },
|
||||
use_texture_alpha = true,
|
||||
inventory_image = "homedecor_hanging_lantern_inv.png",
|
||||
wield_image = "homedecor_hanging_lantern_inv.png",
|
||||
groups = {snappy=3},
|
||||
light_source = 11,
|
||||
selection_box = hl_cbox,
|
||||
walkable = false
|
||||
})
|
||||
|
||||
local cl_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.35, -0.45, -0.35, 0.35, 0.5, 0.35 }
|
||||
}
|
||||
|
||||
homedecor.register("ceiling_lantern", {
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_ceiling_lantern.obj",
|
||||
tiles = { "homedecor_light.png", "homedecor_generic_metal_wrought_iron.png" },
|
||||
use_texture_alpha = true,
|
||||
inventory_image = "homedecor_ceiling_lantern_inv.png",
|
||||
description = S("Ceiling Lantern"),
|
||||
groups = {snappy=3},
|
||||
light_source = 11,
|
||||
selection_box = cl_cbox,
|
||||
walkable = false
|
||||
})
|
||||
|
||||
local sm_light = default.LIGHT_MAX-2
|
||||
|
||||
if minetest.get_modpath("darkage") then
|
||||
minetest.register_alias("homedecor:lattice_lantern_large", "darkage:lamp")
|
||||
sm_light = default.LIGHT_MAX-5
|
||||
else
|
||||
homedecor.register("lattice_lantern_large", {
|
||||
description = S("Lattice lantern (large)"),
|
||||
tiles = { 'homedecor_lattice_lantern_large.png' },
|
||||
groups = { snappy = 3 },
|
||||
light_source = default.LIGHT_MAX,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
homedecor.register("lattice_lantern_small", {
|
||||
description = S("Lattice lantern (small)"),
|
||||
tiles = {
|
||||
'homedecor_lattice_lantern_small_tb.png',
|
||||
'homedecor_lattice_lantern_small_tb.png',
|
||||
'homedecor_lattice_lantern_small_sides.png'
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
|
||||
},
|
||||
groups = { snappy = 3 },
|
||||
light_source = sm_light,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
on_place = minetest.rotate_node
|
||||
})
|
||||
|
||||
local brightness_tab = {
|
||||
0xffd0d0d0,
|
||||
0xffd8d8d8,
|
||||
0xffe0e0e0,
|
||||
0xffe8e8e8,
|
||||
0xffffffff,
|
||||
}
|
||||
|
||||
-- table lamps and standing lamps
|
||||
|
||||
local repl = {
|
||||
["off"] ="low",
|
||||
["low"] ="med",
|
||||
["med"] ="hi",
|
||||
["hi"] ="max",
|
||||
["max"] ="off",
|
||||
}
|
||||
|
||||
local lamp_colors = {
|
||||
"white",
|
||||
"blue",
|
||||
"green",
|
||||
"pink",
|
||||
"red",
|
||||
"violet",
|
||||
}
|
||||
|
||||
local tlamp_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 }
|
||||
}
|
||||
|
||||
local slamp_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 1.5, 0.25 }
|
||||
}
|
||||
|
||||
local function reg_lamp(suffix, nxt, light, brightness)
|
||||
|
||||
local wool_brighten = (light or 0) * 15
|
||||
|
||||
homedecor.register("table_lamp_"..suffix, {
|
||||
description = S("Table Lamp"),
|
||||
mesh = "homedecor_table_lamp.obj",
|
||||
tiles = {
|
||||
"wool_grey.png^[colorize:#ffffff:"..wool_brighten,
|
||||
{ name = "homedecor_table_standing_lamp_lightbulb.png", color = brightness_tab[brightness] },
|
||||
{ name = "homedecor_generic_wood_red.png", color = 0xffffffff },
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_black },
|
||||
},
|
||||
inventory_image = "homedecor_table_lamp_foot_inv.png^homedecor_table_lamp_top_inv.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
walkable = false,
|
||||
light_source = light,
|
||||
selection_box = tlamp_cbox,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
groups = {cracky=2,oddly_breakable_by_hand=1, ud_param2_colorable = 1,
|
||||
not_in_creative_inventory=((light ~= nil) and 1) or nil,
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
node.name = "homedecor:table_lamp_"..repl[suffix]
|
||||
minetest.set_node(pos, node)
|
||||
end,
|
||||
on_construct = unifieddyes.on_construct,
|
||||
drop = {
|
||||
items = {
|
||||
{items = {"homedecor:table_lamp_off"}, inherit_color = true },
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
homedecor.register("standing_lamp_"..suffix, {
|
||||
description = S("Standing Lamp"),
|
||||
mesh = "homedecor_standing_lamp.obj",
|
||||
tiles = {
|
||||
"wool_grey.png^[colorize:#ffffff:"..wool_brighten,
|
||||
{ name = "homedecor_table_standing_lamp_lightbulb.png", color = brightness_tab[brightness] },
|
||||
{ name = "homedecor_generic_wood_red.png", color = 0xffffffff },
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_black },
|
||||
},
|
||||
inventory_image = "homedecor_standing_lamp_foot_inv.png^homedecor_standing_lamp_top_inv.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
walkable = false,
|
||||
light_source = light,
|
||||
groups = {cracky=2,oddly_breakable_by_hand=1, ud_param2_colorable = 1,
|
||||
not_in_creative_inventory=((light ~= nil) and 1) or nil,
|
||||
},
|
||||
selection_box = slamp_cbox,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
node.name = "homedecor:standing_lamp_"..repl[suffix]
|
||||
minetest.set_node(pos, node)
|
||||
end,
|
||||
on_construct = unifieddyes.on_construct,
|
||||
--expand = { top="air" },
|
||||
drop = {
|
||||
items = {
|
||||
{items = {"homedecor:standing_lamp_off"}, inherit_color = true },
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
-- for old maps that had the original 3dforniture mod
|
||||
minetest.register_alias("3dforniture:table_lamp_"..suffix, "homedecor:table_lamp_"..suffix)
|
||||
end
|
||||
|
||||
reg_lamp("off", "low", nil, 1 )
|
||||
reg_lamp("low", "med", 3, 2 )
|
||||
reg_lamp("med", "hi", 7, 3 )
|
||||
reg_lamp("hi", "max", 11, 4 )
|
||||
reg_lamp("max", "off", 14, 5 )
|
||||
|
||||
-- "gooseneck" style desk lamps
|
||||
|
||||
local dlamp_cbox = {
|
||||
type = "wallmounted",
|
||||
wall_side = { -0.2, -0.5, -0.15, 0.32, 0.12, 0.15 },
|
||||
}
|
||||
|
||||
homedecor.register("desk_lamp", {
|
||||
description = S("Desk Lamp"),
|
||||
mesh = "homedecor_desk_lamp.obj",
|
||||
tiles = {
|
||||
"homedecor_generic_metal.png",
|
||||
"homedecor_generic_metal.png",
|
||||
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
|
||||
{ name = "homedecor_table_standing_lamp_lightbulb.png", color = brightness_tab[5] },
|
||||
},
|
||||
inventory_image = "homedecor_desk_lamp_inv.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "colorwallmounted",
|
||||
palette = "unifieddyes_palette_colorwallmounted.png",
|
||||
selection_box = dlamp_cbox,
|
||||
node_box = dlamp_cbox,
|
||||
walkable = false,
|
||||
groups = {snappy=3, ud_param2_colorable = 1},
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
|
||||
end,
|
||||
on_rotate = unifieddyes.fix_after_screwdriver_nsew
|
||||
})
|
||||
|
||||
-- "kitchen"/"dining room" ceiling lamp
|
||||
|
||||
homedecor.register("ceiling_lamp", {
|
||||
description = S("Ceiling Lamp"),
|
||||
mesh = "homedecor_ceiling_lamp.obj",
|
||||
tiles = {
|
||||
"homedecor_generic_metal_brass.png",
|
||||
"homedecor_ceiling_lamp_glass.png",
|
||||
"homedecor_table_standing_lamp_lightbulb.png",
|
||||
{ name = "homedecor_generic_plastic.png", color = 0xff442d04 },
|
||||
},
|
||||
inventory_image = "homedecor_ceiling_lamp_inv.png",
|
||||
light_source = default.LIGHT_MAX,
|
||||
groups = {snappy=3},
|
||||
walkable = false,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
minetest.set_node(pos, {name = "homedecor:ceiling_lamp_off"})
|
||||
end,
|
||||
})
|
||||
|
||||
homedecor.register("ceiling_lamp_off", {
|
||||
description = S("Ceiling Lamp (off)"),
|
||||
mesh = "homedecor_ceiling_lamp.obj",
|
||||
tiles = {
|
||||
"homedecor_generic_metal_brass.png",
|
||||
"homedecor_ceiling_lamp_glass.png",
|
||||
{ "homedecor_table_standing_lamp_lightbulb.png", color = 0xffd0d0d0 },
|
||||
{ name = "homedecor_generic_plastic.png", color = 0xff442d04 },
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1},
|
||||
walkable = false,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
minetest.set_node(pos, {name = "homedecor:ceiling_lamp"})
|
||||
end,
|
||||
drop = "homedecor:ceiling_lamp"
|
||||
})
|
||||
|
||||
-- conversion LBM for param2 coloring
|
||||
|
||||
homedecor.old_static_nodes = {
|
||||
"homedecor:glowlight_quarter_white",
|
||||
"homedecor:glowlight_quarter_yellow",
|
||||
"homedecor:glowlight_half_white",
|
||||
"homedecor:glowlight_half_yellow",
|
||||
"homedecor:glowlight_small_cube_white",
|
||||
"homedecor:glowlight_small_cube_yellow"
|
||||
}
|
||||
|
||||
local lamp_power = {"off", "low", "med", "hi", "max"}
|
||||
|
||||
for _, power in ipairs(lamp_power) do
|
||||
for _, color in ipairs(lamp_colors) do
|
||||
table.insert(homedecor.old_static_nodes, "homedecor:table_lamp_"..color.."_"..power)
|
||||
table.insert(homedecor.old_static_nodes, "homedecor:standing_lamp_"..color.."_"..power)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "homedecor:convert_lighting",
|
||||
label = "Convert homedecor glowlights, table lamps, and standing lamps to use param2 color",
|
||||
run_at_every_load = false,
|
||||
nodenames = homedecor.old_static_nodes,
|
||||
action = function(pos, node)
|
||||
local name = node.name
|
||||
local newname
|
||||
local color
|
||||
|
||||
if string.find(name, "small_cube") then
|
||||
newname = "homedecor:glowlight_small_cube"
|
||||
elseif string.find(name, "glowlight_half") then
|
||||
newname = "homedecor:glowlight_half"
|
||||
elseif string.find(name, "glowlight_quarter") then
|
||||
newname = "homedecor:glowlight_quarter"
|
||||
end
|
||||
|
||||
local lampname
|
||||
if string.find(name, "standing_lamp") then
|
||||
lampname = "homedecor:standing_lamp"
|
||||
elseif string.find(name, "table_lamp") then
|
||||
lampname = "homedecor:table_lamp"
|
||||
end
|
||||
if lampname then
|
||||
newname = lampname
|
||||
if string.find(name, "_off") then
|
||||
newname = newname.."_off"
|
||||
elseif string.find(name, "_low") then
|
||||
newname = newname.."_low"
|
||||
elseif string.find(name, "_med") then
|
||||
newname = newname.."_med"
|
||||
elseif string.find(name, "_hi") then
|
||||
newname = newname.."_hi"
|
||||
elseif string.find(name, "_max") then
|
||||
newname = newname.."_max"
|
||||
end
|
||||
end
|
||||
|
||||
if string.find(name, "red") then
|
||||
color = "red"
|
||||
elseif string.find(name, "pink") then
|
||||
color = "pink"
|
||||
elseif string.find(name, "green") then
|
||||
color = "green"
|
||||
elseif string.find(name, "blue") then
|
||||
color = "blue"
|
||||
elseif string.find(name, "yellow") then
|
||||
color = "yellow"
|
||||
elseif string.find(name, "violet") then
|
||||
color = "violet"
|
||||
else
|
||||
color = "white"
|
||||
end
|
||||
|
||||
local paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, "extended")
|
||||
|
||||
local old_fdir
|
||||
local new_node = newname
|
||||
local new_fdir = 1
|
||||
local param2
|
||||
|
||||
if string.find(name, "glowlight") then
|
||||
paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted")
|
||||
|
||||
old_fdir = math.floor(node.param2 / 4)
|
||||
|
||||
if old_fdir == 5 then
|
||||
new_fdir = 0
|
||||
elseif old_fdir == 1 then
|
||||
new_fdir = 5
|
||||
elseif old_fdir == 2 then
|
||||
new_fdir = 4
|
||||
elseif old_fdir == 3 then
|
||||
new_fdir = 3
|
||||
elseif old_fdir == 4 then
|
||||
new_fdir = 2
|
||||
elseif old_fdir == 0 then
|
||||
new_fdir = 1
|
||||
end
|
||||
param2 = paletteidx + new_fdir
|
||||
else
|
||||
param2 = paletteidx
|
||||
end
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
if string.find(name, "table_lamp") or string.find(name, "standing_lamp") then
|
||||
meta:set_string("palette", "ext")
|
||||
end
|
||||
|
||||
minetest.set_node(pos, { name = new_node, param2 = param2 })
|
||||
meta:set_string("dye", "unifieddyes:"..color)
|
||||
end
|
||||
})
|
||||
|
||||
-- this one's for the small "gooseneck" desk lamps
|
||||
|
||||
homedecor.old_static_desk_lamps = {
|
||||
"homedecor:desk_lamp_red",
|
||||
"homedecor:desk_lamp_blue",
|
||||
"homedecor:desk_lamp_green",
|
||||
"homedecor:desk_lamp_violet",
|
||||
}
|
||||
|
||||
minetest.register_lbm({
|
||||
name = "homedecor:convert_desk_lamps",
|
||||
label = "Convert homedecor desk lamps to use param2 color",
|
||||
run_at_every_load = false,
|
||||
nodenames = homedecor.old_static_desk_lamps,
|
||||
action = function(pos, node)
|
||||
local name = node.name
|
||||
local color = string.sub(name, string.find(name, "_", -8) + 1)
|
||||
|
||||
if color == "green" then
|
||||
color = "medium_green"
|
||||
elseif color == "violet" then
|
||||
color = "magenta"
|
||||
end
|
||||
|
||||
local paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted")
|
||||
local old_fdir = math.floor(node.param2 % 32)
|
||||
local new_fdir = 3
|
||||
|
||||
if old_fdir == 0 then
|
||||
new_fdir = 3
|
||||
elseif old_fdir == 1 then
|
||||
new_fdir = 4
|
||||
elseif old_fdir == 2 then
|
||||
new_fdir = 2
|
||||
elseif old_fdir == 3 then
|
||||
new_fdir = 5
|
||||
end
|
||||
|
||||
local param2 = paletteidx + new_fdir
|
||||
|
||||
minetest.set_node(pos, { name = "homedecor:desk_lamp", param2 = param2 })
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("dye", "unifieddyes:"..color)
|
||||
end
|
||||
})
|
||||
|
||||
local chains_sbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.1, -0.5, -0.1, 0.1, 0.5, 0.1 }
|
||||
}
|
||||
|
||||
local topchains_sbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.25, 0.35, -0.25, 0.25, 0.5, 0.25 },
|
||||
{ -0.1, -0.5, -0.1, 0.1, 0.4, 0.1 }
|
||||
}
|
||||
}
|
||||
|
||||
minetest.register_node("homedecor:chain_steel_top", {
|
||||
description = S("Hanging chain (ceiling mount, steel)"),
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_chains_top.obj",
|
||||
tiles = {"basic_materials_chain_steel.png"},
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
inventory_image = "basic_materials_chain_steel_inv.png",
|
||||
groups = {cracky=3},
|
||||
selection_box = topchains_sbox,
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:chain_brass_top", {
|
||||
description = S("Hanging chain (ceiling mount, brass)"),
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_chains_top.obj",
|
||||
tiles = {"basic_materials_chain_brass.png"},
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
inventory_image = "basic_materials_chain_brass_inv.png",
|
||||
groups = {cracky=3},
|
||||
selection_box = topchains_sbox,
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:chandelier_steel", {
|
||||
description = S("Chandelier (steel)"),
|
||||
paramtype = "light",
|
||||
light_source = 12,
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
sunlight_propagates = true,
|
||||
tiles = {
|
||||
"basic_materials_chain_steel.png",
|
||||
"homedecor_candle_flat.png",
|
||||
{
|
||||
name="homedecor_candle_flame.png",
|
||||
animation={
|
||||
type="vertical_frames",
|
||||
aspect_w=16,
|
||||
aspect_h=16,
|
||||
length=3.0
|
||||
}
|
||||
}
|
||||
},
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_chandelier.obj",
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:chandelier_brass", {
|
||||
description = S("Chandelier (brass)"),
|
||||
paramtype = "light",
|
||||
light_source = 12,
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
sunlight_propagates = true,
|
||||
tiles = {
|
||||
"basic_materials_chain_brass.png",
|
||||
"homedecor_candle_flat.png",
|
||||
{
|
||||
name="homedecor_candle_flame.png",
|
||||
animation={
|
||||
type="vertical_frames",
|
||||
aspect_w=16,
|
||||
aspect_h=16,
|
||||
length=3.0
|
||||
}
|
||||
}
|
||||
},
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_chandelier.obj",
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
-- crafts
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'homedecor:chain_steel_top',
|
||||
recipe = {
|
||||
{'default:steel_ingot'},
|
||||
{'basic_materials:chainlink_steel'},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'homedecor:chandelier_steel',
|
||||
recipe = {
|
||||
{'', 'basic_materials:chainlink_steel', ''},
|
||||
{'default:torch', 'basic_materials:chainlink_steel', 'default:torch'},
|
||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
-- brass versions
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'homedecor:chain_brass_top',
|
||||
recipe = {
|
||||
{'basic_materials:brass_ingot'},
|
||||
{'basic_materials:chainlink_brass'},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'homedecor:chandelier_brass',
|
||||
recipe = {
|
||||
{'', 'basic_materials:chainlink_brass', ''},
|
||||
{'default:torch', 'basic_materials:chainlink_brass', 'default:torch'},
|
||||
{'basic_materials:brass_ingot', 'basic_materials:brass_ingot', 'basic_materials:brass_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_alias("chains:chain_top", "homedecor:chain_steel_top")
|
||||
minetest.register_alias("chains:chain_top_brass", "homedecor:chain_brass_top")
|
||||
|
||||
minetest.register_alias("chains:chandelier_steel", "homedecor:chandelier_steel")
|
||||
minetest.register_alias("chains:chandelier_brass", "homedecor:chandelier_brass")
|
||||
|
@ -1,13 +1,7 @@
|
||||
-- Home Decor mod by VanessaE
|
||||
--
|
||||
-- Mostly my own code, with bits and pieces lifted from Minetest's default
|
||||
-- lua files and from ironzorg's flowers mod. Many thanks to GloopMaster
|
||||
-- for helping me figure out the inventories used in the nightstands/dressers.
|
||||
--
|
||||
-- The code for ovens, nightstands, refrigerators are basically modified
|
||||
-- copies of the code for chests and furnaces.
|
||||
|
||||
local S = homedecor.gettext
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
local function N_(x) return x end
|
||||
|
||||
homedecor.register("ceiling_paint", {
|
||||
description = S("Textured Ceiling Paint"),
|
||||
@ -34,9 +28,9 @@ homedecor.register("ceiling_tile", {
|
||||
})
|
||||
|
||||
local rug_types = {
|
||||
{ "small", "homedecor_small_rug.obj" },
|
||||
{ "large", homedecor.box.slab_y(0.0625) },
|
||||
{ "persian", homedecor.box.slab_y(0.0625) },
|
||||
{ N_("small"), "homedecor_small_rug.obj" },
|
||||
{ N_("large"), homedecor.box.slab_y(0.0625) },
|
||||
{ N_("persian"), homedecor.box.slab_y(0.0625) },
|
||||
}
|
||||
|
||||
for _, rt in ipairs(rug_types) do
|
||||
@ -72,7 +66,7 @@ for _, rt in ipairs(rug_types) do
|
||||
})
|
||||
end
|
||||
|
||||
local pot_colors = { "black", "green", "terracotta" }
|
||||
local pot_colors = { N_("black"), N_("green"), N_("terracotta") }
|
||||
|
||||
for _, p in ipairs(pot_colors) do
|
||||
homedecor.register("flower_pot_"..p, {
|
||||
@ -130,22 +124,21 @@ for _, f in ipairs(flowers_list) do
|
||||
end
|
||||
|
||||
homedecor.register("pole_brass", {
|
||||
description = S("Brass Pole"),
|
||||
description = S("Brass Pole"),
|
||||
mesh = "homedecor_round_pole.obj",
|
||||
tiles = {"homedecor_generic_metal_brass.png^homedecor_generic_metal_lines_overlay.png",},
|
||||
inventory_image = "homedecor_pole_brass_inv.png",
|
||||
wield_image = "homedecor_pole_brass_inv.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.125, -0.5, -0.125, 0.125, 0.5, 0.125 },
|
||||
},
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.125, -0.5, -0.125, 0.125, 0.5, 0.125 },
|
||||
},
|
||||
groups = {snappy=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
check_for_pole = true
|
||||
tiles = {"homedecor_generic_metal_brass.png^homedecor_generic_metal_lines_overlay.png",},
|
||||
inventory_image = "homedecor_pole_brass_inv.png",
|
||||
wield_image = "homedecor_pole_brass_inv.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.125, -0.5, -0.125, 0.125, 0.5, 0.125 },
|
||||
},
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.125, -0.5, -0.125, 0.125, 0.5, 0.125 },
|
||||
},
|
||||
groups = {snappy=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
homedecor.register("pole_wrought_iron", {
|
||||
@ -395,6 +388,53 @@ homedecor.register("tool_cabinet", {
|
||||
minetest.register_alias("homedecor:tool_cabinet_bottom", "homedecor:tool_cabinet")
|
||||
minetest.register_alias("homedecor:tool_cabinet_top", "air")
|
||||
|
||||
local pframe_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.18, -0.5, -0.08, 0.18, -0.08, 0.18 }
|
||||
}
|
||||
local n = { 1, 2 }
|
||||
|
||||
for _, i in ipairs(n) do
|
||||
homedecor.register("picture_frame"..i, {
|
||||
description = S("Picture Frame "..i),
|
||||
mesh = "homedecor_picture_frame.obj",
|
||||
tiles = {
|
||||
"homedecor_picture_frame_image"..i..".png",
|
||||
homedecor.lux_wood,
|
||||
"homedecor_picture_frame_back.png",
|
||||
},
|
||||
inventory_image = "homedecor_picture_frame"..i.."_inv.png",
|
||||
wield_image = "homedecor_picture_frame"..i.."_inv.png",
|
||||
groups = {snappy = 3},
|
||||
selection_box = pframe_cbox,
|
||||
walkable = false,
|
||||
sounds = default.node_sound_glass_defaults()
|
||||
})
|
||||
end
|
||||
|
||||
local p_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.5, -0.5, 0.4375, 0.5, 0.5, 0.5 }
|
||||
}
|
||||
}
|
||||
|
||||
for i = 1,20 do
|
||||
homedecor.register("painting_"..i, {
|
||||
description = S("Decorative painting #@1", i),
|
||||
mesh = "homedecor_painting.obj",
|
||||
tiles = {
|
||||
"default_wood.png",
|
||||
"homedecor_blank_canvas.png",
|
||||
"homedecor_painting"..i..".png"
|
||||
},
|
||||
selection_box = p_cbox,
|
||||
walkable = false,
|
||||
groups = {snappy=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
homedecor.banister_materials = {
|
||||
{ "wood",
|
||||
S("wood"),
|
||||
@ -479,7 +519,6 @@ for _, side in ipairs({"diagonal_left", "diagonal_right", "horizontal"}) do
|
||||
def.airbrush_replacement_node = "homedecor:banister_wood_"..side.."_grey"
|
||||
def.groups.ud_param2_colorable = 1
|
||||
def.paramtype2 = "colorfacedir"
|
||||
def.on_dig = unifieddyes.on_dig
|
||||
end
|
||||
homedecor.register(nodename, def)
|
||||
|
||||
@ -588,471 +627,3 @@ minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_node(":homedecor:tatami_mat", {
|
||||
tiles = {
|
||||
"homedecor_tatami.png",
|
||||
"homedecor_tatami.png",
|
||||
"homedecor_tatami.png",
|
||||
"homedecor_tatami.png",
|
||||
"homedecor_tatami.png",
|
||||
"homedecor_tatami.png"
|
||||
},
|
||||
description = S("Japanese tatami"),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
groups = {snappy=3},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
homedecor.register("dartboard", {
|
||||
description = S("Dartboard"),
|
||||
mesh = "homedecor_dartboard.obj",
|
||||
tiles = { "homedecor_dartboard.png" },
|
||||
inventory_image = "homedecor_dartboard_inv.png",
|
||||
wield_image = "homedecor_dartboard_inv.png",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {choppy=2,dig_immediate=2,attached_node=1},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
-- crafting
|
||||
|
||||
-- Crafting for homedecor mod (includes folding) by Vanessa Ezekowitz
|
||||
--
|
||||
-- Mostly my own code; overall template borrowed from game default
|
||||
|
||||
local S = homedecor.gettext
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:flower_pot_terracotta",
|
||||
recipe = {
|
||||
{ "homedecor:roof_tile_terracotta", "default:dirt", "homedecor:roof_tile_terracotta" },
|
||||
{ "homedecor:roof_tile_terracotta", "homedecor:roof_tile_terracotta", "homedecor:roof_tile_terracotta" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:flower_pot_green",
|
||||
recipe = {
|
||||
{ "", "dye:dark_green", "" },
|
||||
{ "basic_materials:plastic_sheet", "default:dirt", "basic_materials:plastic_sheet" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:flower_pot_black",
|
||||
recipe = {
|
||||
{ "dye:black", "dye:black", "dye:black" },
|
||||
{ "basic_materials:plastic_sheet", "default:dirt", "basic_materials:plastic_sheet" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:ceiling_paint 20",
|
||||
recipe = {
|
||||
"dye:white",
|
||||
"dye:white",
|
||||
"default:sand",
|
||||
"bucket:bucket_water",
|
||||
},
|
||||
replacements = { { "bucket:bucket_water","bucket:bucket_empty" } }
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:ceiling_tile 10",
|
||||
recipe = {
|
||||
{ "", "dye:white", "" },
|
||||
{ "default:steel_ingot", "default:stone", "default:steel_ingot" },
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:drawer_small",
|
||||
recipe = {
|
||||
{ "group:wood", "default:steel_ingot", "group:wood" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:drawer_small",
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
-- vertical poles/lampposts
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:pole_brass 4",
|
||||
recipe = {
|
||||
{ "", "basic_materials:brass_ingot", "" },
|
||||
{ "", "basic_materials:brass_ingot", "" },
|
||||
{ "", "basic_materials:brass_ingot", "" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:pole_wrought_iron 4",
|
||||
recipe = {
|
||||
{ "default:iron_lump", },
|
||||
{ "default:iron_lump", },
|
||||
{ "default:iron_lump", },
|
||||
},
|
||||
})
|
||||
|
||||
-- ===========================================================
|
||||
-- Recipes that require materials from wool (cotton alternate)
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:rug_small 8",
|
||||
recipe = {
|
||||
"wool:red",
|
||||
"wool:yellow",
|
||||
"wool:blue",
|
||||
"wool:black"
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:rug_persian 8",
|
||||
recipe = {
|
||||
{ "", "wool:yellow", "" },
|
||||
{ "wool:red", "wool:blue", "wool:red" },
|
||||
{ "", "wool:yellow", "" }
|
||||
},
|
||||
})
|
||||
|
||||
-- cotton versions:
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:rug_small 8",
|
||||
recipe = {
|
||||
"cotton:red",
|
||||
"cotton:yellow",
|
||||
"cotton:blue",
|
||||
"cotton:black"
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:rug_persian 8",
|
||||
recipe = {
|
||||
{ "", "cotton:yellow", "" },
|
||||
{ "cotton:red", "cotton:blue", "cotton:red" },
|
||||
{ "", "cotton:yellow", "" }
|
||||
},
|
||||
})
|
||||
|
||||
-- fuel recipes for same
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:rug_small",
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "homedecor:rug_large 2",
|
||||
recipe = {
|
||||
"homedecor:rug_small",
|
||||
"homedecor:rug_small",
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:rug_large",
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:rug_persian",
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
-- more misc stuff here
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:fishtank",
|
||||
recipe = {
|
||||
{ "basic_materials:plastic_sheet", "homedecor:glowlight_small_cube", "basic_materials:plastic_sheet" },
|
||||
{ "default:glass", "bucket:bucket_water", "default:glass" },
|
||||
{ "default:glass", "building_blocks:gravel_spread", "default:glass" },
|
||||
},
|
||||
replacements = { {"bucket:bucket_water", "bucket:bucket_empty"} }
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:cardboard_box 2",
|
||||
recipe = {
|
||||
{ "default:paper", "", "default:paper" },
|
||||
{ "default:paper", "default:paper", "default:paper" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:cardboard_box_big 2",
|
||||
recipe = {
|
||||
{ "default:paper", "", "default:paper" },
|
||||
{ "default:paper", "", "default:paper" },
|
||||
{ "default:paper", "default:paper", "default:paper" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:openframe_bookshelf",
|
||||
recipe = {
|
||||
{"group:wood", "", "group:wood"},
|
||||
{"default:book", "default:book", "default:book"},
|
||||
{"group:wood", "", "group:wood"},
|
||||
},
|
||||
})
|
||||
|
||||
-- japanese walls and mat
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:japanese_wall_top",
|
||||
recipe = {
|
||||
{"group:stick", "default:paper"},
|
||||
{"default:paper", "group:stick"},
|
||||
{"group:stick", "default:paper"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:japanese_wall_top",
|
||||
recipe = {
|
||||
{"default:paper", "group:stick"},
|
||||
{"group:stick", "default:paper"},
|
||||
{"default:paper", "group:stick"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:japanese_wall_middle",
|
||||
recipe = {
|
||||
{"homedecor:japanese_wall_top"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:japanese_wall_bottom",
|
||||
recipe = {
|
||||
{"homedecor:japanese_wall_middle"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:japanese_wall_top",
|
||||
recipe = {
|
||||
{"homedecor:japanese_wall_bottom"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:tatami_mat",
|
||||
recipe = {
|
||||
{"farming:wheat", "farming:wheat", "farming:wheat"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:pool_table",
|
||||
recipe = {
|
||||
{ "wool:dark_green", "wool:dark_green", "wool:dark_green" },
|
||||
{ "building_blocks:hardwood", "building_blocks:hardwood", "building_blocks:hardwood" },
|
||||
{ "building_blocks:slab_hardwood", "", "building_blocks:slab_hardwood" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:dartboard",
|
||||
recipe = {
|
||||
{"dye:black", "basic_materials:plastic_sheet", "dye:white"},
|
||||
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet"},
|
||||
{"dye:dark_green", "basic_materials:plastic_sheet", "dye:red"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:piano",
|
||||
recipe = {
|
||||
{ "", "basic_materials:steel_wire", "building_blocks:hardwood" },
|
||||
{ "basic_materials:plastic_strip", "basic_materials:steel_wire", "building_blocks:hardwood" },
|
||||
{ "basic_materials:brass_ingot", "default:steelblock", "building_blocks:hardwood" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:wall_shelf 2",
|
||||
recipe = {
|
||||
{ "homedecor:wood_table_small_square", "homedecor:curtainrod_wood", "homedecor:curtainrod_wood" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:trophy 3",
|
||||
recipe = {
|
||||
{ "default:gold_ingot","","default:gold_ingot" },
|
||||
{ "","default:gold_ingot","" },
|
||||
{ "group:wood","default:gold_ingot","group:wood" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:sportbench",
|
||||
recipe = {
|
||||
{ "stairs:slab_steelblock","basic_materials:steel_bar","stairs:slab_steelblock" },
|
||||
{ "default:steel_ingot","wool:black","default:steel_ingot" },
|
||||
{ "default:steel_ingot","wool:black","default:steel_ingot" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:skateboard",
|
||||
recipe = {
|
||||
{ "dye:yellow","dye:green","dye:blue" },
|
||||
{ "homedecor:wood_table_small_square","homedecor:wood_table_small_square","homedecor:wood_table_small_square" },
|
||||
{ "default:steel_ingot","","default:steel_ingot" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:tool_cabinet",
|
||||
recipe = {
|
||||
{ "basic_materials:motor", "default:axe_steel", "default:pick_steel" },
|
||||
{ "default:steel_ingot", "homedecor:drawer_small", "default:steel_ingot" },
|
||||
{ "default:steel_ingot", "homedecor:drawer_small", "default:steel_ingot" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:spiral_staircase",
|
||||
recipe = {
|
||||
{ "default:steelblock", "homedecor:pole_wrought_iron", "" },
|
||||
{ "", "homedecor:pole_wrought_iron", "default:steelblock" },
|
||||
{ "default:steelblock", "homedecor:pole_wrought_iron", "" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craftitem(":homedecor:flower_pot_small", {
|
||||
description = S("Small Flower Pot"),
|
||||
inventory_image = "homedecor_flowerpot_small_inv.png"
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:flower_pot_small",
|
||||
recipe = {
|
||||
{ "default:clay_brick", "", "default:clay_brick" },
|
||||
{ "", "default:clay_brick", "" }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:flower_pot_small 3",
|
||||
recipe = { { "homedecor:flower_pot_terracotta" } }
|
||||
})
|
||||
|
||||
for i in ipairs(homedecor.banister_materials) do
|
||||
|
||||
local name = homedecor.banister_materials[i][1]
|
||||
local topmat = homedecor.banister_materials[i][5]
|
||||
local vertmat = homedecor.banister_materials[i][6]
|
||||
local dye1 = homedecor.banister_materials[i][7]
|
||||
local dye2 = homedecor.banister_materials[i][8]
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:banister_"..name.."_horizontal 2",
|
||||
recipe = {
|
||||
{ topmat, "", dye1 },
|
||||
{ vertmat, topmat, "" },
|
||||
{ dye2, vertmat, topmat }
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
unifieddyes.register_color_craft({
|
||||
output = "",
|
||||
palette = "split",
|
||||
neutral_node = "homedecor:banister_wood_horizontal",
|
||||
type = "shapeless",
|
||||
output_prefix = "homedecor:banister_wood_horizontal_",
|
||||
output_suffix = "",
|
||||
recipe = {
|
||||
"NEUTRAL_NODE",
|
||||
"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(),
|
||||
})
|