diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-06-01 18:07:22 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-06-03 22:31:00 +0300 |
commit | 29f03756bd7494ee6ceffd555c3b93a19295324d (patch) | |
tree | 015fc91771209566972ce505c6cf4bf8cf1eeb67 /games | |
parent | fe8c5546f09a6dbe410cde0a7cd99a3f4031ce8e (diff) | |
download | minetest-29f03756bd7494ee6ceffd555c3b93a19295324d.tar.gz minetest-29f03756bd7494ee6ceffd555c3b93a19295324d.tar.bz2 minetest-29f03756bd7494ee6ceffd555c3b93a19295324d.zip |
Attempt to begin to implement chests and furnace in Lua (with problems)
Diffstat (limited to 'games')
-rw-r--r-- | games/minimal/mods/default/init.lua | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua index 952c114db..516968f38 100644 --- a/games/minimal/mods/default/init.lua +++ b/games/minimal/mods/default/init.lua @@ -1119,10 +1119,18 @@ minetest.register_node("default:chest", { tile_images = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png", "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"}, paramtype2 = "facedir", - metadata_name = "chest", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, 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_player;main;0,5;8,4;]") + meta:set_string("infotext", "Chest"); + end, }) minetest.register_node("default:chest_locked", { @@ -1130,10 +1138,18 @@ minetest.register_node("default:chest_locked", { tile_images = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png", "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"}, paramtype2 = "facedir", - metadata_name = "locked_chest", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, 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_player;main;0,5;8,4;]") + meta:set_string("infotext", "Locked Chest"); + end, }) minetest.register_node("default:furnace", { @@ -1141,10 +1157,19 @@ minetest.register_node("default:furnace", { tile_images = {"default_furnace_side.png", "default_furnace_side.png", "default_furnace_side.png", "default_furnace_side.png", "default_furnace_side.png", "default_furnace_front.png"}, paramtype2 = "facedir", - metadata_name = "furnace", groups = {cracky=2}, legacy_facedir_simple = true, sounds = default.node_sound_stone_defaults(), + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + meta:set_string("formspec", + "invsize[8,9;]".. + "list[current_name;fuel;2,3;1,1;]".. + "list[current_name;src;2,1;1,1;]".. + "list[current_name;dst;5,1;2,2;]".. + "list[current_player;main;0,5;8,4;]") + meta:set_string("infotext", "Furnace"); + end, }) minetest.register_node("default:cobble", { |