├── .gitattributes
├── LICENSE
├── README.md
├── docs
├── component.lua
├── components
│ ├── abstracts
│ │ ├── BaseComponent.lua
│ │ └── CommonNetworkAPI.lua
│ ├── aemultipart.lua
│ ├── database.lua
│ ├── glasses.lua
│ ├── gpu.lua
│ ├── gt_machine.lua
│ ├── inventory_controller.lua
│ ├── level_maintainer.lua
│ ├── me_controller.lua
│ ├── me_exportbus.lua
│ ├── me_interface.lua
│ ├── redstone.lua
│ ├── screen.lua
│ └── tilechest.lua
├── robot.lua
├── sides.lua
└── type_definitions
│ ├── ae_types
│ ├── AECpu.lua
│ ├── AECpuMetadata.lua
│ ├── AECraftable.lua
│ ├── AECraftingJob.lua
│ ├── LevelMaintainerSlot.lua
│ ├── MEFluidStack.lua
│ ├── MEItemStack.lua
│ ├── MEItemStackFilter.lua
│ ├── MEPattern.lua
│ └── MEPatternSlot.lua
│ ├── ar_glasses
│ ├── interfaces
│ │ ├── I2DVertex.lua
│ │ ├── I3DPositionable.lua
│ │ ├── I3DVertex.lua
│ │ ├── IAlpha.lua
│ │ ├── IAttribute.lua
│ │ ├── IColorizable.lua
│ │ ├── IItemable.lua
│ │ ├── ILookable.lua
│ │ ├── IPositionable.lua
│ │ ├── IResizable.lua
│ │ ├── IRotatable.lua
│ │ ├── IScalable.lua
│ │ ├── ITextable.lua
│ │ ├── IThroughVisibility.lua
│ │ └── IViewDistance.lua
│ └── widgets
│ │ ├── 2d
│ │ ├── Dot2D.lua
│ │ ├── ItemIcon2D.lua
│ │ ├── Quad2D.lua
│ │ ├── Rect2D.lua
│ │ ├── Text2D.lua
│ │ └── Triangle2D.lua
│ │ └── 3d
│ │ ├── Cube3D.lua
│ │ ├── Dot3D.lua
│ │ ├── Line3D.lua
│ │ ├── Quad3D.lua
│ │ ├── Text3D.lua
│ │ └── Triangle3D.lua
│ ├── ic2_types
│ └── CropNBT.lua
│ └── oc_types
│ ├── EssentiaStack.lua
│ ├── FluidStack.lua
│ └── ItemStack.lua
├── example.png
└── image.png
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GTNH-OCLuaDocumentation
2 | Basic Lua documentation for Open Computer types for use with GTNH
3 | 
4 |
5 | ## How to use for auto-completion in VS Code
6 | 1. Install this extension: https://marketplace.visualstudio.com/items?itemName=sumneko.lua
7 | 2. Open the VS code settings (Ctrl+,).
8 | 3. Switch to the `Workspace` tab.
9 | 4. Search for `Lua.workspace.library`.
10 | 5. Click `Add Item` and enter the path to `docs` folder in the input.
11 | 6. Click OK
12 |
13 | 
--------------------------------------------------------------------------------
/docs/component.lua:
--------------------------------------------------------------------------------
1 | ---@meta 'component'
2 |
3 | ---@class component
4 | ---@field gt_machine gt_machine
5 | ---@field inventory_controller inventory_controller
6 | ---@field gpu gpu
7 | ---@field screen screen
8 | ---@field glasses glasses
9 | ---@field aemultipart aemultipart
10 | ---@field me_interface me_interface
11 | ---@field me_exportbus me_exportbus
12 | ---@field me_controller me_controller
13 | ---@field level_maintainer level_maintainer
14 | ---@field tilechests tilechest
15 | ---@field database database
16 | ---@field redstone redstone
17 | local component = {}
18 |
19 |
20 | ---Returns the documentation string for the method with the specified name of the component with the specified address, if any.
21 | ---
22 | ---Note that you can also get this string by using tostring on a method in a proxy, for example tostring(component.screen.isOn).
23 | ---@param address string # The address of a component
24 | ---@param methodName string # The name of the method
25 | function component.doc(address, methodName) end
26 |
27 |
28 | ---Calls the method with the specified name on the component with the specified address,
29 | ---passing the remaining arguments as arguments to that method.
30 | ---Depending on the called method's implementation this may throw an error.
31 | ---@param address string # The address of the component
32 | ---@param methodName string # The name of the method to invoke
33 | ---@vararg ... # The parameters for the method
34 | ---@return any # Return type depends on the method invoked, annotation casting is reccomended.
35 | function component.invoke(address, methodName, ...) end
36 |
37 |
38 | ---Gets a list of all the components
39 | ---@param filter? string # A complete or partial type name to look up with
40 | ---@param exact? boolean # Set to true to do an exact match on the types
41 | ---@return table # The list of component that match the query
42 | function component.list(filter, exact) end
43 |
44 |
45 | ---Returns a table with the names of all methods provided by the component with the specified address and whether those methods are called directly.
46 | ---@param address string The address of the component.
47 | ---@return table # the key is the name of the function while the value indicates if it's called directly.
48 | function component.methods(address) end
49 |
50 |
51 | ---Gets a 'proxy' object for a component that provides all methods the component provides as fields,
52 | ---so they can be called more directly (instead of via invoke). This is what's used to generate 'primaries'
53 | ---of the individual component types, i.e. what you get via `component.blah`.
54 | ---
55 | ---For example, you can use it like so: `component.proxy(component.list("redstone")()).getInput(sides.north)`,
56 | ---which gets you a proxy for the first redstone component returned by the component.list iterator, and then calls getInput on it.
57 | ---
58 | ---Note that proxies will always have at least two fields, type with the component's type name, and address with the component's address.
59 | ---@generic T
60 | ---@param address string # The full address of the component
61 | ---@param type `T` # The full address of the component
62 | ---@return T
63 | function component.proxy(address, type) end
64 |
65 |
66 | ---Get the component type of the component with the specified address.
67 | ---@param address string # The full address of the component
68 | ---@return string? # The type of the component
69 | ---@return string? # An optional error message
70 | function component.type(address) end
71 |
72 |
73 | ---Returns the slot number of a component within the machine it's installed or -1 .
74 | ---@param address string # The full address of the component.
75 | ---@return integer? # -1 if not applicable, else it represents a slot in the computer/server/robot.
76 | ---@return string? # An optional error message
77 | function component.slot(address) end
78 |
79 |
80 | ---Should return the fields of a component, but the feature seems to not be working.
81 | ---@param address string # The full address of the component.
82 | ---@return table
83 | function component.slot(address) end
84 |
85 |
86 | ---Tries to resolve an abbreviated address to a full address.
87 | ---Returns the full address on success, or nil and an error message otherwise.
88 | ---Optionally filters by component type.
89 | ---@param address string # The address of the component, can be partial
90 | ---@param type? string # The type of the component
91 | ---@return string # The address of the component, nil if component not found
92 | function component.get(address, type) end
93 |
94 |
95 | ---Checks if a component of a specific type is available
96 | ---@param type string # the type of component to look for
97 | ---@return boolean # True if a component of that type exists
98 | function component.isAvailable(type) end
99 |
100 |
101 | ---Gets a proxy to the primary component of a given type.
102 | ---Can also be accessed using `component.name`
103 | ---throws an error on invalid types.
104 | ---@generic T
105 | ---@param type `T`
106 | ---@return T
107 | function component.getPrimary(type) end
108 |
109 |
110 | --- Sets a new primary component for the specified component type.
111 | --- The address may be abbreviated, but must be valid if it is not nil.
112 | --- Triggers the component_unavailable and component_available signals if set to nil or a new value, respectively.
113 | ---@param type string # The type of component to set a primary for
114 | ---@param address string|nil # The address may be partial
115 | function component.setPrimary(type, address) end
116 |
117 |
118 | return component
119 |
--------------------------------------------------------------------------------
/docs/components/abstracts/BaseComponent.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class BaseComponent
4 | ---@field slot integer # the physical slot in which the component is stored inside the computer, -1 if non applicable (eg: stuff from adapters)
5 | ---@field address string # the address of the component
--------------------------------------------------------------------------------
/docs/components/abstracts/CommonNetworkAPI.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class CommonNetworkAPI: BaseComponent
4 | local CommonNetworkAPI = {}
5 |
6 |
7 | --#region storage
8 |
9 |
10 | ---Get an iterator object for the list of the items in the network.
11 | ---@return fun():MEItemStack|nil
12 | function CommonNetworkAPI.allItems() end
13 |
14 |
15 | ---Get a list of the stored items in the network.
16 | ---@param filter MEItemStackFilter A filter for the query
17 | ---@return MEItemStack[]
18 | function CommonNetworkAPI.getItemsInNetwork(filter) end
19 |
20 |
21 | ---Get a list of the stored fluids in the network.
22 | ---@return MEFluidStack[]
23 | function CommonNetworkAPI.getFluidsInNetwork() end
24 |
25 |
26 | ---Get a list of the stored essentia in the network.
27 | ---@return EssentiaStack[]
28 | function CommonNetworkAPI.getEssentiaInNetwork() end
29 |
30 |
31 | ---Store items in the network matching the specified filter in the database with the specified address.
32 | ---@param filter MEItemStackFilter # A filter of items to look for.
33 | ---@param dbAddress string # Address of the internal database to store items to.
34 | ---@param startSlot? integer # Optional, start index of the first item to store
35 | ---@param count? integer # Optional, how many items to store
36 | ---@return boolean
37 | function CommonNetworkAPI.store(filter, dbAddress, startSlot, count) end
38 |
39 |
40 | --#endregion storage
41 |
42 |
43 | --#region crafting
44 |
45 |
46 | ---Get a list of all available cpus on the network.
47 | ---@return AECpuMetadata[]
48 | function CommonNetworkAPI.getCpus() end
49 |
50 |
51 | ---Get a list of known item recipes. These can be used to issue crafting requests.
52 | ---@return AECraftable[]
53 | function CommonNetworkAPI.getCraftables(filter) end
54 |
55 |
56 | --#endregion crafting
57 |
58 |
59 | --#region power storage
60 |
61 |
62 | ---Get the average power injection into the network.
63 | ---@return number
64 | function CommonNetworkAPI.getAvgPowerInjection() end
65 |
66 |
67 | ---Get the average power usage of the network.
68 | ---@return number
69 | function CommonNetworkAPI.getAvgPowerUsage() end
70 |
71 |
72 | ---Get the maximum stored power in the network.
73 | ---@return number
74 | function CommonNetworkAPI.getMaxStoredPower() end
75 |
76 |
77 | ---Get the stored power in the network.
78 | ---@return number
79 | function CommonNetworkAPI.getStoredPower() end
80 |
81 |
82 | ---Get the idle power usage of the network.
83 | ---@return number
84 | function CommonNetworkAPI.getIdlePowerUsage() end
85 |
86 |
87 | --#endregion power storage
--------------------------------------------------------------------------------
/docs/components/aemultipart.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class aemultipart: BaseComponent
4 | ---@field type 'aemultipart'
5 | local aemultipart = {}
6 |
7 |
8 | ---Returns the amount of stored energy for the given side.
9 | ---@param direction? sides # The side to check, defaults to 6
10 | ---@return number # how much energy is stored on that side.
11 | function aemultipart.getEnergyStored(direction) end
12 |
13 |
14 | ---Returns the maximum amount of stored energy for the given side.
15 | ---@param direction? sides # The side to check, defaults to 6
16 | ---@return number # how much energy is stored on that side.
17 | function aemultipart.getMaxEnergyStored(direction) end
18 |
19 |
20 | ---Returns whether this component can receive energy.
21 | ---@return boolean # True if the block can recieve energy
22 | function aemultipart.isEnergyReceiver() end
23 |
24 |
25 | ---Returns whether this component can provide energy.
26 | ---@return boolean # True if the block can provide energy.
27 | function aemultipart.isEnergyProvider() end
28 |
--------------------------------------------------------------------------------
/docs/components/database.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class database: BaseComponent
4 | ---@field type 'database'
5 | local database = {}
6 |
7 |
8 | ---Get the representation of the item stack stored in the specified slot.
9 | ---@param slot integer # The slot to get an item from.
10 | ---@return ItemStack|nil # The item stack's descriptor if a value was found.
11 | function database.get(slot) end
12 |
13 |
14 | ---Gets the index of an item stack with the specified hash. Returns a negative value if no such stack was found.
15 | ---@param hash string # The hash of the item you are looking for.
16 | ---@return number # slot of the item or -1 if not found
17 | function database.indexOf(hash) end
18 |
19 |
20 | ---Set an item into the specified database slot. NBT tag is expected in JSON format
21 | ---@param slot integer # The slot to write an item to
22 | ---@param id string # The unlocalided name of the item eg: minecraft:stone
23 | ---@param damage integer # The damage/metadata of the item
24 | ---@param nbt? string # The nbt of the item, formatted using JSON
25 | ---@return boolean # True if the item was succesfully written.
26 | ---@return nil|string # An error telling you what went wrong.
27 | function database.set(slot, id, damage, nbt) end
28 |
29 |
30 | ---Clears the specified slot. Returns true if there was something in the slot before.
31 | ---@param slot integer
32 | ---@return boolean # Returns true if there was something in the slot before.
33 | function database.clear(slot) end
34 |
35 |
36 | ---Copies the data stored in this database to another database with the specified address.
37 | ---Will error if the database has empty slots.
38 | ---@param dbAddress string # The address of the database to copy to.
39 | ---@return integer # how many slots were overwritten.
40 | function database.clone(dbAddress) end
41 |
42 |
43 | ---Computes a hash value for the item stack in the specified slot.
44 | ---@param slot integer # The slot to comupte the hash for
45 | ---@return string
46 | function database.computeHash(slot) end
47 |
48 |
49 | ---Copies an entry to another slot, optionally to another database. Returns true if something was overwritten.
50 | ---@param fromSlot integer # The slot to copy from
51 | ---@param toStot integer # The slot to copy to
52 | ---@param dbAddress? string # (Optional) The address of the database to copy to.
53 | ---@return boolean # True if somethign was overwritten.
54 | function database.copy(fromSlot, toStot, dbAddress) end
55 |
--------------------------------------------------------------------------------
/docs/components/glasses.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class glasses : BaseComponent
4 | local glasses = {}
5 |
6 |
7 | ---Lists the name of all the players currently wearing ar glasses linked to the terminal that are online.
8 | ---@return string ... # The names of all the players currently wearing ar glasses linked to the terminal that are online.
9 | function glasses.getBindPlayers() end
10 |
11 |
12 | ---Gets the number of instanciated widgets.
13 | ---@return integer # The number of instanciated widgets.
14 | function glasses.getObjectCount() end
15 |
16 |
17 | ---Removes the widget with the corresponding id.
18 | ---@param widgetId integer # The id of the widget to remove.
19 | ---@return boolean # `True` if the widget was removed.
20 | function glasses.removeObject(widgetId) end
21 |
22 |
23 | ---Removes all widgets.
24 | function glasses.removeAll() end
25 |
26 |
27 | ---Generates a new UUID
28 | ---@return integer # the new UUID
29 | function glasses.newUniqueKey() end
30 |
31 |
32 | --#region widget creation
33 |
34 |
35 | ---Adds a new rectangle widget to the render surface.
36 | ---@return Rect2D # The new rectangle widget.
37 | function glasses.addRect() end
38 |
39 |
40 | ---Adds a new dot widget to the render surface.
41 | ---@return Dot2D # The new dot widget.
42 | function glasses.addDot() end
43 |
44 |
45 | ---Adds a new item widget to the surface.
46 | ---@return ItemIcon2D # The new item widget.
47 | function glasses.addItem() end
48 |
49 |
50 | ---Adds a new cube widget to the world.
51 | ---@return Cube3D # The new cube widget.
52 | function glasses.addCube3D() end
53 |
54 |
55 | ---Adds a new floating text widget to the world.
56 | ---@return Text3D # The new floating text widget.
57 | function glasses.addFloatingText() end
58 |
59 |
60 | ---Adds a new triangle widget to the surface.
61 | ---@return Triangle2D # The new triangle widget.
62 | function glasses.addTriangle() end
63 |
64 |
65 | ---Adds a new 3D dot widget to the world.
66 | ---@return Dot3D # The new 3D dot widget.
67 | function glasses.addDot3D() end
68 |
69 |
70 | ---Adds a new text label widget to the surface.
71 | ---@return Text2D # The new text label widget.
72 | function glasses.addTextLabel() end
73 |
74 |
75 | ---Adds a new 3D line widget to the world.
76 | ---@return Line3D # The new 3D line Widget.
77 | function glasses.addLine3D() end
78 |
79 |
80 | ---Adds a new 3D triangle widget to the world.
81 | ---@return Triangle3D # The new 3D triangle Widget.
82 | function glasses.addTriangle3D() end
83 |
84 |
85 | ---Adds a new 3D quad widget to the world.
86 | ---@return Quad3D # The new 3D quad Widget.
87 | function glasses.addQuad3D() end
88 |
89 |
90 | ---Adds a new quad widget to the surface.
91 | ---@return Quad2D # The new quad Widget.
92 | function glasses.addQuad() end
93 |
94 |
95 | --#endregion
--------------------------------------------------------------------------------
/docs/components/gpu.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class gpu: BaseComponent
4 | ---@field type 'gpu'
5 | local gpu = {}
6 |
7 |
8 | ---Tries to bind the GPU to a screen with the specified address.
9 | ---
10 | ---Resets the screen unless reset is set to false.
11 | ---
12 | ---A GPU can only be bound to one screen at a time.
13 | ---All operations on it will work on the bound screen.
14 | ---If you wish to control multiple screens at once,
15 | ---you'll need to put more than one graphics card into your computer.
16 | ---@param address string the address of the screen
17 | ---@param reset? boolean set to false to prevent a screen reset
18 | ---@return boolean success true on success
19 | ---@return string|nil error a string where an error occures
20 | function gpu.bind(address, reset) end
21 |
22 |
23 | ---Returns the address of the screen bound to the gpu.
24 | ---@return string address
25 | function gpu.getScreen() end
26 |
27 |
28 | ---Gets the current background color.
29 | ---@return integer color 0x00RRGGBB int for generic colors, 0-15 when using a palettes
30 | ---@return boolean isPaletteColor True if the color is a palette number
31 | function gpu.getBackground() end
32 |
33 |
34 | ---Sets the background color.
35 | ---@param color integer the color an integer in the format of 0x00RRGGBB or the palette index when using a palette
36 | ---@param isPaletteIndex? boolean wether the color parameter is a palette index, defaults to true
37 | ---@return integer oldBackroundColor The old color value it was set to, not compressed to gpu's color depth
38 | ---@return integer|nil oldPaletteIndex If the old background was a palette color, the index of that palette
39 | function gpu.setBackground(color, isPaletteIndex) end
40 |
41 |
42 | ---Gets the current foreground/text color.
43 | ---@return integer color 0x00RRGGBB int for generic colors, 0-15 when using a palettes
44 | ---@return boolean isPaletteColor True if the color is a palette number
45 | function gpu.getForeground() end
46 |
47 |
48 | ---Sets the foreground/text color.
49 | ---@param color integer the color an integer in the format of 0x00RRGGBB or the palette index when using a palette
50 | ---@param isPaletteIndex? boolean wether the color parameter is a palette index, defaults to true
51 | ---@return integer oldBackroundColor The old color value it was set to, not compressed to gpu's color depth
52 | ---@return integer|nil oldPaletteIndex If the old color was a palette color, the index of that palette
53 | function gpu.setForeground(color, isPaletteIndex) end
54 |
55 |
56 | ---Gets the current color of a palette.
57 | ---@param index integer the index of the palette.
58 | ---@return integer color the color as an integer in the format of 0x00RRGGBB.
59 | function gpu.getPaletteColor(index) end
60 |
61 |
62 | ---Sets the RGB value of the color in the palette at the specified index.
63 | ---@param index integer the index of the palette.
64 | ---@param value integer The new color as an integer in the format of 0x00RRGGBB.
65 | ---@return integer oldColor The old color as an integer in the format of 0x00RRGGBB.
66 | function gpu.setPaletteColor(index, value) end
67 |
68 |
69 | ---Gets the maximum supported color depth supported by the GPU and the screen it is bound to (minimum of the two).
70 | ---@return integer depth The maximum color depth of the gpu.
71 | function gpu.maxDepth() end
72 |
73 |
74 | ---Gets the currently set color depth of the GPU/screen, in bits. Can be 1, 4 or 8.
75 | ---@return integer depth The maximum color depth of the gpu.
76 | function gpu.getDepth() end
77 |
78 |
79 | ---Sets the color depth to use. Can be up to the maximum supported color depth.
80 | --- If a larger or invalid value is provided it will throw an error.
81 | ---@param bit integer either 1,4,or 8
82 | ---@return "OneBit"|"FourBit"|"EightBit" oldDepthString The old depth as one of the strings OneBit, FourBit, or EightBit.
83 | function gpu.setDepth(bit) end
84 |
85 |
86 | ---Gets the maximum resolution supported by the GPU and the screen it is bound to (minimum of the two).
87 | ---@return integer width The maximum resolution's width
88 | ---@return integer height The maximum resolution's height
89 | function gpu.maxResolution() end
90 |
91 |
92 | ---Gets the current resolution of the GPU.
93 | ---@return integer width The current resolution's width
94 | ---@return integer height The current resolution's height
95 | function gpu.getResolution() end
96 |
97 |
98 | ---Sets the specified resolution. Can be up to the maximum supported resolution.
99 | ---If a larger or invalid resolution is provided it will throw an error.
100 | ---@param width integer The desired width
101 | ---@param height integer The desired height
102 | ---@return boolean success True if the resolution was changed (may return false if an attempt was made to set it to the same value it was set before), false otherwise.
103 | function gpu.setResolution(width, height) end
104 |
105 |
106 | ---Get the current viewport resolution.
107 | ---@return integer width The width of the viewport
108 | ---@return integer height The height of the viewport
109 | function gpu.getViewport() end
110 |
111 |
112 | ---Set the current viewport resolution.
113 | ---
114 | ---This makes it look like screen resolution is lower, but the actual resolution stays the same.
115 | ---Characters outside top-left corner of specified size are just hidden,
116 | ---and are intended for rendering or storing things off-screen and copying them to the visible area when needed.
117 | ---Changing resolution will change viewport to whole screen.
118 | ---@param width integer The resolution of the viewport
119 | ---@return boolean success True if it was changed (may return false if an attempt was made to set it to the same value it was set before), false otherwise.
120 | function gpu.setViewport(width, height) end
121 |
122 |
123 | ---Gets the character, foreground/text color and the background color at a specific coordinate
124 | ---@param x integer The x coordinate of the character
125 | ---@param y integer The y coordinate of the character
126 | ---@return string char The character being displayed
127 | ---@return integer foregroundColor The color of the text being displayed as an integer in the format of 0x00RRGGBB.
128 | ---@return integer backgroundColor The color of the text being displayed as an integer in the format of 0x00RRGGBB.
129 | ---@return integer|nil foregroundPalette The palette index if the text color uses a palette.
130 | ---@return integer|nil backgroundPalette The palette index if the background color uses a palette.
131 | function gpu.get(x, y) end
132 |
133 |
134 | ---Writes a string to the screen, starting at the specified coordinates.
135 | ---
136 | ---The string will be copied to the screen's buffer directly, in a single row.
137 | ---This means even if the specified string contains line breaks,
138 | ---these will just be printed as special characters,
139 | ---the string will not be displayed over multiple lines.
140 | ---
141 | ---If the 4th parameter is set to true, the text will be displayed vertically
142 | ---@param x integer The x coordinate of the start of the text
143 | ---@param y integer The y coordinate of the start of the text
144 | ---@param value string The string to display
145 | ---@param vertical? boolean Set to true to display the text vertically, defaults to false.
146 | ---@return string char true if the string was displayed succesfully
147 | function gpu.set(x, y, value, vertical) end
148 |
149 |
150 | ---Copies a portion of the screens buffer to another location.
151 | ---
152 | ---The source rectangle is specified by the x, y, width and height parameters.
153 | ---
154 | ---The target rectangle is defined by x + tx, y + ty, width and height.
155 | ---@param x integer The x coordinate of the top left corner of the source rectangle.
156 | ---@param y integer The y coordinate of the top left corner of the source rectangle.
157 | ---@param width integer The width of the source rectangle.
158 | ---@param height integer The height of the source rectangle.
159 | ---@param tx integer The x coordinate of the top left corner of the destination.
160 | ---@param ty integer The y coordinate of the top right corner of the destination.
161 | ---@return boolean success on success, false otherwise.
162 | function gpu.copy(x, y, width, height, tx, ty) end
163 |
164 |
165 | ---Fills a rectangle in the screen buffer with the specified character.
166 | ---
167 | ---The target rectangle is specified by the x and y coordinates and the rectangle's width and height.
168 | ---
169 | ---The fill character char must be a string of length one, i.e. a single character.
170 | ---Note that filling screens with spaces ( ) is usually less expensive, i.e. consumes less energy,
171 | ---because it is considered a “clear” operation (see config).
172 | ---@param x integer The x coordinate of the top left corner of the rectangle.
173 | ---@param y integer The y coordinate of the top left corner of the rectangle.
174 | ---@param width integer The width of the rectangle to fill.
175 | ---@param height integer The height of the rectangle to fill.
176 | ---@param char string The character to display
177 | ---@return boolean success True on success, false otherwise.
178 | function gpu.fill(x, y, width, height, char) end
179 |
180 |
181 | ---Returns the index of the currently selected buffer.
182 | ---
183 | ---0 is reserved for the screen, and may return 0 even when there is no screen
184 | ---@return integer bufferIndex the index of the active buffer.
185 | function gpu.getActiveBuffer() end
186 |
187 |
188 | ---Sets the active buffer to index.
189 | ---
190 | ---0 is reserved for the screen and can be set even when there is no screen.
191 | ---@return integer|nil bufferIndex Returns nil for an invalid index (0 is valid even with no screen)
192 | function gpu.setActiveBuffer(index) end
193 |
194 |
195 | ---Returns an array of all current page indexes (0 is not included in this list, that is reserved for the screen).
196 | ---@return integer[] bufferIndexes the indexes of all the active buffers, screen not included
197 | function gpu.buffers() end
198 |
199 |
200 | ---Allocates a buffer with the gpu's max resolution as it's dimention.
201 | ---
202 | ---A buffer can be allocated even when there is no screen bound to this gpu.
203 | ---
204 | ---Index 0 is always reserved for the screen and thus the lowest possible index of an allocated buffer is always 1.
205 | ---@return integer|nil bufferIndex Returns the index of this new buffer or nil if it couldn't be allocated.
206 | ---@return string|nil error A message if the buffer couldn't be allocated
207 | function gpu.allocateBuffer() end
208 |
209 |
210 | ---Allocates a buffer with the specified dimentions.
211 | ---
212 | ---A buffer can be allocated even when there is no screen bound to this gpu.
213 | ---
214 | ---Index 0 is always reserved for the screen and thus the lowest possible index of an allocated buffer is always 1.
215 | ---@return integer|nil bufferIndex Returns the index of this new buffer or nil if it couldn't be allocated.
216 | ---@return string|nil error A message if the buffer couldn't be allocated
217 | function gpu.allocateBuffer(width, height) end
218 |
219 |
220 | ---Frees the current buffer
221 | ---
222 | ---The gpu automatically switches back to buffer 0 (the screen buffer)
223 | ---@return boolean success True if the buffer was succesfully freed
224 | function gpu.freeBuffer() end
225 |
226 |
227 | ---Frees the specified buffer
228 | ---
229 | ---Removes buffer at the specified index. Returns true if the buffer was removed.
230 | ---
231 | ---The gpu automatically switches back to buffer 0 (the screen buffer) if the buffer is the active buffer
232 | ---@return boolean success True if the buffer was succesfully freed
233 | function gpu.freeBuffer(bufferIndex) end
234 |
235 |
236 | ---Removes all buffers, freeing all video memory. The buffer index is always 0 after this call.
237 | function gpu.freeAllBuffers() end
238 |
239 |
240 | ---Returns the total memory size of the gpu vram.
241 | ---
242 | ---This does not include the screen.
243 | ---@return integer totalMemory The total vram capacity.
244 | function totalMemory() end
245 |
246 |
247 | ---Returns the total free memory not allocated to buffers. This does not include the screen.
248 | ---@return integer freeMemory The remaining amount of vram.
249 | function gpu.freeMemory() end
250 |
251 |
252 | ---Returns the dimentions of the active buffer.
253 | ---@return integer width The width of the active buffer.
254 | ---@return integer height The height of the active buffer.
255 | function gpu.getBufferSize() end
256 |
257 |
258 | ---Returns the dimentions of the specified buffer
259 | ---@param bufferIndex integer The index of the buffer you want the dimentions of.
260 | ---@return integer width The width of the active buffer.
261 | ---@return integer height The height of the active buffer.
262 | function gpu.getBufferSize(bufferIndex) end
263 |
264 |
265 | ---Copy a region from buffer to buffer, screen to buffer, or buffer to screen.
266 | ---
267 | ---bitblt should preform very fast on repeated use.
268 | ---
269 | ---If the buffer is dirty there is an initial higher cost to sync the buffer with the destination object.
270 | ---
271 | ---If you have a large number of updates to make with frequent bitblts, consider making multiple and smaller buffers.
272 | ---
273 | ---If you plan to use a static buffer (one with few or no updatse), then a large buffer is just fine.
274 | ---@param dst? integer The destination of the buffer defaults to 0
275 | ---@param dstX? integer The x coordinate of the top left corner of the rectangle to paste on the destination buffer. defaults to 1
276 | ---@param dstY? integer The y coordinate of the top left corner of the rectangle to paste on the destination buffer. defaults to 1
277 | ---@param width? integer The width of the copied rectanlge. Defaults to the width of the destination buffer.
278 | ---@param height? integer The height of the copied rectangle. Defaults to the height of the destination buffer.
279 | ---@param srcX? integer The x coordinate of the top left corner of the rectangle to copy on the source buffer.
280 | ---@param srcY? integer The y coordinate of the top left corner of the rectangle to copy on the source buffer.
281 | ---@return boolean success True on success
282 | function gpu.bitblt(dst, dstX, dstY, width, height, src, srcX, srcY) end
--------------------------------------------------------------------------------
/docs/components/gt_machine.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class gt_machine: BaseComponent
4 | ---@field type 'gt_machine'
5 | local gt_machine = {}
6 |
7 |
8 | --- Returns the amount of electricity contained in this Block, in EU units! (As a string for HUGE amounts.)
9 | ---@return string storedEuString
10 | function gt_machine.getStoredEUString() end
11 |
12 |
13 | ---Returns the average EU input of this block
14 | ---@return number averageInput
15 | function gt_machine.getEUInputAverage() end
16 |
17 | ---Gets the Output in EU/p.
18 | ---@return number outputVoltage
19 | function gt_machine.getOutputVoltage() end
20 |
21 | ---Returns the machine's name
22 | ---@return string name
23 | function gt_machine.getName() end
24 |
25 | ---Returns whether the machine is currently active
26 | ---@return boolean isActive
27 | function gt_machine.isMachineActive() end
28 |
29 | ---Returns the EU stored in this block
30 | ---@return number euStored
31 | function gt_machine.getEUStored() end
32 |
33 | ---Returns the amount of electricity containable in this Block, in EU units!
34 | ---@return number euCapacity
35 | function gt_machine.getEUCapacity() end
36 |
37 | ---Returns the steam stored in this block
38 | ---@return number steamStored
39 | function gt_machine.getSteamStored() end
40 |
41 | ---Returns sensor information about this block
42 | ---@return string[] sensorLines
43 | function gt_machine.getSensorInformation() end
44 |
45 | ---Returns the average EU output of this block
46 | ---@return number averageOutput
47 | function gt_machine.getEUOutputAverage() end
48 |
49 | ---Returns the amount of electricity containable in this Block, in EU units! (As a string for HUGE amounts.)
50 | ---@return string euCapacityString
51 | function gt_machine.getEUCapacityString() end
52 |
53 | ---Returns machine coordinates
54 | ---@return {[1]:number,[2]:number,[3]:number} coordinates
55 | function gt_machine.getCoordinates() end
56 |
57 | ---Returns the amount of Electricity, accepted by this Block the last 5 ticks as Average.
58 | ---@return number averageInput
59 | function gt_machine.getAverageElectricInput() end
60 |
61 | ---Gets the maximum Input in EU/p.
62 | ---@return number maxInput
63 | function gt_machine.getInputVoltage() end
64 |
65 | -- Gets the amount of Energy Packets per tick.
66 | ---@return number packetPerTick
67 | function gt_machine.getOutputAmperage() end
68 |
69 | ---Sets whether this block is currently allowed to work
70 | ---@param enabled boolean
71 | ---@return number packetPerTick
72 | function gt_machine.setWorkAllowed(enabled) end
73 |
74 | ---Returns the name of this block's owner
75 | ---@return string ownerName
76 | function gt_machine.getOwnerName() end
77 |
78 | ---Returns true if the machine currently has work to do
79 | ---@return boolean hasWork
80 | function gt_machine.hasWork() end
81 |
82 | ---Returns the amount of Steam contained in this Block, in EU units!
83 | ---@return number storedSteamAsEu
84 | function gt_machine.getStoredSteam() end
85 |
86 | ---Returns the current progress of this block in ticks
87 | ---@return number progress
88 | function gt_machine.getWorkProgress() end
89 |
90 | ---Returns the max EU that can be stored in this block
91 | ---@return number euCapacity
92 | function gt_machine.getEUMaxStored() end
93 |
94 | ---Returns the amount of Electricity, outputted by this Block the last 5 ticks as Average.
95 | ---@return number averageElectricOutput
96 | function gt_machine.getAverageElectricOutput() end
97 |
98 | ---Returns the amount of electricity contained in this Block, in EU units!
99 | ---@return number storedEU
100 | function gt_machine.getStoredEU() end
101 |
102 | ---Returns whether this block is currently allowed to work
103 | ---@return boolean isAllowed
104 | function gt_machine.isWorkAllowed() end
105 |
106 | ---Returns the max progress of this block in ticks
107 | ---@return number maxProgress
108 | function gt_machine.getWorkMaxProgress() end
109 |
110 | ---Returns the amount of Steam containable in this Block, in EU units!
111 | ---@return number steamCapacityAsEU
112 | function gt_machine.getSteamCapacity() end
113 |
114 | ---Returns the max steam that can be stored in this block
115 | ---@return number steamCapacity
116 | function gt_machine.getSteamMaxStored() end
--------------------------------------------------------------------------------
/docs/components/inventory_controller.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class inventory_controller: BaseComponent
4 | ---@field type 'inventory_controller'
5 | local inventory_controller = {}
6 |
7 |
8 | ---Gets Itemstack description of item in the specified (or selected slot if no slot number is provided) of robot inventory.
9 | ---@param slot? integer which slot to look at
10 | ---@return ItemStack|nil # `nil` if there is no items in the slot
11 | function inventory_controller.getStackInInternalSlot(slot) end
12 |
13 |
14 | ---Gets Itemstack description of item in the specified of an external inventory.
15 | ---@param side integer which side to look at
16 | ---@param slot integer which slot to look at
17 | ---@return ItemStack|nil # `nil` if there is no items in the slot
18 | function inventory_controller.getStackInSlot(side, slot) end
--------------------------------------------------------------------------------
/docs/components/level_maintainer.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class level_maintainer: BaseComponent
4 | ---@field type 'level_maintainer'
5 | local level_maintainer = {}
6 |
7 |
8 | ---Sets an item to be stocked in the level maintainer
9 | ---DOES NOT APPEAR TO FUNCTION IN 2.6.1
10 | ---
11 | ---@param slot integer # The slot to edit
12 | ---@param dbAddress string # The address of the database to set the item from
13 | ---@param dbIndex integer # The index in the database of the item to maintain
14 | ---@param quantity integer # The amount to level maintain
15 | ---@param batchSize integer # How many items to craft per request
16 | ---@return true # always returns true or just crashes if it doesn't work
17 | function level_maintainer.setSlot(slot, dbAddress, dbIndex, quantity, batchSize) end
18 |
19 |
20 | ---Updates the amounts to craft for a specific slot
21 | ---DOES NOT APPEAR TO FUNCTION IN 2.6.1
22 | ---
23 | ---@param slot integer # The slot to edit
24 | ---@param quantity integer # The amount to level maintain
25 | ---@param batchSize integer # How many items to craft per request
26 | ---@return true # always returns true or just crashes if it doesn't work
27 | function level_maintainer.setSlot(slot, quantity, batchSize) end
28 |
29 |
30 | ---Fetches information about a slot in a level maintainer
31 | ---@return LevelMaintainerSlot|nil # A descriptor of the slot or nil if the slot is unset
32 | function level_maintainer.getSlot(slot) end
33 |
34 |
35 | ---Gets the state of the level maintainer
36 | ---@return boolean # True if the level maintainer is connected to AE
37 | function level_maintainer.active() end
38 |
39 |
40 | ---Checks if a slot has is done crafting items
41 | ---@param slot integer # The slot to check the status of
42 | ---@return boolean # True if the slot is done crafting
43 | function level_maintainer.isDone(slot) end
44 |
45 |
46 | ---Enables or disables a specific slot
47 | ---@param slot integer # The slot to change the status of
48 | ---@param newStatus boolean # True to enable the slot, false to disable it
49 | ---@return true # Always returns true
50 | function level_maintainer.isDone(slot, newStatus) end
51 |
52 |
53 | ---Enable or disables a specific slot
54 | ---@param slot integer # The slot to get the status of
55 | ---@return boolean # True if the slot is enabled
56 | function level_maintainer.isEnable(slot) end
--------------------------------------------------------------------------------
/docs/components/me_controller.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class me_controller: CommonNetworkAPI, aemultipart
4 | ---@field type "me_controller"
5 | local me_controller = {}
6 |
7 |
8 | -- empty on purpose, it's just a mash of the CommonNetworkAPI and aemultipart types
--------------------------------------------------------------------------------
/docs/components/me_exportbus.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class me_exportbus: aemultipart
4 | ---@field type "me_exportbus"
5 | local me_exportbus = {}
6 |
7 |
8 | ---Configure the export bus pointing in the specified direction to export item stacks matching the specified descriptor.
9 | ---@param side sides # The side of the export bus.
10 | ---@param slot integer # The slot number to configure.
11 | ---@param database string # The address of a database.
12 | ---@param entry integer # The slot number of the item in the database.
13 | ---@return boolean # True if success
14 | function me_exportbus.setExportConfiguration(side, slot, database, entry) end
15 |
16 |
17 | ---Configure the export bus pointing in the specified direction to export item stacks matching the specified descriptor.
18 | ---@param side sides # The side of the export bus.
19 | ---@param database string # The address of a database.
20 | ---@param entry integer # The slot number of the item in the database.
21 | ---@return boolean # True if success
22 | function me_exportbus.setExportConfiguration(side, database, entry) end
23 |
24 |
25 | ---Get the configuration of the export bus pointing in the specified direction.
26 | ---@param side sides # The side of the export bus.
27 | ---@param slot? integer # The slot number of the item to get the configuration of.
28 | ---@return ItemStack # The descriptor for the item to view.
29 | function me_exportbus.getExportConfiguration(side, slot) end
30 |
31 |
32 | ---Make the export bus facing the specified direction perform a single export operation into the specified slot.
33 | ---You can use a redstone control upgrade set to only on signal to make the export bus only export when called on by OC.
34 | ---@param side sides # The side of the export bus.
35 | ---@param slot integer # The slot number in the target destination
36 | ---@return boolean # True if succesful
37 | function me_exportbus.exportIntoSlot(side, slot) end
38 |
--------------------------------------------------------------------------------
/docs/components/me_interface.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class me_interface: CommonNetworkAPI
4 | ---@field type 'me_interface'
5 | local me_interface = {}
6 |
7 |
8 | --#region item stocking
9 |
10 |
11 | ---Gets the item being stocked in at the specified slot or the first if none is specified.
12 | ---@param slot integer # The slot index to check
13 | ---@return table
14 | function me_interface.getInterfaceConfiguration(slot) end
15 |
16 |
17 | ---Clears the item being stocked in the specified slot (or the first one if none is specified)
18 | ---@param slot integer # The index of the slot to clear.
19 | ---@return boolean
20 | function me_interface.setInterfaceConfiguration(slot) end
21 |
22 |
23 | ---Sets the item being stocked in a specified slot.
24 | ---@param slot integer # The index of the slot to set.
25 | ---@param dbAddress string # The address of a database that contains the item you want to stock.
26 | ---@param dbIndex integer # The index of the item to stock.
27 | ---@param count? integer # The amount of items to stock in the interface. (defaults to 1)
28 | ---@return boolean
29 | function me_interface.setInterfaceConfiguration(slot, dbAddress, dbIndex, count) end
30 |
31 |
32 | ---Sets the item being stocked in the first slot.
33 | ---@param dbAddress string # The address of a database that contains the item you want to stock.
34 | ---@param dbIndex integer # The index of the item to stock.
35 | ---@param count? integer # The amount of items to stock in the interface. (defaults to 1)
36 | ---@return boolean
37 | function me_interface.setInterfaceConfiguration(dbAddress, dbIndex, count) end
38 |
39 |
40 | --#endregion item stocking
41 |
42 |
43 | --#region fluid stocking
44 |
45 |
46 | ---Gets the fluid being stocked in at the specified slot.
47 | ---@param side sides # The index of the side to check.
48 | function me_interface.getFluidInterfaceConfiguration(side) end
49 |
50 |
51 | ---Clears the fluid being stocked on a given side.
52 | ---@param side sides # The side to clear of fluids.
53 | ---@return boolean
54 | function me_interface.setFluidInterfaceConfiguration(side) end
55 |
56 |
57 | ---Clears out the fluid being stocked on a given side.
58 | ---@param side sides # The side on which to stock the fluid.
59 | ---@param dbAddress string # The address of a database that contains the fluid you want to stock. (stored as an ae2fc drop.)
60 | ---@param dbIndex integer # The index of the entry containing the fluid to stock.
61 | ---@return boolean
62 | function me_interface.setFluidInterfaceConfiguration(side, dbAddress, dbIndex) end
63 |
64 |
65 | --#endregion fluid stocking
66 |
67 |
68 | --#region pattern modifications
69 |
70 |
71 | ---Get the given pattern in the interface or the first one in the first slot if none is specified.
72 | ---@param patternIndex integer # The index of the pattern to get.
73 | ---@return MEPattern
74 | function me_interface.getInterfacePattern(patternIndex) end
75 |
76 |
77 | ---Set the pattern input at the given index.
78 | ---@param patternIndex integer # The index of the pattern to modify.
79 | ---@param dbAddress string # The address of the database that contains the desired input.
80 | ---@param dbIndex integer # The index of the entry that contains the new input.
81 | ---@param count integer # The amount to set the input to.
82 | ---@param inputIndex integer # The index of the input slot to modify.
83 | ---@return boolean
84 | function me_interface.setInterfacePatternInput(patternIndex, dbAddress, dbIndex, count, inputIndex) end
85 |
86 |
87 | ---Set the pattern output at the given index.
88 | ---@param patternIndex integer # The index of the pattern to modify.
89 | ---@param dbAddress string # The address of the database that contains the desired output.
90 | ---@param dbIndex integer # The index of the entry that contains the new output.
91 | ---@param count integer # The amount to set the output to.
92 | ---@param outputIndex integer # The index of the output slot to modify.
93 | ---@return boolean
94 | function me_interface.setInterfacePatternOutput(patternIndex, dbAddress, dbIndex, count, outputIndex) end
95 |
96 |
97 | ---Clears an input slot in a pattern.
98 | ---@param patternIndex integer # The index of the pattern to modify.
99 | ---@param inputIndex integer # The index of the input slot to clear.
100 | ---@return boolean
101 | function me_interface.clearInterfacePatternInput(patternIndex, inputIndex) end
102 |
103 |
104 | ---Removes an output from a pattern.
105 | ---@param patternIndex integer # The index of the pattern to modify.
106 | ---@param outputIndex integer # The index of the output slot to clear.
107 | ---@return boolean
108 | function me_interface.clearInterfacePatternOutput(patternIndex, outputIndex) end
109 |
110 |
111 | -- #endregion pattern modifications
112 |
113 |
114 | -- #region pattern reading
115 |
116 |
117 | ---Stores a specified input of a pattern inside of a database.
118 | ---Fluids are stored as ae2fc drops.
119 | ---@param patternIndex integer # The index of the pattern to get inputs from.
120 | ---@param inputIndex integer # The index of the input to store.
121 | ---@param dbAddress string # The address of the database to store the output at
122 | ---@param dbIndex integer # Where to store the input inside of the database.
123 | ---@return boolean
124 | function me_interface.storeInterfacePatternInput(patternIndex, inputIndex, dbAddress, dbIndex) end
125 |
126 |
127 | ---Stores a specified output of a pattern inside of a database.
128 | ---Fluids are stored as ae2fc drops.
129 | ---@param patternIndex integer # The index of the pattern to get outputs from.
130 | ---@param outputIndex integer # The index of the output to store.
131 | ---@param dbAddress string # The address of the database to store the output at
132 | ---@param dbIndex integer # Where to store the output inside of the database.
133 | ---@return boolean
134 | function me_interface.storeInterfacePatternOutput(patternIndex, outputIndex, dbAddress, dbIndex) end
135 |
136 |
137 | -- #endregion pattern reading
--------------------------------------------------------------------------------
/docs/components/redstone.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class redstone: BaseComponent
4 | ---@field type 'redstone'
5 | local redstone = {};
6 |
7 |
8 | ---Returns current incoming (non-bundled) redstone values on all sides..
9 | ---@return redstoneIOStatus signals # The values may exceede the 0-15 range if using project red.
10 | function redstone.getInput() end
11 |
12 |
13 | -- Returns current incoming (non-bundled) redstone value on a specific side.
14 | ---@param side integer # The side to check.
15 | ---@return integer input # The value may exceede the 0-15 range if using project red.
16 | function redstone.getInput(side) end
17 |
18 |
19 | ---Returns current outgoing (non-bundled) redstone values on all sides.
20 | ---@return redstoneIOStatus values # The values may exceede the 0-15 range if using project red.
21 | function redstone.getOutput() end
22 |
23 |
24 | -- Returns current outgoing (non-bundled) redstone value on a specific side.
25 | ---@param side integer # The side The side to check
26 | ---@return integer value # The value may exceede the 0-15 range if using project red
27 | function redstone.getOutput(side) end
28 |
29 |
30 | ---Sets the strength of the redstone signal to emit on a specific side.
31 | ---@param side integer # The value to set on that side.
32 | ---@param value integer # The value to output on the specified side.
33 | ---@return integer oldValue # Returns the old output value on that side. This can be an arbitrarily large number for mods that support this.
34 | function redstone.setOutput(side, value) end
35 |
36 |
37 | ---@alias redstoneIOStatus table<(0|1|2|3|4|5), integer>
38 |
39 | ---Lets you specify the output signal strength to a all sides at once, you can omit some values if needed to not update them.
40 | ---@param values redstoneIOStatus # A side-value dictionary for the new output values.
41 | ---@return redstoneIOStatus oldValues # the old output values
42 | function redstone.setOutput(values) end
--------------------------------------------------------------------------------
/docs/components/screen.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class screen: BaseComponent
4 | ---@field type 'screen'
5 | local screen = {};
6 |
7 | ---Returns whether the screen is currently on.
8 | ---@return boolean
9 | function screen.isOn() end
10 |
11 | ---Turns on the screen
12 | ---@return boolean wasOff true if it was off.
13 | function screen.turnOn() end
14 |
15 | ---Turns off the screen
16 | ---@return boolean wasOn true if it was on.
17 | function screen.turnOff() end
18 |
19 | ---The aspect ratio of the screen. For multi-block screens this is the number of blocks, horizontal and vertical.
20 | ---@return integer width The width in blocks of the screen.
21 | ---@return integer height The height in blocks of the screen.
22 | function screen.getAspectRatio() end
23 |
24 | ---Returns a list of adresses for the keyboards attached to this screen.
25 | ---@return string[] keyboardAddresses The address of the keyboards attached to this screen
26 | function screen.getKeyboards() end
27 |
28 | ---Set whether to use high-precision mode (sub-pixel mouse event position).
29 | ---
30 | ---Requires Screen (Tier 3)
31 | ---@param enabled boolean Whether to enable or disable precise mode
32 | ---@return boolean success true if it changed
33 | function screen.setPrecise(enabled) end
34 |
35 | --- Check whether high-precision mode is enabled (sub-pixel mouse event position).
36 | ---
37 | ---Requires Screen (Tier 3).
38 | ---@return boolean isPrecise true if the mode changed.
39 | function screen.isPrecise() end
40 |
41 | --- Sets Inverted Touch mode (Sneak-activate opens GUI if set to true).
42 | ---@param enabled boolean Whether to enable or disable inverted touch mode
43 | ---@return boolean success true if the mode changed.
44 | function screen.setTouchModeInverted(enabled) end
45 |
46 | ---Check to see if Inverted Touch mode is enabled (Sneak-activate opens GUI is set to true).
47 | ---@return boolean isInverted true if inverted touch mode is enabled.
48 | function screen.isTouchModeInverted() end
--------------------------------------------------------------------------------
/docs/components/tilechest.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---Refers to ME chests
4 | ---@class tilechest: aemultipart
5 | ---@field type 'tilechest'
6 |
7 | -- Empty on purpose, this component is just a reskined aemultipart
--------------------------------------------------------------------------------
/docs/robot.lua:
--------------------------------------------------------------------------------
1 | ---@meta 'robot'
2 |
3 | ---@class robot
4 | local robot = {}
5 |
6 |
7 | ---Returns the robot's name.
8 | ---The name of a Robot is set initially during it's creation and cannot be changed programmatically.
9 | ---However you can change it using an anvil if you want.
10 | ---@return string
11 | function robot.name() end
12 |
13 | ---@alias detectType 'entity'|'solid'|'replaceable'|'liquid'|'passable'|'air'
14 |
15 | ---Detects what is directly in front of the robot and returns if the robot could move through it aswell as a generic description.
16 | ---@return boolean # `true` if whatever is in front of the robot would prevent it from moving forward (a block or an entity) (Note: Drones return true even if the block is passable), false otherwise.
17 | ---@return detectType # The type of obstruction detected.
18 | function robot.detect() end
19 |
20 |
21 | ---Detects what is directly up of the robot and returns if the robot could move through it as well as a generic description.
22 | ---@return boolean # `true` if whatever is in front of the robot would prevent it from moving forward (a block or an entity) (Note: Drones return true even if the block is passable), false otherwise.
23 | ---@return detectType # The type of obstruction detected.
24 | function robot.detectUp() end
25 |
26 |
27 | ---Detects what is directly down of the robot and returns if the robot could move through it as well as a generic description.
28 | ---@return boolean # `true` if whatever is in front of the robot would prevent it from moving forward (a block or an entity) (Note: Drones return true even if the block is passable), false otherwise.
29 | ---@return detectType # The type of obstruction detected.
30 | function robot.detectDown() end
31 |
32 |
33 | ---Returns the currently selected slot
34 | ---@return integer # the currently selected slot
35 | function robot.select() end
36 |
37 |
38 | ---Selects the given inventory slot if specified and returns the current inventory slot
39 | ---@param slot integer the slot to select
40 | ---@return integer # the currently selected slot. Either the one specified (if successfully selected) or the one that was previously selected.
41 | function robot.select(slot) end
42 |
43 |
44 | ---Returns the amount of select-able internal robot inventory slots. To get the number of inventory upgrade use: x = robot.inventorySize() / 16.
45 | ---@return integer
46 | function robot.inventorySize() end
47 |
48 |
49 | ---Returns the number of items in the currently selected slot
50 | ---@return integer # the amount of items in the currently selected slot
51 | function robot.count() end
52 |
53 |
54 | ---Returns the number of items in a given slot
55 | ---@param slot integer the slot to check for
56 | ---@return integer # The amount of items in the slot
57 | function robot.count(slot) end
58 |
59 |
60 | ---Returns the amount of items that can be sucked up to fill the currently selected slot
61 | ---@return integer # the amount of items that can be sucked up to fill the currently selected slot
62 | function robot.space() end
63 |
64 |
65 | ---Returns the amount of items that can be sucked up to fill a given slot
66 | ---@param slot integer the slot to check for
67 | ---@return integer # the amount of items that can be sucked up to fill the given slot
68 | function robot.space(slot) end
69 |
70 |
71 | ---Moves all or up to count items from the currently selected slot to the specified slot.
72 | ---
73 | ---If there are items in the target slot then this function attempts to swap the items in those slots.
74 | ---This only succeeds if you move all items away from the current slot or if the current slot was empty anyways.
75 | ---
76 | ---Note that this will always return true if the specified slot is the same as the currently selected slot,
77 | ---or if both slots are empty, even though no items are effectively moved.
78 | ---@param slot integer specifies the slot move the items from the currently selected slot to.
79 | ---@param count? integer if specified only up to this many items are moved, otherwise the entire stack is moved.
80 | ---@return boolean # `true` if exchanging the content between those slots was successful, false otherwise.
81 | function robot.transferTo(slot, count) end
82 |
83 |
84 | ---Compares the item of the currently selected slot to the item of the slot specified and returns whether they are equal or not.
85 | ---
86 | ---Two items are considered the 'same' if their item type and metadata are the same.
87 | ---Stack size or any additional mod-specific item informations (like for example the content of two floppy disks) are not checked.
88 | ---@param slot integer specifies the slot to compare the current slot to.
89 | ---@return boolean # `true` if the item type in the specified slot and the currently selected slot are equal, `false` otherwise.
90 | function robot.compareTo(slot) end
91 |
92 |
93 | ---Compares the block in front of the robot with the item in the currently selected slot and returns whether they are the same or not.
94 | ---
95 | ---Blocks are considered the 'same' if their type and metadata are the same.
96 | ---Stack size or any additional informations (like for example the inventory of a container) are not checked.
97 | ---
98 | ---Note that empty space in front of the robot is considered an 'air block' by the game,
99 | ---which cannot be put into an inventory slot and therefore compared by normal means.
100 | ---An empty slot and an air block are not the same.
101 | ---You can use robot.detect() beforehand to determine if there is actually a block in front of the robot.
102 | ---
103 | ---Also keep in mind that blocks that drop items need to be compared to the actual same block that is in the world.
104 | ---For example stone blocks drop as cobblestone and diamond ores drop diamond items, which are not the same for this function.
105 | ---Use silk-touch items to retrieve the actual block in the world for comparison.
106 | ---
107 | ---@return boolean
108 | function robot.compare() end
109 |
110 |
111 | ---Compares the block over of the robot with the item in the currently selected slot and returns whether they are the same or not.
112 | ---
113 | ---Blocks are considered the 'same' if their type and metadata are the same.
114 | ---Stack size or any additional informations (like for example the inventory of a container) are not checked.
115 | ---
116 | ---Note that empty space in front of the robot is considered an 'air block' by the game,
117 | ---which cannot be put into an inventory slot and therefore compared by normal means.
118 | ---An empty slot and an air block are not the same.
119 | ---You can use robot.detect() beforehand to determine if there is actually a block in front of the robot.
120 | ---
121 | ---Also keep in mind that blocks that drop items need to be compared to the actual same block that is in the world.
122 | ---For example stone blocks drop as cobblestone and diamond ores drop diamond items, which are not the same for this function.
123 | ---Use silk-touch items to retrieve the actual block in the world for comparison.
124 | ---
125 | ---@return boolean
126 | function robot.compareUp() end
127 |
128 |
129 | ---Compares the block under of the robot with the item in the currently selected slot and returns whether they are the same or not.
130 | ---
131 | ---Blocks are considered the 'same' if their type and metadata are the same.
132 | ---Stack size or any additional informations (like for example the inventory of a container) are not checked.
133 | ---
134 | ---Note that empty space in front of the robot is considered an 'air block' by the game,
135 | ---which cannot be put into an inventory slot and therefore compared by normal means. An empty slot and an air block are not the same.
136 | ---You can use robot.detect() beforehand to determine if there is actually a block in front of the robot.
137 | ---
138 | ---Also keep in mind that blocks that drop items need to be compared to the actual same block that is in the world.
139 | ---For example stone blocks drop as cobblestone and diamond ores drop diamond items, which are not the same for this function.
140 | ---Use silk-touch items to retrieve the actual block in the world for comparison.
141 | ---
142 | ---@return boolean
143 | function robot.compareDown() end
144 |
145 |
146 | ---Tries to drop or store items from the currently selected inventory slot in front of the robot.
147 | ---
148 | ---If the block or entity (like chests or mine-carts with a chest) immediately in front of the robot has an accessible item inventory,
149 | ---the robot will try to put those items into this inventory instead of throwing them into the world.
150 | ---If the block in front has an inventory but the item could not be moved into it for any reason,
151 | ---then this function returns false and does not move any items.
152 | ---Where the item will be put on depends on the inventory and the side the robot is facing.
153 | ---Furnaces for example receive items to smelt from the top side.
154 | ---Also note that robots are considered “blocks with an inventory” as well and
155 | ---therefore items can be moved into robot slots as with any other inventory as well.
156 | ---
157 | ---This function cannot interact with non-item inventories (like for example fluid tanks) and
158 | ---will not consider them an inventory and therefore items will be thrown into the world instead.
159 | ---You need to use the robot.use function to interact with those types of blocks.
160 | ---
161 | ---Note that this will always return false, if the currently selected slot contains no items at all.
162 | ---
163 | ---@param side integer What side to drop the item into
164 | ---@param count? integer specifies how many items to drop. If omitted or if count exceeds the amount of items in the currently selected slot, then all items in the currently selected slot are dropped.
165 | ---@return boolean # `true` if it was able to move at leat 1 item.
166 | ---@return string? # The reason why it wasn't dropped.
167 | function robot.drop(side, count) end
168 |
169 |
170 | ---Tries to drop or store items from the currently selected inventory slot above the robot.
171 | ---
172 | ---If the block or entity (like chests or mine-carts with a chest) immediately above the robot has an accessible item inventory,
173 | ---the robot will try to put those items into this inventory instead of throwing them into the world.
174 | ---If the block above has an inventory but the item could not be moved into it for any reason,
175 | ---then this function returns false and does not move any items.
176 | ---
177 | ---Where the item will be put on depends on the inventory and the side the robot is facing.
178 | ---Furnaces for example receive items to smelt from the top side.
179 | ---Also note that robots are considered “blocks with an inventory” as well and
180 | ---therefore items can be moved into robot slots as with any other inventory as well.
181 | ---
182 | ---This function cannot interact with non-item inventories (like for example fluid tanks) and
183 | ---will not consider them an inventory and therefore items will be thrown into the world instead.
184 | ---You need to use the robot.use function to interact with those types of blocks.
185 | ---
186 | ---Note that this will always return false, if the currently selected slot contains no items at all.
187 | ---
188 | ---@param count? integer specifies how many items to drop. If omitted or if count exceeds the amount of items in the currently selected slot, then all items in the currently selected slot are dropped.
189 | ---@return boolean # `true` if it was able to move at leat 1 item.
190 | ---@return string? # The reason why it wasn't dropped.
191 | function robot.dropUp(count) end
192 |
193 |
194 | ---Tries to drop or store items from the currently selected inventory slot below the robot.
195 | ---
196 | ---If the block or entity (like chests or mine-carts with a chest) immediately below the robot has an accessible item inventory,
197 | ---the robot will try to put those items into this inventory instead of throwing them into the world.
198 | ---If the block below has an inventory but the item could not be moved into it for any reason,
199 | ---then this function returns false and does not move any items.
200 | ---Where the item will be put on depends on the inventory and the side the robot is facing.
201 | ---Furnaces for example receive items to smelt from the top side.
202 | ---Also note that robots are considered “blocks with an inventory” as well and
203 | ---therefore items can be moved into robot slots as with any other inventory as well.
204 | ---
205 | ---This function cannot interact with non-item inventories (like for example fluid tanks) and
206 | ---will not consider them an inventory and therefore items will be thrown into the world instead.
207 | ---You need to use the robot.use function to interact with those types of blocks.
208 | ---
209 | ---Note that this will always return false, if the currently selected slot contains no items at all.
210 | ---
211 | ---@param count? integer specifies how many items to drop. If omitted or if count exceeds the amount of items in the currently selected slot, then all items in the currently selected slot are dropped.
212 | ---@return boolean # `true` if it was able to move at leat 1 item.
213 | ---@return string? # The reason why it wasn't dropped.
214 | function robot.dropDown(count) end
215 |
216 |
217 | ---Tries to pick up items from directly in front the robot and puts it into the selected slot or (if occupied) first possible slot.
218 | ---
219 | ---This is basically the inverse of robot.drop and will interact with item inventories in the same way.
220 | ---However this will only take the first item available in that inventory.
221 | ---For more precise inventory management you need to install an inventory controller upgrade into the robot.
222 | ---
223 | ---If there are multiple items in front of the robot, this will pick them up based on the distance to the robot.
224 | ---This will skip items that cannot be picked up for whatever reason and try other items first before returning false.
225 | ---
226 | ---If the currently selected slot contains a different item than the one the robot tries to pick up,
227 | ---the robot will attempt to place the item in the next possible slots after the selected one that are
228 | ---either free or contain identical items with less than the maximum stack size for those items.
229 | ---This will distribute the items to pick up over several slots if necessary.
230 | ---If no slot after the selected one is able to contain the items the robot tries to put up,
231 | ---this function will fail, even if there are slots before the currently selected slot that could hold those items.
232 | ---
233 | ---@param count? integer limits the amount of items to pick up by this many. If omitted a maximum of one stack is taken.
234 | ---@return integer|false # the amount of items sucked up or false.
235 | function robot.suck(count) end
236 |
237 |
238 | ---Tries to pick up items from directly over the robot and puts it into the selected slot or (if occupied) first possible slot.
239 | ---
240 | ---This is basically the inverse of robot.drop and will interact with item inventories in the same way.
241 | ---However this will only take the first item available in that inventory.
242 | ---For more precise inventory management you need to install an inventory controller upgrade into the robot.
243 | ---
244 | ---If there are multiple items in over of the robot, this will pick them up based on the distance to the robot.
245 | ---This will skip items that cannot be picked up for whatever reason and try other items first before returning false.
246 | ---
247 | ---If the currently selected slot contains a different item than the one the robot tries to pick up,
248 | ---the robot will attempt to place the item in the next possible slots after the selected one that are
249 | ---either free or contain identical items with less than the maximum stack size for those items.
250 | ---This will distribute the items to pick up over several slots if necessary.
251 | ---If no slot after the selected one is able to contain the items the robot tries to put up,
252 | ---this function will fail, even if there are slots before the currently selected slot that could hold those items.
253 | ---
254 | ---@param count? integer limits the amount of items to pick up by this many. If omitted a maximum of one stack is taken.
255 | ---@return integer|false # the amount of items sucked up or false.
256 | function robot.suckUp(count) end
257 |
258 |
259 | --- Tries to pick up items from directly under the robot and puts it into the selected slot or (if occupied) first possible slot.
260 | ---
261 | ---This is basically the inverse of robot.drop and will interact with item inventories in the same way.
262 | ---However this will only take the first item available in that inventory.
263 | ---For more precise inventory management you need to install an inventory controller upgrade into the robot.
264 | ---
265 | ---If there are multiple items in under of the robot, this will pick them up based on the distance to the robot.
266 | ---This will skip items that cannot be picked up for whatever reason and try other items first before returning false.
267 | ---
268 | ---If the currently selected slot contains a different item than the one the robot tries to pick up,
269 | ---the robot will attempt to place the item in the next possible slots after the selected one that are
270 | ---either free or contain identical items with less than the maximum stack size for those items.
271 | ---This will distribute the items to pick up over several slots if necessary.
272 | ---If no slot after the selected one is able to contain the items the robot tries to put up,
273 | ---this function will fail, even if there are slots before the currently selected slot that could hold those items.
274 | ---
275 | ---@param count? integer limits the amount of items to pick up by this many. If omitted a maximum of one stack is taken.
276 | ---@return integer|false # the amount of items sucked up or false.
277 | function robot.suckDown(count) end
278 |
279 |
280 | ---Tries to place the block in the currently selected inventory slot in front of the robot.
281 | ---
282 | ---A robot can only place blocks to the side of another solid block,
283 | ---they cannot place blocks “into the air” without an Angel upgrade.
284 | ---This can be changed in the config file.
285 | ---
286 | ---Note that trying to place an empty inventory slot will always fail.
287 | ---
288 | ---@param side? integer If specified this determines the surface on which the robot attempts to place the block for example to place torches to a specific side. If omitted the robot will try all possible sides. See the Sides API for a list of possible sides.
289 | ---@param sneaky? boolean If set to true the robot will simulate a sneak-placement (like if the player would be using shift during placement), which is usually not necessary and only included for compatibility to other mods.
290 | ---@return boolean # `true` if an item could be placed, false otherwise.
291 | ---@return string? # describes why the placement failed if it failed.
292 | function robot.place(side, sneaky) end
293 |
294 |
295 | ---Tries to place the block in the currently selected inventory slot over of the robot.
296 | ---
297 | ---A robot can only place blocks to the side of another solid block, they cannot place blocks “into the air” without an Angel upgrade. This can be changed in the config file.
298 | ---
299 | ---Note that trying to place an empty inventory slot will always fail.
300 | ---
301 | ---@param side? integer If specified this determines the surface on which the robot attempts to place the block for example to place torches to a specific side. If omitted the robot will try all possible sides. See the Sides API for a list of possible sides.
302 | ---@param sneaky? boolean If set to true the robot will simulate a sneak-placement (like if the player would be using shift during placement), which is usually not necessary and only included for compatibility to other mods.
303 | ---@return boolean # `true` if an item could be placed, false otherwise.
304 | ---@return string? # describes why the placement failed if it failed.
305 | function robot.placeUp(side, sneaky) end
306 |
307 |
308 | ---Tries to place the block in the currently selected inventory slot under of the robot.
309 | ---
310 | ---A robot can only place blocks to the side of another solid block, they cannot place blocks “into the air” without an Angel upgrade. This can be changed in the config file.
311 | ---
312 | ---Note that trying to place an empty inventory slot will always fail.
313 | ---
314 | ---@param side? integer If specified this determines the surface on which the robot attempts to place the block for example to place torches to a specific side. If omitted the robot will try all possible sides. See the Sides API for a list of possible sides.
315 | ---@param sneaky? boolean If set to true the robot will simulate a sneak-placement (like if the player would be using shift during placement), which is usually not necessary and only included for compatibility to other mods.
316 | ---@return boolean # `true` if an item could be placed, false otherwise.
317 | ---@return string? # describes why the placement failed if it failed.
318 | function robot.placeDown(side, sneaky) end
319 |
320 |
321 | ---Checks the durability of the currently equipped tool
322 | ---
323 | ---If no item is equipped or the item has no durability this returns nil and an error message describing why no durability could be returned.
324 | ---
325 | ---The error message is one of `no tool equipped` or `tool cannot be damaged`.
326 | ---
327 | ---@return number|nil # The tool's durability of the equipped tool
328 | ---@return string? # the current durability of the equipped or an error message
329 | function robot.durability() end
330 |
331 |
332 | ---Makes the robot use the item currently in the tool slot against the block or space
333 | ---immediately in front of the robot in the same way as if a player would make a left-click.
334 | ---
335 | ---This can be used to mine blocks or fight entities in the same way as if the player did a left-click.
336 | ---Note that tools and weapons do lose durability in the same way as if a player would use them and need to be replaced eventually.
337 | ---Items mined or dropped of mobs will be put into the inventory if possible, otherwise they will be dropped to the ground.
338 | ---
339 | ---Note that even though the action is performed immediately (like a block being destroyed)
340 | ---this function will wait for a while appropriate to the action performed to simulate
341 | ---the time it would take a player to do the same action.
342 | ---This is most noticeable if you try to mine obsidian blocks:
343 | ---they are destroyed and put into the inventory immediately,
344 | ---but the function will wait for a few seconds.
345 | ---
346 | ---If this is used to mine blocks, then the tool equipped needs to be sufficient to actually mine the block in front.
347 | ---If for example a wooden pick-axe is used on an obsidian block this will return false.
348 | ---Everything (including an empty slot) can be used to fight mobs, but the damage will be based on the item used.
349 | ---Equally everything can be used to extinguish fire, and items with durability will not lose any if done so.
350 | ---
351 | ---@param side? integer if given the robot will try to 'left-click' only on the surface as specified by side, otherwise the robot will try all possible sides. See the Sides API for a list of possible sides.
352 | ---@param sneaky? boolean # simulates a shift-left click operation if specified.
353 | ---@return boolean # `true` if the robot could interact with the block or entity in front of it, `false` otherwise.
354 | ---@return 'entity'|'block'|'fire' # If successful the secondary parameter describes what the robot interacted with and will be one of 'entity', 'block' or 'fire'.
355 | function robot.swing(side, sneaky) end
356 |
357 |
358 | ---Makes the robot use the item currently in the tool slot against the block or space
359 | ---immediately over the robot in the same way as if a player would make a left-click.
360 | ---
361 | ---This can be used to mine blocks or fight entities in the same way as if the player did a left-click.
362 | ---Note that tools and weapons do lose durability in the same way as if a player would use them and need to be replaced eventually.
363 | ---Items mined or dropped of mobs will be put into the inventory if possible, otherwise they will be dropped to the ground.
364 | ---
365 | ---Note that even though the action is performed immediately (like a block being destroyed)
366 | ---this function will wait for a while appropriate to the action performed to simulate
367 | ---the time it would take a player to do the same action.
368 | ---This is most noticeable if you try to mine obsidian blocks:
369 | ---they are destroyed and put into the inventory immediately,
370 | ---but the function will wait for a few seconds.
371 | ---
372 | ---If this is used to mine blocks, then the tool equipped needs to be sufficient to actually mine the block over it.
373 | ---If for example a wooden pick-axe is used on an obsidian block this will return false.
374 | ---Everything (including an empty slot) can be used to fight mobs, but the damage will be based on the item used.
375 | ---Equally everything can be used to extinguish fire, and items with durability will not lose any if done so.
376 | ---
377 | ---@param side? integer if given the robot will try to 'left-click' only on the surface as specified by side, otherwise the robot will try all possible sides. See the Sides API for a list of possible sides.
378 | ---@param sneaky? boolean # simulates a shift-left click operation if specified.
379 | ---@return boolean # `true` if the robot could interact with the block or entity over it, `false` otherwise.
380 | ---@return 'entity'|'block'|'fire' # If successful the secondary parameter describes what the robot interacted with and will be one of 'entity', 'block' or 'fire'.
381 | function robot.swingUp(side, sneaky) end
382 |
383 |
384 | ---Makes the robot use the item currently in the tool slot against the block or space
385 | ---immediately under the robot in the same way as if a player would make a left-click.
386 | ---
387 | ---This can be used to mine blocks or fight entities in the same way as if the player did a left-click.
388 | ---Note that tools and weapons do lose durability in the same way as if a player would use them and need to be replaced eventually.
389 | ---Items mined or dropped of mobs will be put into the inventory if possible, otherwise they will be dropped to the ground.
390 | ---
391 | ---Note that even though the action is performed immediately (like a block being destroyed)
392 | ---this function will wait for a while appropriate to the action performed to simulate
393 | ---the time it would take a player to do the same action.
394 | ---This is most noticeable if you try to mine obsidian blocks:
395 | ---they are destroyed and put into the inventory immediately,
396 | ---but the function will wait for a few seconds.
397 | ---
398 | ---If this is used to mine blocks, then the tool equipped needs to be sufficient to actually mine the block under it.
399 | ---If for example a wooden pick-axe is used on an obsidian block this will return false.
400 | ---Everything (including an empty slot) can be used to fight mobs, but the damage will be based on the item used.
401 | ---Equally everything can be used to extinguish fire, and items with durability will not lose any if done so.
402 | ---
403 | ---@param side? integer if given the robot will try to 'left-click' only on the surface as specified by side, otherwise the robot will try all possible sides. See the Sides API for a list of possible sides.
404 | ---@param sneaky? boolean # simulates a shift-left click operation if specified.
405 | ---@return boolean # `true` if the robot could interact with the block or entity under it, `false` otherwise.
406 | ---@return 'entity'|'block'|'fire' # If successful the secondary parameter describes what the robot interacted with and will be one of 'entity', 'block' or 'fire'.
407 | function robot.swingDown(side, sneaky) end
408 |
409 |
410 | ---Attempts to use the item currently equipped in the tool slot in the same way as if the player would make a right-click.
411 | ---
412 | ---This function has a very broad use as the robot can simulate right-clicks with most items.
413 | ---The only difference to players is that the robot cannot use itemsthat specifically
414 | ---require the user to be an entity as the robot is a block. So drinking potions,
415 | ---eating food or throwing an ender pearl will fail.
416 | ---
417 | ---This functions secondary return value can be used to determine what the result of the right-click caused.
418 | ---Which of the item results is returned is not always obvious and requires some testing beforehand.
419 | ---Also note that while robots are not affected by harmful potions they can be destroyed by explosions,
420 | ---so be careful when you place, throw or activate any form of explosives with this function.
421 | ---
422 | ---Possible values for the second return value:
423 | ---* `block_activated` - a block was activated (like levers, switches or doors).
424 | ---* `item_interacted` - the equipped tool interacted with the world, for example sheers when used on a sheep.
425 | ---* `item_placed` - something was placed into the world. This is not only caused by placeable blocks, but as well by items that cause blocks or entities to appear in the world (like flint and stone or mob eggs).
426 | ---* `item_used` - the equipped was activated, like a splash-potion.
427 | ---* `air` - the equipped item requires a target but there was none. Note that if your robot has an Angel upgrade, this will never be returned, however some actions might still cause no effect.
428 | ---
429 | ---@param side? integer if given the robot will try to 'right-click' only on the surface as specified by side, otherwise the robot will try all possible sides. See the Sides API for a list of possible sides.
430 | ---@param sneaky? boolean - if set to true the robot will simulate a sneak-right-click (like if the player would be using shift during a right-click). Some items (like buckets) will behave differently if this is set to true.
431 | ---@param duration? number - how long the item is used. This is useful when using charging items like a bow.
432 | ---@return boolean # true if the robot could interact with the block or entity in front of it, false otherwise.
433 | ---@return 'blockactivated'|'itemplaced'|'iteminteracted'|'itemused'? # If successful the secondary parameter describes what the robot interacted with.
434 | function robot.use(side, sneaky, duration) end
435 |
436 |
437 | ---Attempts to use the item currently equipped in the tool slot in the same way as if the player would make a right-click upwards.
438 | ---
439 | ---This function has a very broad use as the robot can simulate right-clicks with most items.
440 | ---The only difference to players is that the robot cannot use items that specifically require the user to be an entity as the robot is a block.
441 | ---So drinking potions, eating food or throwing an ender pearl will fail.
442 | ---
443 | ---This functions secondary return value can be used to determine what the result of the right-click caused.
444 | ---Which of the item results is returned is not always obvious and requires some testing beforehand.
445 | ---Also note that while robots are not affected by harmful potions they can be destroyed by explosions,
446 | ---so be careful when you place, throw or activate any form of explosives with this function.
447 | ---
448 | ---Possible values for the second return value:
449 | ---* `block_activated` - a block was activated (like levers, switches or doors).
450 | ---* `item_interacted` - the equipped tool interacted with the world, for example sheers when used on a sheep.
451 | ---* `item_placed` - something was placed into the world. This is not only caused by placeable blocks, but as well by items that cause blocks or entities to appear in the world (like flint and stone or mob eggs).
452 | ---* `item_used` - the equipped was activated, like a splash-potion.
453 | ---* `air` - the equipped item requires a target but there was none. Note that if your robot has an Angel upgrade, this will never be returned, however some actions might still cause no effect.
454 | ---
455 | ---@param side? integer if given the robot will try to 'right-click' only on the surface as specified by side, otherwise the robot will try all possible sides. See the Sides API for a list of possible sides.
456 | ---@param sneaky? boolean - if set to true the robot will simulate a sneak-right-click (like if the player would be using shift during a right-click). Some items (like buckets) will behave differently if this is set to true.
457 | ---@param duration? number - how long the item is used. This is useful when using charging items like a bow.
458 | ---@return boolean # true if the robot could interact with the block or entity over it, false otherwise.
459 | ---@return 'blockactivated'|'itemplaced'|'iteminteracted'|'itemused'? # If successful the secondary parameter describes what the robot interacted with.
460 | function robot.useUp(side, sneaky, duration) end
461 |
462 |
463 | ---Attempts to use the item currently equipped in the tool slot in the same way as if the player would make a right-click downwards.
464 | ---
465 | ---This function has a very broad use as the robot can simulate right-clicks with most items.
466 | ---The only difference to players is that the robot cannot use items that specifically require the user to be an entity as the robot is a block.
467 | ---So drinking potions, eating food or throwing an ender pearl will fail.
468 | ---
469 | ---This functions secondary return value can be used to determine what the result of the right-click caused.
470 | ---Which of the item results is returned is not always obvious and requires some testing beforehand.
471 | ---Also note that while robots are not affected by harmful potions they can be destroyed by explosions,
472 | ---so be careful when you place, throw or activate any form of explosives with this function.
473 | ---
474 | ---Possible values for the second return value:
475 | ---* `block_activated` - a block was activated (like levers, switches or doors).
476 | ---* `item_interacted` - the equipped tool interacted with the world, for example sheers when used on a sheep.
477 | ---* `item_placed` - something was placed into the world. This is not only caused by placeable blocks, but as well by items that cause blocks or entities to appear in the world (like flint and stone or mob eggs).
478 | ---* `item_used` - the equipped was activated, like a splash-potion.
479 | ---* `air` - the equipped item requires a target but there was none.Note that if your robot has an Angel upgrade, this will never be returned, however some actions might still cause no effect.
480 | ---
481 | ---@param side? integer if given the robot will try to 'right-click' only on the surface as specified by side, otherwise the robot will try all possible sides. See the Sides API for a list of possible sides.
482 | ---@param sneaky? boolean - if set to true the robot will simulate a sneak-right-click (like if the player would be using shift during a right-click). Some items (like buckets) will behave differently if this is set to true.
483 | ---@param duration? number - how long the item is used. This is useful when using charging items like a bow.
484 | ---@return boolean # true if the robot could interact with the block or entity under it, false otherwise.
485 | ---@return 'block_activated'|'item_placed'|'item_interacted'|'item_used'? # If successful the secondary parameter describes what the robot interacted with.
486 | function robot.useDown(side, sneaky, duration) end
487 |
488 |
489 | --- @alias moveError 'not enough energy'|'impossible move'
490 |
491 |
492 | ---Tries to move the robot forward
493 | ---* `not enough energy` is rarely returned as being low on energy usually causes the robot to shut down beforehand.
494 | ---* `impossible move` is kind of a fall-back result and will be returned for example if the robot tries to move into an area of the world that is currently not loaded.
495 | ---
496 | ---@return boolean # true if the robot successfully moved, nil otherwise.
497 | ---@return moveError|detectType? # what prevented the robot form moving
498 | function robot.forward() end
499 |
500 |
501 | ---Tries to move the robot backwards
502 | ---* `not enough energy` is rarely returned as being low on energy usually causes the robot to shut down beforehand.
503 | ---* `impossible move` is kind of a fall-back result and will be returned for example if the robot tries to move into an area of the world that is currently not loaded.
504 | ---
505 | ---@return boolean # true if the robot successfully moved, nil otherwise.
506 | ---@return moveError|detectType? # what prevented the robot form moving
507 | function robot.back() end
508 |
509 |
510 | ---Tries to move the robot upwards
511 | ---* `not enough energy` is rarely returned as being low on energy usually causes the robot to shut down beforehand.
512 | ---* `impossible move` is kind of a fall-back result and will be returned for example if the robot tries to move into an area of the world that is currently not loaded.
513 | ---
514 | ---@return boolean # true if the robot successfully moved, nil otherwise.
515 | ---@return moveError|detectType? # what prevented the robot form moving
516 | function robot.up() end
517 |
518 |
519 | ---Tries to move the robot downwards
520 | ---* `not enough energy` is rarely returned as being low on energy usually causes the robot to shut down beforehand.
521 | ---* `impossible move` is kind of a fall-back result and will be returned for example if the robot tries to move into an area of the world that is currently not loaded.
522 | ---@return boolean # true if the robot successfully moved, nil otherwise.
523 | ---@return moveError|detectType? # what prevented the robot form moving
524 | function robot.down() end
525 |
526 |
527 | ---Turns the robot 90° to the left.
528 | ---Note that this can only fail if the robot has not enough energy to perform the turn but has not yet shut down because of it.
529 | ---@return boolean # `true` if success
530 | function robot.turnLeft() end
531 |
532 |
533 | ---Turns the robot 90° to the right.
534 | ---Note that this can only fail if the robot has not enough energy to perform the turn but has not yet shut down because of it.
535 | ---@return boolean # `true` if success
536 | function robot.turnRight() end
537 |
538 |
539 | ---This is the same as calling robot.turnRight twice.
540 | ---Note that this can only fail if the robot has not enough energy to perform the turn but has not yet shut down because of it.
541 | ---@return boolean # `true` if success
542 | function robot.turnAround() end
543 |
544 |
545 | ---@deprecated
546 | ---Deprecated since OC 1.3 use component.experience.level() instead (only available if the experience upgrade is installed).
547 | ---@return number # The current level of the robot, with the fractional part being the percentual progress towards the next level. For example, if this returns 1.5, then the robot is level one, and 50% towards achieving level two.
548 | function robot.level() end
549 |
550 |
551 | ---Returns the number of tanks in the robot
552 | ---@return integer # The number of tanks installed in the robot.
553 | function robot.tankCount() end
554 |
555 |
556 | ---Returns the selected tank or selects a tank and returns the selected tank's number
557 | ---@param tank? integer # the tank to select
558 | ---@return integer # the selected tank
559 | function robot.selectTank(tank) end
560 |
561 |
562 | ---The the current fluid level in the specified tank, or, if none is specified, the selected tank.
563 | ---@param tank? integer # the tank to check
564 | ---@return integer # the current fluid amount in the tank
565 | function robot.tankLevel(tank) end
566 |
567 |
568 | ---The the remaining fluid capacity in the specified tank, or, if none is specified, the selected tank.
569 | ---@param tank? integer # the tank to check
570 | ---@return integer # the current fluid amount in the tank
571 | function robot.tankSpace(tank) end
572 |
573 |
574 | ---Tests whether the fluid in the selected tank is the same as in the specified tank.
575 | ---@param tank integer
576 | ---@return boolean
577 | function robot.compareFluidTo(tank) end
578 |
579 |
580 | ---Transfers the specified amount of fluid from the selected tank into the specified tank.
581 | ---If no volume is specified, tries to transfer 1000 mB.
582 | ---
583 | ---@param tank integer which tank to transfer to
584 | ---@param count? integer The amount to transfer
585 | ---@return boolean
586 | function robot.transferFluidTo(tank, count) end
587 |
588 |
589 | ---Tests whether the fluid in the selected tank is the same as in the world or the tank in front of the robot.
590 | ---@return boolean
591 | function robot.compareFluid() end
592 |
593 |
594 | ---Tests whether the fluid in the selected tank is the same as in the world or the tank over the robot.
595 | function robot.compareFluidUp() end
596 |
597 |
598 | ---Tests whether the fluid in the selected tank is the same as in the world or the tank under the robot.
599 | function robot.compareFluidDown() end
600 |
601 |
602 | ---Extracts the specified amount of fluid from the world or the tank in front of the robot.
603 | ---When no amount is specified, will try to drain 1000 mB.
604 | ---When the drained fluid is in the world and it cannot be fully stored in the selected tank,
605 | ---the operation fails, i.e. no fluid is lost.
606 | ---
607 | ---@param count? integer The amount to transfer
608 | ---@return boolean
609 | function robot.drain(count) end
610 |
611 |
612 | ---Extracts the specified amount of fluid from the world or the tank over the robot.
613 | ---When no amount is specified, will try to drain 1000 mB.
614 | ---When the drained fluid is in the world and it cannot be fully stored in the selected tank,
615 | ---the operation fails, i.e. no fluid is lost.
616 | ---
617 | ---@param count? integer The amount to transfer
618 | ---@return boolean
619 | function robot.drainUp(count) end
620 |
621 |
622 | ---Extracts the specified amount of fluid from the world or the tank under the robot.
623 | ---When no amount is specified, will try to drain 1000 mB.
624 | ---When the drained fluid is in the world and it cannot be fully stored in the selected tank,
625 | ---the operation fails, i.e. no fluid is lost.
626 | ---
627 | ---@param count? integer The amount to transfer
628 | ---@return boolean
629 | function robot.drainDown(count) end
630 |
631 |
632 | ---Injects the specified amount of fluid from the selected tank into the the world or the tank in front of the robot.
633 | ---When no amount is specified, will try to eject 1000 mB. When there is not enough fluid to fill a block,
634 | ---or the target tank does not have enough room, the operation fails, i.e. no fluid is lost.
635 | ---
636 | ---@param count? integer The amount to transfer
637 | ---@return boolean
638 | function robot.fill(count) end
639 |
640 |
641 | ---Injects the specified amount of fluid from the selected tank into the the world or the tank over the robot.
642 | ---When no amount is specified, will try to eject 1000 mB. When there is not enough fluid to fill a block,
643 | ---or the target tank does not have enough room, the operation fails, i.e. no fluid is lost.
644 | ---
645 | ---@param count? integer The amount to transfer
646 | ---@return boolean
647 | function robot.fillUp(count) end
648 |
649 |
650 | ---Injects the specified amount of fluid from the selected tank into the the world or the tank under the robot.
651 | ---When no amount is specified, will try to eject 1000 mB. When there is not enough fluid to fill a block,
652 | ---or the target tank does not have enough room, the operation fails, i.e. no fluid is lost.
653 | ---
654 | ---@param count? integer The amount to transfer
655 | ---@return boolean
656 | function robot.fillDown(count) end
657 |
658 |
659 | return robot
--------------------------------------------------------------------------------
/docs/sides.lua:
--------------------------------------------------------------------------------
1 | ---@meta 'sides'
2 |
3 | ---@class sides
4 | local sides = {}
5 |
6 | -- lookups
7 | sides[0] = 'bottom'
8 | sides[1] = 'top'
9 | sides[2] = 'back'
10 | sides[3] = 'front'
11 | sides[4] = 'right'
12 | sides[5] = 'left'
13 | sides[6] = 'unknown'
14 |
15 | -- cardinal
16 | sides.north = 2
17 | sides.south = 3
18 | sides.west = 4
19 | sides.east = 5
20 |
21 | -- directional
22 | sides.bottom = 0
23 | sides.down = 0
24 | sides.up = 1
25 | sides.top = 1
26 | sides.back = 2
27 | sides.front = 3
28 | sides.forward = 3
29 | sides.right = 4
30 | sides.left = 5
31 |
32 | -- axis
33 | sides.negx = 4
34 | sides.posy = 1
35 | sides.negz = 2
36 | sides.posx = 5
37 | sides.negy = 0
38 | sides.posz = 3
39 |
40 | sides.unknown = 6
41 |
42 | return sides
--------------------------------------------------------------------------------
/docs/type_definitions/ae_types/AECpu.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class AECpu
4 | local AECpu = {}
5 |
6 | ---Get the list of items that are actively being crafted.
7 | ---@return ItemStack[]
8 | function AECpu.activeItems() end
9 |
10 | ---Get the list of items currently stored in the cpu.
11 | ---@return ItemStack[]
12 | function AECpu.storedItems() end
13 |
14 | ---Get the list of items that are scheduled to be crafted.
15 | ---@return ItemStack[]
16 | function AECpu.pendingItems() end
17 |
18 | ---Gets the item being crafted by the CPU.
19 | ---Does not function without a crafting monitor.
20 | ---@return ItemStack
21 | function AECpu.finalOutput() end
22 |
23 | ---Attempts to cancel the craft.
24 | ---@return boolean
25 | function AECpu.cancel() end
26 |
27 | ---Checks if the cpu is online.
28 | ---@return boolean
29 | function AECpu.isActive() end
30 |
31 | ---Checks if the cpu is currently crafting something.
32 | ---@return boolean
33 | function AECpu.isBusy() end
--------------------------------------------------------------------------------
/docs/type_definitions/ae_types/AECpuMetadata.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class AECpuMetadata
4 | ---@field name string # The name of the CPU.
5 | ---@field busy boolean # true if the cpu is currently crafting something.
6 | ---@field storage integer # The storage capacity of the cpu.
7 | ---@field coprocessors integer # The number of available coprocessors.
8 | ---@field cpu AECpu # The CPU being described.
--------------------------------------------------------------------------------
/docs/type_definitions/ae_types/AECraftable.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class AECraftable
4 | local AECraftable = {}
5 |
6 | ---Sends a craft request to the ME system for this pattern
7 | ---@param amount number # The amount of items to craft
8 | ---@param prioritizePower boolean # Wether to prioririze power usage idk needs more digging?
9 | ---@param cpuName string # the name of the cpu to start the craft in
10 | ---@return AECraftingJob # A tracker for the craft
11 | function AECraftable.request(amount, prioritizePower, cpuName) end
12 |
13 |
14 | ---Gets the display item for the pattern
15 | ---@return MEItemStack
16 | function AECraftable.getItemStack() end
--------------------------------------------------------------------------------
/docs/type_definitions/ae_types/AECraftingJob.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | --#region AECraftingJob
4 |
5 | ---@class AECraftingJob
6 | local AECraftingJob = {}
7 |
8 |
9 | ---Get whether the crafting request is currently computing.
10 | ---@return boolean
11 | function AECraftingJob.isComputing() end
12 |
13 |
14 | ---Get whether the crafting request has failed.
15 | ---@return boolean
16 | function AECraftingJob.hasFailed() end
17 |
18 |
19 | ---Get whether the crafting request has been canceled.
20 | ---@return boolean
21 | function AECraftingJob.isCanceled() end
22 |
23 |
24 | ---Get whether the crafting request is done.
25 | ---@return boolean
26 | function AECraftingJob.isDone() end
--------------------------------------------------------------------------------
/docs/type_definitions/ae_types/LevelMaintainerSlot.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class LevelMaintainerSlot
4 | ---@field name string # The item id
5 | ---@field label string # The name of the item
6 | ---@field damage integer # The damage of the item
7 | ---@field maxDamage integer # The maximum amount of damage that can be applied to the item
8 | ---@field hasTag boolean # True if the item has nbt tags
9 | ---@field batch integer # The amount of items to craft per craft request
10 | ---@field quantity integer # The amount of items to stock
11 | ---@field isDone boolean # True if the level maintainer is done crafting
12 | ---@field isEnable boolean # True if the slot is enabled
13 | ---@field isFluid boolean # True if the item is a fluid
14 | ---@field fluid FluidStack? # The fluid stack if the thing to maintain is a fluid
15 |
--------------------------------------------------------------------------------
/docs/type_definitions/ae_types/MEFluidStack.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class MEFluidStack: FluidStack
4 | ---@field isCraftable boolean # True if the fluid is craftable
--------------------------------------------------------------------------------
/docs/type_definitions/ae_types/MEItemStack.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class MEItemStack: ItemStack
4 | ---@field isCraftable boolean # True if the item is craftable
--------------------------------------------------------------------------------
/docs/type_definitions/ae_types/MEItemStackFilter.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class MEItemStackFilter
4 | ---@field name string? # The id of the item.
5 | ---@field damage integer? # Either the metadata of the item or how much damage it has taken.
6 | ---@field maxDamage integer? # How much damage an item can take
7 | ---@field size integer? # How many items are in the stack.
8 | ---@field maxSize integer? # The maximum items per stack.
9 | ---@field label string? # The localised name of the item.
10 | ---@field hasTag boolean? # `true` if the item has an NBT tag.
11 | ---@field tag string? # An encoded version of the NBT tag (looks like the usual zlib encode for BNBT)
12 | ---@field isCraftable boolean? # True if the item is craftable
--------------------------------------------------------------------------------
/docs/type_definitions/ae_types/MEPattern.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class MEPattern: MEItemStack
4 | ---@field inputs MEPatternSlot[] # The inputs of the pattern
5 | ---@field outputs MEPatternSlot[] # The outputs of the pattern
--------------------------------------------------------------------------------
/docs/type_definitions/ae_types/MEPatternSlot.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class MEPatternSlot
4 | ---@field name string # The localised name of the item in the slot.
5 | ---@field count integer # The amount set in the slot.
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/I2DVertex.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class I2DVertex: IAttribute
4 | local I2DVertex = {}
5 |
6 |
7 | ---Sets the position of a vertex of this widget.
8 | ---@param vertexId integer # The id of the vertex to change.
9 | ---@param x number # The new x position of the vertex.
10 | ---@param y number # The new y position of the vertex.
11 | function I2DVertex.setVertex(vertexId, x, y) end
12 |
13 |
14 | ---Gets the number of vertex in the widget.
15 | ---@return integer # The number of vertex in the widget.
16 | function I2DVertex.GetVertexCount() end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/I3DPositionable.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class I3DPositionable: IAttribute
4 | local I3DPositionable = {}
5 |
6 |
7 | ---Sets the origin position of a 3d widget relative to the position of the glasses terminal.
8 | ---@param x number # The new x position of the vertex in the world relative to the position of the glasses terminal.
9 | ---@param y number # The new y position of the vertex in the world relative to the position of the glasses terminal.
10 | ---@param z number # The new z position of the vertex in the world relative to the position of the glasses terminal.
11 | function I3DPositionable.set3DPos(x, y, z) end
12 |
13 |
14 | ---Gets the origin position of a 3d widget relative to the position of the glasses terminal.
15 | ---@return number x # The x position of the widget in the world relative to the position of the glasses terminal.
16 | ---@return number y # The y position of the widget in the world relative to the position of the glasses terminal.
17 | ---@return number z # The z position of the widget in the world relative to the position of the glasses terminal.
18 | function I3DPositionable.get3DPos() end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/I3DVertex.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class I3DVertex: IAttribute
4 | local I3DVertex = {}
5 |
6 |
7 | ---Sets the position of a vertex of this widget relative to the position of the glasses terminal.
8 | ---@param vertexId integer # The id of the vertex to change.
9 | ---@param x number # The new x position of the vertex relative to the position of the glasses terminal.
10 | ---@param y number # The new y position of the vertex relative to the position of the glasses terminal.
11 | ---@param z number # The new z position of the vertex relative to the position of the glasses terminal.
12 | function I3DVertex.setVertex(vertexId, x, y, z) end
13 |
14 |
15 | ---Gets the number of vertex in the widget.
16 | ---@return integer # The number of vertex in the widget.
17 | function I3DVertex.GetVertexCount() end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/IAlpha.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class IAlpha: IAttribute
4 | local IAlpha = {}
5 |
6 |
7 | ---Sets the transparency value of a widget
8 | ---@param alpha number # The new alpha value, 1 is fully visible, 0 is invisible
9 | function IAlpha.setAlpha(alpha) end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/IAttribute.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class IAttribute
4 | local IAttribute = {}
5 |
6 |
7 | ---Gets the unique identifier of the widget.
8 | ---@return integer # The unique identifier of the widget.
9 | function IAttribute.getID() end
10 |
11 | ---Sets the visibilility of the widget.
12 | ---@param visible boolean # The new visibility status of the widget.
13 | function IAttribute.setVisible(visible) end
14 |
15 | ---Checks if the widget is being rendered.
16 | ---@return boolean # `true` if the widget is being rendered.
17 | function IAttribute.isVisible() end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/IColorizable.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class IColorizable: IAttribute
4 | local IColorizable = {}
5 |
6 |
7 | ---Sets the color of a widget.
8 | ---@param r number # The red component from `0.0` to `1.0`.
9 | ---@param g number # The green component from `0.0` to `1.0`.
10 | ---@param b number # The blue component from `0.0` to `1.0`.
11 | function IColorizable.setColor(r, g, b) end
12 |
13 |
14 | ---Gets the color of a widget.
15 | ---@return number r # The red component from `0.0` to `1.0`.
16 | ---@return number g # The green component from `0.0` to `1.0`.
17 | ---@return number b # The blue component from `0.0` to `1.0`.
18 | function IColorizable.setColor(r, g, b) end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/IItemable.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class IItemable: IAttribute
4 | local IITemable = {}
5 |
6 |
7 | ---Sets the item displayed by the widget
8 | ---@param dbAddress string # The address of a database containing the item
9 | ---@param dbIndex integer # The index of the item within the database
10 | function IITemable.setItem(dbAddress, dbIndex) end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/ILookable.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class ILookable: IAttribute
4 | local ILookable = {}
5 |
6 |
7 | ---Enables or disables the ability to hide the widget unless the player looks at a block (default state set to false)
8 | ---@param enable integer # Set to `true` to enable the looking at feature.
9 | function ILookable.setLookingAt(enable) end
10 |
11 |
12 | ---Sets the location of the block that must be looked at in order for this widget to appear.
13 | ---
14 | ---You must also run `setLookingAt(true)` if you want this feature to work.
15 | ---@param x integer # The global x coordinate of the block.
16 | ---@param y integer # The global y coordinate of the block.
17 | ---@param z integer # The global z coordinate of the block.
18 | function ILookable.setLookingAt(x,y,z) end
19 |
20 |
21 | ---Checks if the looking at feature is enabled on this widget.
22 | ---@return integer x # The global x coordinate of the block that must be looked at to see this widget.
23 | ---@return integer y # The global y coordinate of the block that must be looked at to see this widget.
24 | ---@return integer z # The global z coordinate of the block that must be looked at to see this widget.
25 | ---@return boolean status # `True` if the looking at feature is enabled.
26 | function ILookable.getLookingAt() end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/IPositionable.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class IPositionable: IAttribute
4 | local IPositionable = {}
5 |
6 |
7 | ---Sets the position of a widget on the screen. 0,0 is the top left of the screen.
8 | ---
9 | ---Note that the size and position of a widget is dependent on the player's window size/resolution and ui scale.
10 | ---There is no way to find either the scale or resolution of a player programmatically.
11 | ---@param x number # The x position of the widget.
12 | ---@param y number # The y position of the widget.
13 | function IPositionable.setPosition(x,y) end
14 |
15 |
16 | ---Gets the position of a 2D widget.
17 | ---@return number x # The x position of the widget on the screen.
18 | ---@return number y # The x position of the widget on the screen.
19 | function IPositionable.getPosition() end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/IResizable.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class IResizable: IAttribute
4 | local IResizable = {}
5 |
6 |
7 | ---Sets the width and height of the widget.
8 | ---
9 | ---Note that the size and position of a widget is dependent on the player's window size/resolution and ui scale.
10 | ---There is no way to find either the scale or resolution of a player programmatically.
11 | ---@param width number # The new height of the widget.
12 | ---@param height number # The new width of the widget.
13 | function IResizable.setSize(width, height) end
14 |
15 | ---Gets the width and height of the widget.
16 | ---@return number width # The height of the widget.
17 | ---@return number height # The width of the widget.
18 | function IResizable.getSize() end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/IRotatable.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class IRotatable: IAttribute
4 | local IRotatable = {}
5 |
6 |
7 | ---Sets the rotation angle of the widget.
8 | ---@param degrees number # The new rotation angle of the widget in degrees.
9 | function IRotatable.setRotation(degrees) end
10 |
11 |
12 | ---Gets the rotation angle of the widget.
13 | ---@return number degrees # The number of degrees by which the widget is rotated.
14 | function IRotatable.getRotation() end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/IScalable.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class IScalable: IAttribute
4 | local IScalable = {}
5 |
6 |
7 | ---Sets the scale of a widget.
8 | ---
9 | ---Note that the size and position of a widget is dependent on the player's window size/resolution and ui scale.
10 | ---There is no way to find either the scale or resolution of a player programmatically.
11 | ---@param scale number # The factor by which to scale the widget.
12 | function IScalable.setScale(scale) end
13 |
14 |
15 | ---Gets the scale of the widget.
16 | ---@return number # The scale of the widget.
17 | function IScalable.getscale() end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/ITextable.lua:
--------------------------------------------------------------------------------
1 | ---@meta
2 |
3 | ---@class ITextable: IAttribute
4 | local ITextable = {}
5 |
6 |
7 | ---Sets the text displayed by the widget.
8 | ---@param text string # The new text being displayed by the widget.
9 | function ITextable.setText(text) end
10 |
11 |
12 | ---Gets the text being displayed by the widget.
13 | function ITextable.getText() end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/IThroughVisibility.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class IThroughVisibility: IAttribute
4 | local IThroughVisibility = {}
5 |
6 |
7 | ---Sets a widget to be visible though blocks.
8 | ---@param status boolean # Set to `True` to allow this widget to be visible though blocks.
9 | function IThroughVisibility.setVisibleThroughObjects(status) end
10 |
11 |
12 | ---Checks if an object should be visible though blocks.
13 | ---@return boolean # `True` if the object is set to be visible though blocks.
14 | function IThroughVisibility.isVisibleThroughObjects() end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/interfaces/IViewDistance.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class IViewDistance: I3DPositionable
4 | local IViewDistance = {}
5 |
6 |
7 | ---Sets the maximum distance from a player at which the 3D widget will become visible.
8 | ---@param distance integer # The maximum distance from the player at which the 3D widget will be rendered.
9 | function IViewDistance.setViewDistance(distance) end
10 |
11 |
12 | ---Gets the maximum distance from a player at which the 3D widget will become visible.
13 | ---@return integer # The maximum distance from the player at which the 3D widget will be rendered.
14 | function IViewDistance.getViewDistance() end
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/widgets/2d/Dot2D.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class Dot2D: IPositionable, IColorizable, IAlpha, IScalable
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/widgets/2d/ItemIcon2D.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class ItemIcon2D: IItemable, IPositionable, IScalable, IRotatable
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/widgets/2d/Quad2D.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class Quad2D: Triangle2D
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/widgets/2d/Rect2D.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class Rect2D: IPositionable, IResizable, IColorizable, IAlpha
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/widgets/2d/Text2D.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class Text2D: ITextable, IRotatable
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/widgets/2d/Triangle2D.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class Triangle2D: IColorizable, IAlpha, I2DVertex
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/widgets/3d/Cube3D.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class Cube3D: I3DPositionable, IAlpha, IThroughVisibility, IColorizable, IViewDistance, ILookable, IScalable
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/widgets/3d/Dot3D.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class Dot3D: IAlpha, IScalable, IColorizable, I3DPositionable, IThroughVisibility, IViewDistance
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/widgets/3d/Line3D.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class Line3D: IAlpha, IColorizable, I3DVertex, IScalable, IThroughVisibility
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/widgets/3d/Quad3D.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class Quad3D: Triangle3D
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/widgets/3d/Text3D.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class Text3D: IViewDistance, ILookable, I3DPositionable, ITextable, IColorizable, IScalable, IAlpha, IThroughVisibility
--------------------------------------------------------------------------------
/docs/type_definitions/ar_glasses/widgets/3d/Triangle3D.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class Triangle3D: IAlpha, IColorizable, IThroughVisibility, I3DVertex
--------------------------------------------------------------------------------
/docs/type_definitions/ic2_types/CropNBT.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class CropNBT
4 | ---@field resistance integer the resistance value of the crop
5 | ---@field gain integer the gain value of the crop
6 | ---@field growth integer the growth value of the crop
7 | ---@field tier integer the tier of the crop
8 | ---@field name string the name of the crop
--------------------------------------------------------------------------------
/docs/type_definitions/oc_types/EssentiaStack.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class EssentiaStack
4 | ---@field amount integer # The amount of essentia available
5 | ---@field label string # The name of the essentia (seems to always be: [name] Super Critical Fluid)
6 | ---@field name string # The unlocalized name of the essentia
7 | ---@field hasTag boolean # True if it has an NBT tag.
8 | ---@field tag string? # An encoded version of the NBT tag (looks like the usual zlib encode for BNBT)
--------------------------------------------------------------------------------
/docs/type_definitions/oc_types/FluidStack.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class FluidStack
4 | ---@field amount integer # The amount of mb available
5 | ---@field hasTag boolean # True if it has an NBT tag.
6 | ---@field tag string? # An encoded version of the NBT tag (looks like the usual zlib encode for BNBT)
7 | ---@field label string # The localised name of the fluid.
8 | ---@field name string # The unlocalized name of the fluid.
--------------------------------------------------------------------------------
/docs/type_definitions/oc_types/ItemStack.lua:
--------------------------------------------------------------------------------
1 | ---@meta _
2 |
3 | ---@class ItemStack
4 | ---@field name string # The id of the item.
5 | ---@field damage integer # Either the metadata of the item or how much damage it has taken.
6 | ---@field maxDamage integer # How much damage an item can take
7 | ---@field size integer # How many items are in the stack.
8 | ---@field maxSize integer # The maximum items per stack.
9 | ---@field label string # The localised name of the item.
10 | ---@field hasTag boolean # `true` if the item has an NBT tag.
11 | ---@field tag string? # An encoded version of the NBT tag (looks like the usual zlib encode for BNBT)
12 | ---@field crop CropNBT? # The data for an analyzed IC2 seed bag.
--------------------------------------------------------------------------------
/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/C0bra5/GTNH-OCLuaDocumentation/85a6e606a48263dd2cfd246128f05bf7d0d62545/example.png
--------------------------------------------------------------------------------
/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/C0bra5/GTNH-OCLuaDocumentation/85a6e606a48263dd2cfd246128f05bf7d0d62545/image.png
--------------------------------------------------------------------------------