diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-06-01 19:51:24 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-06-03 22:31:00 +0300 |
commit | 70c98c997221e81993e12815afa0ed8bf371fda9 (patch) | |
tree | d871610ba1cd76d08729448b22c6886369fcae18 /games/minimal/mods | |
parent | 45f32838b910abb6bf106ee043a4890a3325c8e3 (diff) | |
download | minetest-70c98c997221e81993e12815afa0ed8bf371fda9.tar.gz minetest-70c98c997221e81993e12815afa0ed8bf371fda9.tar.bz2 minetest-70c98c997221e81993e12815afa0ed8bf371fda9.zip |
Properly create metadata inventories in minimal
Diffstat (limited to 'games/minimal/mods')
-rw-r--r-- | games/minimal/mods/default/init.lua | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua index ed16e6a37..9573db119 100644 --- a/games/minimal/mods/default/init.lua +++ b/games/minimal/mods/default/init.lua @@ -1129,13 +1129,14 @@ minetest.register_node("default:chest", { legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), on_construct = function(pos) - --local n = minetest.env:get_node(pos) local meta = minetest.env:get_meta(pos) meta:set_string("formspec", "invsize[8,9;]".. - "list[current_name;0;0,0;8,4;]".. + "list[current_name;main;0,0;8,4;]".. "list[current_player;main;0,5;8,4;]") meta:set_string("infotext", "Chest"); + local inv = meta:get_inventory() + inv:set_size("main", 8*4) end, }) @@ -1148,13 +1149,14 @@ minetest.register_node("default:chest_locked", { legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), on_construct = function(pos) - --local n = minetest.env:get_node(pos) local meta = minetest.env:get_meta(pos) meta:set_string("formspec", "invsize[8,9;]".. - "list[current_name;0;0,0;8,4;]".. + "list[current_name;main;0,0;8,4;]".. "list[current_player;main;0,5;8,4;]") meta:set_string("infotext", "Locked Chest"); + local inv = meta:get_inventory() + inv:set_size("main", 8*4) end, }) @@ -1175,6 +1177,10 @@ minetest.register_node("default:furnace", { "list[current_name;dst;5,1;2,2;]".. "list[current_player;main;0,5;8,4;]") meta:set_string("infotext", "Furnace"); + local inv = meta:get_inventory() + inv:set_size("fuel", 1) + inv:set_size("src", 1) + inv:set_size("dst", 4) end, }) |