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