Various changes
Recipe changes:
Brass and wrought iron poles, table legs, and fences/railings were too
expensive in practice. Increased recipe outputs.
Small square glass table now comes from one small round table (instead of
three-to-two). Large square glass comes from one small square insted of two. Small round, small square, and large wooden tables follow the same pattern.
All glass tables can be recycled back into glass blocks via the Vessels mod's
recipes. All are 3:1 with glass fragments (and thus, 3:1 with glass blocks),
so there's no glass wasted.
All wooden tables can be crafted into sticks by putting three of a given item
onto the crafting grid. Any such craft yields 4 sticks, so there's no waste.
Other changes:
3d-ified nightstands, improved their textures somewhat.
New nodes:
* Added working oven (really just a furnace with new textures)
* Added mini-fridge that stores 24 slots
* Added kitchen cabinet that stores 24 slots
* Added half-size kitchen cabinet that stores 12 slots (6x2)
* Added kitchen sink with under-sink cabinet that stores 16 slots.
* Added slab-sized and half-slab-sized glowlights (e.g. ceiling fixtures)
* Added curtains in 6 colors: red, green, blue, purple, pink, white
Notes:
This mod now requires Moreblocks for some recipes - namely fridge and oven.
2012-09-30 07:51:59 +02:00
|
|
|
-- This file supplies refrigerators
|
|
|
|
|
2013-10-22 02:31:54 +02:00
|
|
|
local S = homedecor.gettext
|
2013-03-05 08:18:56 +01:00
|
|
|
|
2014-08-14 20:05:41 +02:00
|
|
|
-- nodebox models
|
|
|
|
|
|
|
|
local fridge_model_bottom = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{0, -0.4375, -0.4375, 0.5, 0.5, 0.5}, -- NodeBox1
|
|
|
|
{-0.5, -0.5, -0.42, 0.5, 0.5, 0.5}, -- NodeBox2
|
|
|
|
{-0.5, -0.4375, -0.4375, -0.0625, 0.5, 0.5}, -- NodeBox3
|
|
|
|
{0, 0.25, -0.5, 0.0625, 0.3125, -0.4375}, -- NodeBox4
|
|
|
|
{-0.125, 0.25, -0.5, -0.0625, 0.3125, -0.4375}, -- NodeBox5
|
|
|
|
{0, 0.25, -0.5, 0.0625, 0.5, -0.473029}, -- NodeBox6
|
|
|
|
{-0.125, 0.25, -0.5, -0.0625, 0.5, -0.473029}, -- NodeBox7
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
local fridge_model_top = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{0, -0.5, -0.4375, 0.5, 0.5, 0.5}, -- NodeBox1
|
|
|
|
{-0.0625, -0.5, -0.42, 0, 0.5, 0.5}, -- NodeBox2
|
|
|
|
{-0.5, -0.5, -0.4375, -0.0625, -0.4375, 0.5}, -- NodeBox3
|
|
|
|
{-0.5, -0.5, -0.4375, -0.4375, 0.5, 0.5}, -- NodeBox4
|
|
|
|
{-0.5, -0.1875, -0.4375, -0.0625, 0.5, 0.5}, -- NodeBox5
|
|
|
|
{-0.4375, -0.4375, -0.125, -0.0625, -0.1875, 0.5}, -- NodeBox6
|
|
|
|
{-0.125, -0.4375, -0.4375, -0.0625, -0.1875, -0.125}, -- NodeBox7
|
|
|
|
{-0.3125, -0.3125, -0.307054, -0.25, -0.1875, -0.286307}, -- NodeBox8
|
|
|
|
{-0.125, 0, -0.5, -0.0625, 0.0625, -0.4375}, -- NodeBox9
|
|
|
|
{0, 0, -0.5, 0.0625, 0.0625, -0.4375}, -- NodeBox10
|
|
|
|
{0, -0.5, -0.5, 0.0625, 0.0625, -0.473029}, -- NodeBox11
|
|
|
|
{-0.125, -0.5, -0.5, -0.0625, 0.0625, -0.473029}, -- NodeBox12
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-- steel-textured fridge
|
|
|
|
|
|
|
|
minetest.register_node("homedecor:refrigerator_steel_bottom", {
|
|
|
|
tiles = {
|
|
|
|
"default_steel_block.png",
|
|
|
|
"homedecor_refrigerator_steel_bottom.png",
|
|
|
|
"homedecor_refrigerator_steel_sides2.png",
|
|
|
|
"homedecor_refrigerator_steel_sides2.png^[transformFX",
|
|
|
|
"homedecor_refrigerator_steel_back2.png",
|
|
|
|
"homedecor_refrigerator_steel_front2.png"
|
|
|
|
},
|
|
|
|
inventory_image = "homedecor_refrigerator_steel_inv.png",
|
|
|
|
description = S("Refrigerator (stainless steel)"),
|
|
|
|
drawtype = "nodebox",
|
|
|
|
paramtype = "light",
|
2013-03-05 08:18:56 +01:00
|
|
|
paramtype2 = "facedir",
|
2014-08-14 20:05:41 +02:00
|
|
|
groups = {snappy=3},
|
|
|
|
node_box = fridge_model_bottom,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 }
|
|
|
|
},
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
local pos = pointed_thing.under
|
|
|
|
local pnode = minetest.get_node(pointed_thing.under)
|
|
|
|
local rnodedef = minetest.registered_nodes[pnode.name]
|
|
|
|
|
|
|
|
if not rnodedef["buildable_to"] then
|
|
|
|
pos = pointed_thing.above
|
|
|
|
end
|
|
|
|
|
|
|
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
|
|
|
local pos2 = { x = pos.x, y=pos.y + 1, z = pos.z }
|
|
|
|
|
|
|
|
local tnode = minetest.get_node(pos)
|
|
|
|
local tnode2 = minetest.get_node(pos2)
|
|
|
|
|
|
|
|
if homedecor.get_nodedef_field(tnode.name, "buildable_to")
|
|
|
|
and homedecor.get_nodedef_field(tnode2.name, "buildable_to")
|
|
|
|
and not minetest.is_protected(pos, placer:get_player_name())
|
|
|
|
and not minetest.is_protected(pos2, placer:get_player_name()) then
|
2014-08-17 19:08:27 +02:00
|
|
|
local nodename = itemstack:get_name()
|
|
|
|
minetest.add_node(pos, { name = nodename, param2 = fdir })
|
2014-08-14 20:05:41 +02:00
|
|
|
minetest.add_node(pos2, { name = "homedecor:refrigerator_steel_top", param2 = fdir })
|
|
|
|
if not homedecor.expect_infinite_stacks then
|
|
|
|
itemstack:take_item()
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
|
|
|
local pos2 = { x = pos.x, y=pos.y + 1, z = pos.z }
|
|
|
|
if minetest.get_node(pos2).name == "homedecor:refrigerator_steel_top" then
|
|
|
|
minetest.remove_node(pos2)
|
|
|
|
end
|
|
|
|
end,
|
2013-03-05 08:18:56 +01:00
|
|
|
on_construct = function(pos)
|
2013-07-01 05:55:07 +02:00
|
|
|
local meta = minetest.get_meta(pos)
|
2013-03-05 08:18:56 +01:00
|
|
|
meta:set_string("formspec",
|
|
|
|
"size[10,10]"..
|
|
|
|
"list[current_name;main;0,0;10,5;]"..
|
|
|
|
"list[current_player;main;1,6;8,4;]")
|
|
|
|
meta:set_string("infotext", S("Refrigerator"))
|
|
|
|
local inv = meta:get_inventory()
|
|
|
|
inv:set_size("main",50)
|
|
|
|
end,
|
|
|
|
can_dig = function(pos,player)
|
2013-07-01 05:55:07 +02:00
|
|
|
local meta = minetest.get_meta(pos);
|
2013-03-05 08:18:56 +01:00
|
|
|
local inv = meta:get_inventory()
|
|
|
|
return inv:is_empty("main")
|
|
|
|
end,
|
|
|
|
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
|
|
|
minetest.log("action", S("%s moves stuff in refrigerator at %s"):format(
|
|
|
|
player:get_player_name(),
|
|
|
|
minetest.pos_to_string(pos)
|
|
|
|
))
|
|
|
|
end,
|
Various changes
Recipe changes:
Brass and wrought iron poles, table legs, and fences/railings were too
expensive in practice. Increased recipe outputs.
Small square glass table now comes from one small round table (instead of
three-to-two). Large square glass comes from one small square insted of two. Small round, small square, and large wooden tables follow the same pattern.
All glass tables can be recycled back into glass blocks via the Vessels mod's
recipes. All are 3:1 with glass fragments (and thus, 3:1 with glass blocks),
so there's no glass wasted.
All wooden tables can be crafted into sticks by putting three of a given item
onto the crafting grid. Any such craft yields 4 sticks, so there's no waste.
Other changes:
3d-ified nightstands, improved their textures somewhat.
New nodes:
* Added working oven (really just a furnace with new textures)
* Added mini-fridge that stores 24 slots
* Added kitchen cabinet that stores 24 slots
* Added half-size kitchen cabinet that stores 12 slots (6x2)
* Added kitchen sink with under-sink cabinet that stores 16 slots.
* Added slab-sized and half-slab-sized glowlights (e.g. ceiling fixtures)
* Added curtains in 6 colors: red, green, blue, purple, pink, white
Notes:
This mod now requires Moreblocks for some recipes - namely fridge and oven.
2012-09-30 07:51:59 +02:00
|
|
|
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
2013-03-05 08:18:56 +01:00
|
|
|
minetest.log("action", S("%s moves stuff to refrigerator at %s"):format(
|
|
|
|
player:get_player_name(),
|
|
|
|
minetest.pos_to_string(pos)
|
|
|
|
))
|
|
|
|
end,
|
Various changes
Recipe changes:
Brass and wrought iron poles, table legs, and fences/railings were too
expensive in practice. Increased recipe outputs.
Small square glass table now comes from one small round table (instead of
three-to-two). Large square glass comes from one small square insted of two. Small round, small square, and large wooden tables follow the same pattern.
All glass tables can be recycled back into glass blocks via the Vessels mod's
recipes. All are 3:1 with glass fragments (and thus, 3:1 with glass blocks),
so there's no glass wasted.
All wooden tables can be crafted into sticks by putting three of a given item
onto the crafting grid. Any such craft yields 4 sticks, so there's no waste.
Other changes:
3d-ified nightstands, improved their textures somewhat.
New nodes:
* Added working oven (really just a furnace with new textures)
* Added mini-fridge that stores 24 slots
* Added kitchen cabinet that stores 24 slots
* Added half-size kitchen cabinet that stores 12 slots (6x2)
* Added kitchen sink with under-sink cabinet that stores 16 slots.
* Added slab-sized and half-slab-sized glowlights (e.g. ceiling fixtures)
* Added curtains in 6 colors: red, green, blue, purple, pink, white
Notes:
This mod now requires Moreblocks for some recipes - namely fridge and oven.
2012-09-30 07:51:59 +02:00
|
|
|
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
2013-03-05 08:18:56 +01:00
|
|
|
minetest.log("action", S("%s takes stuff from refrigerator at %s"):format(
|
|
|
|
player:get_player_name(),
|
|
|
|
minetest.pos_to_string(pos)
|
|
|
|
))
|
|
|
|
end,
|
Various changes
Recipe changes:
Brass and wrought iron poles, table legs, and fences/railings were too
expensive in practice. Increased recipe outputs.
Small square glass table now comes from one small round table (instead of
three-to-two). Large square glass comes from one small square insted of two. Small round, small square, and large wooden tables follow the same pattern.
All glass tables can be recycled back into glass blocks via the Vessels mod's
recipes. All are 3:1 with glass fragments (and thus, 3:1 with glass blocks),
so there's no glass wasted.
All wooden tables can be crafted into sticks by putting three of a given item
onto the crafting grid. Any such craft yields 4 sticks, so there's no waste.
Other changes:
3d-ified nightstands, improved their textures somewhat.
New nodes:
* Added working oven (really just a furnace with new textures)
* Added mini-fridge that stores 24 slots
* Added kitchen cabinet that stores 24 slots
* Added half-size kitchen cabinet that stores 12 slots (6x2)
* Added kitchen sink with under-sink cabinet that stores 16 slots.
* Added slab-sized and half-slab-sized glowlights (e.g. ceiling fixtures)
* Added curtains in 6 colors: red, green, blue, purple, pink, white
Notes:
This mod now requires Moreblocks for some recipes - namely fridge and oven.
2012-09-30 07:51:59 +02:00
|
|
|
})
|
2014-06-25 06:24:03 +02:00
|
|
|
|
2014-08-14 20:05:41 +02:00
|
|
|
minetest.register_node("homedecor:refrigerator_steel_top", {
|
|
|
|
tiles = {
|
|
|
|
"homedecor_refrigerator_steel_top.png",
|
|
|
|
"default_steel_block.png",
|
|
|
|
"homedecor_refrigerator_steel_sides1.png",
|
|
|
|
"homedecor_refrigerator_steel_sides1.png^[transformFX",
|
|
|
|
"homedecor_refrigerator_steel_back1.png",
|
|
|
|
"homedecor_refrigerator_steel_front1.png"
|
|
|
|
},
|
|
|
|
drawtype = "nodebox",
|
|
|
|
paramtype = "light",
|
2014-06-25 06:24:03 +02:00
|
|
|
paramtype2 = "facedir",
|
2014-08-14 20:05:41 +02:00
|
|
|
groups = {snappy=3},
|
|
|
|
node_box = fridge_model_top,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { 0, 0, 0, 0, 0, 0 }
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- white, enameled fridge
|
|
|
|
|
|
|
|
minetest.register_node("homedecor:refrigerator_white_bottom", {
|
|
|
|
tiles = {
|
|
|
|
"default_steel_block.png",
|
|
|
|
"homedecor_refrigerator_white_bottom.png",
|
|
|
|
"homedecor_refrigerator_white_sides2.png",
|
|
|
|
"homedecor_refrigerator_white_sides2.png^[transformFX",
|
|
|
|
"homedecor_refrigerator_white_back2.png",
|
|
|
|
"homedecor_refrigerator_white_front2.png"
|
|
|
|
},
|
|
|
|
inventory_image = "homedecor_refrigerator_white_inv.png",
|
|
|
|
description = S("Refrigerator"),
|
|
|
|
drawtype = "nodebox",
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
groups = {snappy=3},
|
|
|
|
node_box = fridge_model_bottom,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 }
|
|
|
|
},
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
local pos = pointed_thing.under
|
|
|
|
local pnode = minetest.get_node(pointed_thing.under)
|
|
|
|
local rnodedef = minetest.registered_nodes[pnode.name]
|
|
|
|
|
|
|
|
if not rnodedef["buildable_to"] then
|
|
|
|
pos = pointed_thing.above
|
|
|
|
end
|
|
|
|
|
|
|
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
|
|
|
local pos2 = { x = pos.x, y=pos.y + 1, z = pos.z }
|
|
|
|
|
|
|
|
local tnode = minetest.get_node(pos)
|
|
|
|
local tnode2 = minetest.get_node(pos2)
|
|
|
|
|
|
|
|
if homedecor.get_nodedef_field(tnode.name, "buildable_to")
|
|
|
|
and homedecor.get_nodedef_field(tnode2.name, "buildable_to")
|
|
|
|
and not minetest.is_protected(pos, placer:get_player_name())
|
|
|
|
and not minetest.is_protected(pos2, placer:get_player_name()) then
|
2014-08-17 19:08:27 +02:00
|
|
|
local nodename = itemstack:get_name()
|
|
|
|
minetest.add_node(pos, { name = nodename, param2 = fdir })
|
2014-08-14 20:05:41 +02:00
|
|
|
minetest.add_node(pos2, { name = "homedecor:refrigerator_white_top", param2 = fdir })
|
|
|
|
if not homedecor.expect_infinite_stacks then
|
|
|
|
itemstack:take_item()
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
|
|
|
local pos2 = { x = pos.x, y=pos.y + 1, z = pos.z }
|
|
|
|
if minetest.get_node(pos2).name == "homedecor:refrigerator_white_top" then
|
|
|
|
minetest.remove_node(pos2)
|
|
|
|
end
|
|
|
|
end,
|
2014-06-25 06:24:03 +02:00
|
|
|
on_construct = function(pos)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
meta:set_string("formspec",
|
|
|
|
"size[10,10]"..
|
|
|
|
"list[current_name;main;0,0;10,5;]"..
|
|
|
|
"list[current_player;main;1,6;8,4;]")
|
2014-08-14 20:05:41 +02:00
|
|
|
meta:set_string("infotext", S("Refrigerator"))
|
2014-06-25 06:24:03 +02:00
|
|
|
local inv = meta:get_inventory()
|
|
|
|
inv:set_size("main",50)
|
|
|
|
end,
|
|
|
|
can_dig = function(pos,player)
|
|
|
|
local meta = minetest.get_meta(pos);
|
|
|
|
local inv = meta:get_inventory()
|
|
|
|
return inv:is_empty("main")
|
|
|
|
end,
|
|
|
|
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
2014-08-14 20:05:41 +02:00
|
|
|
minetest.log("action", S("%s moves stuff in refrigerator at %s"):format(
|
2014-06-25 06:24:03 +02:00
|
|
|
player:get_player_name(),
|
|
|
|
minetest.pos_to_string(pos)
|
|
|
|
))
|
|
|
|
end,
|
|
|
|
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
2014-08-14 20:05:41 +02:00
|
|
|
minetest.log("action", S("%s moves stuff to refrigerator at %s"):format(
|
2014-06-25 06:24:03 +02:00
|
|
|
player:get_player_name(),
|
|
|
|
minetest.pos_to_string(pos)
|
|
|
|
))
|
|
|
|
end,
|
|
|
|
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
2014-08-14 20:05:41 +02:00
|
|
|
minetest.log("action", S("%s takes stuff from refrigerator at %s"):format(
|
2014-06-25 06:24:03 +02:00
|
|
|
player:get_player_name(),
|
|
|
|
minetest.pos_to_string(pos)
|
|
|
|
))
|
|
|
|
end,
|
|
|
|
})
|
2014-08-14 20:05:41 +02:00
|
|
|
|
|
|
|
minetest.register_node("homedecor:refrigerator_white_top", {
|
|
|
|
tiles = {
|
|
|
|
"homedecor_refrigerator_white_top.png",
|
|
|
|
"default_steel_block.png",
|
|
|
|
"homedecor_refrigerator_white_sides1.png",
|
|
|
|
"homedecor_refrigerator_white_sides1.png^[transformFX",
|
|
|
|
"homedecor_refrigerator_white_back1.png",
|
|
|
|
"homedecor_refrigerator_white_front1.png"
|
|
|
|
},
|
|
|
|
drawtype = "nodebox",
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
groups = {snappy=3},
|
|
|
|
node_box = fridge_model_top,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { 0, 0, 0, 0, 0, 0 }
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- convert the old single-node fridges to the new two-node models
|
|
|
|
|
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "homedecor:refrigerator" },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
local fdir = node.param2
|
|
|
|
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
|
|
|
|
minetest.swap_node(pos, { name = "homedecor:refrigerator_white_bottom", param2 = fdir })
|
|
|
|
minetest.set_node(p_top, { name = "homedecor:refrigerator_white_top", param2 = fdir })
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "homedecor:refrigerator_locked" },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
local fdir = node.param2
|
|
|
|
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
|
|
|
|
minetest.swap_node(pos, { name = "homedecor:refrigerator_white_bottom_locked", param2 = fdir })
|
|
|
|
minetest.set_node(p_top, { name = "homedecor:refrigerator_white_top", param2 = fdir })
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "homedecor:refrigerator_steel" },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
local fdir = node.param2
|
|
|
|
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
|
|
|
|
minetest.swap_node(pos, { name = "homedecor:refrigerator_steel_bottom", param2 = fdir })
|
|
|
|
minetest.set_node(p_top, { name = "homedecor:refrigerator_steel_top", param2 = fdir })
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "homedecor:refrigerator_steel_locked" },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
local fdir = node.param2
|
|
|
|
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
|
|
|
|
minetest.swap_node(pos, { name = "homedecor:refrigerator_steel_bottom_locked", param2 = fdir })
|
|
|
|
minetest.set_node(p_top, { name = "homedecor:refrigerator_steel_top", param2 = fdir })
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|