@@ -5,12 +5,11 @@ minetest.register_craftitem(":technic:uranium_lump", {
5
5
description = S (" Uranium Lump" ),
6
6
inventory_image = " technic_uranium_lump.png" ,
7
7
})
8
- minetest .register_alias (" technic:uranium" , " technic:uranium_lump" )
9
8
10
9
minetest .register_craftitem (" :technic:uranium_ingot" , {
11
10
description = S (" Uranium Ingot" ),
12
11
inventory_image = " technic_uranium_ingot.png" ,
13
- groups = {uranium_ingot = 1 },
12
+ groups = {uranium_ingot = 1 },
14
13
})
15
14
16
15
minetest .register_craftitem (" :technic:chromium_lump" , {
@@ -48,14 +47,6 @@ minetest.register_craftitem(":technic:sulfur_lump", {
48
47
inventory_image = " technic_sulfur_lump.png" ,
49
48
})
50
49
51
- minetest .register_alias (" technic:wrought_iron_ingot" , " default:steel_ingot" )
52
-
53
- minetest .override_item (" default:steel_ingot" , {
54
- description = S (" Wrought Iron Ingot" ),
55
- -- make the color of the ingot a bit darker to separate it better from tin
56
- inventory_image = " technic_wrought_iron_ingot.png^[multiply:#bbbbbbff" ,
57
- })
58
-
59
50
minetest .register_craftitem (" :technic:cast_iron_ingot" , {
60
51
description = S (" Cast Iron Ingot" ),
61
52
inventory_image = " technic_cast_iron_ingot.png" ,
@@ -71,7 +62,21 @@ minetest.register_craftitem(":technic:stainless_steel_ingot", {
71
62
inventory_image = " technic_stainless_steel_ingot.png" ,
72
63
})
73
64
74
- local function register_block (block , ingot )
65
+ local blocks = {
66
+ " uranium" ,
67
+ " chromium" ,
68
+ " zinc" ,
69
+ " lead" ,
70
+ " cast_iron" ,
71
+ " carbon_steel" ,
72
+ " stainless_steel" ,
73
+ " sulfur" ,
74
+ }
75
+
76
+ for _ , name in pairs (blocks ) do
77
+ local block = " technic:" .. name .. " _block"
78
+ local ingot = " technic:" .. name .. " _ingot"
79
+
75
80
minetest .register_craft ({
76
81
output = block ,
77
82
recipe = {
@@ -83,112 +88,66 @@ local function register_block(block, ingot)
83
88
84
89
minetest .register_craft ({
85
90
output = ingot .. " 9" ,
86
- recipe = {
87
- {block }
88
- }
91
+ recipe = {{block }}
89
92
})
90
93
end
91
94
92
- register_block (" technic:uranium_block" , " technic:uranium_ingot" )
93
- register_block (" technic:chromium_block" , " technic:chromium_ingot" )
94
- register_block (" technic:zinc_block" , " technic:zinc_ingot" )
95
- register_block (" technic:lead_block" , " technic:lead_ingot" )
96
- register_block (" technic:cast_iron_block" , " technic:cast_iron_ingot" )
97
- register_block (" technic:carbon_steel_block" , " technic:carbon_steel_ingot" )
98
- register_block (" technic:stainless_steel_block" , " technic:stainless_steel_ingot" )
99
- register_block (" technic:sulfur_block" , " technic:sulfur_lump" )
100
-
101
95
minetest .register_craft ({
102
- type = ' cooking' ,
96
+ type = " cooking" ,
103
97
recipe = " technic:zinc_lump" ,
104
98
output = " technic:zinc_ingot" ,
105
99
})
106
100
107
101
minetest .register_craft ({
108
- type = ' cooking' ,
102
+ type = " cooking" ,
109
103
recipe = " technic:chromium_lump" ,
110
104
output = " technic:chromium_ingot" ,
111
105
})
112
106
113
107
minetest .register_craft ({
114
- type = ' cooking' ,
108
+ type = " cooking" ,
115
109
recipe = " technic:uranium_lump" ,
116
110
output = " technic:uranium_ingot" ,
117
111
})
118
112
119
113
minetest .register_craft ({
120
- type = ' cooking' ,
114
+ type = " cooking" ,
121
115
recipe = " technic:lead_lump" ,
122
116
output = " technic:lead_ingot" ,
123
117
})
124
118
125
-
126
119
minetest .register_craft ({
127
- type = ' cooking' ,
128
- recipe = minetest . registered_aliases [ " technic:wrought_iron_ingot " ] ,
120
+ type = " cooking" ,
121
+ recipe = " default:steel_ingot " ,
129
122
output = " technic:cast_iron_ingot" ,
130
123
})
131
124
132
125
minetest .register_craft ({
133
- type = ' cooking' ,
126
+ type = " cooking" ,
134
127
recipe = " technic:cast_iron_ingot" ,
135
128
cooktime = 2 ,
136
129
output = " technic:wrought_iron_ingot" ,
137
130
})
138
131
139
132
minetest .register_craft ({
140
- type = ' cooking' ,
133
+ type = " cooking" ,
141
134
recipe = " technic:carbon_steel_ingot" ,
142
135
cooktime = 2 ,
143
136
output = " technic:wrought_iron_ingot" ,
144
137
})
145
138
146
- local function for_each_registered_item (action )
147
- local already_reg = {}
148
- for k , _ in pairs (minetest .registered_items ) do
149
- table.insert (already_reg , k )
150
- end
151
- local really_register_craftitem = minetest .register_craftitem
152
- minetest .register_craftitem = function (name , def )
153
- really_register_craftitem (name , def )
154
- action (string.gsub (name , " ^:" , " " ))
155
- end
156
- local really_register_tool = minetest .register_tool
157
- minetest .register_tool = function (name , def )
158
- really_register_tool (name , def )
159
- action (string.gsub (name , " ^:" , " " ))
160
- end
161
- local really_register_node = minetest .register_node
162
- minetest .register_node = function (name , def )
163
- really_register_node (name , def )
164
- action (string.gsub (name , " ^:" , " " ))
165
- end
166
- for _ , name in ipairs (already_reg ) do
167
- action (name )
168
- end
169
- end
170
-
171
- local steel_to_iron = {}
172
- for _ , i in ipairs ({
173
- " default:axe_steel" ,
174
- " default:pick_steel" ,
175
- " default:shovel_steel" ,
176
- " default:sword_steel" ,
177
- " doors:door_steel" ,
178
- " farming:hoe_steel" ,
179
- " glooptest:hammer_steel" ,
180
- " glooptest:handsaw_steel" ,
181
- " glooptest:reinforced_crystal_glass" ,
182
- " mesecons_doors:op_door_steel" ,
183
- " mesecons_doors:sig_door_steel" ,
184
- " vessels:steel_bottle" ,
185
- }) do
186
- steel_to_iron [i ] = true
187
- end
139
+ minetest .register_craft ({
140
+ output = " technic:marble_bricks 4" ,
141
+ recipe = {
142
+ {" technic:marble" ," technic:marble" },
143
+ {" technic:marble" ," technic:marble" }
144
+ }
145
+ })
188
146
189
- for_each_registered_item (function (item_name )
190
- local item_def = minetest .registered_items [item_name ]
191
- if steel_to_iron [item_name ] and string.find (item_def .description , " Steel" ) then
192
- minetest .override_item (item_name , { description = string.gsub (item_def .description , " Steel" , S (" Iron" )) })
193
- end
194
- end )
147
+ minetest .register_craft ({
148
+ output = " technic:granite_bricks 4" ,
149
+ recipe = {
150
+ {" technic:granite" ," technic:granite" },
151
+ {" technic:granite" ," technic:granite" }
152
+ }
153
+ })
0 commit comments