/ bjvxlx_computers / components.lua
components.lua
  1  local mod = bjvxlx.computers
  2  local S = mod.translate
  3  
  4  minetest.register_craftitem('bjvxlx_computers:copper_wire_spool', {
  5      description = S("Spool of Copper Wire"),
  6      _doc_items_longdesc = S(table.concat({
  7          "A spool of copper wire contains a full stack of copper wire.",
  8          "The wire can be extracted from the spool via ordinary crafting."
  9      }, ' ')),
 10      inventory_image = "bjvxlx_computers_copper_wire_spool.png",
 11      stack_max = 64
 12  })
 13  bjvxlx.engineering.register_blueprint({
 14      output = 'bjvxlx_computers:copper_wire_spool',
 15      recipe = {
 16          {'', 'mcl_copper:copper_ingot', ''},
 17          {'mcl_copper:copper_ingot', '', 'mcl_copper:copper_ingot'},
 18          {'', 'mcl_copper:copper_ingot', ''}
 19      },
 20      tool = 'mcl_tools:shears'
 21  })
 22  
 23  minetest.register_craftitem('bjvxlx_computers:copper_wire', {
 24      description = S("Copper Wire"),
 25      _doc_items_longdesc = S(table.concat({
 26          "Copper wires can be used in engineering recipes",
 27          "for micro-redstone devices and similar."
 28      }, ' ')),
 29      inventory_image = "bjvxlx_computers_copper_wire.png",
 30      stack_max = 64
 31  })
 32  minetest.register_craft({
 33      type = 'shapeless',
 34      output = 'bjvxlx_computers:copper_wire 64',
 35      recipe = {'bjvxlx_computers:copper_wire_spool'}
 36  })
 37  
 38  minetest.register_craftitem('bjvxlx_computers:silicon_wafer', {
 39      description = S("Silicon Wafer"),
 40      _doc_items_longdesc = S(table.concat({
 41          "Silicon wafers can be used in engineering recipes",
 42          "for computer components."
 43      }, ' ')),
 44      inventory_image = "bjvxlx_computers_silicon_wafer.png",
 45      stack_max = 64
 46  })
 47  bjvxlx.engineering.register_blueprint({
 48      output = 'bjvxlx_computers:silicon_wafer',
 49      recipe = {
 50          {'bjvxlx_silicon:silicon_nugget',
 51              'bjvxlx_silicon:silicon_nugget',
 52              'bjvxlx_silicon:silicon_nugget'},
 53          {'bjvxlx_silicon:silicon_nugget',
 54              'bjvxlx_silicon:silicon_nugget',
 55              'bjvxlx_silicon:silicon_nugget'},
 56          {'bjvxlx_silicon:silicon_nugget',
 57              'bjvxlx_silicon:silicon_nugget',
 58              'bjvxlx_silicon:silicon_nugget'}
 59      },
 60      tool = 'bjvxlx_computers:soldering_iron'
 61  })
 62  
 63  minetest.register_craftitem('bjvxlx_computers:integrated_circuit', {
 64      description = S("Integrated Circuit"),
 65      _doc_items_longdesc = S(table.concat({
 66          "An integrated circuit is a micro-redstone circuit",
 67          "heat-etched into the surface of a silicon wafer.",
 68          "With further engineering, it can be adapted",
 69          "for certain specific computational purposes."
 70      }, ' ')),
 71      inventory_image = "bjvxlx_computers_integrated_circuit.png",
 72      stack_max = 64
 73  })
 74  bjvxlx.engineering.register_blueprint({
 75      output = 'bjvxlx_computers:integrated_circuit',
 76      recipe = {
 77          {'', 'mesecons:wire_00000000_off', ''},
 78          {'mesecons:wire_00000000_off', 'bjvxlx_computers:silicon_wafer',
 79              'mesecons:wire_00000000_off'},
 80          {'', 'mesecons:wire_00000000_off', ''}
 81      },
 82      tool = 'bjvxlx_computers:soldering_iron'
 83  })
 84  
 85  minetest.register_craftitem('bjvxlx_computers:alu', {
 86      description = S("Arithmetic Logic Unit"),
 87      _doc_items_longdesc = S(table.concat({
 88          "The ALU is a required component of a CPU.",
 89          "It implements operations which transform data,",
 90          "as opposed to those which load or store it."
 91      }, ' ')),
 92      inventory_image = "bjvxlx_computers_integrated_circuit_red.png",
 93      stack_max = 64
 94  })
 95  bjvxlx.engineering.register_blueprint({
 96      output = 'bjvxlx_computers:alu',
 97      recipe = {
 98          {'mesecons:wire_00000000_off',
 99              'mcl_comparators:comparator_off_comp',
100              'mesecons:wire_00000000_off'},
101          {'mcl_comparators:comparator_off_comp',
102              'bjvxlx_computers:integrated_circuit',
103              'mcl_comparators:comparator_off_comp'},
104          {'mesecons:wire_00000000_off',
105              'mcl_comparators:comparator_off_comp',
106              'mesecons:wire_00000000_off'}
107      },
108      tool = 'bjvxlx_computers:soldering_iron'
109  })
110  
111  minetest.register_craftitem('bjvxlx_computers:register_bank', {
112      description = S("Register Bank"),
113      _doc_items_longdesc = S(table.concat({
114          "A register bank stores small amounts of digital information.",
115          "It is a required component in a CPU,",
116          "where it implements a small set of high-speed temporary variables.",
117          "In addition to this, it is the basic building block of RAM."
118      }, ' ')),
119      inventory_image = "bjvxlx_computers_integrated_circuit_green.png",
120      stack_max = 64
121  })
122  bjvxlx.engineering.register_blueprint({
123      output = 'bjvxlx_computers:register_bank',
124      recipe = {
125          {'bjvxlx_bronze:bronze_nugget',
126              'mesecons_walllever:wall_lever_off',
127              'bjvxlx_bronze:bronze_nugget'},
128          {'mesecons_walllever:wall_lever_off',
129              'bjvxlx_computers:integrated_circuit',
130              'mesecons_walllever:wall_lever_off'},
131          {'bjvxlx_bronze:bronze_nugget',
132              'mesecons_walllever:wall_lever_off',
133              'bjvxlx_bronze:bronze_nugget'}
134      },
135      tool = 'bjvxlx_computers:soldering_iron'
136  })
137  
138  minetest.register_craftitem('bjvxlx_computers:oscillator', {
139      description = S("Oscillator"),
140      _doc_items_longdesc = S(table.concat({
141          "An oscillator dispatches a micro-redstone signal",
142          "which alternates at a highly reliable fixed rate.",
143          "It is a required component in a CPU,",
144          "where it allows operations to occur in sequence."
145      }, ' ')),
146      inventory_image = "bjvxlx_computers_integrated_circuit_yellow.png",
147      stack_max = 64
148  })
149  bjvxlx.engineering.register_blueprint({
150      output = 'bjvxlx_computers:oscillator',
151      recipe = {
152          {'mcl_core:gold_nugget',
153              'mesecons_delayer:delayer_off_1',
154              'mcl_core:gold_nugget'},
155          {'mesecons_delayer:delayer_off_1',
156              'bjvxlx_computers:integrated_circuit',
157              'mesecons_delayer:delayer_off_1'},
158          {'mcl_core:gold_nugget',
159              'mesecons_delayer:delayer_off_1',
160              'mcl_core:gold_nugget'}
161      },
162      tool = 'bjvxlx_computers:soldering_iron'
163  })
164  
165  minetest.register_craftitem('bjvxlx_computers:mcu', {
166      description = S("Memory Control Unit"),
167      _doc_items_longdesc = S(table.concat({
168          "A memory control unit is a required component in a CPU.",
169          "It arbitrates register accesses among the other components,",
170          "as well as RAM accesses by the CPU as a whole."
171      }, ' ')),
172      inventory_image = "bjvxlx_computers_integrated_circuit_blue.png",
173      stack_max = 64
174  })
175  bjvxlx.engineering.register_blueprint({
176      output = 'bjvxlx_computers:mcu',
177      recipe = {
178          {'mcl_core:iron_nugget',
179              'mcl_comparators:comparator_off_comp',
180              'mcl_core:iron_nugget'},
181          {'mesecons_delayer:delayer_off_1',
182              'bjvxlx_computers:integrated_circuit',
183              'mesecons_delayer:delayer_off_1'},
184          {'mcl_core:iron_nugget',
185              'mcl_comparators:comparator_off_comp',
186              'mcl_core:iron_nugget'}
187      },
188      tool = 'bjvxlx_computers:soldering_iron'
189  })
190  
191  minetest.register_craftitem('bjvxlx_computers:cpu', {
192      description = S("Central Processing Unit"),
193      _doc_items_longdesc = S(table.concat({
194          "The central processing unit is the core component of a computer.",
195          "If you imagine the computer as a box",
196          "where a funny little gnome lives,",
197          "and you can order them to do things",
198          "by passing a scratch pad in and out of the room,",
199          "then the CPU is the gnome.",
200          "It is the part of the computer that reads your instructions",
201          "and knows how to carry them out."
202      }, ' ')),
203      inventory_image = "bjvxlx_computers_cpu.png",
204      stack_max = 64
205  })
206  bjvxlx.engineering.register_blueprint({
207      output = 'bjvxlx_computers:cpu',
208      recipe = {
209          {'bjvxlx_computers:copper_wire',
210              'bjvxlx_computers:alu',
211              'bjvxlx_computers:copper_wire'},
212          {'bjvxlx_computers:oscillator',
213              'mcl_core:diamond',
214              'bjvxlx_computers:register_bank'},
215          {'bjvxlx_computers:copper_wire',
216              'bjvxlx_computers:mcu',
217              'bjvxlx_computers:copper_wire'}
218      },
219      tool = 'bjvxlx_computers:soldering_iron'
220  })
221  
222  minetest.register_craftitem('bjvxlx_computers:ram', {
223      description = S("Random-Access Memory"),
224      _doc_items_longdesc = S(table.concat({
225          "Random-access memory modules are essential components",
226          "of a computer. If you imagine the computer as a box",
227          "where a funny little gnome lives,",
228          "and you can order them to do things",
229          "by passing a scratch pad in and out of the room,",
230          "then the RAM is the scratch pad.",
231          "It is the part of the computer which is used as a medium",
232          "to temporarily store information and instructions to execute."
233      }, ' ')),
234      inventory_image = "bjvxlx_computers_ram.png",
235      stack_max = 64
236  })
237  bjvxlx.engineering.register_blueprint({
238      output = 'bjvxlx_computers:ram',
239      recipe = {
240          {'bjvxlx_computers:register_bank',
241              'bjvxlx_computers:register_bank',
242              'bjvxlx_computers:register_bank'},
243          {'bjvxlx_computers:register_bank',
244              'bjvxlx_computers:copper_wire_spool',
245              'bjvxlx_computers:register_bank'},
246          {'bjvxlx_computers:register_bank',
247              'bjvxlx_computers:register_bank',
248              'bjvxlx_computers:register_bank'}
249      },
250      tool = 'bjvxlx_computers:soldering_iron'
251  })
252  
253  minetest.register_craftitem('bjvxlx_computers:keyboard', {
254      description = S("Keyboard"),
255      _doc_items_longdesc = S(table.concat({
256          "A keyboard is a computer component.",
257          "It is theoretically possible to build a computer without it,",
258          "but such a device would be useless,",
259          "because the keyboard is the module",
260          "which allows the user to interact with the computer."
261      }, ' ')),
262      inventory_image = "bjvxlx_computers_keyboard.png",
263      stack_max = 64
264  })
265  bjvxlx.engineering.register_blueprint({
266      output = 'bjvxlx_computers:keyboard',
267      recipe = {
268          {'mesecons_button:button_stone_off',
269              'mesecons_button:button_stone_off',
270              'mesecons_button:button_stone_off'},
271          {'mesecons_button:button_stone_off',
272              'mesecons_button:button_stone_off',
273              'mesecons_button:button_stone_off'},
274          {'bjvxlx_computers:copper_wire',
275              'bjvxlx_computers:integrated_circuit',
276              'bjvxlx_computers:copper_wire'}
277      },
278      tool = 'screwdriver:screwdriver'
279  })
280  
281  minetest.register_craftitem('bjvxlx_computers:monitor', {
282      description = S("Monitor"),
283      _doc_items_longdesc = S(table.concat({
284          "A monitor is a computer component.",
285          "It is theoretically possible to build a computer without it,",
286          "but such a device would be useless,",
287          "because the monitor is the module",
288          "which allows the user to view the results",
289          "of operations which the computer carries out on their behalf."
290      }, ' ')),
291      inventory_image = "bjvxlx_computers_monitor.png",
292      stack_max = 64
293  })
294  bjvxlx.engineering.register_blueprint({
295      output = 'bjvxlx_computers:monitor',
296      recipe = {
297          {'mesecons_lightstone:lightstone_off',
298              'mesecons_lightstone:lightstone_off',
299              'mesecons_lightstone:lightstone_off'},
300          {'mesecons_lightstone:lightstone_off',
301              'mesecons_lightstone:lightstone_off',
302              'mesecons_lightstone:lightstone_off'},
303          {'mesecons_lightstone:lightstone_off',
304              'mesecons_lightstone:lightstone_off',
305              'mesecons_lightstone:lightstone_off'}
306      },
307      tool = 'screwdriver:screwdriver'
308  })
309  
310  minetest.register_craftitem('bjvxlx_computers:floppy', {
311      description = S("Floppy Disk"),
312      _doc_items_longdesc = S(table.concat({
313          "A floppy disk is a persistent storage device",
314          "for use with computers. It encodes data",
315          "via selective magnetization of sectors",
316          "of a spinning metal disk inside its chassis."
317      }, ' ')),
318      inventory_image = "bjvxlx_computers_floppy.png",
319      stack_max = 1
320  })
321  bjvxlx.engineering.register_blueprint({
322      output = 'bjvxlx_computers:floppy',
323      recipe = {
324          {'mcl_core:iron_nugget',
325              'mcl_core:iron_ingot',
326              'mcl_core:iron_nugget'},
327          {'mcl_core:iron_ingot',
328              'bjvxlx_computers:mcu',
329              'mcl_core:iron_ingot'},
330          {'mcl_core:iron_nugget',
331              'mcl_core:iron_ingot',
332              'mcl_core:iron_nugget'}
333      },
334      tool = 'screwdriver:screwdriver'
335  })
336  
337  minetest.register_craftitem('bjvxlx_computers:mineos_floppy', {
338      description = S("MineOS Bootdisk"),
339      _doc_items_longdesc = S(table.concat({
340          "This floppy disk is currently unusable for data storage,",
341          "because it instead holds a copy of MineOS, an operating system.",
342          "The operating system is the core program",
343          "which tells the computer how to run other programs",
344          "and generally what to do at all times.",
345          "It is usually necessary for MineOS to be inserted",
346          "into a computer's bootdisk slot in order for the computer",
347          "to function."
348      }, ' ')),
349      inventory_image = "bjvxlx_computers_floppy.png",
350      color = "#c0c0ffff",
351      stack_max = 1
352  })