diff options
author | h-v-smacker <hans-von-smacker+github@gmail.com> | 2018-07-15 02:24:40 +0300 |
---|---|---|
committer | h-v-smacker <hans-von-smacker+github@gmail.com> | 2018-07-15 02:24:40 +0300 |
commit | db05f23b54d775d7f0de1618c80aeb9938896d91 (patch) | |
tree | bd302ceeeff777001437ea43e9324d41de08043c /nodes_chests.lua | |
parent | 0539c2123cdb75610d8d6c4d8ac35491b1dd480e (diff) |
formspec fixes and cleanup
Diffstat (limited to 'nodes_chests.lua')
-rw-r--r-- | nodes_chests.lua | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/nodes_chests.lua b/nodes_chests.lua index bc7bbbc..eb1e946 100644 --- a/nodes_chests.lua +++ b/nodes_chests.lua @@ -8,54 +8,54 @@ 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) + 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 + 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 + 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", + 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, + 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", + 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, + 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", + 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, + 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, }) |