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