mirror of
https://github.com/mt-mods/pipeworks.git
synced 2025-06-28 22:36:31 +02:00
Compare commits
38 Commits
2018-09-13
...
nalc-1.2.0
Author | SHA1 | Date | |
---|---|---|---|
34262ed8d5 | |||
9eefe9c7bb | |||
8281e3d068 | |||
ed282b0298 | |||
5410ea74f2 | |||
4602290bc5 | |||
64fb90f3e5 | |||
5cfe8d893f | |||
99cb3a5d9d | |||
728d4e179a | |||
760e9e383c | |||
62bc13078f | |||
84d7104c66 | |||
2ca825f991 | |||
0fa88b7054 | |||
8f03c0e684 | |||
975e20f704 | |||
75cfac34e6 | |||
d5fe933456 | |||
6ad2c9f568 | |||
2693e2ecbb | |||
05ca3e4f4f | |||
c93df73a5c | |||
27eb2ca9de | |||
dc8778d7d3 | |||
26e7b46415 | |||
839b0ed4b1 | |||
da764f4ce0 | |||
ef5d30c92d | |||
f2fff77e90 | |||
f37b21e632 | |||
c9a951c2e8 | |||
f5a60ba407 | |||
d7dfd11364 | |||
4c20de48b2 | |||
9725fa2f28 | |||
25c00a6e05 | |||
d8ed6d3af4 |
961
LICENSE
961
LICENSE
@ -1,534 +1,12 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
License for code: LGPL 3.0
|
||||
License for media and all other assets: CC-by-SA 4.0
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
###############################################################################
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Some code in lua_tube.lua is copied from The Mesecons Mod for Minetest:
|
||||
|
||||
License of source code
|
||||
----------------------
|
||||
Copyright (C) 2011-2016 Mesecons Mod Developer Team and contributors
|
||||
|
||||
This program is free software; you can redistribute the Mesecons Mod and/or
|
||||
modify it under the terms of the GNU Lesser General Public License version 3
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
@ -691,3 +169,432 @@ apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
|
||||
###############################################################################
|
||||
|
||||
Attribution-ShareAlike 4.0 International
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||
does not provide legal services or legal advice. Distribution of
|
||||
Creative Commons public licenses does not create a lawyer-client or
|
||||
other relationship. Creative Commons makes its licenses and related
|
||||
information available on an "as-is" basis. Creative Commons gives no
|
||||
warranties regarding its licenses, any material licensed under their
|
||||
terms and conditions, or any related information. Creative Commons
|
||||
disclaims all liability for damages resulting from their use to the
|
||||
fullest extent possible.
|
||||
|
||||
Using Creative Commons Public Licenses
|
||||
|
||||
Creative Commons public licenses provide a standard set of terms and
|
||||
conditions that creators and other rights holders may use to share
|
||||
original works of authorship and other material subject to copyright
|
||||
and certain other rights specified in the public license below. The
|
||||
following considerations are for informational purposes only, are not
|
||||
exhaustive, and do not form part of our licenses.
|
||||
|
||||
Considerations for licensors: Our public licenses are
|
||||
intended for use by those authorized to give the public
|
||||
permission to use material in ways otherwise restricted by
|
||||
copyright and certain other rights. Our licenses are
|
||||
irrevocable. Licensors should read and understand the terms
|
||||
and conditions of the license they choose before applying it.
|
||||
Licensors should also secure all rights necessary before
|
||||
applying our licenses so that the public can reuse the
|
||||
material as expected. Licensors should clearly mark any
|
||||
material not subject to the license. This includes other CC-
|
||||
licensed material, or material used under an exception or
|
||||
limitation to copyright. More considerations for licensors:
|
||||
wiki.creativecommons.org/Considerations_for_licensors
|
||||
|
||||
Considerations for the public: By using one of our public
|
||||
licenses, a licensor grants the public permission to use the
|
||||
licensed material under specified terms and conditions. If
|
||||
the licensor's permission is not necessary for any reason--for
|
||||
example, because of any applicable exception or limitation to
|
||||
copyright--then that use is not regulated by the license. Our
|
||||
licenses grant only permissions under copyright and certain
|
||||
other rights that a licensor has authority to grant. Use of
|
||||
the licensed material may still be restricted for other
|
||||
reasons, including because others have copyright or other
|
||||
rights in the material. A licensor may make special requests,
|
||||
such as asking that all changes be marked or described.
|
||||
Although not required by our licenses, you are encouraged to
|
||||
respect those requests where reasonable. More considerations
|
||||
for the public:
|
||||
wiki.creativecommons.org/Considerations_for_licensees
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International Public
|
||||
License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree
|
||||
to be bound by the terms and conditions of this Creative Commons
|
||||
Attribution-ShareAlike 4.0 International Public License ("Public
|
||||
License"). To the extent this Public License may be interpreted as a
|
||||
contract, You are granted the Licensed Rights in consideration of Your
|
||||
acceptance of these terms and conditions, and the Licensor grants You
|
||||
such rights in consideration of benefits the Licensor receives from
|
||||
making the Licensed Material available under these terms and
|
||||
conditions.
|
||||
|
||||
|
||||
Section 1 -- Definitions.
|
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar
|
||||
Rights that is derived from or based upon the Licensed Material
|
||||
and in which the Licensed Material is translated, altered,
|
||||
arranged, transformed, or otherwise modified in a manner requiring
|
||||
permission under the Copyright and Similar Rights held by the
|
||||
Licensor. For purposes of this Public License, where the Licensed
|
||||
Material is a musical work, performance, or sound recording,
|
||||
Adapted Material is always produced where the Licensed Material is
|
||||
synched in timed relation with a moving image.
|
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright
|
||||
and Similar Rights in Your contributions to Adapted Material in
|
||||
accordance with the terms and conditions of this Public License.
|
||||
|
||||
c. BY-SA Compatible License means a license listed at
|
||||
creativecommons.org/compatiblelicenses, approved by Creative
|
||||
Commons as essentially the equivalent of this Public License.
|
||||
|
||||
d. Copyright and Similar Rights means copyright and/or similar rights
|
||||
closely related to copyright including, without limitation,
|
||||
performance, broadcast, sound recording, and Sui Generis Database
|
||||
Rights, without regard to how the rights are labeled or
|
||||
categorized. For purposes of this Public License, the rights
|
||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||
Rights.
|
||||
|
||||
e. Effective Technological Measures means those measures that, in the
|
||||
absence of proper authority, may not be circumvented under laws
|
||||
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||
Treaty adopted on December 20, 1996, and/or similar international
|
||||
agreements.
|
||||
|
||||
f. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||
any other exception or limitation to Copyright and Similar Rights
|
||||
that applies to Your use of the Licensed Material.
|
||||
|
||||
g. License Elements means the license attributes listed in the name
|
||||
of a Creative Commons Public License. The License Elements of this
|
||||
Public License are Attribution and ShareAlike.
|
||||
|
||||
h. Licensed Material means the artistic or literary work, database,
|
||||
or other material to which the Licensor applied this Public
|
||||
License.
|
||||
|
||||
i. Licensed Rights means the rights granted to You subject to the
|
||||
terms and conditions of this Public License, which are limited to
|
||||
all Copyright and Similar Rights that apply to Your use of the
|
||||
Licensed Material and that the Licensor has authority to license.
|
||||
|
||||
j. Licensor means the individual(s) or entity(ies) granting rights
|
||||
under this Public License.
|
||||
|
||||
k. Share means to provide material to the public by any means or
|
||||
process that requires permission under the Licensed Rights, such
|
||||
as reproduction, public display, public performance, distribution,
|
||||
dissemination, communication, or importation, and to make material
|
||||
available to the public including in ways that members of the
|
||||
public may access the material from a place and at a time
|
||||
individually chosen by them.
|
||||
|
||||
l. Sui Generis Database Rights means rights other than copyright
|
||||
resulting from Directive 96/9/EC of the European Parliament and of
|
||||
the Council of 11 March 1996 on the legal protection of databases,
|
||||
as amended and/or succeeded, as well as other essentially
|
||||
equivalent rights anywhere in the world.
|
||||
|
||||
m. You means the individual or entity exercising the Licensed Rights
|
||||
under this Public License. Your has a corresponding meaning.
|
||||
|
||||
|
||||
Section 2 -- Scope.
|
||||
|
||||
a. License grant.
|
||||
|
||||
1. Subject to the terms and conditions of this Public License,
|
||||
the Licensor hereby grants You a worldwide, royalty-free,
|
||||
non-sublicensable, non-exclusive, irrevocable license to
|
||||
exercise the Licensed Rights in the Licensed Material to:
|
||||
|
||||
a. reproduce and Share the Licensed Material, in whole or
|
||||
in part; and
|
||||
|
||||
b. produce, reproduce, and Share Adapted Material.
|
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||
Exceptions and Limitations apply to Your use, this Public
|
||||
License does not apply, and You do not need to comply with
|
||||
its terms and conditions.
|
||||
|
||||
3. Term. The term of this Public License is specified in Section
|
||||
6(a).
|
||||
|
||||
4. Media and formats; technical modifications allowed. The
|
||||
Licensor authorizes You to exercise the Licensed Rights in
|
||||
all media and formats whether now known or hereafter created,
|
||||
and to make technical modifications necessary to do so. The
|
||||
Licensor waives and/or agrees not to assert any right or
|
||||
authority to forbid You from making technical modifications
|
||||
necessary to exercise the Licensed Rights, including
|
||||
technical modifications necessary to circumvent Effective
|
||||
Technological Measures. For purposes of this Public License,
|
||||
simply making modifications authorized by this Section 2(a)
|
||||
(4) never produces Adapted Material.
|
||||
|
||||
5. Downstream recipients.
|
||||
|
||||
a. Offer from the Licensor -- Licensed Material. Every
|
||||
recipient of the Licensed Material automatically
|
||||
receives an offer from the Licensor to exercise the
|
||||
Licensed Rights under the terms and conditions of this
|
||||
Public License.
|
||||
|
||||
b. Additional offer from the Licensor -- Adapted Material.
|
||||
Every recipient of Adapted Material from You
|
||||
automatically receives an offer from the Licensor to
|
||||
exercise the Licensed Rights in the Adapted Material
|
||||
under the conditions of the Adapter's License You apply.
|
||||
|
||||
c. No downstream restrictions. You may not offer or impose
|
||||
any additional or different terms or conditions on, or
|
||||
apply any Effective Technological Measures to, the
|
||||
Licensed Material if doing so restricts exercise of the
|
||||
Licensed Rights by any recipient of the Licensed
|
||||
Material.
|
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or
|
||||
may be construed as permission to assert or imply that You
|
||||
are, or that Your use of the Licensed Material is, connected
|
||||
with, or sponsored, endorsed, or granted official status by,
|
||||
the Licensor or others designated to receive attribution as
|
||||
provided in Section 3(a)(1)(A)(i).
|
||||
|
||||
b. Other rights.
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not
|
||||
licensed under this Public License, nor are publicity,
|
||||
privacy, and/or other similar personality rights; however, to
|
||||
the extent possible, the Licensor waives and/or agrees not to
|
||||
assert any such rights held by the Licensor to the limited
|
||||
extent necessary to allow You to exercise the Licensed
|
||||
Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this
|
||||
Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to
|
||||
collect royalties from You for the exercise of the Licensed
|
||||
Rights, whether directly or through a collecting society
|
||||
under any voluntary or waivable statutory or compulsory
|
||||
licensing scheme. In all other cases the Licensor expressly
|
||||
reserves any right to collect such royalties.
|
||||
|
||||
|
||||
Section 3 -- License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the
|
||||
following conditions.
|
||||
|
||||
a. Attribution.
|
||||
|
||||
1. If You Share the Licensed Material (including in modified
|
||||
form), You must:
|
||||
|
||||
a. retain the following if it is supplied by the Licensor
|
||||
with the Licensed Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed
|
||||
Material and any others designated to receive
|
||||
attribution, in any reasonable manner requested by
|
||||
the Licensor (including by pseudonym if
|
||||
designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of
|
||||
warranties;
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the
|
||||
extent reasonably practicable;
|
||||
|
||||
b. indicate if You modified the Licensed Material and
|
||||
retain an indication of any previous modifications; and
|
||||
|
||||
c. indicate the Licensed Material is licensed under this
|
||||
Public License, and include the text of, or the URI or
|
||||
hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||
reasonable manner based on the medium, means, and context in
|
||||
which You Share the Licensed Material. For example, it may be
|
||||
reasonable to satisfy the conditions by providing a URI or
|
||||
hyperlink to a resource that includes the required
|
||||
information.
|
||||
|
||||
3. If requested by the Licensor, You must remove any of the
|
||||
information required by Section 3(a)(1)(A) to the extent
|
||||
reasonably practicable.
|
||||
|
||||
b. ShareAlike.
|
||||
|
||||
In addition to the conditions in Section 3(a), if You Share
|
||||
Adapted Material You produce, the following conditions also apply.
|
||||
|
||||
1. The Adapter's License You apply must be a Creative Commons
|
||||
license with the same License Elements, this version or
|
||||
later, or a BY-SA Compatible License.
|
||||
|
||||
2. You must include the text of, or the URI or hyperlink to, the
|
||||
Adapter's License You apply. You may satisfy this condition
|
||||
in any reasonable manner based on the medium, means, and
|
||||
context in which You Share Adapted Material.
|
||||
|
||||
3. You may not offer or impose any additional or different terms
|
||||
or conditions on, or apply any Effective Technological
|
||||
Measures to, Adapted Material that restrict exercise of the
|
||||
rights granted under the Adapter's License You apply.
|
||||
|
||||
|
||||
Section 4 -- Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that
|
||||
apply to Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||
to extract, reuse, reproduce, and Share all or a substantial
|
||||
portion of the contents of the database;
|
||||
|
||||
b. if You include all or a substantial portion of the database
|
||||
contents in a database in which You have Sui Generis Database
|
||||
Rights, then the database in which You have Sui Generis Database
|
||||
Rights (but not its individual contents) is Adapted Material,
|
||||
|
||||
including for purposes of Section 3(b); and
|
||||
c. You must comply with the conditions in Section 3(a) if You Share
|
||||
all or a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not
|
||||
replace Your obligations under this Public License where the Licensed
|
||||
Rights include other Copyright and Similar Rights.
|
||||
|
||||
|
||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||
|
||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided
|
||||
above shall be interpreted in a manner that, to the extent
|
||||
possible, most closely approximates an absolute disclaimer and
|
||||
waiver of all liability.
|
||||
|
||||
|
||||
Section 6 -- Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and
|
||||
Similar Rights licensed here. However, if You fail to comply with
|
||||
this Public License, then Your rights under this Public License
|
||||
terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under
|
||||
Section 6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided
|
||||
it is cured within 30 days of Your discovery of the
|
||||
violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||
right the Licensor may have to seek remedies for Your violations
|
||||
of this Public License.
|
||||
|
||||
c. For the avoidance of doubt, the Licensor may also offer the
|
||||
Licensed Material under separate terms or conditions or stop
|
||||
distributing the Licensed Material at any time; however, doing so
|
||||
will not terminate this Public License.
|
||||
|
||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||
License.
|
||||
|
||||
|
||||
Section 7 -- Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different
|
||||
terms or conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the
|
||||
Licensed Material not stated herein are separate from and
|
||||
independent of the terms and conditions of this Public License.
|
||||
|
||||
|
||||
Section 8 -- Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and
|
||||
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||
conditions on any use of the Licensed Material that could lawfully
|
||||
be made without permission under this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is
|
||||
deemed unenforceable, it shall be automatically reformed to the
|
||||
minimum extent necessary to make it enforceable. If the provision
|
||||
cannot be reformed, it shall be severed from this Public License
|
||||
without affecting the enforceability of the remaining terms and
|
||||
conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no
|
||||
failure to comply consented to unless expressly agreed to by the
|
||||
Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted
|
||||
as a limitation upon, or waiver of, any privileges and immunities
|
||||
that apply to the Licensor or You, including from the legal
|
||||
processes of any jurisdiction or authority.
|
||||
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons is not a party to its public
|
||||
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
||||
its public licenses to material it publishes and in those instances
|
||||
will be considered the “Licensor.” The text of the Creative Commons
|
||||
public licenses is dedicated to the public domain under the CC0 Public
|
||||
Domain Dedication. Except for the limited purpose of indicating that
|
||||
material is shared under a Creative Commons public license or as
|
||||
otherwise permitted by the Creative Commons policies published at
|
||||
creativecommons.org/policies, Creative Commons does not authorize the
|
||||
use of the trademark "Creative Commons" or any other trademark or logo
|
||||
of Creative Commons without its prior written consent including,
|
||||
without limitation, in connection with any unauthorized modifications
|
||||
to any of its public licenses or any other arrangements,
|
||||
understandings, or agreements concerning use of licensed material. For
|
||||
the avoidance of doubt, this paragraph does not form part of the
|
||||
public licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
||||
|
@ -1,3 +1,4 @@
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
local autocrafterCache = {} -- caches some recipe data to avoid to call the slow function minetest.get_craft_result() every second
|
||||
|
||||
local craft_time = 1
|
||||
@ -16,7 +17,7 @@ end
|
||||
local function get_item_info(stack)
|
||||
local name = stack:get_name()
|
||||
local def = minetest.registered_items[name]
|
||||
local description = def and def.description or "Unknown item"
|
||||
local description = def and def.description or S("Unknown item")
|
||||
return description, name
|
||||
end
|
||||
|
||||
@ -66,9 +67,12 @@ local function run_autocrafter(pos, elapsed)
|
||||
local inventory = meta:get_inventory()
|
||||
local craft = get_craft(pos, inventory)
|
||||
local output_item = craft.output.item
|
||||
-- NALC: existence de limitgroup ?
|
||||
local limitcraft = minetest.get_item_group(output_item:get_name(), "limitcraft") or 0
|
||||
-- only use crafts that have an actual result
|
||||
if output_item:is_empty() then
|
||||
meta:set_string("infotext", "unconfigured Autocrafter: unknown recipe")
|
||||
-- NALC: ou si l'item n'est pas dans le group limitcraft
|
||||
if output_item:is_empty() or limitcraft > 0 then
|
||||
meta:set_string("infotext", S("unconfigured Autocrafter: unknown recipe"))
|
||||
return false
|
||||
end
|
||||
|
||||
@ -101,7 +105,7 @@ local function after_recipe_change(pos, inventory)
|
||||
if inventory:is_empty("recipe") then
|
||||
minetest.get_node_timer(pos):stop()
|
||||
autocrafterCache[minetest.hash_node_position(pos)] = nil
|
||||
meta:set_string("infotext", "unconfigured Autocrafter")
|
||||
meta:set_string("infotext", S("unconfigured Autocrafter"))
|
||||
inventory:set_stack("output", 1, "")
|
||||
return
|
||||
end
|
||||
@ -126,7 +130,7 @@ local function after_recipe_change(pos, inventory)
|
||||
craft = craft or get_craft(pos, inventory, hash)
|
||||
local output_item = craft.output.item
|
||||
local description, name = get_item_info(output_item)
|
||||
meta:set_string("infotext", string.format("'%s' Autocrafter (%s)", description, name))
|
||||
meta:set_string("infotext", S("'@1' Autocrafter (@2)", description, name))
|
||||
inventory:set_stack("output", 1, output_item)
|
||||
|
||||
after_inventory_change(pos)
|
||||
@ -190,8 +194,8 @@ local function update_meta(meta, enabled)
|
||||
"listring[context;dst]" ..
|
||||
"listring[current_player;main]"
|
||||
if minetest.get_modpath("digilines") then
|
||||
fs = fs.."field[1,3.5;4,1;channel;Channel;${channel}]"
|
||||
fs = fs.."button_exit[5,3.2;2,1;save;Save]"
|
||||
fs = fs.."field[1,3.5;4,1;channel;"..S("Channel")..";${channel}]"
|
||||
fs = fs.."button_exit[5,3.2;2,1;save;"..S("Save").."]"
|
||||
end
|
||||
meta:set_string("formspec",fs)
|
||||
|
||||
@ -200,13 +204,13 @@ local function update_meta(meta, enabled)
|
||||
-- this might be more written code, but actually executes less
|
||||
local output = meta:get_inventory():get_stack("output", 1)
|
||||
if output:is_empty() then -- doesn't matter if paused or not
|
||||
meta:set_string("infotext", "unconfigured Autocrafter")
|
||||
meta:set_string("infotext", S("unconfigured Autocrafter"))
|
||||
return false
|
||||
end
|
||||
|
||||
local description, name = get_item_info(output)
|
||||
local infotext = enabled and string.format("'%s' Autocrafter (%s)", description, name)
|
||||
or string.format("paused '%s' Autocrafter", description)
|
||||
local infotext = enabled and S("'@1' Autocrafter (@2)", description, name)
|
||||
or S("paused '@1' Autocrafter", description)
|
||||
|
||||
meta:set_string("infotext", infotext)
|
||||
return enabled
|
||||
@ -226,7 +230,7 @@ local function upgrade_autocrafter(pos, meta)
|
||||
update_meta(meta, true)
|
||||
|
||||
if meta:get_string("virtual_items") == "1" then -- we are version 2
|
||||
-- we allready dropped stuff, so lets remove the metadatasetting (we are not being called again for this node)
|
||||
-- we already dropped stuff, so lets remove the metadatasetting (we are not being called again for this node)
|
||||
meta:set_string("virtual_items", "")
|
||||
else -- we are version 1
|
||||
local recipe = inv:get_list("recipe")
|
||||
@ -248,7 +252,7 @@ local function upgrade_autocrafter(pos, meta)
|
||||
end
|
||||
|
||||
minetest.register_node("pipeworks:autocrafter", {
|
||||
description = "Autocrafter",
|
||||
description = S("Autocrafter"),
|
||||
drawtype = "normal",
|
||||
tiles = {"pipeworks_autocrafter.png"},
|
||||
groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1},
|
||||
@ -407,7 +411,7 @@ minetest.register_craft( {
|
||||
output = "pipeworks:autocrafter 2",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "default:mese_crystal", "default:steel_ingot" },
|
||||
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting" },
|
||||
{ "basic_materials:plastic_sheet", "default:steel_ingot", "basic_materials:plastic_sheet" },
|
||||
{ "default:steel_ingot", "default:mese_crystal", "default:steel_ingot" }
|
||||
},
|
||||
})
|
||||
|
@ -111,6 +111,22 @@ function pipeworks.after_dig(pos)
|
||||
pipeworks.scan_for_tube_objects(pos)
|
||||
end
|
||||
|
||||
-- Screwdriver calls this function before rotating a node.
|
||||
-- However, connections must be updated *after* the node is rotated
|
||||
-- So, this function does the rotation itself and returns `true`.
|
||||
-- (Note: screwdriver already checks for protected areas.)
|
||||
|
||||
-- This should only be used for tubes that don't autoconnect.
|
||||
-- (For example, one-way tubes.)
|
||||
-- Autoconnecting tubes will just revert back to their original state
|
||||
-- when they are updated.
|
||||
function pipeworks.on_rotate(pos, node, user, mode, new_param2)
|
||||
node.param2 = new_param2
|
||||
minetest.swap_node(pos, node)
|
||||
pipeworks.scan_for_tube_objects(pos)
|
||||
return true
|
||||
end
|
||||
|
||||
if minetest.get_modpath("mesecons_mvps") then
|
||||
mesecon.register_on_mvps_move(function(moved_nodes)
|
||||
for _, n in ipairs(moved_nodes) do
|
||||
|
@ -146,7 +146,8 @@ override_protected = {
|
||||
input_inventory = "main",
|
||||
connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
|
||||
},
|
||||
after_dig_node = pipeworks.after_dig
|
||||
after_dig_node = pipeworks.after_dig,
|
||||
on_rotate = pipeworks.on_rotate
|
||||
}
|
||||
override = {
|
||||
tiles = {
|
||||
@ -190,7 +191,8 @@ override = {
|
||||
connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
|
||||
},
|
||||
after_place_node = pipeworks.after_place,
|
||||
after_dig_node = pipeworks.after_dig
|
||||
after_dig_node = pipeworks.after_dig,
|
||||
on_rotate = pipeworks.on_rotate
|
||||
}
|
||||
--[[local override_common = {
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
|
||||
-- this file is basically a modified copy of
|
||||
-- minetest_game/mods/default/furnaces.lua
|
||||
|
||||
-- translation support
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
local DS = minetest.get_translator("default")
|
||||
|
||||
local fs_helpers = pipeworks.fs_helpers
|
||||
|
||||
tube_entry = "^pipeworks_tube_connection_stony.png"
|
||||
@ -36,7 +39,7 @@ local function active_formspec(fuel_percent, item_percent, pos, meta)
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
).."label[0.9,3.51;Allow splitting incoming material (not fuel) stacks from tubes]"
|
||||
).."label[0.9,3.51;"..S("Allow splitting incoming material (not fuel) stacks from tubes").."]"
|
||||
return formspec
|
||||
end
|
||||
|
||||
@ -67,7 +70,7 @@ local function inactive_formspec(pos, meta)
|
||||
pipeworks.button_off,
|
||||
pipeworks.button_on
|
||||
}
|
||||
).."label[0.9,3.51;Allow splitting incoming material (not fuel) stacks from tubes]"
|
||||
).."label[0.9,3.51;"..S("Allow splitting incoming material (not fuel) stacks from tubes").."]"
|
||||
return formspec
|
||||
end
|
||||
|
||||
@ -90,7 +93,7 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player)
|
||||
if listname == "fuel" then
|
||||
if minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then
|
||||
if inv:is_empty("src") then
|
||||
meta:set_string("infotext", "Furnace is empty")
|
||||
meta:set_string("infotext", DS("Furnace is empty"))
|
||||
end
|
||||
return stack:get_count()
|
||||
else
|
||||
@ -219,40 +222,40 @@ local function furnace_node_timer(pos, elapsed)
|
||||
if cookable then
|
||||
item_percent = math.floor(src_time / cooked.time * 100)
|
||||
if item_percent > 100 then
|
||||
item_state = "100% (output full)"
|
||||
item_state = DS("100% (output full)")
|
||||
else
|
||||
item_state = item_percent .. "%"
|
||||
item_state = DS("@1%", item_percent)
|
||||
end
|
||||
else
|
||||
if srclist[1]:is_empty() then
|
||||
item_state = "Empty"
|
||||
item_state = DS("Empty")
|
||||
else
|
||||
item_state = "Not cookable"
|
||||
item_state = DS("Not cookable")
|
||||
end
|
||||
end
|
||||
|
||||
local fuel_state = "Empty"
|
||||
local active = "inactive "
|
||||
local fuel_state = DS("Empty")
|
||||
local active = DS("Furnace inactive")
|
||||
local result = false
|
||||
|
||||
if fuel_totaltime ~= 0 then
|
||||
active = "active "
|
||||
active = DS("Furnace active")
|
||||
local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100)
|
||||
fuel_state = fuel_percent .. "%"
|
||||
fuel_state = DS("@1%", fuel_percent)
|
||||
formspec = active_formspec(fuel_percent, item_percent, pos, meta)
|
||||
swap_node(pos, "default:furnace_active")
|
||||
-- make sure timer restarts automatically
|
||||
result = true
|
||||
else
|
||||
if not fuellist[1]:is_empty() then
|
||||
fuel_state = "0%"
|
||||
fuel_state = DS("@1%", "0")
|
||||
end
|
||||
swap_node(pos, "default:furnace")
|
||||
-- stop timer on the inactive furnace
|
||||
minetest.get_node_timer(pos):stop()
|
||||
end
|
||||
|
||||
local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")"
|
||||
local infotext = active.." "..DS("(Item: @1; Fuel: @2)", item_state, fuel_state)
|
||||
|
||||
--
|
||||
-- Set meta values
|
||||
@ -271,7 +274,7 @@ end
|
||||
--
|
||||
|
||||
minetest.register_node(":default:furnace", {
|
||||
description = "Furnace",
|
||||
description = DS("Furnace"),
|
||||
tiles = {
|
||||
"default_furnace_top.png"..tube_entry,
|
||||
"default_furnace_bottom.png"..tube_entry,
|
||||
@ -355,11 +358,12 @@ minetest.register_node(":default:furnace", {
|
||||
meta:set_string("formspec", formspec)
|
||||
end,
|
||||
after_place_node = pipeworks.after_place,
|
||||
after_dig_node = pipeworks.after_dig
|
||||
after_dig_node = pipeworks.after_dig,
|
||||
on_rotate = pipeworks.on_rotate
|
||||
})
|
||||
|
||||
minetest.register_node(":default:furnace_active", {
|
||||
description = "Furnace",
|
||||
description = DS("Furnace"),
|
||||
tiles = {
|
||||
"default_furnace_top.png"..tube_entry,
|
||||
"default_furnace_bottom.png"..tube_entry,
|
||||
@ -428,6 +432,7 @@ minetest.register_node(":default:furnace_active", {
|
||||
meta:set_string("formspec", formspec)
|
||||
end,
|
||||
after_place_node = pipeworks.after_place,
|
||||
after_dig_node = pipeworks.after_dig
|
||||
after_dig_node = pipeworks.after_dig,
|
||||
on_rotate = pipeworks.on_rotate
|
||||
})
|
||||
|
||||
|
85
crafts.lua
85
crafts.lua
@ -85,88 +85,3 @@ minetest.register_craft( {
|
||||
{ "pipeworks:pipe_1_empty" }
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
-- Crafting recipes for pneumatic tubes
|
||||
|
||||
-- If homedecor is not installed, we need to register its crafting chain for
|
||||
-- plastic sheeting so that pipeworks remains compatible with it.
|
||||
|
||||
if minetest.get_modpath("homedecor") == nil then
|
||||
|
||||
minetest.register_craftitem(":homedecor:oil_extract", {
|
||||
description = "Oil extract",
|
||||
inventory_image = "homedecor_oil_extract.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem(":homedecor:paraffin", {
|
||||
description = "Unprocessed paraffin",
|
||||
inventory_image = "homedecor_paraffin.png",
|
||||
})
|
||||
|
||||
minetest.register_alias("homedecor:plastic_base", "homedecor:paraffin")
|
||||
|
||||
minetest.register_craftitem(":homedecor:plastic_sheeting", {
|
||||
description = "Plastic sheet",
|
||||
inventory_image = "homedecor_plastic_sheeting.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "homedecor:oil_extract 4",
|
||||
recipe = {
|
||||
"group:leaves",
|
||||
"group:leaves",
|
||||
"group:leaves",
|
||||
"group:leaves",
|
||||
"group:leaves",
|
||||
"group:leaves"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "homedecor:paraffin",
|
||||
recipe = "homedecor:oil_extract",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "homedecor:plastic_sheeting",
|
||||
recipe = "homedecor:paraffin",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:oil_extract",
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:paraffin",
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "homedecor:plastic_sheeting",
|
||||
burntime = 30,
|
||||
})
|
||||
end
|
||||
|
||||
-- crafting items for creating node breakers
|
||||
minetest.register_craftitem("pipeworks:gear", {
|
||||
description = "Gear",
|
||||
inventory_image = "pipeworks_gear.png",
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:gear 6",
|
||||
recipe = {
|
||||
{ "", "default:steel_ingot", "" },
|
||||
{ "default:steel_ingot","default:stone", "default:steel_ingot" },
|
||||
{ "", "default:steel_ingot", "" }
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
|
||||
local straight = function(pos, node, velocity, stack) return {velocity} end
|
||||
|
||||
minetest.register_node("pipeworks:steel_block_embedded_tube", {
|
||||
description = "Airtight steelblock embedded tube",
|
||||
description = S("Airtight steelblock embedded tube"),
|
||||
tiles = {
|
||||
"default_steel_block.png", "default_steel_block.png",
|
||||
"default_steel_block.png", "default_steel_block.png",
|
||||
@ -24,6 +26,7 @@ minetest.register_node("pipeworks:steel_block_embedded_tube", {
|
||||
},
|
||||
after_place_node = pipeworks.after_place,
|
||||
after_dig_node = pipeworks.after_dig,
|
||||
on_rotate = pipeworks.on_rotate,
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
@ -44,7 +47,7 @@ local pane_box = {
|
||||
}
|
||||
minetest.register_node("pipeworks:steel_pane_embedded_tube", {
|
||||
drawtype = "nodebox",
|
||||
description = "Airtight panel embedded tube ",
|
||||
description = S("Airtight panel embedded tube"),
|
||||
tiles = {
|
||||
"pipeworks_pane_embedded_tube_sides.png^[transformR90",
|
||||
"pipeworks_pane_embedded_tube_sides.png^[transformR90",
|
||||
@ -71,6 +74,7 @@ minetest.register_node("pipeworks:steel_pane_embedded_tube", {
|
||||
},
|
||||
after_place_node = pipeworks.after_place,
|
||||
after_dig_node = pipeworks.after_dig,
|
||||
on_rotate = pipeworks.on_rotate,
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
|
@ -1,4 +0,0 @@
|
||||
default
|
||||
mesecons
|
||||
mesecons_mvps
|
||||
digilines?
|
@ -1 +0,0 @@
|
||||
This mod uses mesh nodes and nodeboxes to supply a complete set of 3D pipes and tubes, along with devices that work with them.
|
77
devices.lua
77
devices.lua
@ -1,3 +1,4 @@
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
local new_flow_logic_register = pipeworks.flowables.register
|
||||
|
||||
local polys = ""
|
||||
@ -135,14 +136,14 @@ for s in ipairs(states) do
|
||||
|
||||
local pumpname = "pipeworks:pump_"..states[s]
|
||||
minetest.register_node(pumpname, {
|
||||
description = "Pump/Intake Module",
|
||||
description = S("Pump/Intake Module"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_pump"..polys..".obj",
|
||||
tiles = { "pipeworks_pump_"..states[s]..".png" },
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = dgroups,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
pipe_connections = { top = 1 },
|
||||
after_place_node = function(pos)
|
||||
@ -178,7 +179,7 @@ for s in ipairs(states) do
|
||||
|
||||
local nodename_valve_empty = "pipeworks:valve_"..states[s].."_empty"
|
||||
minetest.register_node(nodename_valve_empty, {
|
||||
description = "Valve",
|
||||
description = S("Valve"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_valve_"..states[s]..polys..".obj",
|
||||
tiles = { "pipeworks_valve.png" },
|
||||
@ -194,7 +195,7 @@ for s in ipairs(states) do
|
||||
fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 }
|
||||
},
|
||||
groups = dgroups,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
on_place = pipeworks.rotate_on_place,
|
||||
after_dig_node = function(pos)
|
||||
@ -224,7 +225,7 @@ end
|
||||
|
||||
local nodename_valve_loaded = "pipeworks:valve_on_loaded"
|
||||
minetest.register_node(nodename_valve_loaded, {
|
||||
description = "Valve",
|
||||
description = S("Valve"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_valve_on"..polys..".obj",
|
||||
tiles = { "pipeworks_valve.png" },
|
||||
@ -240,7 +241,7 @@ minetest.register_node(nodename_valve_loaded, {
|
||||
fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 }
|
||||
},
|
||||
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
on_place = pipeworks.rotate_on_place,
|
||||
after_dig_node = function(pos)
|
||||
@ -272,7 +273,7 @@ new_flow_logic_register.directional_horizonal_rotate(nodename_valve_loaded, true
|
||||
|
||||
-- FIXME: should this do anything useful in the new flow logic?
|
||||
minetest.register_node("pipeworks:grating", {
|
||||
description = "Decorative grating",
|
||||
description = S("Decorative grating"),
|
||||
tiles = {
|
||||
"pipeworks_grating_top.png",
|
||||
"pipeworks_grating_sides.png",
|
||||
@ -289,7 +290,7 @@ minetest.register_node("pipeworks:grating", {
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
groups = {snappy=3, pipe=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
pipe_connections = { top = 1 },
|
||||
after_place_node = function(pos)
|
||||
@ -305,7 +306,7 @@ minetest.register_node("pipeworks:grating", {
|
||||
|
||||
local nodename_spigot_empty = "pipeworks:spigot"
|
||||
minetest.register_node(nodename_spigot_empty, {
|
||||
description = "Spigot outlet",
|
||||
description = S("Spigot outlet"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_spigot"..polys..".obj",
|
||||
tiles = { "pipeworks_spigot.png" },
|
||||
@ -313,7 +314,7 @@ minetest.register_node(nodename_spigot_empty, {
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3, pipe=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
pipe_connections = { left=1, right=1, front=1, back=1,
|
||||
left_param2 = 3, right_param2 = 1, front_param2 = 2, back_param2 = 0 },
|
||||
@ -336,7 +337,7 @@ minetest.register_node(nodename_spigot_empty, {
|
||||
|
||||
local nodename_spigot_loaded = "pipeworks:spigot_pouring"
|
||||
minetest.register_node(nodename_spigot_loaded, {
|
||||
description = "Spigot outlet",
|
||||
description = S("Spigot outlet"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_spigot_pouring"..polys..".obj",
|
||||
tiles = {
|
||||
@ -355,7 +356,7 @@ minetest.register_node(nodename_spigot_loaded, {
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
pipe_connections = { left=1, right=1, front=1, back=1,
|
||||
left_param2 = 3, right_param2 = 1, front_param2 = 2, back_param2 = 0 },
|
||||
@ -402,14 +403,14 @@ local panel_cbox = {
|
||||
|
||||
local nodename_panel_empty = "pipeworks:entry_panel_empty"
|
||||
minetest.register_node(nodename_panel_empty, {
|
||||
description = "Airtight Pipe entry/exit",
|
||||
description = S("Airtight Pipe entry/exit"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_entry_panel"..polys..".obj",
|
||||
tiles = { "pipeworks_entry_panel.png" },
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3, pipe=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
on_place = pipeworks.rotate_on_place,
|
||||
after_dig_node = function(pos)
|
||||
@ -422,14 +423,14 @@ minetest.register_node(nodename_panel_empty, {
|
||||
|
||||
local nodename_panel_loaded = "pipeworks:entry_panel_loaded"
|
||||
minetest.register_node(nodename_panel_loaded, {
|
||||
description = "Airtight Pipe entry/exit",
|
||||
description = S("Airtight Pipe entry/exit"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_entry_panel"..polys..".obj",
|
||||
tiles = { "pipeworks_entry_panel.png" },
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
on_place = pipeworks.rotate_on_place,
|
||||
after_dig_node = function(pos)
|
||||
@ -448,7 +449,7 @@ new_flow_logic_register.directional_horizonal_rotate(nodename_panel_loaded, true
|
||||
|
||||
local nodename_sensor_empty = "pipeworks:flow_sensor_empty"
|
||||
minetest.register_node(nodename_sensor_empty, {
|
||||
description = "Flow Sensor",
|
||||
description = S("Flow Sensor"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_flow_sensor"..polys..".obj",
|
||||
tiles = { "pipeworks_flow_sensor_off.png" },
|
||||
@ -456,7 +457,7 @@ minetest.register_node(nodename_sensor_empty, {
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3, pipe=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
on_place = pipeworks.rotate_on_place,
|
||||
after_dig_node = function(pos)
|
||||
@ -487,7 +488,7 @@ minetest.register_node(nodename_sensor_empty, {
|
||||
|
||||
local nodename_sensor_loaded = "pipeworks:flow_sensor_loaded"
|
||||
minetest.register_node(nodename_sensor_loaded, {
|
||||
description = "Flow sensor (on)",
|
||||
description = S("Flow sensor (on)"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_flow_sensor"..polys..".obj",
|
||||
tiles = { "pipeworks_flow_sensor_on.png" },
|
||||
@ -495,7 +496,7 @@ minetest.register_node(nodename_sensor_loaded, {
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
on_place = pipeworks.rotate_on_place,
|
||||
after_dig_node = function(pos)
|
||||
@ -536,18 +537,18 @@ new_flow_logic_register.transition_simple_set(sensor_pressure_set, { mesecons=pi
|
||||
|
||||
-- TODO flow-logic-stub: these don't currently do anything under the new flow logic.
|
||||
for fill = 0, 10 do
|
||||
local filldesc="empty"
|
||||
local filldesc=S("empty")
|
||||
local sgroups = {snappy=3, pipe=1, tankfill=fill+1}
|
||||
local image = nil
|
||||
|
||||
if fill ~= 0 then
|
||||
filldesc=fill.."0% full"
|
||||
filldesc=S("@1% full", 10*fill)
|
||||
sgroups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1}
|
||||
image = "pipeworks_storage_tank_fittings.png"
|
||||
end
|
||||
|
||||
minetest.register_node("pipeworks:expansion_tank_"..fill, {
|
||||
description = "Expansion Tank ("..filldesc..")... You hacker, you.",
|
||||
description = S("Expansion Tank (@1)", filldesc),
|
||||
tiles = {
|
||||
"pipeworks_storage_tank_fittings.png",
|
||||
"pipeworks_storage_tank_fittings.png",
|
||||
@ -560,7 +561,7 @@ for fill = 0, 10 do
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
drop = "pipeworks:storage_tank_0",
|
||||
pipe_connections = { top = 1, bottom = 1},
|
||||
@ -575,7 +576,7 @@ for fill = 0, 10 do
|
||||
})
|
||||
|
||||
minetest.register_node("pipeworks:storage_tank_"..fill, {
|
||||
description = "Fluid Storage Tank ("..filldesc..")",
|
||||
description = S("Fluid Storage Tank (@1)", filldesc),
|
||||
tiles = {
|
||||
"pipeworks_storage_tank_fittings.png",
|
||||
"pipeworks_storage_tank_fittings.png",
|
||||
@ -588,7 +589,7 @@ for fill = 0, 10 do
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = sgroups,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
drop = "pipeworks:storage_tank_0",
|
||||
pipe_connections = { top = 1, bottom = 1},
|
||||
@ -607,14 +608,14 @@ end
|
||||
|
||||
local nodename_fountain_empty = "pipeworks:fountainhead"
|
||||
minetest.register_node(nodename_fountain_empty, {
|
||||
description = "Fountainhead",
|
||||
description = S("Fountainhead"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_fountainhead"..polys..".obj",
|
||||
tiles = { "pipeworks_fountainhead.png" },
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
groups = {snappy=3, pipe=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
pipe_connections = { bottom = 1 },
|
||||
after_place_node = function(pos)
|
||||
@ -641,14 +642,14 @@ minetest.register_node(nodename_fountain_empty, {
|
||||
|
||||
local nodename_fountain_loaded = "pipeworks:fountainhead_pouring"
|
||||
minetest.register_node(nodename_fountain_loaded, {
|
||||
description = "Fountainhead",
|
||||
description = S("Fountainhead"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_fountainhead"..polys..".obj",
|
||||
tiles = { "pipeworks_fountainhead.png" },
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
pipe_connections = { bottom = 1 },
|
||||
after_place_node = function(pos)
|
||||
@ -691,14 +692,14 @@ local sp_cbox = {
|
||||
|
||||
local nodename_sp_empty = "pipeworks:straight_pipe_empty"
|
||||
minetest.register_node(nodename_sp_empty, {
|
||||
description = "Straight-only Pipe",
|
||||
description = S("Straight-only Pipe"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_straight_pipe"..polys..".obj",
|
||||
tiles = { "pipeworks_straight_pipe_empty.png" },
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3, pipe=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
on_place = pipeworks.rotate_on_place,
|
||||
after_dig_node = function(pos)
|
||||
@ -706,19 +707,21 @@ minetest.register_node(nodename_sp_empty, {
|
||||
end,
|
||||
selection_box = sp_cbox,
|
||||
collision_box = sp_cbox,
|
||||
on_rotate = pipeworks.fix_after_rotation
|
||||
on_rotate = pipeworks.fix_after_rotation,
|
||||
check_for_pole = pipeworks.check_for_vert_pipe,
|
||||
check_for_horiz_pole = pipeworks.check_for_horiz_pipe
|
||||
})
|
||||
|
||||
local nodename_sp_loaded = "pipeworks:straight_pipe_loaded"
|
||||
minetest.register_node(nodename_sp_loaded, {
|
||||
description = "Straight-only Pipe",
|
||||
description = S("Straight-only Pipe"),
|
||||
drawtype = "mesh",
|
||||
mesh = "pipeworks_straight_pipe"..polys..".obj",
|
||||
tiles = { "pipeworks_straight_pipe_loaded.png" },
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
on_place = pipeworks.rotate_on_place,
|
||||
after_dig_node = function(pos)
|
||||
@ -727,7 +730,9 @@ minetest.register_node(nodename_sp_loaded, {
|
||||
selection_box = sp_cbox,
|
||||
collision_box = sp_cbox,
|
||||
drop = "pipeworks:straight_pipe_empty",
|
||||
on_rotate = pipeworks.fix_after_rotation
|
||||
on_rotate = pipeworks.fix_after_rotation,
|
||||
check_for_pole = pipeworks.check_for_vert_pipe,
|
||||
check_for_horiz_pole = pipeworks.check_for_horiz_pipe
|
||||
})
|
||||
|
||||
new_flow_logic_register.directional_horizonal_rotate(nodename_sp_empty, true)
|
||||
|
@ -1,3 +1,4 @@
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
local fs_helpers = pipeworks.fs_helpers
|
||||
|
||||
local function delay(x)
|
||||
@ -5,47 +6,47 @@ local function delay(x)
|
||||
end
|
||||
|
||||
local function set_filter_infotext(data, meta)
|
||||
local infotext = data.wise_desc.." Filter-Injector"
|
||||
local infotext = S("@1 Filter-Injector", data.wise_desc)
|
||||
if meta:get_int("slotseq_mode") == 2 then
|
||||
infotext = infotext .. " (slot #"..meta:get_int("slotseq_index").." next)"
|
||||
infotext = infotext .. " "..S("(slot #@1 next)", meta:get_int("slotseq_index"))
|
||||
end
|
||||
meta:set_string("infotext", infotext)
|
||||
end
|
||||
|
||||
local function set_filter_formspec(data, meta)
|
||||
local itemname = data.wise_desc.." Filter-Injector"
|
||||
local itemname = S("@1 Filter-Injector", data.wise_desc)
|
||||
|
||||
local formspec
|
||||
if data.digiline then
|
||||
formspec = "size[8,2.7]"..
|
||||
"item_image[0,0;1,1;pipeworks:"..data.name.."]"..
|
||||
"label[1,0;"..minetest.formspec_escape(itemname).."]"..
|
||||
"field[0.3,1.5;8.0,1;channel;Channel;${channel}]"..
|
||||
"field[0.3,1.5;8.0,1;channel;"..S("Channel")..";${channel}]"..
|
||||
fs_helpers.cycling_button(meta, "button[0,2;4,1", "slotseq_mode",
|
||||
{"Sequence slots by Priority",
|
||||
"Sequence slots Randomly",
|
||||
"Sequence slots by Rotation"})..
|
||||
{S("Sequence slots by Priority"),
|
||||
S("Sequence slots Randomly"),
|
||||
S("Sequence slots by Rotation")})..
|
||||
fs_helpers.cycling_button(meta, "button[4,2;4,1", "exmatch_mode",
|
||||
{"Exact match - off",
|
||||
"Exact match - on "})
|
||||
{S("Exact match - off"),
|
||||
S("Exact match - on")})
|
||||
else
|
||||
local exmatch_button = ""
|
||||
if data.stackwise then
|
||||
exmatch_button =
|
||||
fs_helpers.cycling_button(meta, "button[4,3.5;4,1", "exmatch_mode",
|
||||
{"Exact match - off",
|
||||
"Exact match - on "})
|
||||
{S("Exact match - off"),
|
||||
S("Exact match - on")})
|
||||
end
|
||||
|
||||
formspec = "size[8,8.5]"..
|
||||
"item_image[0,0;1,1;pipeworks:"..data.name.."]"..
|
||||
"label[1,0;"..minetest.formspec_escape(itemname).."]"..
|
||||
"label[0,1;Prefer item types:]"..
|
||||
"label[0,1;"..S("Prefer item types:").."]"..
|
||||
"list[context;main;0,1.5;8,2;]"..
|
||||
fs_helpers.cycling_button(meta, "button[0,3.5;4,1", "slotseq_mode",
|
||||
{"Sequence slots by Priority",
|
||||
"Sequence slots Randomly",
|
||||
"Sequence slots by Rotation"})..
|
||||
{S("Sequence slots by Priority"),
|
||||
S("Sequence slots Randomly"),
|
||||
S("Sequence slots by Rotation")})..
|
||||
exmatch_button..
|
||||
"list[current_player;main;0,4.5;8,4;]" ..
|
||||
"listring[]"
|
||||
@ -53,116 +54,6 @@ local function set_filter_formspec(data, meta)
|
||||
meta:set_string("formspec", formspec)
|
||||
end
|
||||
|
||||
-- todo SOON: this function has *way too many* parameters
|
||||
local function grabAndFire(data,slotseq_mode,exmatch_mode,filtmeta,frominv,frominvname,frompos,fromnode,filterfor,fromtube,fromdef,dir,fakePlayer,all,digiline)
|
||||
local sposes = {}
|
||||
if not frominvname or not frominv:get_list(frominvname) then return end
|
||||
for spos,stack in ipairs(frominv:get_list(frominvname)) do
|
||||
local matches
|
||||
if filterfor == "" then
|
||||
matches = stack:get_name() ~= ""
|
||||
else
|
||||
local fname = filterfor.name
|
||||
local fgroup = filterfor.group
|
||||
local fwear = filterfor.wear
|
||||
local fmetadata = filterfor.metadata
|
||||
matches = (not fname -- If there's a name filter,
|
||||
or stack:get_name() == fname) -- it must match.
|
||||
|
||||
and (not fgroup -- If there's a group filter,
|
||||
or (type(fgroup) == "string" -- it must be a string
|
||||
and minetest.get_item_group( -- and it must match.
|
||||
stack:get_name(), fgroup) ~= 0))
|
||||
|
||||
and (not fwear -- If there's a wear filter:
|
||||
or (type(fwear) == "number" -- If it's a number,
|
||||
and stack:get_wear() == fwear) -- it must match.
|
||||
or (type(fwear) == "table" -- If it's a table:
|
||||
and (not fwear[1] -- If there's a lower bound,
|
||||
or (type(fwear[1]) == "number" -- it must be a number
|
||||
and fwear[1] <= stack:get_wear())) -- and it must be <= the actual wear.
|
||||
and (not fwear[2] -- If there's an upper bound
|
||||
or (type(fwear[2]) == "number" -- it must be a number
|
||||
and stack:get_wear() < fwear[2])))) -- and it must be > the actual wear.
|
||||
-- If the wear filter is of any other type, fail.
|
||||
--
|
||||
and (not fmetadata -- If there's a matadata filter,
|
||||
or (type(fmetadata) == "string" -- it must be a string
|
||||
and stack:get_metadata() == fmetadata)) -- and it must match.
|
||||
end
|
||||
if matches then table.insert(sposes, spos) end
|
||||
end
|
||||
if #sposes == 0 then return false end
|
||||
if slotseq_mode == 1 then
|
||||
for i = #sposes, 2, -1 do
|
||||
local j = math.random(i)
|
||||
local t = sposes[j]
|
||||
sposes[j] = sposes[i]
|
||||
sposes[i] = t
|
||||
end
|
||||
elseif slotseq_mode == 2 then
|
||||
local headpos = filtmeta:get_int("slotseq_index")
|
||||
table.sort(sposes, function (a, b)
|
||||
if a >= headpos then
|
||||
if b < headpos then return true end
|
||||
else
|
||||
if b >= headpos then return false end
|
||||
end
|
||||
return a < b
|
||||
end)
|
||||
end
|
||||
for _, spos in ipairs(sposes) do
|
||||
local stack = frominv:get_stack(frominvname, spos)
|
||||
local doRemove = stack:get_count()
|
||||
if fromtube.can_remove then
|
||||
doRemove = fromtube.can_remove(frompos, fromnode, stack, dir, frominvname, spos)
|
||||
elseif fromdef.allow_metadata_inventory_take then
|
||||
doRemove = fromdef.allow_metadata_inventory_take(frompos, frominvname,spos, stack, fakePlayer)
|
||||
end
|
||||
-- stupid lack of continue statements grumble
|
||||
if doRemove > 0 then
|
||||
if slotseq_mode == 2 then
|
||||
local nextpos = spos + 1
|
||||
if nextpos > frominv:get_size(frominvname) then
|
||||
nextpos = 1
|
||||
end
|
||||
filtmeta:set_int("slotseq_index", nextpos)
|
||||
set_filter_infotext(data, filtmeta)
|
||||
end
|
||||
local item
|
||||
local count
|
||||
if all then
|
||||
count = math.min(stack:get_count(), doRemove)
|
||||
if filterfor.count and (filterfor.count > 1 or digiline) then
|
||||
if exmatch_mode ~= 0 and filterfor.count > count then
|
||||
return false -- not enough, fail
|
||||
else
|
||||
-- limit quantity to filter amount
|
||||
count = math.min(filterfor.count, count)
|
||||
end
|
||||
end
|
||||
else
|
||||
count = 1
|
||||
end
|
||||
if fromtube.remove_items then
|
||||
-- it could be the entire stack...
|
||||
item = fromtube.remove_items(frompos, fromnode, stack, dir, count, frominvname, spos)
|
||||
else
|
||||
item = stack:take_item(count)
|
||||
frominv:set_stack(frominvname, spos, stack)
|
||||
if fromdef.on_metadata_inventory_take then
|
||||
fromdef.on_metadata_inventory_take(frompos, frominvname, spos, item, fakePlayer)
|
||||
end
|
||||
end
|
||||
local pos = vector.add(frompos, vector.multiply(dir, 1.4))
|
||||
local start_pos = vector.add(frompos, dir)
|
||||
local item1 = pipeworks.tube_inject_item(pos, start_pos, dir, item, fakePlayer:get_player_name())
|
||||
return true-- only fire one item, please
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function punch_filter(data, filtpos, filtnode, msg)
|
||||
local filtmeta = minetest.get_meta(filtpos)
|
||||
local filtinv = filtmeta:get_inventory()
|
||||
@ -178,8 +69,6 @@ local function punch_filter(data, filtpos, filtnode, msg)
|
||||
if not fromdef then return end
|
||||
local fromtube = fromdef.tube
|
||||
local input_special_cases = {
|
||||
["technic:mv_furnace"] = "dst",
|
||||
["technic:mv_furnace_active"] = "dst",
|
||||
["technic:mv_electric_furnace"] = "dst",
|
||||
["technic:mv_electric_furnace_active"] = "dst",
|
||||
["technic:mv_alloy_furnace"] = "dst",
|
||||
@ -193,6 +82,14 @@ local function punch_filter(data, filtpos, filtnode, msg)
|
||||
["technic:mv_grinder"] = "dst",
|
||||
["technic:mv_grinder_active"] = "dst",
|
||||
["technic:tool_workshop"] = "src",
|
||||
["technic:mv_freezer"] = "dst",
|
||||
["technic:mv_freezer_active"] = "dst",
|
||||
["technic:hv_electric_furnace"] = "dst",
|
||||
["technic:hv_electric_furnace_active"] = "dst",
|
||||
["technic:hv_compressor"] = "dst",
|
||||
["technic:hv_compressor_active"] = "dst",
|
||||
["technic:hv_grinder"] = "dst",
|
||||
["technic:hv_grinder_active"] = "dst"
|
||||
}
|
||||
|
||||
-- make sure there's something appropriate to inject the item into
|
||||
@ -212,7 +109,7 @@ local function punch_filter(data, filtpos, filtnode, msg)
|
||||
if not (fromtube and fromtube.input_inventory) then return end
|
||||
|
||||
local slotseq_mode
|
||||
local exact_match
|
||||
local exmatch_mode
|
||||
|
||||
local filters = {}
|
||||
if data.digiline then
|
||||
@ -249,10 +146,10 @@ local function punch_filter(data, filtpos, filtnode, msg)
|
||||
|
||||
local exmatch = msg.exmatch
|
||||
local t_exmatch = type(exmatch)
|
||||
if t_exmatch == "number" and exmatch >= 0 and exmatch <= 1 then
|
||||
exact_match = exmatch
|
||||
if t_exmatch == "number" and (exmatch == 0 or exmatch == 1) then
|
||||
exmatch_mode = exmatch
|
||||
elseif t_exmatch == "boolean" then
|
||||
exact_match = exmatch and 1 or 0
|
||||
exmatch_mode = exmatch and 1 or 0
|
||||
end
|
||||
|
||||
local slotseq_index = msg.slotseq_index
|
||||
@ -269,11 +166,11 @@ local function punch_filter(data, filtpos, filtnode, msg)
|
||||
filtmeta:set_int("slotseq_mode", slotseq_mode)
|
||||
end
|
||||
|
||||
if exact_match ~= nil then
|
||||
filtmeta:set_int("exmatch_mode", exact_match)
|
||||
if exmatch_mode ~= nil then
|
||||
filtmeta:set_int("exmatch_mode", exmatch_mode)
|
||||
end
|
||||
|
||||
if slotseq_mode ~= nil or exact_match ~= nil then
|
||||
if slotseq_mode ~= nil or exmatch_mode ~= nil then
|
||||
set_filter_formspec(data, filtmeta)
|
||||
end
|
||||
|
||||
@ -311,8 +208,8 @@ local function punch_filter(data, filtpos, filtnode, msg)
|
||||
slotseq_mode = filtmeta:get_int("slotseq_mode")
|
||||
end
|
||||
|
||||
if exact_match == nil then
|
||||
exact_match = filtmeta:get_int("exmatch_mode")
|
||||
if exmatch_mode == nil then
|
||||
exmatch_mode = filtmeta:get_int("exmatch_mode")
|
||||
end
|
||||
|
||||
local frominv
|
||||
@ -326,10 +223,120 @@ local function punch_filter(data, filtpos, filtnode, msg)
|
||||
frominv = frommeta:get_inventory()
|
||||
end
|
||||
if fromtube.before_filter then fromtube.before_filter(frompos) end
|
||||
|
||||
local function grabAndFire(frominvname, filterfor)
|
||||
local sposes = {}
|
||||
if not frominvname or not frominv:get_list(frominvname) then return end
|
||||
for spos,stack in ipairs(frominv:get_list(frominvname)) do
|
||||
local matches
|
||||
if filterfor == "" then
|
||||
matches = stack:get_name() ~= ""
|
||||
else
|
||||
local fname = filterfor.name
|
||||
local fgroup = filterfor.group
|
||||
local fwear = filterfor.wear
|
||||
local fmetadata = filterfor.metadata
|
||||
matches = (not fname -- If there's a name filter,
|
||||
or stack:get_name() == fname) -- it must match.
|
||||
|
||||
and (not fgroup -- If there's a group filter,
|
||||
or (type(fgroup) == "string" -- it must be a string
|
||||
and minetest.get_item_group( -- and it must match.
|
||||
stack:get_name(), fgroup) ~= 0))
|
||||
|
||||
and (not fwear -- If there's a wear filter:
|
||||
or (type(fwear) == "number" -- If it's a number,
|
||||
and stack:get_wear() == fwear) -- it must match.
|
||||
or (type(fwear) == "table" -- If it's a table:
|
||||
and (not fwear[1] -- If there's a lower bound,
|
||||
or (type(fwear[1]) == "number" -- it must be a number
|
||||
and fwear[1] <= stack:get_wear())) -- and it must be <= the actual wear.
|
||||
and (not fwear[2] -- If there's an upper bound
|
||||
or (type(fwear[2]) == "number" -- it must be a number
|
||||
and stack:get_wear() < fwear[2])))) -- and it must be > the actual wear.
|
||||
-- If the wear filter is of any other type, fail.
|
||||
|
||||
and (not fmetadata -- If there's a metadata filter,
|
||||
or (type(fmetadata) == "string" -- it must be a string
|
||||
and stack:get_metadata() == fmetadata)) -- and it must match.
|
||||
end
|
||||
if matches then table.insert(sposes, spos) end
|
||||
end
|
||||
if #sposes == 0 then return false end
|
||||
if slotseq_mode == 1 then
|
||||
for i = #sposes, 2, -1 do
|
||||
local j = math.random(i)
|
||||
local t = sposes[j]
|
||||
sposes[j] = sposes[i]
|
||||
sposes[i] = t
|
||||
end
|
||||
elseif slotseq_mode == 2 then
|
||||
local headpos = filtmeta:get_int("slotseq_index")
|
||||
table.sort(sposes, function (a, b)
|
||||
if a >= headpos then
|
||||
if b < headpos then return true end
|
||||
else
|
||||
if b >= headpos then return false end
|
||||
end
|
||||
return a < b
|
||||
end)
|
||||
end
|
||||
for _, spos in ipairs(sposes) do
|
||||
local stack = frominv:get_stack(frominvname, spos)
|
||||
local doRemove = stack:get_count()
|
||||
if fromtube.can_remove then
|
||||
doRemove = fromtube.can_remove(frompos, fromnode, stack, dir, frominvname, spos)
|
||||
elseif fromdef.allow_metadata_inventory_take then
|
||||
doRemove = fromdef.allow_metadata_inventory_take(frompos, frominvname,spos, stack, fakePlayer)
|
||||
end
|
||||
-- stupid lack of continue statements grumble
|
||||
if doRemove > 0 then
|
||||
if slotseq_mode == 2 then
|
||||
local nextpos = spos + 1
|
||||
if nextpos > frominv:get_size(frominvname) then
|
||||
nextpos = 1
|
||||
end
|
||||
filtmeta:set_int("slotseq_index", nextpos)
|
||||
set_filter_infotext(data, filtmeta)
|
||||
end
|
||||
local item
|
||||
local count
|
||||
if data.stackwise then
|
||||
count = math.min(stack:get_count(), doRemove)
|
||||
if filterfor.count and (filterfor.count > 1 or data.digiline) then
|
||||
if exmatch_mode ~= 0 and filterfor.count > count then
|
||||
return false -- not enough, fail
|
||||
else
|
||||
-- limit quantity to filter amount
|
||||
count = math.min(filterfor.count, count)
|
||||
end
|
||||
end
|
||||
else
|
||||
count = 1
|
||||
end
|
||||
if fromtube.remove_items then
|
||||
-- it could be the entire stack...
|
||||
item = fromtube.remove_items(frompos, fromnode, stack, dir, count, frominvname, spos)
|
||||
else
|
||||
item = stack:take_item(count)
|
||||
frominv:set_stack(frominvname, spos, stack)
|
||||
if fromdef.on_metadata_inventory_take then
|
||||
fromdef.on_metadata_inventory_take(frompos, frominvname, spos, item, fakePlayer)
|
||||
end
|
||||
end
|
||||
local pos = vector.add(frompos, vector.multiply(dir, 1.4))
|
||||
local start_pos = vector.add(frompos, dir)
|
||||
local item1 = pipeworks.tube_inject_item(pos, start_pos, dir, item, fakePlayer:get_player_name())
|
||||
return true -- only fire one item, please
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
for _, frominvname in ipairs(type(fromtube.input_inventory) == "table" and fromtube.input_inventory or {fromtube.input_inventory}) do
|
||||
local done = false
|
||||
for _, filterfor in ipairs(filters) do
|
||||
if grabAndFire(data, slotseq_mode, exact_match, filtmeta, frominv, frominvname, frompos, fromnode, filterfor, fromtube, fromdef, dir, fakePlayer, data.stackwise, data.digiline) then
|
||||
if grabAndFire(frominvname, filterfor) then
|
||||
done = true
|
||||
break
|
||||
end
|
||||
@ -342,23 +349,23 @@ end
|
||||
for _, data in ipairs({
|
||||
{
|
||||
name = "filter",
|
||||
wise_desc = "Itemwise",
|
||||
wise_desc = S("Itemwise"),
|
||||
stackwise = false,
|
||||
},
|
||||
{
|
||||
name = "mese_filter",
|
||||
wise_desc = "Stackwise",
|
||||
wise_desc = S("Stackwise"),
|
||||
stackwise = true,
|
||||
},
|
||||
{ -- register even if no digilines
|
||||
name = "digiline_filter",
|
||||
wise_desc = "Digiline",
|
||||
wise_desc = S("Digiline"),
|
||||
stackwise = true,
|
||||
digiline = true,
|
||||
},
|
||||
}) do
|
||||
local node = {
|
||||
description = data.wise_desc.." Filter-Injector",
|
||||
description = S("@1 Filter-Injector", data.wise_desc),
|
||||
tiles = {
|
||||
"pipeworks_"..data.name.."_top.png",
|
||||
"pipeworks_"..data.name.."_top.png",
|
||||
@ -383,6 +390,7 @@ for _, data in ipairs({
|
||||
pipeworks.after_place(pos)
|
||||
end,
|
||||
after_dig_node = pipeworks.after_dig,
|
||||
on_rotate = pipeworks.on_rotate,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
if not pipeworks.may_configure(pos, player) then
|
||||
return 0
|
||||
@ -472,18 +480,18 @@ end
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:filter 2",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "default:steel_ingot", "homedecor:plastic_sheeting" },
|
||||
{ "group:stick", "default:mese_crystal", "homedecor:plastic_sheeting" },
|
||||
{ "default:steel_ingot", "default:steel_ingot", "homedecor:plastic_sheeting" }
|
||||
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:plastic_sheet" },
|
||||
{ "group:stick", "default:mese_crystal", "basic_materials:plastic_sheet" },
|
||||
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:plastic_sheet" }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:mese_filter 2",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "default:steel_ingot", "homedecor:plastic_sheeting" },
|
||||
{ "group:stick", "default:mese", "homedecor:plastic_sheeting" },
|
||||
{ "default:steel_ingot", "default:steel_ingot", "homedecor:plastic_sheeting" }
|
||||
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:plastic_sheet" },
|
||||
{ "group:stick", "default:mese", "basic_materials:plastic_sheet" },
|
||||
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:plastic_sheet" }
|
||||
},
|
||||
})
|
||||
|
||||
@ -491,9 +499,9 @@ if minetest.get_modpath("digilines") then
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:digiline_filter 2",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "default:steel_ingot", "homedecor:plastic_sheeting" },
|
||||
{ "group:stick", "digilines:wire_std_00000000", "homedecor:plastic_sheeting" },
|
||||
{ "default:steel_ingot", "default:steel_ingot", "homedecor:plastic_sheeting" }
|
||||
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:plastic_sheet" },
|
||||
{ "group:stick", "digilines:wire_std_00000000", "basic_materials:plastic_sheet" },
|
||||
{ "default:steel_ingot", "default:steel_ingot", "basic_materials:plastic_sheet" }
|
||||
},
|
||||
})
|
||||
end
|
||||
|
16
init.lua
16
init.lua
@ -3,8 +3,6 @@
|
||||
-- This mod supplies various steel pipes and plastic pneumatic tubes
|
||||
-- and devices that they can connect to.
|
||||
--
|
||||
-- License: WTFPL
|
||||
--
|
||||
|
||||
pipeworks = {}
|
||||
|
||||
@ -12,6 +10,7 @@ local DEBUG = false
|
||||
|
||||
pipeworks.worldpath = minetest.get_worldpath()
|
||||
pipeworks.modpath = minetest.get_modpath("pipeworks")
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
|
||||
dofile(pipeworks.modpath.."/default_settings.lua")
|
||||
-- Read the external config file if it exists.
|
||||
@ -47,7 +46,7 @@ pipeworks.liquid_texture = "default_water.png"
|
||||
pipeworks.button_off = {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"}
|
||||
pipeworks.button_on = {text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
||||
pipeworks.button_base = "image_button[0,4.3;1,0.6"
|
||||
pipeworks.button_label = "label[0.9,4.31;Allow splitting incoming stacks from tubes]"
|
||||
pipeworks.button_label = "label[0.9,4.31;"..S("Allow splitting incoming stacks from tubes").."]"
|
||||
|
||||
-- Helper functions
|
||||
|
||||
@ -104,6 +103,10 @@ if pipeworks.toggles.finite_water == nil then
|
||||
dofile(pipeworks.modpath.."/autodetect-finite-water.lua")
|
||||
end
|
||||
|
||||
if minetest.get_modpath("signs_lib") then
|
||||
dofile(pipeworks.modpath.."/signs_compat.lua")
|
||||
end
|
||||
|
||||
dofile(pipeworks.modpath.."/common.lua")
|
||||
dofile(pipeworks.modpath.."/models.lua")
|
||||
dofile(pipeworks.modpath.."/autoplace_pipes.lua")
|
||||
@ -135,15 +138,16 @@ dofile(pipeworks.modpath..logicdir.."flowable_node_registry_install.lua")
|
||||
if pipeworks.enable_pipes then dofile(pipeworks.modpath.."/pipes.lua") end
|
||||
if pipeworks.enable_teleport_tube then dofile(pipeworks.modpath.."/teleport_tube.lua") end
|
||||
if pipeworks.enable_pipe_devices then dofile(pipeworks.modpath.."/devices.lua") end
|
||||
|
||||
if pipeworks.enable_redefines then
|
||||
dofile(pipeworks.modpath.."/compat-chests.lua")
|
||||
dofile(pipeworks.modpath.."/compat-furnaces.lua")
|
||||
end
|
||||
if pipeworks.enable_autocrafter then dofile(pipeworks.modpath.."/autocrafter.lua") end
|
||||
if pipeworks.enable_lua_tube then dofile(pipeworks.modpath.."/lua_tube.lua") end
|
||||
if pipeworks.enable_lua_tube and
|
||||
(minetest.get_modpath("mesecons") or minetest.get_modpath("digilines")) then
|
||||
dofile(pipeworks.modpath.."/lua_tube.lua")
|
||||
end
|
||||
|
||||
minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")
|
||||
|
||||
print("Pipeworks loaded!")
|
||||
|
||||
|
@ -61,7 +61,7 @@ local crunch_tube = function(pos, cnode, cmeta)
|
||||
local itemcount = tube_item_count[h] or 0
|
||||
if itemcount > max_tube_limit then
|
||||
cmeta:set_string("the_tube_was", minetest.serialize(cnode))
|
||||
print("[Pipeworks] Warning - a tube at "..minetest.pos_to_string(pos).." broke due to too many items ("..itemcount..")")
|
||||
pipeworks.logger("Warning - a tube at "..minetest.pos_to_string(pos).." broke due to too many items ("..itemcount..")")
|
||||
minetest.swap_node(pos, {name = "pipeworks:broken_tube_1"})
|
||||
pipeworks.scan_for_tube_objects(pos)
|
||||
end
|
||||
|
@ -1,3 +1,4 @@
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
|
||||
if not minetest.get_modpath("auto_tree_tap") and
|
||||
minetest.get_modpath("technic") then
|
||||
@ -20,7 +21,7 @@ if not minetest.get_modpath("auto_tree_tap") and
|
||||
})
|
||||
|
||||
minetest.register_node(":auto_tree_tap:off", {
|
||||
description = "Auto-Tap",
|
||||
description = S("Auto-Tap"),
|
||||
tiles = {"pipeworks_nodebreaker_top_off.png","pipeworks_nodebreaker_bottom_off.png","pipeworks_nodebreaker_side2_off.png","pipeworks_nodebreaker_side1_off.png",
|
||||
"pipeworks_nodebreaker_back.png","pipeworks_nodebreaker_front_off.png"},
|
||||
is_ground_content = true,
|
||||
|
112
locale/pipeworks.fr.tr
Normal file
112
locale/pipeworks.fr.tr
Normal file
@ -0,0 +1,112 @@
|
||||
# textdomain: pipeworks
|
||||
|
||||
# License: CC-by-SA 4.0
|
||||
# Author: Louis Royer <4259825-lroyer@users.noreply.gitlab.com>
|
||||
|
||||
## digilines interfacing
|
||||
Channel=Canal
|
||||
|
||||
## init
|
||||
Allow splitting incoming stacks from tubes=Séparer les piles venant des tubes
|
||||
|
||||
## autocrafter
|
||||
Unknown item=Item inconnu
|
||||
unconfigured Autocrafter: unknown recipe=Autocrafteur non-configuré : recette inconnue
|
||||
unconfigured Autocrafter=Autocrafteur non-configuré
|
||||
'@1' Autocrafter (@2)=Autocrafteur de '@1' (@2)
|
||||
Save=Valider
|
||||
paused '@1' Autocrafter=Autocrafteur de '@1' en pause
|
||||
Autocrafter=Autocrafteur
|
||||
|
||||
## compat-furnaces
|
||||
Allow splitting incoming material (not fuel) stacks from tubes=Séparer les piles (sauf le carburant) venant des tubes
|
||||
|
||||
## decorative tubes
|
||||
Airtight steelblock embedded tube=Tube hermétique intégré à un bloc d’acier
|
||||
Airtight panel embedded tube=Tube hermétique intégré à un panneau
|
||||
|
||||
## devices
|
||||
Pump/Intake Module=Module de pompage et d’admission
|
||||
Valve=Vanne
|
||||
Decorative grating=Grillage décoratif
|
||||
Spigot outlet=Sortie de robinet
|
||||
Airtight Pipe entry/exit=Extrémité de tube hermétique
|
||||
Flow Sensor=Détecteur de débit
|
||||
Flow sensor (on)=Détecteur de débit (actif)
|
||||
empty=vide
|
||||
@1% full=plein à @1 %
|
||||
Expansion Tank (@1)=Réservoir d’expansion (@1)
|
||||
Fluid Storage Tank (@1)=Réservoir de liquides (@1)
|
||||
Fountainhead=Tête de fontaine
|
||||
Straight-only Pipe=Tuyau droit
|
||||
|
||||
## filter-injector
|
||||
(slot #@1 next)=(slot suivant : #@1)
|
||||
@1 Filter-Injector=Filtre-injecteur @1
|
||||
Sequence slots by Priority=Ordonner par priorité
|
||||
Sequence slots Randomly=Ordonner aléatoirement
|
||||
Sequence slots by Rotation=Ordonner en rotation
|
||||
Exact match - off=Filtrage inactif
|
||||
Exact match - on=Filtrage actif
|
||||
Prefer item types:=Items à filtrer :
|
||||
Itemwise=par item
|
||||
Stackwise=par piles d’items
|
||||
Digiline=digiline
|
||||
|
||||
## legacy
|
||||
Auto-Tap=Robinet d’arbre automatique
|
||||
|
||||
## pipes
|
||||
Pipe Segment=Segment de tuyau
|
||||
Pipe Segment (legacy)=Segment de tuyau (obsolète)
|
||||
|
||||
|
||||
## routing tubes
|
||||
Pneumatic tube segment=Segment de tuyau pneumatique
|
||||
Broken Tube=Tuyau cassé
|
||||
High Priority Tube Segment=Segment de tuyau haute priorité
|
||||
Accelerating Pneumatic Tube Segment=Segment de tuyau pneumatique accélérante
|
||||
Crossing Pneumatic Tube Segment=Intersection de tuyau pneumatique
|
||||
One way tube=Tuyau unidirectionnel
|
||||
|
||||
## signal tubes
|
||||
Detecting Pneumatic Tube Segment on=Segment de tuyau pneumatique avec détecteur (actif)
|
||||
Detecting Pneumatic Tube Segment=Segment de tuyau pneumatique avec détecteur
|
||||
Digiline Detecting Pneumatic Tube Segment=Segment de tuyau pneumatique avec détecteur digiline
|
||||
Digiline Detecting Tube=Tuyau avec détecteur digiline
|
||||
Conducting Pneumatic Tube Segment=Segment de tuyau pneumatique conducteur
|
||||
Conducting Pneumatic Tube Segment on=Segment de tuyau pneumatique conducteur actif
|
||||
Digiline Conducting Pneumatic Tube Segment=Segment de tuyau pneumatique conducteur digiline
|
||||
Mesecon and Digiline Conducting Pneumatic Tube Segment=Segment de tuyau pneumatique conducteur mesecon et digiline
|
||||
Mesecon and Digiline Conducting Pneumatic Tube Segment on=Segment de tuyau pneumatique conducteur mesecon et digiline (actif)
|
||||
|
||||
## sorting tubes
|
||||
Sorting Pneumatic Tube Segment=Segment de tuyau pneumatique triant
|
||||
Sorting pneumatic tube=Tuyau pneumatique triant
|
||||
|
||||
## teleport tube
|
||||
Receive=Reception
|
||||
channels are public by default=Les canaux sont publics par défaut
|
||||
use <player>:<channel> for fully private channels=Utilisez <joueur>:<canal> pour un canal entièrement privé
|
||||
use <player>;<channel> for private receivers=Utilisez <joueur>;<canal> pour une réception privée
|
||||
Teleporting Pneumatic Tube Segment=Segment de tuyau pneumatique téléporteur
|
||||
unconfigured Teleportation Tube=Tuyau téléporteur non-configuré
|
||||
Sorry, channel '@1' is reserved for exclusive use by @2=Désolé, le canal '@1' est réservé exclusivement à l’utilisateur @2.
|
||||
Sorry, receiving from channel '@1' is reserved for @2=Désolé, la réception depuis le canal '@1' est réservée pour @2.
|
||||
Teleportation Tube @1 on '@2'=Tuyau de téléportation @1 sur '@2'
|
||||
|
||||
## trashcan
|
||||
Trash Can=Poubelle
|
||||
|
||||
## tube registration
|
||||
Pneumatic tube segment (legacy)=Segment de tuyau pneumatique (obsolète)
|
||||
|
||||
## vacuum tubes
|
||||
Vacuuming Pneumatic Tube Segment=Segment de tuyau pneumatique aspirant
|
||||
Adjustable Vacuuming Pneumatic Tube Segment=Segment de tuyau pneumatique aspirant réglable
|
||||
Adjustable Vacuuming Pneumatic Tube Segment (@1m)=Segment de tuyau pneumatique aspirant réglable (@1 m)
|
||||
|
||||
## wielder
|
||||
Node Breaker=Casseur de blocs
|
||||
Deployer=Poseur de blocs
|
||||
Dispenser=Distributeur
|
112
locale/template.txt
Normal file
112
locale/template.txt
Normal file
@ -0,0 +1,112 @@
|
||||
# textdomain: pipeworks
|
||||
|
||||
# License: CC-by-SA 4.0
|
||||
# Author:
|
||||
|
||||
## digilines interfacing
|
||||
Channel=
|
||||
|
||||
## init
|
||||
Allow splitting incoming stacks from tubes=
|
||||
|
||||
## autocrafter
|
||||
Unknown item=
|
||||
unconfigured Autocrafter: unknown recipe=
|
||||
unconfigured Autocrafter=
|
||||
'@1' Autocrafter (@2)=
|
||||
Save=
|
||||
paused '@1' Autocrafter=
|
||||
Autocrafter=
|
||||
|
||||
## compat-furnaces
|
||||
Allow splitting incoming material (not fuel) stacks from tubes=
|
||||
|
||||
## decorative tubes
|
||||
Airtight steelblock embedded tube=
|
||||
Airtight panel embedded tube=
|
||||
|
||||
## devices
|
||||
Pump/Intake Module=
|
||||
Valve=
|
||||
Decorative grating=
|
||||
Spigot outlet=
|
||||
Airtight Pipe entry/exit=
|
||||
Flow Sensor=
|
||||
Flow sensor (on)=
|
||||
empty=
|
||||
@1% full=
|
||||
Expansion Tank (@1)=
|
||||
Fluid Storage Tank (@1)=
|
||||
Fountainhead=
|
||||
Straight-only Pipe=
|
||||
|
||||
## filter-injector
|
||||
(slot #@1 next)=
|
||||
@1 Filter-Injector=
|
||||
Sequence slots by Priority=
|
||||
Sequence slots Randomly=
|
||||
Sequence slots by Rotation=
|
||||
Exact match - off=
|
||||
Exact match - on=
|
||||
Prefer item types:=
|
||||
Itemwise=
|
||||
Stackwise=
|
||||
Digiline=
|
||||
|
||||
## legacy
|
||||
Auto-Tap=
|
||||
|
||||
## pipes
|
||||
Pipe Segment=
|
||||
Pipe Segment (legacy)=
|
||||
|
||||
|
||||
## routing tubes
|
||||
Pneumatic tube segment=
|
||||
Broken Tube=
|
||||
High Priority Tube Segment=
|
||||
Accelerating Pneumatic Tube Segment=
|
||||
Crossing Pneumatic Tube Segment=
|
||||
One way tube=
|
||||
|
||||
## signal tubes
|
||||
Detecting Pneumatic Tube Segment on=
|
||||
Detecting Pneumatic Tube Segment=
|
||||
Digiline Detecting Pneumatic Tube Segment=
|
||||
Digiline Detecting Tube=
|
||||
Conducting Pneumatic Tube Segment=
|
||||
Conducting Pneumatic Tube Segment on=
|
||||
Digiline Conducting Pneumatic Tube Segment=
|
||||
Mesecon and Digiline Conducting Pneumatic Tube Segment=
|
||||
Mesecon and Digiline Conducting Pneumatic Tube Segment on=
|
||||
|
||||
## sorting tubes
|
||||
Sorting Pneumatic Tube Segment=
|
||||
Sorting pneumatic tube=
|
||||
|
||||
## teleport tube
|
||||
Receive=
|
||||
channels are public by default=
|
||||
use <player>:<channel> for fully private channels=
|
||||
use <player>;<channel> for private receivers=
|
||||
Teleporting Pneumatic Tube Segment=
|
||||
unconfigured Teleportation Tube=
|
||||
Sorry, channel '@1' is reserved for exclusive use by @2=
|
||||
Sorry, receiving from channel '@1' is reserved for @2=
|
||||
Teleportation Tube @1 on '@2'=
|
||||
|
||||
## trashcan
|
||||
Trash Can=
|
||||
|
||||
## tube registration
|
||||
Pneumatic tube segment (legacy)=
|
||||
|
||||
## vacuum tubes
|
||||
Vacuuming Pneumatic Tube Segment=
|
||||
Adjustable Vacuuming Pneumatic Tube Segment=
|
||||
Adjustable Vacuuming Pneumatic Tube Segment (@1m)=
|
||||
|
||||
## wielder
|
||||
Node Breaker=
|
||||
Deployer=
|
||||
Dispenser=
|
31
lua_tube.lua
31
lua_tube.lua
@ -24,7 +24,7 @@
|
||||
-- use too much memory from the sandbox.
|
||||
-- You can add more functions to the environment
|
||||
-- (see where local env is defined)
|
||||
-- Something nice to play is is appending minetest.env to it.
|
||||
-- Something nice to play is appending minetest.env to it.
|
||||
|
||||
local BASENAME = "pipeworks:lua_tube"
|
||||
|
||||
@ -37,6 +37,23 @@ local rules = {
|
||||
white = {x = 0, y = 0, z = 1, name = "white"},
|
||||
}
|
||||
|
||||
local digiline_rules_luatube = {
|
||||
{x=0, y=0, z=-1},
|
||||
{x=1, y=0, z=0},
|
||||
{x=-1, y=0, z=0},
|
||||
{x=0, y=0, z=1},
|
||||
{x=1, y=1, z=0},
|
||||
{x=1, y=-1, z=0},
|
||||
{x=-1, y=1, z=0},
|
||||
{x=-1, y=-1, z=0},
|
||||
{x=0, y=1, z=1},
|
||||
{x=0, y=-1, z=1},
|
||||
{x=0, y=1, z=-1},
|
||||
{x=0, y=-1, z=-1},
|
||||
-- vertical connectivity
|
||||
{x=0, y=1, z=0},
|
||||
{x=0, y=-1, z=0},
|
||||
}
|
||||
|
||||
------------------
|
||||
-- Action stuff --
|
||||
@ -303,7 +320,7 @@ local function get_digiline_send(pos)
|
||||
end
|
||||
|
||||
minetest.after(0, function()
|
||||
digilines.receptor_send(pos, digiline.rules.default, channel, msg)
|
||||
digilines.receptor_send(pos, digiline_rules_luatube, channel, msg)
|
||||
end)
|
||||
return true
|
||||
end
|
||||
@ -316,8 +333,11 @@ local safe_globals = {
|
||||
}
|
||||
|
||||
local function create_environment(pos, mem, event)
|
||||
-- Gather variables for the environment
|
||||
-- Make sure the tube hasn't broken.
|
||||
local vports = minetest.registered_nodes[minetest.get_node(pos).name].virtual_portstates
|
||||
if not vports then return {} end
|
||||
|
||||
-- Gather variables for the environment
|
||||
local vports_copy = {}
|
||||
for k, v in pairs(vports) do vports_copy[k] = v end
|
||||
local rports = get_real_port_states(pos)
|
||||
@ -540,7 +560,10 @@ local digiline = {
|
||||
action = function(pos, node, channel, msg)
|
||||
run(pos, {type = "digiline", channel = channel, msg = msg})
|
||||
end
|
||||
}
|
||||
},
|
||||
wire = {
|
||||
rules = pipeworks.digilines_rules
|
||||
},
|
||||
}
|
||||
local function on_receive_fields(pos, form_name, fields, sender)
|
||||
if not fields.program then
|
||||
|
@ -46,6 +46,11 @@ local function read_entities()
|
||||
end
|
||||
|
||||
local function write_entities()
|
||||
if not luaentity.entities then
|
||||
-- This can happen if crashing on startup, causing another error that
|
||||
-- masks the original one. Return gracefully in that case instead.
|
||||
return
|
||||
end
|
||||
for _, entity in pairs(luaentity.entities) do
|
||||
setmetatable(entity, nil)
|
||||
for _, attached in pairs(entity._attached_entities) do
|
||||
|
4
mod.conf
4
mod.conf
@ -1 +1,5 @@
|
||||
name = pipeworks
|
||||
description = This mod uses mesh nodes and nodeboxes to supply a complete set of 3D pipes and tubes, along with devices that work with them.
|
||||
depends = default, basic_materials, screwdriver
|
||||
optional_depends = mesecons, mesecons_mvps, digilines, signs_lib
|
||||
min_minetest_version = 5.2.0
|
||||
|
21
pipes.lua
21
pipes.lua
@ -1,4 +1,5 @@
|
||||
-- This file supplies the steel pipes
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
|
||||
local REGISTER_COMPATIBILITY = true
|
||||
|
||||
@ -35,11 +36,11 @@ for index, connects in ipairs(cconnects) do
|
||||
end
|
||||
|
||||
local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1}
|
||||
local pipedesc = "Pipe segement".." "..dump(connects).."... You hacker, you."
|
||||
local pipedesc = S("Pipe Segment").." "..dump(connects)
|
||||
|
||||
if #connects == 0 then
|
||||
pgroups = {snappy = 3, tube = 1}
|
||||
pipedesc = "Pipe segment"
|
||||
pipedesc = S("Pipe Segment")
|
||||
end
|
||||
|
||||
local outimg_e = { "pipeworks_pipe_plain.png" }
|
||||
@ -73,7 +74,7 @@ for index, connects in ipairs(cconnects) do
|
||||
fixed = outsel
|
||||
},
|
||||
groups = pgroups,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
drop = "pipeworks:pipe_1_empty",
|
||||
after_place_node = function(pos)
|
||||
@ -82,7 +83,10 @@ for index, connects in ipairs(cconnects) do
|
||||
after_dig_node = function(pos)
|
||||
pipeworks.scan_for_pipe_objects(pos)
|
||||
end,
|
||||
on_rotate = false
|
||||
on_rotate = false,
|
||||
check_for_pole = pipeworks.check_for_vert_pipe,
|
||||
check_for_horiz_pole = pipeworks.check_for_horiz_pipe,
|
||||
pipenumber = index
|
||||
})
|
||||
|
||||
local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1}
|
||||
@ -104,7 +108,7 @@ for index, connects in ipairs(cconnects) do
|
||||
fixed = outsel
|
||||
},
|
||||
groups = pgroups,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
walkable = true,
|
||||
drop = "pipeworks:pipe_1_empty",
|
||||
after_place_node = function(pos)
|
||||
@ -114,7 +118,10 @@ for index, connects in ipairs(cconnects) do
|
||||
after_dig_node = function(pos)
|
||||
pipeworks.scan_for_pipe_objects(pos)
|
||||
end,
|
||||
on_rotate = false
|
||||
on_rotate = false,
|
||||
check_for_pole = pipeworks.check_for_vert_pipe,
|
||||
check_for_horiz_pole = pipeworks.check_for_horiz_pipe,
|
||||
pipenumber = index
|
||||
})
|
||||
|
||||
local emptypipe = "pipeworks:pipe_"..index.."_empty"
|
||||
@ -134,7 +141,7 @@ if REGISTER_COMPATIBILITY then
|
||||
drawtype = "airlike",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
description = "Pipe Segment (legacy)",
|
||||
description = S("Pipe Segment (legacy)"),
|
||||
groups = {not_in_creative_inventory = 1, pipe_to_update = 1},
|
||||
drop = "pipeworks:pipe_1_empty",
|
||||
after_place_node = function(pos)
|
||||
|
@ -1,19 +1,19 @@
|
||||
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
-- the default tube and default textures
|
||||
pipeworks.register_tube("pipeworks:tube", "Pneumatic tube segment")
|
||||
pipeworks.register_tube("pipeworks:tube", S("Pneumatic tube segment"))
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:tube_1 6",
|
||||
recipe = {
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||
{ "", "", "" },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
|
||||
},
|
||||
})
|
||||
|
||||
local nodecolor = 0xffff3030
|
||||
|
||||
pipeworks.register_tube("pipeworks:broken_tube", {
|
||||
description = "Broken Tube (you hacker you)",
|
||||
description = S("Broken Tube"),
|
||||
plain = { { name = "pipeworks_broken_tube_plain.png", backface_culling = false, color = nodecolor } },
|
||||
noctr = { { name = "pipeworks_broken_tube_plain.png", backface_culling = false, color = nodecolor } },
|
||||
ends = { { name = "pipeworks_broken_tube_end.png", color = nodecolor } },
|
||||
@ -35,7 +35,7 @@ pipeworks.register_tube("pipeworks:broken_tube", {
|
||||
local itemstack = puncher:get_wielded_item()
|
||||
local wieldname = itemstack:get_name()
|
||||
local playername = puncher:get_player_name()
|
||||
print("[Pipeworks] "..playername.." struck a broken tube at "..minetest.pos_to_string(pos))
|
||||
local log_msg = playername.." struck a broken tube at "..minetest.pos_to_string(pos).."\n"
|
||||
if wieldname == "anvil:hammer"
|
||||
or wieldname == "cottages:hammer"
|
||||
or wieldname == "glooptest:hammer_steel"
|
||||
@ -47,17 +47,17 @@ pipeworks.register_tube("pipeworks:broken_tube", {
|
||||
local meta = minetest.get_meta(pos)
|
||||
local was_node = minetest.deserialize(meta:get_string("the_tube_was"))
|
||||
if was_node and was_node ~= "" then
|
||||
print(" with "..wieldname.." to repair it.")
|
||||
pipeworks.logger(log_msg.." with "..wieldname.." to repair it.")
|
||||
minetest.swap_node(pos, { name = was_node.name, param2 = was_node.param2 })
|
||||
pipeworks.scan_for_tube_objects(pos)
|
||||
itemstack:add_wear(1000)
|
||||
puncher:set_wielded_item(itemstack)
|
||||
return itemstack
|
||||
else
|
||||
print(" but it can't be repaired.")
|
||||
pipeworks.logger(log_msg.." but it can't be repaired.")
|
||||
end
|
||||
else
|
||||
print(" with "..wieldname.." but that tool is too weak.")
|
||||
pipeworks.logger(log_msg.." with "..wieldname.." but that tool is too weak.")
|
||||
end
|
||||
end
|
||||
}
|
||||
@ -69,7 +69,7 @@ pipeworks.register_tube("pipeworks:broken_tube", {
|
||||
if pipeworks.enable_priority_tube then
|
||||
local color = "#ff3030:128"
|
||||
pipeworks.register_tube("pipeworks:priority_tube", {
|
||||
description = "High Priority Tube Segment",
|
||||
description = S("High Priority Tube Segment"),
|
||||
inventory_image = "pipeworks_tube_inv.png^[colorize:" .. color,
|
||||
plain = { { name = "pipeworks_tube_plain.png", color = nodecolor } },
|
||||
noctr = { { name = "pipeworks_tube_noctr.png", color = nodecolor } },
|
||||
@ -82,16 +82,16 @@ if pipeworks.enable_priority_tube then
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:priority_tube_1 6",
|
||||
recipe = {
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||
{ "default:gold_ingot", "", "default:gold_ingot" },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
if pipeworks.enable_accelerator_tube then
|
||||
pipeworks.register_tube("pipeworks:accelerator_tube", {
|
||||
description = "Accelerating Pneumatic Tube Segment",
|
||||
description = S("Accelerating Pneumatic Tube Segment"),
|
||||
inventory_image = "pipeworks_accelerator_tube_inv.png",
|
||||
plain = { "pipeworks_accelerator_tube_plain.png" },
|
||||
noctr = { "pipeworks_accelerator_tube_noctr.png" },
|
||||
@ -107,16 +107,16 @@ if pipeworks.enable_accelerator_tube then
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:accelerator_tube_1 2",
|
||||
recipe = {
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||
{ "default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment" },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
if pipeworks.enable_crossing_tube then
|
||||
pipeworks.register_tube("pipeworks:crossing_tube", {
|
||||
description = "Crossing Pneumatic Tube Segment",
|
||||
description = S("Crossing Pneumatic Tube Segment"),
|
||||
inventory_image = "pipeworks_crossing_tube_inv.png",
|
||||
plain = { "pipeworks_crossing_tube_plain.png" },
|
||||
noctr = { "pipeworks_crossing_tube_noctr.png" },
|
||||
@ -138,7 +138,7 @@ end
|
||||
|
||||
if pipeworks.enable_one_way_tube then
|
||||
minetest.register_node("pipeworks:one_way_tube", {
|
||||
description = "One way tube",
|
||||
description = S("One way tube"),
|
||||
tiles = {"pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_output.png",
|
||||
"pipeworks_one_way_tube_input.png", "pipeworks_one_way_tube_side.png", "pipeworks_one_way_tube_top.png"},
|
||||
paramtype2 = "facedir",
|
||||
@ -161,13 +161,16 @@ if pipeworks.enable_one_way_tube then
|
||||
},
|
||||
after_place_node = pipeworks.after_place,
|
||||
after_dig_node = pipeworks.after_dig,
|
||||
on_rotate = pipeworks.on_rotate,
|
||||
check_for_pole = pipeworks.check_for_vert_tube,
|
||||
check_for_horiz_pole = pipeworks.check_for_horiz_tube
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "pipeworks:one_way_tube 2",
|
||||
recipe = {
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{ "group:stick", "default:mese_crystal", "homedecor:plastic_sheeting" },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||
{ "group:stick", "default:mese_crystal", "basic_materials:plastic_sheet" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
|
||||
},
|
||||
})
|
||||
end
|
||||
|
@ -1,7 +1,8 @@
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
if pipeworks.enable_detector_tube then
|
||||
local detector_tube_step = 5 * tonumber(minetest.settings:get("dedicated_server_step"))
|
||||
pipeworks.register_tube("pipeworks:detector_tube_on", {
|
||||
description = "Detecting Pneumatic Tube Segment on (you hacker you)",
|
||||
description = S("Detecting Pneumatic Tube Segment on"),
|
||||
inventory_image = "pipeworks_detector_tube_inv.png",
|
||||
plain = { "pipeworks_detector_tube_plain.png" },
|
||||
node_def = {
|
||||
@ -40,7 +41,7 @@ if pipeworks.enable_detector_tube then
|
||||
},
|
||||
})
|
||||
pipeworks.register_tube("pipeworks:detector_tube_off", {
|
||||
description = "Detecting Pneumatic Tube Segment",
|
||||
description = S("Detecting Pneumatic Tube Segment"),
|
||||
inventory_image = "pipeworks_detector_tube_inv.png",
|
||||
plain = { "pipeworks_detector_tube_plain.png" },
|
||||
node_def = {
|
||||
@ -60,9 +61,9 @@ if pipeworks.enable_detector_tube then
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:detector_tube_off_1 2",
|
||||
recipe = {
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||
{ "mesecons:mesecon", "mesecons_materials:silicon", "mesecons:mesecon" },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
|
||||
},
|
||||
})
|
||||
end
|
||||
@ -70,7 +71,7 @@ end
|
||||
local digiline_enabled = minetest.get_modpath("digilines") ~= nil
|
||||
if digiline_enabled and pipeworks.enable_digiline_detector_tube then
|
||||
pipeworks.register_tube("pipeworks:digiline_detector_tube", {
|
||||
description = "Digiline Detecting Pneumatic Tube Segment",
|
||||
description = S("Digiline Detecting Pneumatic Tube Segment"),
|
||||
inventory_image = "pipeworks_digiline_detector_tube_inv.png",
|
||||
plain = { "pipeworks_digiline_detector_tube_plain.png" },
|
||||
node_def = {
|
||||
@ -79,7 +80,7 @@ if digiline_enabled and pipeworks.enable_digiline_detector_tube then
|
||||
|
||||
local setchan = meta:get_string("channel")
|
||||
|
||||
digiline:receptor_send(pos, digiline.rules.default, setchan, stack:to_string())
|
||||
digiline:receptor_send(pos, digiline.rules.default, setchan, stack:to_table())
|
||||
|
||||
return pipeworks.notvel(pipeworks.meseadjlist, velocity)
|
||||
end},
|
||||
@ -87,9 +88,9 @@ if digiline_enabled and pipeworks.enable_digiline_detector_tube then
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec",
|
||||
"size[8.6,2.2]"..
|
||||
"field[0.6,0.6;8,1;channel;Channel:;${channel}]"..
|
||||
"field[0.6,0.6;8,1;channel;"..S("Channel")..";${channel}]"..
|
||||
"image[0.3,1.3;1,1;pipeworks_digiline_detector_tube_inv.png]"..
|
||||
"label[1.6,1.2;Digiline Detecting Tube]"
|
||||
"label[1.6,1.2;"..S("Digiline Detecting Tube").."]"
|
||||
)
|
||||
end,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
@ -102,7 +103,10 @@ if digiline_enabled and pipeworks.enable_digiline_detector_tube then
|
||||
receptor = {},
|
||||
effector = {
|
||||
action = function(pos,node,channel,msg) end
|
||||
}
|
||||
},
|
||||
wire = {
|
||||
rules = pipeworks.digilines_rules
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
@ -110,16 +114,16 @@ if digiline_enabled and pipeworks.enable_digiline_detector_tube then
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:digiline_detector_tube_1 2",
|
||||
recipe = {
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||
{ "digilines:wire_std_00000000", "mesecons_materials:silicon", "digilines:wire_std_00000000" },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
if pipeworks.enable_conductor_tube then
|
||||
pipeworks.register_tube("pipeworks:conductor_tube_off", {
|
||||
description = "Conducting Pneumatic Tube Segment",
|
||||
description = S("Conducting Pneumatic Tube Segment"),
|
||||
inventory_image = "pipeworks_conductor_tube_inv.png",
|
||||
short = "pipeworks_conductor_tube_short.png",
|
||||
plain = { "pipeworks_conductor_tube_plain.png" },
|
||||
@ -133,7 +137,7 @@ if pipeworks.enable_conductor_tube then
|
||||
},
|
||||
})
|
||||
pipeworks.register_tube("pipeworks:conductor_tube_on", {
|
||||
description = "Conducting Pneumatic Tube Segment on (you hacker you)",
|
||||
description = S("Conducting Pneumatic Tube Segment on"),
|
||||
inventory_image = "pipeworks_conductor_tube_inv.png",
|
||||
short = "pipeworks_conductor_tube_short.png",
|
||||
plain = { "pipeworks_conductor_tube_on_plain.png" },
|
||||
@ -157,7 +161,7 @@ end
|
||||
|
||||
if digiline_enabled and pipeworks.enable_digiline_conductor_tube then
|
||||
pipeworks.register_tube("pipeworks:digiline_conductor_tube", {
|
||||
description = "Digiline Conducting Pneumatic Tube Segment",
|
||||
description = S("Digiline Conducting Pneumatic Tube Segment"),
|
||||
inventory_image = "pipeworks_tube_inv.png^pipeworks_digiline_conductor_tube_inv.png",
|
||||
short = "pipeworks_tube_short.png^pipeworks_digiline_conductor_tube_short.png",
|
||||
plain = {"pipeworks_tube_plain.png^pipeworks_digiline_conductor_tube_plain.png"},
|
||||
@ -175,7 +179,7 @@ end
|
||||
if digiline_enabled and pipeworks.enable_digiline_conductor_tube and
|
||||
pipeworks.enable_conductor_tube then
|
||||
pipeworks.register_tube("pipeworks:mesecon_and_digiline_conductor_tube_off", {
|
||||
description = "Mesecon and Digiline Conducting Pneumatic Tube Segment",
|
||||
description = S("Mesecon and Digiline Conducting Pneumatic Tube Segment"),
|
||||
inventory_image = "pipeworks_conductor_tube_inv.png^pipeworks_digiline_conductor_tube_inv.png",
|
||||
short = "pipeworks_conductor_tube_short.png^pipeworks_digiline_conductor_tube_short.png",
|
||||
plain = {"pipeworks_conductor_tube_plain.png^pipeworks_digiline_conductor_tube_plain.png"},
|
||||
@ -192,7 +196,7 @@ if digiline_enabled and pipeworks.enable_digiline_conductor_tube and
|
||||
},
|
||||
})
|
||||
pipeworks.register_tube("pipeworks:mesecon_and_digiline_conductor_tube_on", {
|
||||
description = "Mesecon and Digiline Conducting Pneumatic Tube Segment on (you hacker you)",
|
||||
description = S("Mesecon and Digiline Conducting Pneumatic Tube Segment on"),
|
||||
inventory_image = "pipeworks_conductor_tube_inv.png^pipeworks_digiline_conductor_tube_inv.png",
|
||||
short = "pipeworks_conductor_tube_short.png^pipeworks_digiline_conductor_tube_short.png",
|
||||
plain = {"pipeworks_conductor_tube_on_plain.png^pipeworks_digiline_conductor_tube_plain.png"},
|
||||
|
241
signs_compat.lua
Normal file
241
signs_compat.lua
Normal file
@ -0,0 +1,241 @@
|
||||
-- This file adds placement rules for signs_lib, if present
|
||||
|
||||
local spv = {
|
||||
[4] = true,
|
||||
[6] = true,
|
||||
[8] = true,
|
||||
[10] = true,
|
||||
[13] = true,
|
||||
[15] = true,
|
||||
[17] = true,
|
||||
[19] = true
|
||||
}
|
||||
|
||||
local sphns = {
|
||||
[1] = true,
|
||||
[3] = true,
|
||||
[5] = true,
|
||||
[7] = true,
|
||||
[9] = true,
|
||||
[11] = true,
|
||||
[21] = true,
|
||||
[23] = true
|
||||
}
|
||||
|
||||
local sphew = {
|
||||
[0] = true,
|
||||
[2] = true,
|
||||
[12] = true,
|
||||
[14] = true,
|
||||
[16] = true,
|
||||
[18] = true,
|
||||
[20] = true,
|
||||
[22] = true
|
||||
}
|
||||
|
||||
local owtv = {
|
||||
[5] = true,
|
||||
[7] = true,
|
||||
[9] = true,
|
||||
[11] = true,
|
||||
[12] = true,
|
||||
[14] = true,
|
||||
[16] = true,
|
||||
[18] = true
|
||||
}
|
||||
|
||||
local owtns = {
|
||||
[0] = true,
|
||||
[2] = true,
|
||||
[4] = true,
|
||||
[6] = true,
|
||||
[8] = true,
|
||||
[10] = true,
|
||||
[20] = true,
|
||||
[22] = true
|
||||
}
|
||||
|
||||
local owtew = {
|
||||
[1] = true,
|
||||
[3] = true,
|
||||
[13] = true,
|
||||
[15] = true,
|
||||
[17] = true,
|
||||
[19] = true,
|
||||
[21] = true,
|
||||
[23] = true
|
||||
}
|
||||
|
||||
local vert_n = {
|
||||
[3] = {[5] = true},
|
||||
[6] = {[9] = true, [12] = true, [16] = true},
|
||||
[7] = {[9] = true, [11] = true},
|
||||
}
|
||||
|
||||
local vert_e = {
|
||||
[3] = {[5] = true},
|
||||
[6] = {[5] = true, [9] = true, [16] = true},
|
||||
[7] = {[7] = true, [11] = true},
|
||||
}
|
||||
|
||||
local vert_s = {
|
||||
[3] = {[5] = true},
|
||||
[6] = {[5] = true, [12] = true, [16] = true},
|
||||
[7] = {[5] = true, [7] = true},
|
||||
}
|
||||
|
||||
local vert_w = {
|
||||
[3] = {[5] = true},
|
||||
[6] = {[5] = true, [9] = true, [12] = true},
|
||||
[7] = {[5] = true, [9] = true},
|
||||
}
|
||||
|
||||
local horiz_n = {
|
||||
[3] = {[0] = true},
|
||||
[6] = {[0] = true, [4] = true, [20] = true},
|
||||
[7] = {[2] = true, [10] = true},
|
||||
[8] = {[0] = true},
|
||||
[9] = {[2] = true},
|
||||
}
|
||||
|
||||
local horiz_e = {
|
||||
[3] = {[1] = true},
|
||||
[6] = {[1] = true, [17] = true, [21] = true},
|
||||
[7] = {[3] = true, [19] = true},
|
||||
[8] = {[1] = true},
|
||||
[9] = {[3] = true},
|
||||
}
|
||||
|
||||
local horiz_s = {
|
||||
[3] = {[0] = true},
|
||||
[6] = {[0] = true, [8] = true, [20] = true},
|
||||
[7] = {[0] = true, [4] = true},
|
||||
[8] = {[0] = true},
|
||||
[9] = {[0] = true},
|
||||
}
|
||||
|
||||
local horiz_w = {
|
||||
[3] = {[1] = true},
|
||||
[6] = {[1] = true, [13] = true, [21] = true},
|
||||
[7] = {[1] = true, [13] = true},
|
||||
[8] = {[1] = true},
|
||||
[9] = {[1] = true},
|
||||
}
|
||||
|
||||
local function get_sign_dir(node, def)
|
||||
if (node.param2 == 4 and def.paramtype2 == "wallmounted")
|
||||
or (node.param2 == 0 and def.paramtype2 ~= "wallmounted") then
|
||||
return {["N"] = true}
|
||||
elseif (node.param2 == 2 and def.paramtype2 == "wallmounted")
|
||||
or (node.param2 == 1 and def.paramtype2 ~= "wallmounted") then
|
||||
return {["E"] = true}
|
||||
elseif (node.param2 == 5 and def.paramtype2 == "wallmounted")
|
||||
or (node.param2 == 2 and def.paramtype2 ~= "wallmounted") then
|
||||
return {["S"] = true}
|
||||
elseif node.param2 == 3 then
|
||||
return {["W"] = true}
|
||||
end
|
||||
return {}
|
||||
end
|
||||
|
||||
--[[
|
||||
In the functions below:
|
||||
|
||||
pos: the (real) position of the placed sign
|
||||
node: the sign node itself
|
||||
def: its definition
|
||||
|
||||
ppos: the position of the pointed node (pipe/tube)
|
||||
pnode: the node itself
|
||||
pdef: its definition
|
||||
|
||||
--]]
|
||||
|
||||
|
||||
-- pipes
|
||||
|
||||
function pipeworks.check_for_vert_pipe(pos, node, def, ppos, pnode, pdef)
|
||||
local signdir = get_sign_dir(node, def)
|
||||
local pipenumber = pdef.pipenumber
|
||||
local pipedir = pnode.param2
|
||||
if string.find(pnode.name, "straight_pipe") and spv[pipedir] then
|
||||
return true
|
||||
elseif signdir["N"] and vert_n[pipenumber] and vert_n[pipenumber][pipedir] then
|
||||
return true
|
||||
elseif signdir["E"] and vert_e[pipenumber] and vert_e[pipenumber][pipedir] then
|
||||
return true
|
||||
elseif signdir["S"] and vert_s[pipenumber] and vert_s[pipenumber][pipedir] then
|
||||
return true
|
||||
elseif signdir["W"] and vert_w[pipenumber] and vert_w[pipenumber][pipedir] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function pipeworks.check_for_horiz_pipe(pos, node, def, ppos, pnode, pdef)
|
||||
local signdir = get_sign_dir(node, def)
|
||||
local pipenumber = pdef.pipenumber
|
||||
local pipedir = pnode.param2
|
||||
if string.find(pnode.name, "straight_pipe") then
|
||||
if (signdir["N"] or signdir["S"]) and sphns[pipedir] then
|
||||
return true
|
||||
elseif (signdir["E"] or signdir["W"]) and sphew[pipedir] then
|
||||
return true
|
||||
end
|
||||
elseif signdir["N"] and horiz_n[pipenumber] and horiz_n[pipenumber][pipedir] then
|
||||
return true
|
||||
elseif signdir["E"] and horiz_e[pipenumber] and horiz_e[pipenumber][pipedir] then
|
||||
return true
|
||||
elseif signdir["S"] and horiz_s[pipenumber] and horiz_s[pipenumber][pipedir] then
|
||||
return true
|
||||
elseif signdir["W"] and horiz_w[pipenumber] and horiz_w[pipenumber][pipedir] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- tubes
|
||||
|
||||
function pipeworks.check_for_vert_tube(pos, node, def, ppos, pnode, pdef)
|
||||
local signdir = get_sign_dir(node, def)
|
||||
local tubenumber = pdef.tubenumber
|
||||
local tubedir = pnode.param2
|
||||
if pnode.name == "pipeworks:one_way_tube" and owtv[tubedir] then
|
||||
return true
|
||||
elseif tubenumber == 2 and (tubedir == 5 or tubedir == 7) then -- it's a stub pointing up or down
|
||||
return true
|
||||
elseif signdir["N"] and vert_n[tubenumber] and vert_n[tubenumber][tubedir] then
|
||||
return true
|
||||
elseif signdir["E"] and vert_e[tubenumber] and vert_e[tubenumber][tubedir] then
|
||||
return true
|
||||
elseif signdir["S"] and vert_s[tubenumber] and vert_s[tubenumber][tubedir] then
|
||||
return true
|
||||
elseif signdir["W"] and vert_w[tubenumber] and vert_w[tubenumber][tubedir] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function pipeworks.check_for_horiz_tube(pos, node, def, ppos, pnode, pdef)
|
||||
local signdir = get_sign_dir(node, def)
|
||||
local tubenumber = pdef.tubenumber
|
||||
local tubedir = pnode.param2
|
||||
if tubenumber == 2 then -- it'a a stub pointing sideways
|
||||
if (tubedir == 0 or tubedir == 2) and (signdir["N"] or signdir["S"]) then
|
||||
return true
|
||||
elseif (tubedir == 1 or tubedir == 3) and (signdir["E"] or signdir["W"]) then
|
||||
return true
|
||||
end
|
||||
elseif pnode.name == "pipeworks:one_way_tube" then
|
||||
if (signdir["N"] or signdir["S"]) and owtns[tubedir] then
|
||||
return true
|
||||
elseif (signdir["E"] or signdir["W"]) and owtew[tubedir] then
|
||||
return true
|
||||
end
|
||||
elseif signdir["N"] and horiz_n[tubenumber] and horiz_n[tubenumber][tubedir] then
|
||||
return true
|
||||
elseif signdir["E"] and horiz_e[tubenumber] and horiz_e[tubenumber][tubedir] then
|
||||
return true
|
||||
elseif signdir["S"] and horiz_s[tubenumber] and horiz_s[tubenumber][tubedir] then
|
||||
return true
|
||||
elseif signdir["W"] and horiz_w[tubenumber] and horiz_w[tubenumber][tubedir] then
|
||||
return true
|
||||
end
|
||||
end
|
@ -1,3 +1,4 @@
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
local fs_helpers = pipeworks.fs_helpers
|
||||
|
||||
if pipeworks.enable_mese_tube then
|
||||
@ -55,7 +56,7 @@ if pipeworks.enable_mese_tube then
|
||||
end
|
||||
|
||||
pipeworks.register_tube("pipeworks:mese_tube", {
|
||||
description = "Sorting Pneumatic Tube Segment",
|
||||
description = S("Sorting Pneumatic Tube Segment"),
|
||||
inventory_image = "pipeworks_mese_tube_inv.png",
|
||||
noctr = {"pipeworks_mese_tube_noctr_1.png", "pipeworks_mese_tube_noctr_2.png", "pipeworks_mese_tube_noctr_3.png",
|
||||
"pipeworks_mese_tube_noctr_4.png", "pipeworks_mese_tube_noctr_5.png", "pipeworks_mese_tube_noctr_6.png"},
|
||||
@ -107,7 +108,7 @@ if pipeworks.enable_mese_tube then
|
||||
inv:set_size("line"..tostring(i), 6*1)
|
||||
end
|
||||
update_formspec(pos)
|
||||
meta:set_string("infotext", "Sorting pneumatic tube")
|
||||
meta:set_string("infotext", S("Sorting pneumatic tube"))
|
||||
end,
|
||||
on_punch = update_formspec,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
@ -153,9 +154,9 @@ if pipeworks.enable_mese_tube then
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:mese_tube_000000 2",
|
||||
recipe = {
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||
{ "", "default:mese_crystal", "" },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
local filename=minetest.get_worldpath() .. "/teleport_tubes"
|
||||
|
||||
local tp_tube_db = nil -- nil forces a read
|
||||
@ -127,19 +128,19 @@ local function update_meta(meta, can_receive)
|
||||
meta:set_int("can_receive", can_receive and 1 or 0)
|
||||
local cr_state = can_receive and "on" or "off"
|
||||
meta:set_string("formspec","size[8.6,2.2]"..
|
||||
"field[0.6,0.6;7,1;channel;Channel:;${channel}]"..
|
||||
"label[7.3,0;Receive]"..
|
||||
"field[0.6,0.6;7,1;channel;"..S("Channel")..";${channel}]"..
|
||||
"label[7.3,0;"..S("Receive").."]"..
|
||||
"image_button[7.3,0.3;1,0.6;pipeworks_button_" .. cr_state .. ".png;cr" .. (can_receive and 0 or 1) .. ";;;false;pipeworks_button_interm.png]"..
|
||||
"image[0.3,1.3;1,1;pipeworks_teleport_tube_inv.png]"..
|
||||
"label[1.6,1.2;channels are public by default]" ..
|
||||
"label[1.6,1.5;use <player>:<channel> for fully private channels]" ..
|
||||
"label[1.6,1.8;use <player>\\;<channel> for private receivers]" ..
|
||||
"label[1.6,1.2;"..S("channels are public by default").."]" ..
|
||||
"label[1.6,1.5;"..S("use <player>:<channel> for fully private channels").."]" ..
|
||||
"label[1.6,1.8;"..S("use <player>\\;<channel> for private receivers").."]" ..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img)
|
||||
end
|
||||
|
||||
pipeworks.register_tube("pipeworks:teleport_tube", {
|
||||
description = "Teleporting Pneumatic Tube Segment",
|
||||
description = S("Teleporting Pneumatic Tube Segment"),
|
||||
inventory_image = "pipeworks_teleport_tube_inv.png",
|
||||
noctr = { "pipeworks_teleport_tube_noctr.png" },
|
||||
plain = { "pipeworks_teleport_tube_plain.png" },
|
||||
@ -169,7 +170,7 @@ pipeworks.register_tube("pipeworks:teleport_tube", {
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
update_meta(meta, true)
|
||||
meta:set_string("infotext", "unconfigured Teleportation Tube")
|
||||
meta:set_string("infotext", S("unconfigured Teleportation Tube"))
|
||||
end,
|
||||
on_receive_fields = function(pos,formname,fields,sender)
|
||||
if not fields.channel -- ignore escaping or clientside manipulation of the form
|
||||
@ -189,12 +190,14 @@ pipeworks.register_tube("pipeworks:teleport_tube", {
|
||||
if name and mode and name ~= sender_name then
|
||||
--channels starting with '[name]:' can only be used by the named player
|
||||
if mode == ":" then
|
||||
minetest.chat_send_player(sender_name, "Sorry, channel '"..new_channel.."' is reserved for exclusive use by "..name)
|
||||
minetest.chat_send_player(sender_name, S("Sorry, channel '@1' is reserved for exclusive use by @2",
|
||||
new_channel, name))
|
||||
return
|
||||
|
||||
--channels starting with '[name];' can be used by other players, but cannot be received from
|
||||
elseif mode == ";" and (fields.cr1 or (can_receive ~= 0 and not fields.cr0)) then
|
||||
minetest.chat_send_player(sender_name, "Sorry, receiving from channel '"..new_channel.."' is reserved for "..name)
|
||||
minetest.chat_send_player(sender_name, S("Sorry, receiving from channel '@1' is reserved for @2",
|
||||
new_channel, name))
|
||||
return
|
||||
end
|
||||
end
|
||||
@ -226,11 +229,11 @@ pipeworks.register_tube("pipeworks:teleport_tube", {
|
||||
if channel ~= "" then
|
||||
set_tube(pos, channel, can_receive)
|
||||
local cr_description = (can_receive == 1) and "sending and receiving" or "sending"
|
||||
meta:set_string("infotext", string.format("Teleportation Tube %s on '%s'", cr_description, channel))
|
||||
meta:set_string("infotext", S("Teleportation Tube @1 on '@2'", cr_description, channel))
|
||||
else
|
||||
-- remove empty channel tubes, to not have to search through them
|
||||
remove_tube(pos)
|
||||
meta:set_string("infotext", "unconfigured Teleportation Tube")
|
||||
meta:set_string("infotext", S("unconfigured Teleportation Tube"))
|
||||
end
|
||||
end
|
||||
end,
|
||||
@ -242,9 +245,9 @@ pipeworks.register_tube("pipeworks:teleport_tube", {
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:teleport_tube_1 2",
|
||||
recipe = {
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||
{ "default:desert_stone", "default:mese", "default:desert_stone" },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
|
||||
},
|
||||
})
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.7 KiB |
@ -1,5 +1,6 @@
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
minetest.register_node("pipeworks:trashcan", {
|
||||
description = "Trash Can",
|
||||
description = S("Trash Can"),
|
||||
drawtype = "normal",
|
||||
tiles = {
|
||||
"pipeworks_trashcan_bottom.png",
|
||||
@ -22,7 +23,7 @@ minetest.register_node("pipeworks:trashcan", {
|
||||
meta:set_string("formspec",
|
||||
"size[8,7]"..
|
||||
"item_image[0,0;1,1;pipeworks:trashcan]"..
|
||||
"label[1,0;Trash Can]"..
|
||||
"label[1,0;"..S("Trash Can").."]"..
|
||||
"list[context;trash;3.5,1;1,1;]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
@ -30,7 +31,7 @@ minetest.register_node("pipeworks:trashcan", {
|
||||
default.get_hotbar_bg(0,3) ..
|
||||
"list[current_player;main;0,3;8,4;]" ..
|
||||
"listring[]")
|
||||
meta:set_string("infotext", "Trash Can")
|
||||
meta:set_string("infotext", S("Trash Can"))
|
||||
meta:get_inventory():set_size("trash", 1)
|
||||
end,
|
||||
after_place_node = pipeworks.after_place,
|
||||
@ -43,7 +44,7 @@ minetest.register_node("pipeworks:trashcan", {
|
||||
minetest.register_craft({
|
||||
output = "pipeworks:trashcan",
|
||||
recipe = {
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||
{ "default:steel_ingot", "", "default:steel_ingot" },
|
||||
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
|
||||
},
|
||||
|
@ -1,4 +1,5 @@
|
||||
-- This file supplies the various kinds of pneumatic tubes
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
|
||||
local tubenodes = {}
|
||||
pipeworks.tubenodes = tubenodes
|
||||
@ -56,8 +57,8 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
|
||||
end
|
||||
|
||||
local tgroups = {snappy = 3, tube = 1, tubedevice = 1, not_in_creative_inventory = 1}
|
||||
local tubedesc = string.format("%s %s... You hacker, you.", desc, dump(connects))
|
||||
local iimg = plain[1]
|
||||
local tubedesc = string.format("%s %s", desc, dump(connects))
|
||||
local iimg = type(plain[1]) == "table" and plain[1].name or plain[1]
|
||||
local wscale = {x = 1, y = 1, z = 1}
|
||||
|
||||
if #connects == 0 then
|
||||
@ -108,6 +109,7 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
|
||||
},
|
||||
after_place_node = pipeworks.after_place,
|
||||
after_dig_node = pipeworks.after_dig,
|
||||
on_rotate = false,
|
||||
on_blast = function(pos, intensity)
|
||||
if not intensity or intensity > 1 + 3^0.5 then
|
||||
minetest.remove_node(pos)
|
||||
@ -115,7 +117,10 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
|
||||
end
|
||||
minetest.swap_node(pos, {name = "pipeworks:broken_tube_1"})
|
||||
pipeworks.scan_for_tube_objects(pos)
|
||||
end
|
||||
end,
|
||||
check_for_pole = pipeworks.check_for_vert_tube,
|
||||
check_for_horiz_pole = pipeworks.check_for_horiz_tube,
|
||||
tubenumber = tonumber(tname)
|
||||
}
|
||||
if style == "6d" then
|
||||
nodedef.paramtype2 = "facedir"
|
||||
@ -193,7 +198,7 @@ local register_all_tubes = function(name, desc, plain, noctrs, ends, short, inv,
|
||||
wield_image = inv,
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
description = "Pneumatic tube segment (legacy)",
|
||||
description = S("Pneumatic tube segment (legacy)"),
|
||||
after_place_node = pipeworks.after_place,
|
||||
groups = {not_in_creative_inventory = 1, tube_to_update = 1, tube = 1},
|
||||
tube = {connect_sides = {front = 1, back = 1, left = 1, right = 1, top = 1, bottom = 1}},
|
||||
|
@ -1,6 +1,7 @@
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
if pipeworks.enable_sand_tube then
|
||||
pipeworks.register_tube("pipeworks:sand_tube", {
|
||||
description = "Vacuuming Pneumatic Tube Segment",
|
||||
description = S("Vacuuming Pneumatic Tube Segment"),
|
||||
inventory_image = "pipeworks_sand_tube_inv.png",
|
||||
short = "pipeworks_sand_tube_short.png",
|
||||
noctr = {"pipeworks_sand_tube_noctr.png"},
|
||||
@ -12,9 +13,9 @@ if pipeworks.enable_sand_tube then
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:sand_tube_1 2",
|
||||
recipe = {
|
||||
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"},
|
||||
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet"},
|
||||
{"group:sand", "group:sand", "group:sand"},
|
||||
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"}
|
||||
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet"}
|
||||
},
|
||||
})
|
||||
|
||||
@ -28,7 +29,7 @@ end
|
||||
|
||||
if pipeworks.enable_mese_sand_tube then
|
||||
pipeworks.register_tube("pipeworks:mese_sand_tube", {
|
||||
description = "Adjustable Vacuuming Pneumatic Tube Segment",
|
||||
description = S("Adjustable Vacuuming Pneumatic Tube Segment"),
|
||||
inventory_image = "pipeworks_mese_sand_tube_inv.png",
|
||||
short = "pipeworks_mese_sand_tube_short.png",
|
||||
noctr = {"pipeworks_mese_sand_tube_noctr.png"},
|
||||
@ -44,7 +45,7 @@ if pipeworks.enable_mese_sand_tube then
|
||||
"field[1.3,0.4;1,1;dist;radius;${dist}]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img)
|
||||
meta:set_string("infotext", "Adjustable Vacuuming Pneumatic Tube Segment")
|
||||
meta:set_string("infotext", S("Adjustable Vacuuming Pneumatic Tube Segment"))
|
||||
end,
|
||||
on_receive_fields = function(pos,formname,fields,sender)
|
||||
if not pipeworks.may_configure(pos, sender) then return end
|
||||
@ -54,7 +55,7 @@ if pipeworks.enable_mese_sand_tube then
|
||||
dist = math.max(0, dist)
|
||||
dist = math.min(8, dist)
|
||||
meta:set_int("dist", dist)
|
||||
meta:set_string("infotext", ("Adjustable Vacuuming Pneumatic Tube Segment (%dm)"):format(dist))
|
||||
meta:set_string("infotext", (S("Adjustable Vacuuming Pneumatic Tube Segment (@1m)", dist)))
|
||||
end
|
||||
end,
|
||||
},
|
||||
@ -63,9 +64,9 @@ if pipeworks.enable_mese_sand_tube then
|
||||
minetest.register_craft( {
|
||||
output = "pipeworks:mese_sand_tube_1 2",
|
||||
recipe = {
|
||||
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
|
||||
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||
{"group:sand", "default:mese_crystal", "group:sand" },
|
||||
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
|
||||
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
|
||||
},
|
||||
})
|
||||
|
||||
|
10
wielder.lua
10
wielder.lua
@ -1,3 +1,4 @@
|
||||
local S = minetest.get_translator("pipeworks")
|
||||
local assumed_eye_pos = vector.new(0, 1.5, 0)
|
||||
|
||||
local function vector_copy(v)
|
||||
@ -39,7 +40,7 @@ local can_tool_dig_node = function(nodename, toolcaps, toolname)
|
||||
-- but a player holding one can - the game seems to fall back to the hand.
|
||||
-- fall back to checking the hand's properties if the tool isn't the correct one.
|
||||
local hand_caps = minetest.registered_items[""].tool_capabilities
|
||||
diggable = minetest.get_dig_params(nodegroups, hand_caps)
|
||||
diggable = minetest.get_dig_params(nodegroups, hand_caps).diggable
|
||||
end
|
||||
return diggable
|
||||
end
|
||||
@ -234,6 +235,7 @@ local function register_wielder(data)
|
||||
end
|
||||
pipeworks.scan_for_tube_objects(pos)
|
||||
end,
|
||||
on_rotate = pipeworks.on_rotate,
|
||||
on_punch = data.fixup_node,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
if not pipeworks.may_configure(pos, player) then return 0 end
|
||||
@ -258,7 +260,7 @@ if pipeworks.enable_node_breaker then
|
||||
local wield_inv_name = "pick"
|
||||
data = {
|
||||
name_base = name_base,
|
||||
description = "Node Breaker",
|
||||
description = S("Node Breaker"),
|
||||
texture_base = "pipeworks_nodebreaker",
|
||||
texture_stateful = { top = true, bottom = true, side2 = true, side1 = true, front = true },
|
||||
tube_connect_sides = { top=1, bottom=1, left=1, right=1, back=1 },
|
||||
@ -407,7 +409,7 @@ end
|
||||
if pipeworks.enable_deployer then
|
||||
register_wielder({
|
||||
name_base = "pipeworks:deployer",
|
||||
description = "Deployer",
|
||||
description = S("Deployer"),
|
||||
texture_base = "pipeworks_deployer",
|
||||
texture_stateful = { front = true },
|
||||
tube_connect_sides = { back=1 },
|
||||
@ -440,7 +442,7 @@ end
|
||||
if pipeworks.enable_dispenser then
|
||||
register_wielder({
|
||||
name_base = "pipeworks:dispenser",
|
||||
description = "Dispenser",
|
||||
description = S("Dispenser"),
|
||||
texture_base = "pipeworks_dispenser",
|
||||
texture_stateful = { front = true },
|
||||
tube_connect_sides = { back=1 },
|
||||
|
Reference in New Issue
Block a user