diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2016-04-01 20:02:19 -0400 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2016-04-01 21:09:33 -0400 |
commit | da66780a569712c23ae4f2996cfb4608a9f9d69d (patch) | |
tree | 217556029a78bc23ad4564720afc86de97228a04 /cottages/nodes_chests.lua | |
parent | 615b22df4d423aded3613db7716943a2f389b047 (diff) | |
download | dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar.gz dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar.bz2 dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar.xz dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.zip |
copy all standard Dreambuilder mods in from the old subgame
(exactly as last supplied there, updates to these mods will follow later)
Diffstat (limited to 'cottages/nodes_chests.lua')
-rw-r--r-- | cottages/nodes_chests.lua | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/cottages/nodes_chests.lua b/cottages/nodes_chests.lua new file mode 100644 index 0000000..c099749 --- /dev/null +++ b/cottages/nodes_chests.lua @@ -0,0 +1,61 @@ + +-- TODO: make these chests as chests and indicate that they are owned by npc +-- TODO: add bags (not for carrying around but for decoration) + +-- Boilerplate to support localized strings if intllib mod is installed. +local S = cottages.S + +cottages_chests = {} +-- uses default.chest_formspec for now +cottages_chests.on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec",default.chest_formspec) +-- meta:set_string("infotext", "Chest") + local inv = meta:get_inventory() + inv:set_size("main", 8*4) + end + +cottages_chests.can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("main") + end + +-- the chests do not need receipes since they are only placeholders and not intended to be built by players +-- (they are later on supposed to be filled with diffrent items by fill_chest.lua) +minetest.register_node("cottages:chest_private", { + description = S("private NPC chest"), + infotext = "chest containing the possesions of one of the inhabitants", + tiles = cottages.texture_chest, + paramtype2 = "facedir", + groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, + legacy_facedir_simple = true, + on_construct = cottages_chests.on_construct, + can_dig = cottages_chests.can_dig, + is_ground_content = false, +}) + +minetest.register_node("cottages:chest_work", { + description = S("chest for work utils and kitchens"), + infotext = "everything the inhabitant needs for his work", + tiles = cottages.texture_chest, + paramtype2 = "facedir", + groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, + legacy_facedir_simple = true, + on_construct = cottages_chests.on_construct, + can_dig = cottages_chests.can_dig, + is_ground_content = false, +}) + +minetest.register_node("cottages:chest_storage", { + description = S("storage chest"), + infotext = "stored food reserves", + tiles = cottages.texture_chest, + paramtype2 = "facedir", + groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, + legacy_facedir_simple = true, + on_construct = cottages_chests.on_construct, + can_dig = cottages_chests.can_dig, + is_ground_content = false, +}) + |