RealBadAngel
2013-04-06 4139e918669972c925c793539b1a425e2f67a745
commit | author | age
82cba9 1 minetest.register_craft({
R 2     output = 'technic:iron_chest 1',
3     recipe = {
4         {'default:steel_ingot','default:steel_ingot','default:steel_ingot'},
5         {'default:steel_ingot','default:chest','default:steel_ingot'},
6         {'default:steel_ingot','default:steel_ingot','default:steel_ingot'},
7     }
8 })
9
10 minetest.register_craft({
11     output = 'technic:iron_locked_chest 1',
12     recipe = {
13         {'default:steel_ingot','default:steel_ingot','default:steel_ingot'},
14         {'default:steel_ingot','default:chest_locked','default:steel_ingot'},
15         {'default:steel_ingot','default:steel_ingot','default:steel_ingot'},
16     }
17 })
18
19 minetest.register_craft({
20     output = 'technic:iron_locked_chest 1',
21     recipe = {
22         {'default:steel_ingot'},
23         {'technic:iron_chest'},
24     }
25 })
26
27
fd3f25 28 minetest.register_craftitem(":technic:iron_chest", {
82cba9 29     description = "Iron Chest",
R 30     stack_max = 99,
31 })
fd3f25 32 minetest.register_craftitem(":technic:iron_locked_chest", {
82cba9 33     description = "Iron Locked Chest",
R 34     stack_max = 99,
35 })
36
fd3f25 37 minetest.register_node(":technic:iron_chest", {
82cba9 38     description = "Iron Chest",
R 39     tiles = {"technic_iron_chest_top.png", "technic_iron_chest_top.png", "technic_iron_chest_side.png",
40         "technic_iron_chest_side.png", "technic_iron_chest_side.png", "technic_iron_chest_front.png"},
41     paramtype2 = "facedir",
42     groups = chest_groups1,
43     tube = tubes_properties,
44     legacy_facedir_simple = true,
45     sounds = default.node_sound_wood_defaults(),
46     on_construct = function(pos)
47         local meta = minetest.env:get_meta(pos)
48         meta:set_string("formspec",
49                 "invsize[9,9;]"..
50                 "list[current_name;main;0,0;9,4;]"..
51                 "list[current_player;main;0,5;8,4;]")
52         meta:set_string("infotext", "Iron Chest")
53         local inv = meta:get_inventory()
54         inv:set_size("main", 9*4)
55     end,
56     can_dig = chest_can_dig,
57     on_metadata_inventory_move = def_on_metadata_inventory_move,
58     on_metadata_inventory_put = def_on_metadata_inventory_put,
59     on_metadata_inventory_take = def_on_metadata_inventory_take 
60 })
61
fd3f25 62 minetest.register_node(":technic:iron_locked_chest", {
82cba9 63     description = "Iron Locked Chest",
R 64     tiles = {"technic_iron_chest_top.png", "technic_iron_chest_top.png", "technic_iron_chest_side.png",
65         "technic_iron_chest_side.png", "technic_iron_chest_side.png", "technic_iron_chest_locked.png"},
66     paramtype2 = "facedir",
67     groups = chest_groups1,
68     tube = tubes_properties,
69     legacy_facedir_simple = true,
70     sounds = default.node_sound_wood_defaults(),
71     after_place_node = function(pos, placer)
72         local meta = minetest.env:get_meta(pos)
73         meta:set_string("owner", placer:get_player_name() or "")
74         meta:set_string("infotext", "Locked Iron Chest (owned by "..
75                 meta:get_string("owner")..")")
76     end,
77     on_construct = function(pos)
78         local meta = minetest.env:get_meta(pos)
79         meta:set_string("formspec",
80                 "invsize[9,9;]"..
81                 "list[current_name;main;0,0;9,4;]"..
82                 "list[current_player;main;0,5;8,4;]")
83         meta:set_string("infotext", "Iron Locked Chest")
84         meta:set_string("owner", "")
85         local inv = meta:get_inventory()
86         inv:set_size("main", 9*4)
87     end,
88     can_dig = chest_can_dig,
89     allow_metadata_inventory_move = def_allow_metadata_inventory_move,
90     allow_metadata_inventory_put = def_allow_metadata_inventory_put,
91     allow_metadata_inventory_take = def_allow_metadata_inventory_take,
92     on_metadata_inventory_move = def_on_metadata_inventory_move,
93     on_metadata_inventory_put = def_on_metadata_inventory_put,
94     on_metadata_inventory_take = def_on_metadata_inventory_take 
95 })