built on 31/05/2020 22:31:18
28
autobahn/COPYING.txt
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
The autobahn mod for Minetest is
|
||||||
|
|
||||||
|
Copyright (C) 2019-2020 Joachim Stolberg
|
||||||
|
|
||||||
|
License of source code
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
This mod is free software; you can redistribute and/or
|
||||||
|
modify it under the terms of the GNU General Public License version 3 or later
|
||||||
|
published by the Free Software Foundation.
|
||||||
|
|
||||||
|
This mod 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
|
||||||
|
General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public
|
||||||
|
License along with this mod; if not, write to the
|
||||||
|
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||||
|
Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
|
||||||
|
License of media (textures, sounds and documentation)
|
||||||
|
-----------------------------------------------------
|
||||||
|
|
||||||
|
All textures, sounds and documentation files are licensed under the
|
||||||
|
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||||
|
http://creativecommons.org/licenses/by-sa/3.0/
|
674
autobahn/LICENSE.txt
Normal file
@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, 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
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If 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 convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU 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
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state 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 program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program 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 General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
17
autobahn/README.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Autobahn Mod
|
||||||
|
|
||||||
|
Street blocks with stripes and slope blocks. Allows faster traveling.
|
||||||
|
For the recipe bitumen or tar is needed from the mods techage or moreblocks.
|
||||||
|
|
||||||
|
![autobahn](https://github.com/joe7575/autobahn/blob/master/screenshot.png)
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
default
|
||||||
|
Optional: moreblocks, techage, minecart
|
||||||
|
|
||||||
|
# License
|
||||||
|
Copyright (C) 2017-2020 Joachim Stolberg
|
||||||
|
Code: Licensed under the GNU GPL version 3 or later. See LICENSE.txt
|
||||||
|
Textures: CC BY-SA 3.0
|
||||||
|
|
||||||
|
|
4
autobahn/depends.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
default
|
||||||
|
moreblocks?
|
||||||
|
techage?
|
||||||
|
minecart?
|
1
autobahn/description.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Street mod for faster travelling.
|
376
autobahn/init.lua
Normal file
@ -0,0 +1,376 @@
|
|||||||
|
--[[
|
||||||
|
|
||||||
|
Autobahn
|
||||||
|
|
||||||
|
Copyright (C) 2017-2020 Joachim Stolberg
|
||||||
|
GPL v3
|
||||||
|
See LICENSE.txt for more information
|
||||||
|
|
||||||
|
History:
|
||||||
|
2017-11-11 v0.01 first version
|
||||||
|
2019-09-13 v0.02 adapted to 5.0.0
|
||||||
|
2020-03-19 v0.03 recipe added for techage bitumen
|
||||||
|
|
||||||
|
]]--
|
||||||
|
|
||||||
|
autobahn = {}
|
||||||
|
|
||||||
|
local Facedir2Dir = {[0] =
|
||||||
|
{x=0, y=0, z=1},
|
||||||
|
{x=1, y=0, z=0},
|
||||||
|
{x=0, y=0, z=-1},
|
||||||
|
{x=-1, y=0, z=0},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- To prevent race condition crashes
|
||||||
|
local Currently_left_the_game = {}
|
||||||
|
|
||||||
|
local function is_active(player)
|
||||||
|
local pl_meta = player:get_meta()
|
||||||
|
if not pl_meta or pl_meta:get_int("autobahn_isactive") ~= 1 then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
local function set_player_privs(player)
|
||||||
|
local physics = player:get_physics_override()
|
||||||
|
local meta = player:get_meta()
|
||||||
|
if meta and physics then
|
||||||
|
-- store the player privs default values
|
||||||
|
meta:set_int("autobahn_speed", physics.speed)
|
||||||
|
-- set operator privs
|
||||||
|
meta:set_int("autobahn_isactive", 1)
|
||||||
|
physics.speed = 3.5
|
||||||
|
minetest.sound_play("autobahn_motor", {
|
||||||
|
pos = player:get_pos(),
|
||||||
|
gain = 0.5,
|
||||||
|
max_hear_distance = 5,
|
||||||
|
})
|
||||||
|
-- write back
|
||||||
|
player:set_physics_override(physics)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function reset_player_privs(player)
|
||||||
|
local physics = player:get_physics_override()
|
||||||
|
local meta = player:get_meta()
|
||||||
|
if meta and physics then
|
||||||
|
-- restore the player privs default values
|
||||||
|
meta:set_int("autobahn_isactive", 0)
|
||||||
|
physics.speed = meta:get_int("autobahn_speed")
|
||||||
|
if physics.speed == 0 then physics.speed = 1 end
|
||||||
|
-- delete stored default values
|
||||||
|
meta:set_string("autobahn_speed", "")
|
||||||
|
-- write back
|
||||||
|
player:set_physics_override(physics)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
if is_active(player) then
|
||||||
|
reset_player_privs(player)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
if is_active(player) then
|
||||||
|
Currently_left_the_game[player:get_player_name()] = true
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
local function control_player(player)
|
||||||
|
local player_name = player:get_player_name()
|
||||||
|
if Currently_left_the_game[player_name] then
|
||||||
|
Currently_left_the_game[player_name] = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if player then
|
||||||
|
local pos = player:get_pos()
|
||||||
|
if pos then
|
||||||
|
--pos.y = math.floor(pos.y)
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
if string.sub(node.name,1,13) == "autobahn:node" then
|
||||||
|
minetest.after(0.5, control_player, player)
|
||||||
|
else
|
||||||
|
pos.y = pos.y - 1
|
||||||
|
node = minetest.get_node(pos)
|
||||||
|
if string.sub(node.name,1,13) == "autobahn:node" then
|
||||||
|
minetest.after(0.5, control_player, player)
|
||||||
|
else
|
||||||
|
reset_player_privs(player)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local NodeTbl1 = {
|
||||||
|
["autobahn:node1"] = true,
|
||||||
|
["autobahn:node2"] = true,
|
||||||
|
["autobahn:node3"] = true,
|
||||||
|
["autobahn:node4"] = true,
|
||||||
|
["autobahn:node12"] = true,
|
||||||
|
["autobahn:node22"] = true,
|
||||||
|
["autobahn:node32"] = true,
|
||||||
|
["autobahn:node42"] = true,
|
||||||
|
}
|
||||||
|
local NodeTbl2 = {
|
||||||
|
["autobahn:node11"] = true,
|
||||||
|
["autobahn:node21"] = true,
|
||||||
|
["autobahn:node31"] = true,
|
||||||
|
["autobahn:node41"] = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- 1) _o_
|
||||||
|
-- /\ [?] ==> 1
|
||||||
|
-- [T][T][S][S][S] T..tar
|
||||||
|
-- [S][S][S][S][S] S..sand
|
||||||
|
--
|
||||||
|
--
|
||||||
|
-- 2) _o_
|
||||||
|
-- /\ [1][?] ==> 2
|
||||||
|
-- [T][T][S][S][S]
|
||||||
|
-- [S][S][S][S][S]
|
||||||
|
--
|
||||||
|
--
|
||||||
|
-- 3) _o_
|
||||||
|
-- /\ [?] ==> 1
|
||||||
|
-- [S][S][S][T][T]
|
||||||
|
-- [S][S][S][S][S]
|
||||||
|
--
|
||||||
|
--
|
||||||
|
-- 4) _o_
|
||||||
|
-- /\ [?][1] ==> 2
|
||||||
|
-- [S][S][S][T][T]
|
||||||
|
-- [S][S][S][S][S]
|
||||||
|
|
||||||
|
local function update_node(pos)
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
local nnode
|
||||||
|
local npos
|
||||||
|
-- check case 1
|
||||||
|
facedir = (2 + node.param2) % 4
|
||||||
|
npos = vector.add(pos, Facedir2Dir[facedir])
|
||||||
|
npos.y = npos.y - 1
|
||||||
|
nnode = minetest.get_node(npos)
|
||||||
|
if NodeTbl1[nnode.name] then
|
||||||
|
node.name = node.name .. "1"
|
||||||
|
minetest.swap_node(pos, node)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- check case 2
|
||||||
|
npos.y = npos.y + 1
|
||||||
|
nnode = minetest.get_node(npos)
|
||||||
|
if NodeTbl2[nnode.name] then
|
||||||
|
node.name = string.sub(node.name,1,-1) .. "2"
|
||||||
|
minetest.swap_node(pos, node)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- check case 3
|
||||||
|
facedir = (0 + node.param2) % 4
|
||||||
|
npos = vector.add(pos, Facedir2Dir[facedir])
|
||||||
|
npos.y = npos.y - 1
|
||||||
|
nnode = minetest.get_node(npos)
|
||||||
|
if NodeTbl1[nnode.name] then
|
||||||
|
node.name = node.name .. "1"
|
||||||
|
node.param2 = 3
|
||||||
|
minetest.swap_node(pos, node)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- check case 4
|
||||||
|
npos.y = npos.y + 1
|
||||||
|
nnode = minetest.get_node(npos)
|
||||||
|
if NodeTbl2[nnode.name] then
|
||||||
|
node.name = string.sub(node.name,1,-1) .. "2"
|
||||||
|
node.param2 = 3
|
||||||
|
minetest.swap_node(pos, node)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function register_node(name, tiles, drawtype, mesh, box, drop)
|
||||||
|
minetest.register_node("autobahn:"..name, {
|
||||||
|
description = "Autobahn",
|
||||||
|
tiles = tiles,
|
||||||
|
drawtype = drawtype,
|
||||||
|
mesh = mesh,
|
||||||
|
selection_box = box,
|
||||||
|
collision_box = box,
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky=2, crumbly=2, not_in_creative_inventory=(mesh==nil) and 0 or 1},
|
||||||
|
drop = "autobahn:"..drop,
|
||||||
|
|
||||||
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||||
|
update_node(pos)
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_rightclick = function(pos, node, clicker)
|
||||||
|
if is_active(clicker) then
|
||||||
|
reset_player_privs(clicker)
|
||||||
|
else
|
||||||
|
set_player_privs(clicker)
|
||||||
|
minetest.after(0.5, control_player, clicker)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local sb1 = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
|
||||||
|
{-0.5, -0.375, -0.25, 0.5, -0.25, 0.5},
|
||||||
|
{-0.5, -0.25, 0, 0.5, -0.125, 0.5},
|
||||||
|
{-0.5, -0.125, 0.25, 0.5, 0, 0.5},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
local sb2 = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.5, -0.5, -0.5, 0.5, 0.125, 0.5},
|
||||||
|
{-0.5, 0.125, -0.25, 0.5, 0.25, 0.5},
|
||||||
|
{-0.5, 0.25, 0, 0.5, 0.375, 0.5},
|
||||||
|
{-0.5, 0.375, 0.25, 0.5, 0.5, 0.5},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local Nodes = {
|
||||||
|
{name="node1", tiles={"autobahn1.png"}, drawtype="normal", mesh=nil, box=nil, drop="node1"},
|
||||||
|
{name="node2", tiles={"autobahn2.png","autobahn1.png"}, drawtype="normal", mesh=nil, box=nil, drop="node2"},
|
||||||
|
{name="node3", tiles={"autobahn3.png","autobahn1.png"}, drawtype="normal", mesh=nil, box=nil, drop="node3"},
|
||||||
|
{name="node4", tiles={"autobahn2.png^[transformR180]","autobahn1.png"}, drawtype="normal", mesh=nil, box=nil, drop="node4"},
|
||||||
|
{name="node5", tiles={"autobahn4.png^[transformR90]","autobahn1.png"}, drawtype="normal", mesh=nil, box=nil, drop="node5"},
|
||||||
|
{name="node6", tiles={"autobahn5.png^[transformR90]","autobahn1.png"}, drawtype="normal", mesh=nil, box=nil, drop="node6"},
|
||||||
|
|
||||||
|
{name="node11", tiles={"autobahn1.png"}, drawtype="mesh", mesh="autobahn_ramp1.obj", box=sb1, drop="node1"},
|
||||||
|
{name="node21", tiles={"autobahn2.png","autobahn1.png"}, drawtype="mesh", mesh="autobahn_ramp1.obj", box=sb1, drop="node2"},
|
||||||
|
{name="node31", tiles={"autobahn3.png","autobahn1.png"}, drawtype="mesh", mesh="autobahn_ramp1.obj", box=sb1, drop="node3"},
|
||||||
|
{name="node41", tiles={"autobahn2.png^[transformR180]","autobahn1.png"}, drawtype="mesh", mesh="autobahn_ramp1.obj", box=sb1, drop="node4"},
|
||||||
|
|
||||||
|
{name="node12", tiles={"autobahn1.png"}, drawtype="mesh", mesh="autobahn_ramp2.obj", box=sb2, drop="node1"},
|
||||||
|
{name="node22", tiles={"autobahn2.png","autobahn1.png"}, drawtype="mesh", mesh="autobahn_ramp2.obj", box=sb2, drop="node2"},
|
||||||
|
{name="node32", tiles={"autobahn3.png","autobahn1.png"}, drawtype="mesh", mesh="autobahn_ramp2.obj", box=sb2, drop="node3"},
|
||||||
|
{name="node42", tiles={"autobahn2.png^[transformR180]","autobahn1.png"}, drawtype="mesh", mesh="autobahn_ramp2.obj", box=sb2, drop="node4"},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _,item in ipairs(Nodes) do
|
||||||
|
register_node(item.name, item.tiles, item.drawtype, item.mesh, item.box, item.drop)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_craftitem("autobahn:stripes", {
|
||||||
|
description = "Autobahn Stripe",
|
||||||
|
inventory_image = 'autobahn_stripes.png',
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
if minetest.global_exists("techage") then
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "autobahn:node1 9",
|
||||||
|
recipe = {
|
||||||
|
{"techage:sieved_basalt_gravel", "techage:sieved_basalt_gravel", "techage:sieved_basalt_gravel"},
|
||||||
|
{"techage:sieved_basalt_gravel", "techage:ta3_barrel_bitumen", "techage:sieved_basalt_gravel"},
|
||||||
|
{"techage:sieved_basalt_gravel", "techage:sieved_basalt_gravel", "techage:sieved_basalt_gravel"},
|
||||||
|
},
|
||||||
|
replacements = {{"techage:ta3_barrel_bitumen", "techage:ta3_barrel_empty"}},
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "autobahn:node1 9",
|
||||||
|
recipe = {
|
||||||
|
{"techage:sieved_gravel", "techage:sieved_gravel", "techage:sieved_gravel"},
|
||||||
|
{"techage:sieved_gravel", "techage:ta3_barrel_bitumen", "techage:sieved_gravel"},
|
||||||
|
{"techage:sieved_gravel", "techage:sieved_gravel", "techage:sieved_gravel"},
|
||||||
|
},
|
||||||
|
replacements = {{"techage:ta3_barrel_bitumen", "techage:ta3_barrel_empty"}},
|
||||||
|
})
|
||||||
|
elseif minetest.global_exists("moreblocks") then
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "autobahn:node1 4",
|
||||||
|
recipe = {
|
||||||
|
{"moreblocks:tar", "moreblocks:tar"},
|
||||||
|
{"default:cobble", "default:cobble"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "autobahn:stripes 8",
|
||||||
|
recipe = {
|
||||||
|
{"dye:white"},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "autobahn:node2",
|
||||||
|
recipe = {
|
||||||
|
{"", "", "autobahn:stripes"},
|
||||||
|
{"", "autobahn:node1", ""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "autobahn:node3",
|
||||||
|
recipe = {
|
||||||
|
{"", "autobahn:stripes", ""},
|
||||||
|
{"", "autobahn:node1", ""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "autobahn:node4",
|
||||||
|
recipe = {
|
||||||
|
{"autobahn:stripes", "", ""},
|
||||||
|
{"", "autobahn:node1", ""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "autobahn:node5",
|
||||||
|
recipe = {
|
||||||
|
{"", "", ""},
|
||||||
|
{"autobahn:stripes", "autobahn:node1", ""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "autobahn:node6",
|
||||||
|
recipe = {
|
||||||
|
{"", "autobahn:stripes", ""},
|
||||||
|
{"autobahn:stripes", "autobahn:node1", ""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if minetest.global_exists("minecart") then
|
||||||
|
minecart.register_protected_node("autobahn:node1")
|
||||||
|
minecart.register_protected_node("autobahn:node2")
|
||||||
|
minecart.register_protected_node("autobahn:node3")
|
||||||
|
minecart.register_protected_node("autobahn:node4")
|
||||||
|
minecart.register_protected_node("autobahn:node5")
|
||||||
|
minecart.register_protected_node("autobahn:node6")
|
||||||
|
minecart.register_protected_node("autobahn:node11")
|
||||||
|
minecart.register_protected_node("autobahn:node21")
|
||||||
|
minecart.register_protected_node("autobahn:node31")
|
||||||
|
minecart.register_protected_node("autobahn:node41")
|
||||||
|
minecart.register_protected_node("autobahn:node12")
|
||||||
|
minecart.register_protected_node("autobahn:node22")
|
||||||
|
minecart.register_protected_node("autobahn:node32")
|
||||||
|
minecart.register_protected_node("autobahn:node42")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
-- External API functions
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- Returns true if player is "driving" on the autobahn
|
||||||
|
-- func autobahn.is_driving(player)
|
||||||
|
autobahn.is_driving = is_active
|
1
autobahn/mod.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
name=autobahn
|
56
autobahn/models/autobahn_ramp1.obj
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
g top
|
||||||
|
v 0.500000 -0.000000 0.500000
|
||||||
|
v -0.500000 -0.000000 0.500000
|
||||||
|
v -0.500000 -0.500000 -0.500000
|
||||||
|
v 0.500000 -0.500000 -0.500000
|
||||||
|
vt 1.0000 1.0000
|
||||||
|
vt 0.0000 1.0000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vn 0.0000 0.8944 -0.4472
|
||||||
|
s off
|
||||||
|
f 2/1/1 1/2/1 4/3/1 3/4/1
|
||||||
|
g bottom
|
||||||
|
v -0.500000 -0.500000 0.500000
|
||||||
|
v 0.500000 -0.500000 0.500000
|
||||||
|
v -0.500000 -0.500000 -0.500000
|
||||||
|
v 0.500000 -0.500000 -0.500000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vt 1.0000 1.0000
|
||||||
|
vt 0.0000 1.0000
|
||||||
|
vn 0.0000 -1.0000 -0.0000
|
||||||
|
s off
|
||||||
|
f 6/5/2 5/6/2 7/7/2 8/8/2
|
||||||
|
g right
|
||||||
|
v -0.500000 -0.000000 0.500000
|
||||||
|
v -0.500000 -0.500000 0.500000
|
||||||
|
v -0.500000 -0.500000 -0.500000
|
||||||
|
vt 1.0000 0.5000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vn -1.0000 0.0000 0.0000
|
||||||
|
s off
|
||||||
|
f 9/9/3 11/10/3 10/11/3
|
||||||
|
g left
|
||||||
|
v 0.500000 -0.000000 0.500000
|
||||||
|
v 0.500000 -0.500000 0.500000
|
||||||
|
v 0.500000 -0.500000 -0.500000
|
||||||
|
vt 0.0000 0.5000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vn 1.0000 0.0000 0.0000
|
||||||
|
s off
|
||||||
|
f 12/12/4 13/13/4 14/14/4
|
||||||
|
g back
|
||||||
|
v 0.500000 -0.000000 0.500000
|
||||||
|
v -0.500000 -0.000000 0.500000
|
||||||
|
v -0.500000 -0.500000 0.500000
|
||||||
|
v 0.500000 -0.500000 0.500000
|
||||||
|
vt 1.0000 0.5000
|
||||||
|
vt 0.0000 0.5000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vn 0.0000 -0.0000 1.0000
|
||||||
|
s off
|
||||||
|
f 15/15/5 16/16/5 17/17/5 18/18/5
|
72
autobahn/models/autobahn_ramp2.obj
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
g top
|
||||||
|
v -0.500000 0.500000 0.500000
|
||||||
|
v -0.500000 0.000000 -0.500000
|
||||||
|
v 0.500000 0.000000 -0.500000
|
||||||
|
v 0.500000 0.500000 0.500000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vt 1.0000 1.0000
|
||||||
|
vt 0.0000 1.0000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vn 0.0000 0.8944 -0.4472
|
||||||
|
s off
|
||||||
|
f 2/1/1 1/2/1 4/3/1 3/4/1
|
||||||
|
g bottom
|
||||||
|
v -0.500000 -0.500000 -0.500000
|
||||||
|
v -0.500000 -0.500000 0.500000
|
||||||
|
v 0.500000 -0.500000 -0.500000
|
||||||
|
v 0.500000 -0.500000 0.500000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vt 1.0000 1.0000
|
||||||
|
vt 0.0000 1.0000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vn 0.0000 -1.0000 -0.0000
|
||||||
|
s off
|
||||||
|
f 6/5/2 5/6/2 7/7/2 8/8/2
|
||||||
|
g right
|
||||||
|
v -0.500000 0.500000 0.500000
|
||||||
|
v -0.500000 0.000000 -0.500000
|
||||||
|
v -0.500000 -0.500000 -0.500000
|
||||||
|
v -0.500000 -0.500000 0.500000
|
||||||
|
vt 1.0000 1.0000
|
||||||
|
vt 0.0000 0.5000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vn -1.0000 0.0000 0.0000
|
||||||
|
s off
|
||||||
|
f 9/9/3 10/10/3 11/11/3 12/12/3
|
||||||
|
g left
|
||||||
|
v 0.500000 0.000000 -0.500000
|
||||||
|
v 0.500000 -0.500000 -0.500000
|
||||||
|
v 0.500000 0.500000 0.500000
|
||||||
|
v 0.500000 -0.500000 0.500000
|
||||||
|
vt 1.0000 0.5000
|
||||||
|
vt 0.0000 1.0000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vn 1.0000 0.0000 0.0000
|
||||||
|
s off
|
||||||
|
f 13/13/4 15/14/4 16/15/4 14/16/4
|
||||||
|
g back
|
||||||
|
v -0.500000 0.500000 0.500000
|
||||||
|
v -0.500000 -0.500000 0.500000
|
||||||
|
v 0.500000 0.500000 0.500000
|
||||||
|
v 0.500000 -0.500000 0.500000
|
||||||
|
vt 1.0000 1.0000
|
||||||
|
vt 0.0000 1.0000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vn 0.0000 -0.0000 1.0000
|
||||||
|
s off
|
||||||
|
f 19/17/5 17/18/5 18/19/5 20/20/5
|
||||||
|
g front
|
||||||
|
v -0.500000 0.000000 -0.500000
|
||||||
|
v -0.500000 -0.500000 -0.500000
|
||||||
|
v 0.500000 0.000000 -0.500000
|
||||||
|
v 0.500000 -0.500000 -0.500000
|
||||||
|
vt 1.0000 0.5000
|
||||||
|
vt 0.0000 0.5000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vn 0.0000 0.0000 -1.0000
|
||||||
|
s off
|
||||||
|
f 21/21/6 23/22/6 24/23/6 22/24/6
|
BIN
autobahn/screenshot.png
Normal file
After Width: | Height: | Size: 734 KiB |
BIN
autobahn/sounds/autobahn_motor.ogg
Normal file
BIN
autobahn/textures/autobahn1.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
autobahn/textures/autobahn2.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
autobahn/textures/autobahn3.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
autobahn/textures/autobahn4.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
autobahn/textures/autobahn5.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
autobahn/textures/autobahn_stripes.png
Normal file
After Width: | Height: | Size: 631 B |
600
basic_materials/LICENSE
Normal file
@ -0,0 +1,600 @@
|
|||||||
|
License for code: LGPL 3.0
|
||||||
|
License for media and all other assets: CC-by-SA 4.0
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
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 that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU 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 as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
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.
|
86
basic_materials/electrical-electronic.lua
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
-- Translation support
|
||||||
|
local S = minetest.get_translator("basic_materials")
|
||||||
|
|
||||||
|
-- items
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:silicon", {
|
||||||
|
description = S("Silicon lump"),
|
||||||
|
inventory_image = "basic_materials_silicon.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:ic", {
|
||||||
|
description = S("Simple Integrated Circuit"),
|
||||||
|
inventory_image = "basic_materials_ic.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:motor", {
|
||||||
|
description = S("Simple Motor"),
|
||||||
|
inventory_image = "basic_materials_motor.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:heating_element", {
|
||||||
|
description = S("Heating element"),
|
||||||
|
inventory_image = "basic_materials_heating_element.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:energy_crystal_simple", {
|
||||||
|
description = S("Simple energy crystal"),
|
||||||
|
inventory_image = "basic_materials_energy_crystal.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- crafts
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "mesecons_materials:silicon 4",
|
||||||
|
recipe = {
|
||||||
|
{ "default:sand", "default:sand" },
|
||||||
|
{ "default:sand", "default:steel_ingot" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:ic 4",
|
||||||
|
recipe = {
|
||||||
|
{ "mesecons_materials:silicon", "mesecons_materials:silicon" },
|
||||||
|
{ "mesecons_materials:silicon", "default:copper_ingot" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:motor 2",
|
||||||
|
recipe = {
|
||||||
|
{ "default:mese_crystal_fragment", "basic_materials:copper_wire", "basic_materials:plastic_sheet" },
|
||||||
|
{ "default:copper_ingot", "default:steel_ingot", "default:steel_ingot" },
|
||||||
|
{ "default:mese_crystal_fragment", "basic_materials:copper_wire", "basic_materials:plastic_sheet" }
|
||||||
|
},
|
||||||
|
replacements = {
|
||||||
|
{ "basic_materials:copper_wire", "basic_materials:empty_spool" },
|
||||||
|
{ "basic_materials:copper_wire", "basic_materials:empty_spool" },
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:heating_element 2",
|
||||||
|
recipe = {
|
||||||
|
{ "default:copper_ingot", "default:mese_crystal_fragment", "default:copper_ingot" }
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
--type = "shapeless",
|
||||||
|
output = "basic_materials:energy_crystal_simple 2",
|
||||||
|
recipe = {
|
||||||
|
{ "default:mese_crystal_fragment", "default:torch", "default:mese_crystal_fragment" },
|
||||||
|
{ "default:diamond", "default:gold_ingot", "default:diamond" }
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- aliases
|
||||||
|
|
||||||
|
minetest.register_alias("homedecor:ic", "basic_materials:ic")
|
||||||
|
minetest.register_alias("homedecor:motor", "basic_materials:motor")
|
||||||
|
minetest.register_alias("technic:motor", "basic_materials:motor")
|
||||||
|
minetest.register_alias("homedecor:heating_element", "basic_materials:heating_element")
|
||||||
|
minetest.register_alias("homedecor:power_crystal", "basic_materials:energy_crystal_simple")
|
||||||
|
|
||||||
|
minetest.register_alias_force("mesecons_materials:silicon", "basic_materials:silicon")
|
14
basic_materials/init.lua
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
-- Basic materials mod
|
||||||
|
-- by Vanessa Dannenberg
|
||||||
|
|
||||||
|
-- This mod supplies all those little random craft items that everyone always
|
||||||
|
-- seems to need, such as metal bars (ala rebar), plastic, wire, and so on.
|
||||||
|
|
||||||
|
local modpath = minetest.get_modpath("basic_materials")
|
||||||
|
|
||||||
|
basic_materials = {}
|
||||||
|
|
||||||
|
dofile(modpath.."/metals.lua")
|
||||||
|
dofile(modpath.."/plastics.lua")
|
||||||
|
dofile(modpath.."/electrical-electronic.lua")
|
||||||
|
dofile(modpath.."/misc.lua")
|
33
basic_materials/locale/basic_materials.de.tr
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# textdomain: basic_materials
|
||||||
|
Silicon lump=Silikonklumpen
|
||||||
|
Simple Integrated Circuit=einfacher Integrierter Schaltkreis
|
||||||
|
Simple Motor=einfacher Motor
|
||||||
|
Heating element=Heizelement
|
||||||
|
Simple energy crystal=einfacher Energiekristall
|
||||||
|
|
||||||
|
Spool of steel wire=Spule mit Stahldraht
|
||||||
|
Spool of copper wire=Spule mit Kupferdraht
|
||||||
|
Spool of silver wire=Spule mit Silberdraht
|
||||||
|
Spool of gold wire=Spule mit Golddraht
|
||||||
|
Steel Strip=Stahlstreifen
|
||||||
|
Copper Strip=Kupferstreifen
|
||||||
|
Steel Bar=Stahlstab
|
||||||
|
Chainlinks (brass)=Messing-Kettenglieder
|
||||||
|
Chainlinks (steel)=Stahl-Kettenglieder
|
||||||
|
Brass Ingot=Messingbarren
|
||||||
|
Steel gear=Stahlzahnrad
|
||||||
|
Padlock=Vorhängeschloss
|
||||||
|
Chain (steel, hanging)=Stahlkette
|
||||||
|
Chain (brass, hanging)=Messingkette
|
||||||
|
Brass Block=Messingblock
|
||||||
|
|
||||||
|
Oil extract=raffiniertes Öl
|
||||||
|
Unprocessed paraffin=unbearbeitetes Paraffin
|
||||||
|
Uncooked Terracotta Base=ungebranntes Terrakotta
|
||||||
|
Wet Cement=nasser Zement
|
||||||
|
Cement=Zement
|
||||||
|
Concrete Block=Betonblock
|
||||||
|
|
||||||
|
Plastic sheet=Kunststoffplatte
|
||||||
|
Plastic strips=Kunststoffstreifen
|
||||||
|
Empty wire spool=leere Drahtspule
|
33
basic_materials/locale/basic_materials.fr.tr
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# textdomain: basic_materials
|
||||||
|
Silicon lump=Morceau de silicium
|
||||||
|
Simple Integrated Circuit=Circuit intégré simple
|
||||||
|
Simple Motor=Moteur simple
|
||||||
|
Heating element=Élément chauffant
|
||||||
|
Simple energy crystal=Cristal d’énergie simple
|
||||||
|
|
||||||
|
Spool of steel wire=Bobine de fil d’acier
|
||||||
|
Spool of copper wire=Bobine de fil de cuivre
|
||||||
|
Spool of silver wire=Bobine de fil d’argent
|
||||||
|
Spool of gold wire=Bobine de fil d’or
|
||||||
|
Steel Strip=Bande de acier
|
||||||
|
Copper Strip=Bande de cuivre
|
||||||
|
Steel Bar=Barre d’acier
|
||||||
|
Chainlinks (brass)=Maillon en laiton
|
||||||
|
Chainlinks (steel)=Maillon en acier
|
||||||
|
Brass Ingot=Lingot de laiton
|
||||||
|
Steel gear=Rouage en acier
|
||||||
|
Padlock=Cadenas
|
||||||
|
Chain (steel, hanging)=Chaine en acier
|
||||||
|
Chain (brass, hanging)=Chaine en laiton
|
||||||
|
Brass Block=Bloc de laiton
|
||||||
|
|
||||||
|
Oil extract=Extrait d’huile
|
||||||
|
Unprocessed paraffin=Paraffine non transformée
|
||||||
|
Uncooked Terracotta Base=Argile crue
|
||||||
|
Wet Cement=Ciment humide
|
||||||
|
Cement=Ciment
|
||||||
|
Concrete Block=Bloc de béton
|
||||||
|
|
||||||
|
Plastic sheet=Morceau de plastique
|
||||||
|
Plastic strips=Bande de plastique
|
||||||
|
Empty wire spool=Bobine de fil vide
|
33
basic_materials/locale/basic_materials.ru.tr
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# textdomain: basic_materials
|
||||||
|
Silicon lump=Кусок Кремния
|
||||||
|
Simple Integrated Circuit=Микросхема
|
||||||
|
Simple Motor=Мотор
|
||||||
|
Heating element=Нить Накала
|
||||||
|
Simple energy crystal=Энергетический Кристалл
|
||||||
|
|
||||||
|
Spool of steel wire=Катушка Стальной Проволоки
|
||||||
|
Spool of copper wire=Катушка Медной Проволоки
|
||||||
|
Spool of silver wire=Катушка Серебрянной Проволоки
|
||||||
|
Spool of gold wire=Катушка Золотой Проволоки
|
||||||
|
Steel Strip=Стальная Полоса
|
||||||
|
Copper Strip=Медная Полоса
|
||||||
|
Steel Bar=Стальной Прут
|
||||||
|
Chainlinks (brass)=Латунные Звенья
|
||||||
|
Chainlinks (steel)=Стальные Звенья
|
||||||
|
Brass Ingot=Латунный Брусок
|
||||||
|
Steel gear=Стальная Шестерня
|
||||||
|
Padlock=Навесной Замок
|
||||||
|
Chain (steel, hanging)=Стальная Цепь
|
||||||
|
Chain (brass, hanging)=Латунная Цепь
|
||||||
|
Brass Block=Латунный Блок
|
||||||
|
|
||||||
|
Oil extract=Масляный Экстракт
|
||||||
|
Unprocessed paraffin=Необработанный Парафин
|
||||||
|
Uncooked Terracotta Base=Ком Мокрого Терракота
|
||||||
|
Wet Cement=Ком Мокрого Цемента
|
||||||
|
Cement=Цемент
|
||||||
|
Concrete Block=Железобетон
|
||||||
|
|
||||||
|
Plastic sheet=Пластиковый Лист
|
||||||
|
Plastic strips=Пластиковая Полоса
|
||||||
|
Empty wire spool=Пустая Катушка
|
300
basic_materials/metals.lua
Normal file
@ -0,0 +1,300 @@
|
|||||||
|
-- Translation support
|
||||||
|
local S = minetest.get_translator("basic_materials")
|
||||||
|
|
||||||
|
-- items
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:steel_wire", {
|
||||||
|
description = S("Spool of steel wire"),
|
||||||
|
inventory_image = "basic_materials_steel_wire.png"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:copper_wire", {
|
||||||
|
description = S("Spool of copper wire"),
|
||||||
|
inventory_image = "basic_materials_copper_wire.png"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:silver_wire", {
|
||||||
|
description = S("Spool of silver wire"),
|
||||||
|
inventory_image = "basic_materials_silver_wire.png"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:gold_wire", {
|
||||||
|
description = S("Spool of gold wire"),
|
||||||
|
inventory_image = "basic_materials_gold_wire.png"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:steel_strip", {
|
||||||
|
description = S("Steel Strip"),
|
||||||
|
inventory_image = "basic_materials_steel_strip.png"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:copper_strip", {
|
||||||
|
description = S("Copper Strip"),
|
||||||
|
inventory_image = "basic_materials_copper_strip.png"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:steel_bar", {
|
||||||
|
description = S("Steel Bar"),
|
||||||
|
inventory_image = "basic_materials_steel_bar.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:chainlink_brass", {
|
||||||
|
description = S("Chainlinks (brass)"),
|
||||||
|
inventory_image = "basic_materials_chainlink_brass.png"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:chainlink_steel", {
|
||||||
|
description = S("Chainlinks (steel)"),
|
||||||
|
inventory_image = "basic_materials_chainlink_steel.png"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:brass_ingot", {
|
||||||
|
description = S("Brass Ingot"),
|
||||||
|
inventory_image = "basic_materials_brass_ingot.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:gear_steel", {
|
||||||
|
description = S("Steel gear"),
|
||||||
|
inventory_image = "basic_materials_gear_steel.png"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:padlock", {
|
||||||
|
description = S("Padlock"),
|
||||||
|
inventory_image = "basic_materials_padlock.png"
|
||||||
|
})
|
||||||
|
|
||||||
|
-- nodes
|
||||||
|
|
||||||
|
local chains_sbox = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = { -0.1, -0.5, -0.1, 0.1, 0.5, 0.1 }
|
||||||
|
}
|
||||||
|
|
||||||
|
local topchains_sbox = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -0.25, 0.35, -0.25, 0.25, 0.5, 0.25 },
|
||||||
|
{ -0.1, -0.5, -0.1, 0.1, 0.4, 0.1 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
minetest.register_node("basic_materials:chain_steel", {
|
||||||
|
description = S("Chain (steel, hanging)"),
|
||||||
|
drawtype = "mesh",
|
||||||
|
mesh = "basic_materials_chains.obj",
|
||||||
|
tiles = {"basic_materials_chain_steel.png"},
|
||||||
|
walkable = false,
|
||||||
|
climbable = true,
|
||||||
|
sunlight_propagates = true,
|
||||||
|
paramtype = "light",
|
||||||
|
inventory_image = "basic_materials_chain_steel_inv.png",
|
||||||
|
groups = {cracky=3},
|
||||||
|
selection_box = chains_sbox,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("basic_materials:chain_brass", {
|
||||||
|
description = S("Chain (brass, hanging)"),
|
||||||
|
drawtype = "mesh",
|
||||||
|
mesh = "basic_materials_chains.obj",
|
||||||
|
tiles = {"basic_materials_chain_brass.png"},
|
||||||
|
walkable = false,
|
||||||
|
climbable = true,
|
||||||
|
sunlight_propagates = true,
|
||||||
|
paramtype = "light",
|
||||||
|
inventory_image = "basic_materials_chain_brass_inv.png",
|
||||||
|
groups = {cracky=3},
|
||||||
|
selection_box = chains_sbox,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("basic_materials:brass_block", {
|
||||||
|
description = S("Brass Block"),
|
||||||
|
tiles = { "basic_materials_brass_block.png" },
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky=1, level=2},
|
||||||
|
sounds = default.node_sound_metal_defaults()
|
||||||
|
})
|
||||||
|
|
||||||
|
-- crafts
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:copper_wire 2",
|
||||||
|
type = "shapeless",
|
||||||
|
recipe = {
|
||||||
|
"default:copper_ingot",
|
||||||
|
"basic_materials:empty_spool",
|
||||||
|
"basic_materials:empty_spool",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:silver_wire 2",
|
||||||
|
type = "shapeless",
|
||||||
|
recipe = {
|
||||||
|
"moreores:silver_ingot",
|
||||||
|
"basic_materials:empty_spool",
|
||||||
|
"basic_materials:empty_spool",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:gold_wire 2",
|
||||||
|
type = "shapeless",
|
||||||
|
recipe = {
|
||||||
|
"default:gold_ingot",
|
||||||
|
"basic_materials:empty_spool",
|
||||||
|
"basic_materials:empty_spool",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:steel_wire 2",
|
||||||
|
type = "shapeless",
|
||||||
|
recipe = {
|
||||||
|
"default:steel_ingot",
|
||||||
|
"basic_materials:empty_spool",
|
||||||
|
"basic_materials:empty_spool",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:steel_strip 12",
|
||||||
|
recipe = {
|
||||||
|
{ "", "default:steel_ingot", "" },
|
||||||
|
{ "default:steel_ingot", "", "" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:copper_strip 12",
|
||||||
|
recipe = {
|
||||||
|
{ "", "default:copper_ingot", "" },
|
||||||
|
{ "default:copper_ingot", "", "" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:steel_bar 6",
|
||||||
|
recipe = {
|
||||||
|
{ "", "", "default:steel_ingot" },
|
||||||
|
{ "", "default:steel_ingot", "" },
|
||||||
|
{ "default:steel_ingot", "", "" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:padlock 2",
|
||||||
|
recipe = {
|
||||||
|
{ "basic_materials:steel_bar" },
|
||||||
|
{ "default:steel_ingot" },
|
||||||
|
{ "default:steel_ingot" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "basic_materials:chainlink_steel 12",
|
||||||
|
recipe = {
|
||||||
|
{"", "default:steel_ingot", "default:steel_ingot"},
|
||||||
|
{ "default:steel_ingot", "", "default:steel_ingot" },
|
||||||
|
{ "default:steel_ingot", "default:steel_ingot", "" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "basic_materials:chainlink_brass 12",
|
||||||
|
recipe = {
|
||||||
|
{"", "basic_materials:brass_ingot", "basic_materials:brass_ingot"},
|
||||||
|
{ "basic_materials:brass_ingot", "", "basic_materials:brass_ingot" },
|
||||||
|
{ "basic_materials:brass_ingot", "basic_materials:brass_ingot", "" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'basic_materials:chain_steel 2',
|
||||||
|
recipe = {
|
||||||
|
{"basic_materials:chainlink_steel"},
|
||||||
|
{"basic_materials:chainlink_steel"},
|
||||||
|
{"basic_materials:chainlink_steel"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'basic_materials:chain_brass 2',
|
||||||
|
recipe = {
|
||||||
|
{"basic_materials:chainlink_brass"},
|
||||||
|
{"basic_materials:chainlink_brass"},
|
||||||
|
{"basic_materials:chainlink_brass"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:gear_steel 6",
|
||||||
|
recipe = {
|
||||||
|
{ "", "default:steel_ingot", "" },
|
||||||
|
{ "default:steel_ingot","basic_materials:chainlink_steel", "default:steel_ingot" },
|
||||||
|
{ "", "default:steel_ingot", "" }
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
type = "shapeless",
|
||||||
|
output = "basic_materials:brass_ingot 3",
|
||||||
|
recipe = {
|
||||||
|
"default:copper_ingot",
|
||||||
|
"default:copper_ingot",
|
||||||
|
"moreores:silver_ingot",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
if not minetest.get_modpath("moreores") then
|
||||||
|
-- Without moreores, there still should be a way to create brass.
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:brass_ingot 9",
|
||||||
|
recipe = {
|
||||||
|
{"default:copper_ingot", "default:tin_ingot", "default:copper_ingot"},
|
||||||
|
{"default:gold_ingot", "default:copper_ingot", "default:gold_ingot"},
|
||||||
|
{"default:copper_ingot", "default:tin_ingot", "default:copper_ingot"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
type = "shapeless",
|
||||||
|
output = "basic_materials:brass_ingot 9",
|
||||||
|
recipe = { "basic_materials:brass_block" },
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:brass_block",
|
||||||
|
recipe = {
|
||||||
|
{ "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" },
|
||||||
|
{ "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" },
|
||||||
|
{ "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- aliases
|
||||||
|
|
||||||
|
minetest.register_alias("homedecor:copper_wire", "basic_materials:copper_wire")
|
||||||
|
minetest.register_alias("technic:fine_copper_wire", "basic_materials:copper_wire")
|
||||||
|
minetest.register_alias("technic:fine_silver_wire", "basic_materials:silver_wire")
|
||||||
|
minetest.register_alias("technic:fine_gold_wire", "basic_materials:gold_wire")
|
||||||
|
|
||||||
|
minetest.register_alias("homedecor:steel_wire", "basic_materials:steel_wire")
|
||||||
|
|
||||||
|
minetest.register_alias("homedecor:brass_ingot", "basic_materials:brass_ingot")
|
||||||
|
minetest.register_alias("technic:brass_ingot", "basic_materials:brass_ingot")
|
||||||
|
minetest.register_alias("technic:brass_block", "basic_materials:brass_block")
|
||||||
|
|
||||||
|
minetest.register_alias("homedecor:copper_strip", "basic_materials:copper_strip")
|
||||||
|
minetest.register_alias("homedecor:steel_strip", "basic_materials:steel_strip")
|
||||||
|
|
||||||
|
minetest.register_alias_force("glooptest:chainlink", "basic_materials:chainlink_steel")
|
||||||
|
minetest.register_alias_force("homedecor:chainlink_steel", "basic_materials:chainlink_steel")
|
||||||
|
minetest.register_alias("homedecor:chainlink_brass", "basic_materials:chainlink_brass")
|
||||||
|
minetest.register_alias("chains:chain", "basic_materials:chain_steel")
|
||||||
|
minetest.register_alias("chains:chain_brass", "basic_materials:chain_brass")
|
||||||
|
|
||||||
|
minetest.register_alias("pipeworks:gear", "basic_materials:gear_steel")
|
||||||
|
|
||||||
|
minetest.register_alias("technic:rebar", "basic_materials:steel_bar")
|
||||||
|
|
126
basic_materials/misc.lua
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
-- Translation support
|
||||||
|
local S = minetest.get_translator("basic_materials")
|
||||||
|
|
||||||
|
-- items
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:oil_extract", {
|
||||||
|
description = S("Oil extract"),
|
||||||
|
inventory_image = "basic_materials_oil_extract.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:paraffin", {
|
||||||
|
description = S("Unprocessed paraffin"),
|
||||||
|
inventory_image = "basic_materials_paraffin.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:terracotta_base", {
|
||||||
|
description = S("Uncooked Terracotta Base"),
|
||||||
|
inventory_image = "basic_materials_terracotta_base.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:wet_cement", {
|
||||||
|
description = S("Wet Cement"),
|
||||||
|
inventory_image = "basic_materials_wet_cement.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- nodes
|
||||||
|
|
||||||
|
minetest.register_node("basic_materials:cement_block", {
|
||||||
|
description = S("Cement"),
|
||||||
|
tiles = {"basic_materials_cement_block.png"},
|
||||||
|
is_ground_content = true,
|
||||||
|
groups = {cracky=2},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("basic_materials:concrete_block", {
|
||||||
|
description = S("Concrete Block"),
|
||||||
|
tiles = {"basic_materials_concrete_block.png",},
|
||||||
|
groups = {cracky=1, level=2, concrete=1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
-- crafts
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "basic_materials:oil_extract 2",
|
||||||
|
recipe = {
|
||||||
|
"group:leaves",
|
||||||
|
"group:leaves",
|
||||||
|
"group:leaves",
|
||||||
|
"group:leaves",
|
||||||
|
"group:leaves",
|
||||||
|
"group:leaves"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "cooking",
|
||||||
|
output = "basic_materials:paraffin",
|
||||||
|
recipe = "basic_materials:oil_extract",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "basic_materials:oil_extract",
|
||||||
|
burntime = 30,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "basic_materials:paraffin",
|
||||||
|
burntime = 30,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
type = "shapeless",
|
||||||
|
output = "basic_materials:terracotta_base 8",
|
||||||
|
recipe = {
|
||||||
|
"bucket:bucket_water",
|
||||||
|
"default:clay_lump",
|
||||||
|
"default:gravel",
|
||||||
|
},
|
||||||
|
replacements = { {"bucket:bucket_water", "bucket:bucket_empty"}, },
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "basic_materials:wet_cement 3",
|
||||||
|
recipe = {
|
||||||
|
"default:dirt",
|
||||||
|
"dye:dark_grey",
|
||||||
|
"dye:dark_grey",
|
||||||
|
"dye:dark_grey",
|
||||||
|
"bucket:bucket_water"
|
||||||
|
},
|
||||||
|
replacements = {{'bucket:bucket_water', 'bucket:bucket_empty'},},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "cooking",
|
||||||
|
output = "basic_materials:cement_block",
|
||||||
|
recipe = "basic_materials:wet_cement",
|
||||||
|
cooktime = 8
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'basic_materials:concrete_block 6',
|
||||||
|
recipe = {
|
||||||
|
{'group:sand', 'basic_materials:wet_cement', 'default:gravel'},
|
||||||
|
{'basic_materials:steel_bar', 'basic_materials:wet_cement', 'basic_materials:steel_bar'},
|
||||||
|
{'default:gravel', 'basic_materials:wet_cement', 'group:sand'},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- aliases
|
||||||
|
|
||||||
|
minetest.register_alias("homedecor:oil_extract", "basic_materials:oil_extract")
|
||||||
|
minetest.register_alias("homedecor:paraffin", "basic_materials:paraffin")
|
||||||
|
minetest.register_alias("homedecor:plastic_base", "basic_materials:paraffin")
|
||||||
|
minetest.register_alias("homedecor:terracotta_base", "basic_materials:terracotta_base")
|
||||||
|
|
||||||
|
minetest.register_alias("gloopblocks:wet_cement", "basic_materials:wet_cement")
|
||||||
|
minetest.register_alias("gloopblocks:cement", "basic_materials:cement_block")
|
||||||
|
|
||||||
|
minetest.register_alias("technic:concrete", "basic_materials:concrete_block")
|
3
basic_materials/mod.conf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
name = basic_materials
|
||||||
|
depends = default
|
||||||
|
optional_depends = moreores
|
881
basic_materials/models/basic_materials_chains.obj
Normal file
@ -0,0 +1,881 @@
|
|||||||
|
# Blender v2.73 (sub 0) OBJ File: 'chains.blend'
|
||||||
|
# www.blender.org
|
||||||
|
o Torus.016_Torus
|
||||||
|
v 0.000000 -0.429978 0.000002
|
||||||
|
v 0.000000 -0.401109 0.055211
|
||||||
|
v -0.014044 -0.391975 0.048870
|
||||||
|
v -0.014044 -0.423304 0.000002
|
||||||
|
v -0.009826 -0.379748 0.040970
|
||||||
|
v -0.009826 -0.406012 0.000002
|
||||||
|
v 0.009826 -0.379748 0.040970
|
||||||
|
v 0.009826 -0.406012 0.000002
|
||||||
|
v 0.014044 -0.391975 0.048870
|
||||||
|
v 0.014044 -0.423304 0.000002
|
||||||
|
v 0.000000 -0.316336 0.080195
|
||||||
|
v -0.014044 -0.316336 0.069112
|
||||||
|
v -0.009826 -0.316336 0.057941
|
||||||
|
v 0.009826 -0.316336 0.057941
|
||||||
|
v 0.014044 -0.316336 0.069112
|
||||||
|
v 0.000000 -0.231564 0.055211
|
||||||
|
v -0.014044 -0.240700 0.048870
|
||||||
|
v -0.009826 -0.252925 0.040970
|
||||||
|
v 0.009826 -0.252925 0.040970
|
||||||
|
v 0.014044 -0.240700 0.048870
|
||||||
|
v 0.000000 -0.202695 0.000002
|
||||||
|
v -0.014044 -0.209368 0.000002
|
||||||
|
v -0.009826 -0.226661 0.000002
|
||||||
|
v 0.009826 -0.226661 0.000002
|
||||||
|
v 0.014044 -0.209368 0.000002
|
||||||
|
v 0.000000 -0.231564 -0.055206
|
||||||
|
v -0.014044 -0.240700 -0.048868
|
||||||
|
v -0.009826 -0.252925 -0.040967
|
||||||
|
v 0.009826 -0.252925 -0.040967
|
||||||
|
v 0.014044 -0.240700 -0.048865
|
||||||
|
v 0.000000 -0.316336 -0.080190
|
||||||
|
v -0.014044 -0.316336 -0.069108
|
||||||
|
v -0.009826 -0.316336 -0.057936
|
||||||
|
v 0.009826 -0.316336 -0.057936
|
||||||
|
v 0.014044 -0.316336 -0.069108
|
||||||
|
v 0.000000 -0.400361 -0.055206
|
||||||
|
v -0.014044 -0.391975 -0.048868
|
||||||
|
v -0.009826 -0.379748 -0.040967
|
||||||
|
v 0.009826 -0.379748 -0.040967
|
||||||
|
v 0.014044 -0.391975 -0.048868
|
||||||
|
v 0.000000 -0.262249 0.000002
|
||||||
|
v -0.061672 -0.233381 0.000002
|
||||||
|
v -0.054590 -0.224245 -0.012569
|
||||||
|
v 0.000000 -0.255577 -0.012569
|
||||||
|
v -0.045765 -0.212018 -0.008794
|
||||||
|
v 0.000000 -0.238285 -0.008794
|
||||||
|
v -0.045765 -0.212018 0.008798
|
||||||
|
v 0.000000 -0.238285 0.008798
|
||||||
|
v -0.054590 -0.224245 0.012574
|
||||||
|
v 0.000000 -0.255577 0.012574
|
||||||
|
v -0.089582 -0.148609 0.000002
|
||||||
|
v -0.077200 -0.148609 -0.012569
|
||||||
|
v -0.064722 -0.148609 -0.008794
|
||||||
|
v -0.064722 -0.148609 0.008799
|
||||||
|
v -0.077200 -0.148609 0.012574
|
||||||
|
v -0.061672 -0.063837 0.000002
|
||||||
|
v -0.054590 -0.072971 -0.012569
|
||||||
|
v -0.045765 -0.085198 -0.008794
|
||||||
|
v -0.045765 -0.085198 0.008799
|
||||||
|
v -0.054590 -0.072971 0.012574
|
||||||
|
v 0.000000 -0.034967 0.000002
|
||||||
|
v 0.000000 -0.041641 -0.012569
|
||||||
|
v 0.000000 -0.058933 -0.008794
|
||||||
|
v 0.000000 -0.058933 0.008799
|
||||||
|
v 0.000000 -0.041641 0.012574
|
||||||
|
v 0.061672 -0.063837 0.000002
|
||||||
|
v 0.054590 -0.072971 -0.012569
|
||||||
|
v 0.045765 -0.085198 -0.008794
|
||||||
|
v 0.045765 -0.085198 0.008799
|
||||||
|
v 0.054590 -0.072971 0.012574
|
||||||
|
v 0.089582 -0.148609 0.000002
|
||||||
|
v 0.077200 -0.148609 -0.012569
|
||||||
|
v 0.064722 -0.148609 -0.008794
|
||||||
|
v 0.064722 -0.148609 0.008799
|
||||||
|
v 0.077200 -0.148609 0.012574
|
||||||
|
v 0.061672 -0.232631 0.000002
|
||||||
|
v 0.054590 -0.224245 -0.012569
|
||||||
|
v 0.045765 -0.212018 -0.008794
|
||||||
|
v 0.045765 -0.212018 0.008798
|
||||||
|
v 0.054590 -0.224245 0.012574
|
||||||
|
v 0.000000 0.073316 0.000002
|
||||||
|
v 0.061672 0.102183 0.000002
|
||||||
|
v 0.054590 0.111319 0.012574
|
||||||
|
v 0.000000 0.079988 0.012574
|
||||||
|
v 0.045765 0.123546 0.008799
|
||||||
|
v 0.000000 0.097280 0.008799
|
||||||
|
v 0.045765 0.123546 -0.008794
|
||||||
|
v 0.000000 0.097280 -0.008794
|
||||||
|
v 0.054590 0.111319 -0.012569
|
||||||
|
v 0.000000 0.079988 -0.012569
|
||||||
|
v 0.089582 0.186956 0.000002
|
||||||
|
v 0.077200 0.186956 0.012574
|
||||||
|
v 0.064722 0.186956 0.008799
|
||||||
|
v 0.064722 0.186956 -0.008794
|
||||||
|
v 0.077200 0.186956 -0.012569
|
||||||
|
v 0.061672 0.271728 0.000002
|
||||||
|
v 0.054590 0.262594 0.012574
|
||||||
|
v 0.045765 0.250367 0.008799
|
||||||
|
v 0.045765 0.250367 -0.008794
|
||||||
|
v 0.054590 0.262594 -0.012569
|
||||||
|
v 0.000000 0.300597 0.000002
|
||||||
|
v 0.000000 0.293923 0.012574
|
||||||
|
v 0.000000 0.276631 0.008799
|
||||||
|
v 0.000000 0.276631 -0.008794
|
||||||
|
v 0.000000 0.293923 -0.012569
|
||||||
|
v -0.061672 0.271728 0.000002
|
||||||
|
v -0.054590 0.262594 0.012574
|
||||||
|
v -0.045765 0.250367 0.008799
|
||||||
|
v -0.045765 0.250367 -0.008794
|
||||||
|
v -0.054590 0.262594 -0.012569
|
||||||
|
v -0.089582 0.186956 0.000002
|
||||||
|
v -0.077200 0.186956 0.012574
|
||||||
|
v -0.064722 0.186956 0.008799
|
||||||
|
v -0.064722 0.186956 -0.008794
|
||||||
|
v -0.077200 0.186956 -0.012569
|
||||||
|
v -0.061672 0.102931 0.000002
|
||||||
|
v -0.054590 0.111319 0.012574
|
||||||
|
v -0.045765 0.123546 0.008799
|
||||||
|
v -0.045765 0.123546 -0.008794
|
||||||
|
v -0.054590 0.111319 -0.012569
|
||||||
|
v 0.000000 -0.095037 0.000002
|
||||||
|
v 0.000000 -0.066168 -0.055206
|
||||||
|
v 0.014044 -0.057034 -0.048868
|
||||||
|
v 0.014044 -0.088363 0.000002
|
||||||
|
v 0.009826 -0.044807 -0.040967
|
||||||
|
v 0.009826 -0.071071 0.000002
|
||||||
|
v -0.009826 -0.044807 -0.040967
|
||||||
|
v -0.009826 -0.071071 0.000002
|
||||||
|
v -0.014044 -0.057034 -0.048868
|
||||||
|
v -0.014044 -0.088363 0.000002
|
||||||
|
v 0.000000 0.018605 -0.080190
|
||||||
|
v 0.014044 0.018605 -0.069108
|
||||||
|
v 0.009826 0.018605 -0.057936
|
||||||
|
v -0.009826 0.018605 -0.057936
|
||||||
|
v -0.014044 0.018605 -0.069108
|
||||||
|
v 0.000000 0.103377 -0.055206
|
||||||
|
v 0.014044 0.094243 -0.048868
|
||||||
|
v 0.009826 0.082016 -0.040967
|
||||||
|
v -0.009826 0.082016 -0.040967
|
||||||
|
v -0.014044 0.094243 -0.048868
|
||||||
|
v 0.000000 0.132246 0.000002
|
||||||
|
v 0.014044 0.125572 0.000002
|
||||||
|
v 0.009826 0.108280 0.000002
|
||||||
|
v -0.009826 0.108280 0.000002
|
||||||
|
v -0.014044 0.125572 0.000002
|
||||||
|
v 0.000000 0.103377 0.055211
|
||||||
|
v 0.014044 0.094243 0.048870
|
||||||
|
v 0.009826 0.082016 0.040970
|
||||||
|
v -0.009826 0.082016 0.040970
|
||||||
|
v -0.014044 0.094243 0.048870
|
||||||
|
v 0.000000 0.018605 0.080195
|
||||||
|
v 0.014044 0.018605 0.069112
|
||||||
|
v 0.009826 0.018605 0.057941
|
||||||
|
v -0.009826 0.018605 0.057941
|
||||||
|
v -0.014044 0.018605 0.069112
|
||||||
|
v 0.000000 -0.065420 0.055211
|
||||||
|
v 0.014044 -0.057032 0.048870
|
||||||
|
v 0.009826 -0.044807 0.040970
|
||||||
|
v -0.009826 -0.044807 0.040970
|
||||||
|
v -0.014044 -0.057032 0.048870
|
||||||
|
v 0.000000 -0.598329 0.000002
|
||||||
|
v 0.061672 -0.569460 0.000002
|
||||||
|
v 0.054590 -0.560326 0.012574
|
||||||
|
v 0.000000 -0.591655 0.012574
|
||||||
|
v 0.045765 -0.548099 0.008798
|
||||||
|
v 0.000000 -0.574363 0.008798
|
||||||
|
v 0.045765 -0.548099 -0.008794
|
||||||
|
v 0.000000 -0.574363 -0.008794
|
||||||
|
v 0.054590 -0.560326 -0.012569
|
||||||
|
v 0.000000 -0.591655 -0.012569
|
||||||
|
v 0.089582 -0.484687 0.000002
|
||||||
|
v 0.077200 -0.484687 0.012574
|
||||||
|
v 0.064722 -0.484687 0.008798
|
||||||
|
v 0.064722 -0.484687 -0.008794
|
||||||
|
v 0.077200 -0.484687 -0.012569
|
||||||
|
v 0.061672 -0.399915 0.000002
|
||||||
|
v 0.054590 -0.409051 0.012574
|
||||||
|
v 0.045765 -0.421278 0.008798
|
||||||
|
v 0.045765 -0.421278 -0.008794
|
||||||
|
v 0.054590 -0.409051 -0.012569
|
||||||
|
v 0.000000 -0.371048 0.000002
|
||||||
|
v 0.000000 -0.377719 0.012574
|
||||||
|
v 0.000000 -0.395012 0.008798
|
||||||
|
v 0.000000 -0.395012 -0.008794
|
||||||
|
v 0.000000 -0.377719 -0.012569
|
||||||
|
v -0.061672 -0.399915 0.000002
|
||||||
|
v -0.054590 -0.409051 0.012574
|
||||||
|
v -0.045765 -0.421278 0.008798
|
||||||
|
v -0.045765 -0.421278 -0.008794
|
||||||
|
v -0.054590 -0.409051 -0.012569
|
||||||
|
v -0.089582 -0.484687 0.000002
|
||||||
|
v -0.077200 -0.484687 0.012574
|
||||||
|
v -0.064722 -0.484687 0.008798
|
||||||
|
v -0.064722 -0.484687 -0.008794
|
||||||
|
v -0.077200 -0.484687 -0.012569
|
||||||
|
v -0.061672 -0.568712 0.000002
|
||||||
|
v -0.054590 -0.560326 0.012574
|
||||||
|
v -0.045765 -0.548099 0.008798
|
||||||
|
v -0.045765 -0.548099 -0.008794
|
||||||
|
v -0.054590 -0.560326 -0.012569
|
||||||
|
v 0.000000 0.241043 0.000002
|
||||||
|
v 0.000000 0.269910 0.055211
|
||||||
|
v -0.014044 0.279047 0.048870
|
||||||
|
v -0.014044 0.247717 0.000002
|
||||||
|
v -0.009826 0.291274 0.040970
|
||||||
|
v -0.009826 0.265007 0.000002
|
||||||
|
v 0.009826 0.291274 0.040970
|
||||||
|
v 0.009826 0.265007 0.000002
|
||||||
|
v 0.014044 0.279047 0.048870
|
||||||
|
v 0.014044 0.247717 0.000002
|
||||||
|
v 0.000000 0.354683 0.080195
|
||||||
|
v -0.014044 0.354683 0.069112
|
||||||
|
v -0.009826 0.354683 0.057941
|
||||||
|
v 0.009826 0.354683 0.057941
|
||||||
|
v 0.014044 0.354683 0.069112
|
||||||
|
v 0.000000 0.439455 0.055211
|
||||||
|
v -0.014044 0.430321 0.048870
|
||||||
|
v -0.009826 0.418094 0.040970
|
||||||
|
v 0.009826 0.418094 0.040970
|
||||||
|
v 0.014044 0.430321 0.048870
|
||||||
|
v 0.000000 0.468325 0.000002
|
||||||
|
v -0.014044 0.461651 0.000002
|
||||||
|
v -0.009826 0.444361 0.000002
|
||||||
|
v 0.009826 0.444361 0.000002
|
||||||
|
v 0.014044 0.461651 0.000002
|
||||||
|
v 0.000000 0.439455 -0.055206
|
||||||
|
v -0.014044 0.430321 -0.048868
|
||||||
|
v -0.009826 0.418094 -0.040967
|
||||||
|
v 0.009826 0.418094 -0.040967
|
||||||
|
v 0.014044 0.430321 -0.048868
|
||||||
|
v 0.000000 0.354683 -0.080190
|
||||||
|
v -0.014044 0.354683 -0.069108
|
||||||
|
v -0.009826 0.354683 -0.057936
|
||||||
|
v 0.009826 0.354683 -0.057936
|
||||||
|
v 0.014044 0.354683 -0.069108
|
||||||
|
v 0.000000 0.270661 -0.055206
|
||||||
|
v -0.014044 0.279047 -0.048868
|
||||||
|
v -0.009826 0.291274 -0.040967
|
||||||
|
v 0.009826 0.291274 -0.040967
|
||||||
|
v 0.014044 0.279047 -0.048868
|
||||||
|
vt 0.187500 0.125000
|
||||||
|
vt 0.250000 0.125000
|
||||||
|
vt 0.250000 0.187500
|
||||||
|
vt 0.187500 0.187500
|
||||||
|
vt 0.250000 0.250000
|
||||||
|
vt 0.187500 0.250000
|
||||||
|
vt 0.250000 0.312500
|
||||||
|
vt 0.187500 0.312500
|
||||||
|
vt 0.250000 0.375000
|
||||||
|
vt 0.187500 0.375000
|
||||||
|
vt 0.187500 0.062500
|
||||||
|
vt 0.250000 0.062500
|
||||||
|
vt 0.312500 0.125000
|
||||||
|
vt 0.312500 0.187500
|
||||||
|
vt 0.312500 0.250000
|
||||||
|
vt 0.312500 0.312500
|
||||||
|
vt 0.312500 0.375000
|
||||||
|
vt 0.312500 0.062500
|
||||||
|
vt 0.375000 0.125000
|
||||||
|
vt 0.375000 0.187500
|
||||||
|
vt 0.375000 0.250000
|
||||||
|
vt 0.375000 0.312500
|
||||||
|
vt 0.375000 0.375000
|
||||||
|
vt 0.375000 0.062500
|
||||||
|
vt 0.437500 0.125000
|
||||||
|
vt 0.437500 0.187500
|
||||||
|
vt 0.437500 0.250000
|
||||||
|
vt 0.437500 0.312500
|
||||||
|
vt 0.437500 0.375000
|
||||||
|
vt 0.437500 0.062500
|
||||||
|
vt 0.500000 0.125000
|
||||||
|
vt 0.500000 0.187500
|
||||||
|
vt 0.500000 0.250000
|
||||||
|
vt 0.500000 0.312500
|
||||||
|
vt 0.500000 0.375000
|
||||||
|
vt 0.500000 0.062500
|
||||||
|
vt -0.000000 0.125000
|
||||||
|
vt 0.062500 0.125000
|
||||||
|
vt 0.062500 0.187500
|
||||||
|
vt -0.000000 0.187500
|
||||||
|
vt 0.062500 0.250000
|
||||||
|
vt -0.000000 0.250000
|
||||||
|
vt 0.062500 0.312500
|
||||||
|
vt -0.000000 0.312500
|
||||||
|
vt 0.062500 0.375000
|
||||||
|
vt -0.000000 0.375000
|
||||||
|
vt -0.000000 0.062500
|
||||||
|
vt 0.062500 0.062500
|
||||||
|
vt 0.125000 0.125000
|
||||||
|
vt 0.125000 0.187500
|
||||||
|
vt 0.125000 0.250000
|
||||||
|
vt 0.125000 0.312500
|
||||||
|
vt 0.125000 0.375000
|
||||||
|
vt 0.125000 0.062500
|
||||||
|
vt 0.750000 0.625000
|
||||||
|
vt 0.812500 0.625000
|
||||||
|
vt 0.812500 0.687500
|
||||||
|
vt 0.750000 0.687500
|
||||||
|
vt 0.750000 0.375000
|
||||||
|
vt 0.812500 0.375000
|
||||||
|
vt 0.812500 0.437500
|
||||||
|
vt 0.750000 0.437500
|
||||||
|
vt 0.812500 0.500000
|
||||||
|
vt 0.750000 0.500000
|
||||||
|
vt 0.812500 0.562500
|
||||||
|
vt 0.750000 0.562500
|
||||||
|
vt 0.875000 0.625000
|
||||||
|
vt 0.875000 0.687500
|
||||||
|
vt 0.875000 0.375000
|
||||||
|
vt 0.875000 0.437500
|
||||||
|
vt 0.875000 0.500000
|
||||||
|
vt 0.875000 0.562500
|
||||||
|
vt 0.937500 0.625000
|
||||||
|
vt 0.937500 0.687500
|
||||||
|
vt 0.937500 0.375000
|
||||||
|
vt 0.937500 0.437500
|
||||||
|
vt 0.937500 0.500000
|
||||||
|
vt 0.937500 0.562500
|
||||||
|
vt 1.000000 0.625000
|
||||||
|
vt 1.000000 0.687500
|
||||||
|
vt 1.000000 0.375000
|
||||||
|
vt 1.000000 0.437500
|
||||||
|
vt 1.000000 0.500000
|
||||||
|
vt 1.000000 0.562500
|
||||||
|
vt 0.500000 0.625000
|
||||||
|
vt 0.562500 0.625000
|
||||||
|
vt 0.562500 0.687500
|
||||||
|
vt 0.500000 0.687500
|
||||||
|
vt 0.562500 0.375000
|
||||||
|
vt 0.562500 0.437500
|
||||||
|
vt 0.500000 0.437500
|
||||||
|
vt 0.562500 0.500000
|
||||||
|
vt 0.500000 0.500000
|
||||||
|
vt 0.562500 0.562500
|
||||||
|
vt 0.500000 0.562500
|
||||||
|
vt 0.625000 0.625000
|
||||||
|
vt 0.625000 0.687500
|
||||||
|
vt 0.625000 0.375000
|
||||||
|
vt 0.625000 0.437500
|
||||||
|
vt 0.625000 0.500000
|
||||||
|
vt 0.625000 0.562500
|
||||||
|
vt 0.687500 0.625000
|
||||||
|
vt 0.687500 0.687500
|
||||||
|
vt 0.687500 0.375000
|
||||||
|
vt 0.687500 0.437500
|
||||||
|
vt 0.687500 0.500000
|
||||||
|
vt 0.687500 0.562500
|
||||||
|
vt 0.250000 0.625000
|
||||||
|
vt 0.312500 0.625000
|
||||||
|
vt 0.312500 0.687500
|
||||||
|
vt 0.250000 0.687500
|
||||||
|
vt 0.312500 0.437500
|
||||||
|
vt 0.250000 0.437500
|
||||||
|
vt 0.312500 0.500000
|
||||||
|
vt 0.250000 0.500000
|
||||||
|
vt 0.312500 0.562500
|
||||||
|
vt 0.250000 0.562500
|
||||||
|
vt 0.375000 0.625000
|
||||||
|
vt 0.375000 0.687500
|
||||||
|
vt 0.375000 0.437500
|
||||||
|
vt 0.375000 0.500000
|
||||||
|
vt 0.375000 0.562500
|
||||||
|
vt 0.437500 0.625000
|
||||||
|
vt 0.437500 0.687500
|
||||||
|
vt 0.437500 0.437500
|
||||||
|
vt 0.437500 0.500000
|
||||||
|
vt 0.437500 0.562500
|
||||||
|
vt -0.000000 0.625000
|
||||||
|
vt 0.062500 0.625000
|
||||||
|
vt 0.062500 0.687500
|
||||||
|
vt -0.000000 0.687500
|
||||||
|
vt 0.062500 0.437500
|
||||||
|
vt -0.000000 0.437500
|
||||||
|
vt 0.062500 0.500000
|
||||||
|
vt -0.000000 0.500000
|
||||||
|
vt 0.062500 0.562500
|
||||||
|
vt -0.000000 0.562500
|
||||||
|
vt 0.125000 0.625000
|
||||||
|
vt 0.125000 0.687500
|
||||||
|
vt 0.125000 0.437500
|
||||||
|
vt 0.125000 0.500000
|
||||||
|
vt 0.125000 0.562500
|
||||||
|
vt 0.187500 0.625000
|
||||||
|
vt 0.187500 0.687500
|
||||||
|
vt 0.187500 0.437500
|
||||||
|
vt 0.187500 0.500000
|
||||||
|
vt 0.187500 0.562500
|
||||||
|
vt 0.687500 0.750000
|
||||||
|
vt 0.750000 0.750000
|
||||||
|
vt 0.750000 0.812500
|
||||||
|
vt 0.687500 0.812500
|
||||||
|
vt 0.750000 0.875000
|
||||||
|
vt 0.687500 0.875000
|
||||||
|
vt 0.750000 0.937500
|
||||||
|
vt 0.687500 0.937500
|
||||||
|
vt 0.750000 1.000000
|
||||||
|
vt 0.687500 1.000000
|
||||||
|
vt 0.812500 0.750000
|
||||||
|
vt 0.812500 0.812500
|
||||||
|
vt 0.812500 0.875000
|
||||||
|
vt 0.812500 0.937500
|
||||||
|
vt 0.812500 1.000000
|
||||||
|
vt 0.875000 0.750000
|
||||||
|
vt 0.875000 0.812500
|
||||||
|
vt 0.875000 0.875000
|
||||||
|
vt 0.875000 0.937500
|
||||||
|
vt 0.875000 1.000000
|
||||||
|
vt 0.937500 0.750000
|
||||||
|
vt 0.937500 0.812500
|
||||||
|
vt 0.937500 0.875000
|
||||||
|
vt 0.937500 0.937500
|
||||||
|
vt 0.937500 1.000000
|
||||||
|
vt 1.000000 0.750000
|
||||||
|
vt 1.000000 0.812500
|
||||||
|
vt 1.000000 0.875000
|
||||||
|
vt 1.000000 0.937500
|
||||||
|
vt 1.000000 1.000000
|
||||||
|
vt 0.500000 0.750000
|
||||||
|
vt 0.562500 0.750000
|
||||||
|
vt 0.562500 0.812500
|
||||||
|
vt 0.500000 0.812500
|
||||||
|
vt 0.562500 0.875000
|
||||||
|
vt 0.500000 0.875000
|
||||||
|
vt 0.562500 0.937500
|
||||||
|
vt 0.500000 0.937500
|
||||||
|
vt 0.562500 1.000000
|
||||||
|
vt 0.500000 1.000000
|
||||||
|
vt 0.625000 0.750000
|
||||||
|
vt 0.625000 0.812500
|
||||||
|
vt 0.625000 0.875000
|
||||||
|
vt 0.625000 0.937500
|
||||||
|
vt 0.625000 1.000000
|
||||||
|
vt 0.750000 0.312500
|
||||||
|
vt 0.812500 0.312500
|
||||||
|
vt 0.750000 0.062500
|
||||||
|
vt 0.812500 0.062500
|
||||||
|
vt 0.812500 0.125000
|
||||||
|
vt 0.750000 0.125000
|
||||||
|
vt 0.812500 0.187500
|
||||||
|
vt 0.750000 0.187500
|
||||||
|
vt 0.812500 0.250000
|
||||||
|
vt 0.750000 0.250000
|
||||||
|
vt 0.875000 0.312500
|
||||||
|
vt 0.875000 0.062500
|
||||||
|
vt 0.875000 0.125000
|
||||||
|
vt 0.875000 0.187500
|
||||||
|
vt 0.875000 0.250000
|
||||||
|
vt 0.937500 0.312500
|
||||||
|
vt 0.937500 0.062500
|
||||||
|
vt 0.937500 0.125000
|
||||||
|
vt 0.937500 0.187500
|
||||||
|
vt 0.937500 0.250000
|
||||||
|
vt 1.000000 0.312500
|
||||||
|
vt 1.000000 0.062500
|
||||||
|
vt 1.000000 0.125000
|
||||||
|
vt 1.000000 0.187500
|
||||||
|
vt 1.000000 0.250000
|
||||||
|
vt 0.562500 0.312500
|
||||||
|
vt 0.562500 0.062500
|
||||||
|
vt 0.562500 0.125000
|
||||||
|
vt 0.562500 0.187500
|
||||||
|
vt 0.562500 0.250000
|
||||||
|
vt 0.625000 0.312500
|
||||||
|
vt 0.625000 0.062500
|
||||||
|
vt 0.625000 0.125000
|
||||||
|
vt 0.625000 0.187500
|
||||||
|
vt 0.625000 0.250000
|
||||||
|
vt 0.687500 0.312500
|
||||||
|
vt 0.687500 0.062500
|
||||||
|
vt 0.687500 0.125000
|
||||||
|
vt 0.687500 0.187500
|
||||||
|
vt 0.687500 0.250000
|
||||||
|
vt 0.250000 0.937500
|
||||||
|
vt 0.312500 0.937500
|
||||||
|
vt 0.312500 1.000000
|
||||||
|
vt 0.250000 1.000000
|
||||||
|
vt 0.312500 0.750000
|
||||||
|
vt 0.250000 0.750000
|
||||||
|
vt 0.312500 0.812500
|
||||||
|
vt 0.250000 0.812500
|
||||||
|
vt 0.312500 0.875000
|
||||||
|
vt 0.250000 0.875000
|
||||||
|
vt 0.375000 0.937500
|
||||||
|
vt 0.375000 1.000000
|
||||||
|
vt 0.375000 0.750000
|
||||||
|
vt 0.375000 0.812500
|
||||||
|
vt 0.375000 0.875000
|
||||||
|
vt 0.437500 0.937500
|
||||||
|
vt 0.437500 1.000000
|
||||||
|
vt 0.437500 0.750000
|
||||||
|
vt 0.437500 0.812500
|
||||||
|
vt 0.437500 0.875000
|
||||||
|
vt 0.000000 0.937500
|
||||||
|
vt 0.062500 0.937500
|
||||||
|
vt 0.062500 1.000000
|
||||||
|
vt 0.000000 1.000000
|
||||||
|
vt 0.062500 0.750000
|
||||||
|
vt 0.000000 0.750000
|
||||||
|
vt 0.062500 0.812500
|
||||||
|
vt 0.000000 0.812500
|
||||||
|
vt 0.062500 0.875000
|
||||||
|
vt 0.000000 0.875000
|
||||||
|
vt 0.125000 0.937500
|
||||||
|
vt 0.125000 1.000000
|
||||||
|
vt 0.125000 0.750000
|
||||||
|
vt 0.125000 0.812500
|
||||||
|
vt 0.125000 0.875000
|
||||||
|
vt 0.187500 0.937500
|
||||||
|
vt 0.187500 1.000000
|
||||||
|
vt 0.187500 0.750000
|
||||||
|
vt 0.187500 0.812500
|
||||||
|
vt 0.187500 0.875000
|
||||||
|
vn 0.000000 -1.000000 -0.004800
|
||||||
|
vn 0.000000 -0.657400 0.753500
|
||||||
|
vn -0.898300 -0.248500 0.362300
|
||||||
|
vn -0.863600 -0.504100 -0.003400
|
||||||
|
vn -0.661500 0.421500 -0.620200
|
||||||
|
vn -0.746000 0.665900 0.000000
|
||||||
|
vn 0.661500 0.421500 -0.620200
|
||||||
|
vn 0.746000 0.665900 0.000000
|
||||||
|
vn 0.898300 -0.248500 0.362300
|
||||||
|
vn 0.863600 -0.504100 -0.003400
|
||||||
|
vn 0.000000 0.000000 1.000000
|
||||||
|
vn -0.925200 0.000000 0.379500
|
||||||
|
vn -0.617100 0.000000 -0.786900
|
||||||
|
vn 0.617100 0.000000 -0.786900
|
||||||
|
vn 0.925200 0.000000 0.379500
|
||||||
|
vn 0.000000 0.657400 0.753500
|
||||||
|
vn -0.898300 0.248400 0.362300
|
||||||
|
vn -0.661500 -0.421500 -0.620200
|
||||||
|
vn 0.661500 -0.421500 -0.620200
|
||||||
|
vn 0.898300 0.248400 0.362300
|
||||||
|
vn 0.000000 1.000000 0.000000
|
||||||
|
vn -0.866100 0.499800 0.000000
|
||||||
|
vn -0.746000 -0.665900 0.000000
|
||||||
|
vn 0.746000 -0.665900 0.000000
|
||||||
|
vn 0.866100 0.499800 0.000000
|
||||||
|
vn 0.000000 0.657400 -0.753500
|
||||||
|
vn -0.898300 0.248400 -0.362400
|
||||||
|
vn -0.661600 -0.421500 0.620200
|
||||||
|
vn 0.661500 -0.421500 0.620200
|
||||||
|
vn 0.898300 0.248400 -0.362300
|
||||||
|
vn 0.000000 -0.000900 -1.000000
|
||||||
|
vn -0.924600 -0.000600 -0.380700
|
||||||
|
vn -0.617100 0.000000 0.786900
|
||||||
|
vn 0.617100 0.000000 0.786900
|
||||||
|
vn 0.924700 -0.000600 -0.380700
|
||||||
|
vn 0.000000 -0.650300 -0.759600
|
||||||
|
vn -0.895600 -0.254600 -0.364800
|
||||||
|
vn -0.661600 0.421500 0.620200
|
||||||
|
vn 0.661600 0.421500 0.620200
|
||||||
|
vn 0.895600 -0.254600 -0.364800
|
||||||
|
vn 0.004900 -1.000000 0.000000
|
||||||
|
vn -0.729700 -0.683800 0.000000
|
||||||
|
vn -0.324500 -0.256300 -0.910500
|
||||||
|
vn 0.003300 -0.475500 -0.879700
|
||||||
|
vn 0.578700 0.436200 -0.689100
|
||||||
|
vn 0.000000 0.666600 -0.745400
|
||||||
|
vn 0.578700 0.436200 0.689100
|
||||||
|
vn 0.000000 0.666600 0.745400
|
||||||
|
vn -0.324500 -0.256300 0.910500
|
||||||
|
vn 0.003300 -0.475500 0.879700
|
||||||
|
vn -1.000000 0.000000 0.000000
|
||||||
|
vn -0.359600 0.000000 -0.933100
|
||||||
|
vn 0.756400 0.000000 -0.654100
|
||||||
|
vn 0.756400 0.000000 0.654100
|
||||||
|
vn -0.359600 0.000000 0.933100
|
||||||
|
vn -0.729700 0.683700 0.000000
|
||||||
|
vn -0.324500 0.256300 -0.910500
|
||||||
|
vn 0.578700 -0.436200 -0.689100
|
||||||
|
vn 0.578700 -0.436200 0.689100
|
||||||
|
vn -0.324500 0.256300 0.910500
|
||||||
|
vn 0.000000 0.470900 -0.882200
|
||||||
|
vn 0.000000 -0.666600 -0.745400
|
||||||
|
vn 0.000000 -0.666600 0.745400
|
||||||
|
vn 0.000000 0.470900 0.882200
|
||||||
|
vn 0.729700 0.683700 0.000000
|
||||||
|
vn 0.324500 0.256300 -0.910500
|
||||||
|
vn -0.578700 -0.436200 -0.689100
|
||||||
|
vn -0.578700 -0.436200 0.689100
|
||||||
|
vn 0.324500 0.256300 0.910500
|
||||||
|
vn 1.000000 -0.001100 0.000000
|
||||||
|
vn 0.361000 -0.000700 -0.932600
|
||||||
|
vn -0.756400 0.000000 -0.654100
|
||||||
|
vn -0.756400 0.000000 0.654100
|
||||||
|
vn 0.361000 -0.000700 0.932600
|
||||||
|
vn 0.736100 -0.676800 0.000000
|
||||||
|
vn 0.327100 -0.263100 -0.907600
|
||||||
|
vn -0.578700 0.436200 -0.689100
|
||||||
|
vn -0.578700 0.436200 0.689100
|
||||||
|
vn 0.327100 -0.263100 0.907600
|
||||||
|
vn -0.004900 -1.000000 0.000000
|
||||||
|
vn 0.729700 -0.683800 0.000000
|
||||||
|
vn 0.324500 -0.256300 0.910500
|
||||||
|
vn -0.003300 -0.475400 0.879700
|
||||||
|
vn 0.324500 -0.256300 -0.910500
|
||||||
|
vn -0.003300 -0.475400 -0.879700
|
||||||
|
vn 1.000000 0.000000 0.000000
|
||||||
|
vn 0.359600 0.000000 0.933100
|
||||||
|
vn 0.359600 0.000000 -0.933100
|
||||||
|
vn -1.000000 -0.001100 0.000000
|
||||||
|
vn -0.361000 -0.000700 0.932600
|
||||||
|
vn -0.361000 -0.000700 -0.932600
|
||||||
|
vn -0.736100 -0.676800 0.000000
|
||||||
|
vn -0.327100 -0.263100 0.907600
|
||||||
|
vn -0.327100 -0.263100 -0.907600
|
||||||
|
vn 0.000000 -1.000000 0.004800
|
||||||
|
vn 0.000000 -0.657400 -0.753500
|
||||||
|
vn 0.898300 -0.248500 -0.362400
|
||||||
|
vn 0.863600 -0.504100 0.003400
|
||||||
|
vn -0.898300 -0.248500 -0.362400
|
||||||
|
vn -0.863600 -0.504100 0.003400
|
||||||
|
vn 0.000000 0.000000 -1.000000
|
||||||
|
vn 0.925200 0.000000 -0.379500
|
||||||
|
vn -0.925200 0.000000 -0.379500
|
||||||
|
vn 0.898300 0.248500 -0.362400
|
||||||
|
vn 0.661600 -0.421500 0.620200
|
||||||
|
vn -0.898300 0.248500 -0.362400
|
||||||
|
vn 0.898300 0.248500 0.362300
|
||||||
|
vn -0.898300 0.248500 0.362300
|
||||||
|
vn 0.000000 -0.000900 1.000000
|
||||||
|
vn 0.924700 -0.000600 0.380700
|
||||||
|
vn -0.924700 -0.000600 0.380700
|
||||||
|
vn 0.000000 -0.650300 0.759600
|
||||||
|
vn 0.895600 -0.254600 0.364700
|
||||||
|
vn -0.895600 -0.254600 0.364700
|
||||||
|
vn 0.729700 -0.683700 0.000000
|
||||||
|
vn 0.729700 0.683800 0.000000
|
||||||
|
vn -0.729700 0.683800 0.000000
|
||||||
|
vn -0.898300 -0.248400 0.362300
|
||||||
|
vn -0.863600 -0.504100 -0.003500
|
||||||
|
vn 0.898300 -0.248400 0.362300
|
||||||
|
vn 0.863600 -0.504100 -0.003500
|
||||||
|
vn -0.661500 -0.421500 0.620200
|
||||||
|
vn 0.924600 -0.000600 -0.380700
|
||||||
|
vn -0.661500 0.421500 0.620200
|
||||||
|
vn 0.661500 0.421500 0.620200
|
||||||
|
s 1
|
||||||
|
f 1/1/1 2/2/2 3/3/3 4/4/4
|
||||||
|
f 4/4/4 3/3/3 5/5/5 6/6/6
|
||||||
|
f 6/6/6 5/5/5 7/7/7 8/8/8
|
||||||
|
f 8/8/8 7/7/7 9/9/9 10/10/10
|
||||||
|
f 1/1/1 10/11/10 9/12/9 2/2/2
|
||||||
|
f 2/2/2 11/13/11 12/14/12 3/3/3
|
||||||
|
f 3/3/3 12/14/12 13/15/13 5/5/5
|
||||||
|
f 5/5/5 13/15/13 14/16/14 7/7/7
|
||||||
|
f 7/7/7 14/16/14 15/17/15 9/9/9
|
||||||
|
f 9/12/9 15/18/15 11/13/11 2/2/2
|
||||||
|
f 11/13/11 16/19/16 17/20/17 12/14/12
|
||||||
|
f 12/14/12 17/20/17 18/21/18 13/15/13
|
||||||
|
f 13/15/13 18/21/18 19/22/19 14/16/14
|
||||||
|
f 14/16/14 19/22/19 20/23/20 15/17/15
|
||||||
|
f 15/18/15 20/24/20 16/19/16 11/13/11
|
||||||
|
f 16/19/16 21/25/21 22/26/22 17/20/17
|
||||||
|
f 17/20/17 22/26/22 23/27/23 18/21/18
|
||||||
|
f 18/21/18 23/27/23 24/28/24 19/22/19
|
||||||
|
f 19/22/19 24/28/24 25/29/25 20/23/20
|
||||||
|
f 20/24/20 25/30/25 21/25/21 16/19/16
|
||||||
|
f 21/25/21 26/31/26 27/32/27 22/26/22
|
||||||
|
f 22/26/22 27/32/27 28/33/28 23/27/23
|
||||||
|
f 23/27/23 28/33/28 29/34/29 24/28/24
|
||||||
|
f 24/28/24 29/34/29 30/35/30 25/29/25
|
||||||
|
f 25/30/25 30/36/30 26/31/26 21/25/21
|
||||||
|
f 26/37/26 31/38/31 32/39/32 27/40/27
|
||||||
|
f 27/40/27 32/39/32 33/41/33 28/42/28
|
||||||
|
f 28/42/28 33/41/33 34/43/34 29/44/29
|
||||||
|
f 29/44/29 34/43/34 35/45/35 30/46/30
|
||||||
|
f 30/47/30 35/48/35 31/38/31 26/37/26
|
||||||
|
f 31/38/31 36/49/36 37/50/37 32/39/32
|
||||||
|
f 32/39/32 37/50/37 38/51/38 33/41/33
|
||||||
|
f 33/41/33 38/51/38 39/52/39 34/43/34
|
||||||
|
f 34/43/34 39/52/39 40/53/40 35/45/35
|
||||||
|
f 35/48/35 40/54/40 36/49/36 31/38/31
|
||||||
|
f 36/49/36 1/1/1 4/4/4 37/50/37
|
||||||
|
f 37/50/37 4/4/4 6/6/6 38/51/38
|
||||||
|
f 38/51/38 6/6/6 8/8/8 39/52/39
|
||||||
|
f 39/52/39 8/8/8 10/10/10 40/53/40
|
||||||
|
f 1/1/1 36/49/36 40/54/40 10/11/10
|
||||||
|
f 41/55/41 42/56/42 43/57/43 44/58/44
|
||||||
|
f 44/59/44 43/60/43 45/61/45 46/62/46
|
||||||
|
f 46/62/46 45/61/45 47/63/47 48/64/48
|
||||||
|
f 48/64/48 47/63/47 49/65/49 50/66/50
|
||||||
|
f 41/55/41 50/66/50 49/65/49 42/56/42
|
||||||
|
f 42/56/42 51/67/51 52/68/52 43/57/43
|
||||||
|
f 43/60/43 52/69/52 53/70/53 45/61/45
|
||||||
|
f 45/61/45 53/70/53 54/71/54 47/63/47
|
||||||
|
f 47/63/47 54/71/54 55/72/55 49/65/49
|
||||||
|
f 49/65/49 55/72/55 51/67/51 42/56/42
|
||||||
|
f 51/67/51 56/73/56 57/74/57 52/68/52
|
||||||
|
f 52/69/52 57/75/57 58/76/58 53/70/53
|
||||||
|
f 53/70/53 58/76/58 59/77/59 54/71/54
|
||||||
|
f 54/71/54 59/77/59 60/78/60 55/72/55
|
||||||
|
f 55/72/55 60/78/60 56/73/56 51/67/51
|
||||||
|
f 56/73/56 61/79/21 62/80/61 57/74/57
|
||||||
|
f 57/75/57 62/81/61 63/82/62 58/76/58
|
||||||
|
f 58/76/58 63/82/62 64/83/63 59/77/59
|
||||||
|
f 59/77/59 64/83/63 65/84/64 60/78/60
|
||||||
|
f 60/78/60 65/84/64 61/79/21 56/73/56
|
||||||
|
f 61/85/21 66/86/65 67/87/66 62/88/61
|
||||||
|
f 62/35/61 67/89/66 68/90/67 63/91/62
|
||||||
|
f 63/91/62 68/90/67 69/92/68 64/93/63
|
||||||
|
f 64/93/63 69/92/68 70/94/69 65/95/64
|
||||||
|
f 65/95/64 70/94/69 66/86/65 61/85/21
|
||||||
|
f 66/86/65 71/96/70 72/97/71 67/87/66
|
||||||
|
f 67/89/66 72/98/71 73/99/72 68/90/67
|
||||||
|
f 68/90/67 73/99/72 74/100/73 69/92/68
|
||||||
|
f 69/92/68 74/100/73 75/101/74 70/94/69
|
||||||
|
f 70/94/69 75/101/74 71/96/70 66/86/65
|
||||||
|
f 71/96/70 76/102/75 77/103/76 72/97/71
|
||||||
|
f 72/98/71 77/104/76 78/105/77 73/99/72
|
||||||
|
f 73/99/72 78/105/77 79/106/78 74/100/73
|
||||||
|
f 74/100/73 79/106/78 80/107/79 75/101/74
|
||||||
|
f 75/101/74 80/107/79 76/102/75 71/96/70
|
||||||
|
f 76/102/75 41/55/41 44/58/44 77/103/76
|
||||||
|
f 77/104/76 44/59/44 46/62/46 78/105/77
|
||||||
|
f 78/105/77 46/62/46 48/64/48 79/106/78
|
||||||
|
f 79/106/78 48/64/48 50/66/50 80/107/79
|
||||||
|
f 41/55/41 76/102/75 80/107/79 50/66/50
|
||||||
|
f 81/108/80 82/109/81 83/110/82 84/111/83
|
||||||
|
f 84/9/83 83/17/82 85/112/78 86/113/48
|
||||||
|
f 86/113/48 85/112/78 87/114/77 88/115/46
|
||||||
|
f 88/115/46 87/114/77 89/116/84 90/117/85
|
||||||
|
f 81/108/80 90/117/85 89/116/84 82/109/81
|
||||||
|
f 82/109/81 91/118/86 92/119/87 83/110/82
|
||||||
|
f 83/17/82 92/23/87 93/120/73 85/112/78
|
||||||
|
f 85/112/78 93/120/73 94/121/72 87/114/77
|
||||||
|
f 87/114/77 94/121/72 95/122/88 89/116/84
|
||||||
|
f 89/116/84 95/122/88 91/118/86 82/109/81
|
||||||
|
f 91/118/86 96/123/65 97/124/69 92/119/87
|
||||||
|
f 92/23/87 97/29/69 98/125/68 93/120/73
|
||||||
|
f 93/120/73 98/125/68 99/126/67 94/121/72
|
||||||
|
f 94/121/72 99/126/67 100/127/66 95/122/88
|
||||||
|
f 95/122/88 100/127/66 96/123/65 91/118/86
|
||||||
|
f 96/123/65 101/85/21 102/88/64 97/124/69
|
||||||
|
f 97/29/69 102/35/64 103/91/63 98/125/68
|
||||||
|
f 98/125/68 103/91/63 104/93/62 99/126/67
|
||||||
|
f 99/126/67 104/93/62 105/95/61 100/127/66
|
||||||
|
f 100/127/66 105/95/61 101/85/21 96/123/65
|
||||||
|
f 101/128/21 106/129/56 107/130/60 102/131/64
|
||||||
|
f 102/46/64 107/45/60 108/132/59 103/133/63
|
||||||
|
f 103/133/63 108/132/59 109/134/58 104/135/62
|
||||||
|
f 104/135/62 109/134/58 110/136/57 105/137/61
|
||||||
|
f 105/137/61 110/136/57 106/129/56 101/128/21
|
||||||
|
f 106/129/56 111/138/89 112/139/90 107/130/60
|
||||||
|
f 107/45/60 112/53/90 113/140/54 108/132/59
|
||||||
|
f 108/132/59 113/140/54 114/141/53 109/134/58
|
||||||
|
f 109/134/58 114/141/53 115/142/91 110/136/57
|
||||||
|
f 110/136/57 115/142/91 111/138/89 106/129/56
|
||||||
|
f 111/138/89 116/143/92 117/144/93 112/139/90
|
||||||
|
f 112/53/90 117/10/93 118/145/47 113/140/54
|
||||||
|
f 113/140/54 118/145/47 119/146/45 114/141/53
|
||||||
|
f 114/141/53 119/146/45 120/147/94 115/142/91
|
||||||
|
f 115/142/91 120/147/94 116/143/92 111/138/89
|
||||||
|
f 116/143/92 81/108/80 84/111/83 117/144/93
|
||||||
|
f 117/10/93 84/9/83 86/113/48 118/145/47
|
||||||
|
f 118/145/47 86/113/48 88/115/46 119/146/45
|
||||||
|
f 119/146/45 88/115/46 90/117/85 120/147/94
|
||||||
|
f 81/108/80 116/143/92 120/147/94 90/117/85
|
||||||
|
f 121/148/95 122/149/96 123/150/97 124/151/98
|
||||||
|
f 124/151/98 123/150/97 125/152/39 126/153/8
|
||||||
|
f 126/153/8 125/152/39 127/154/38 128/155/6
|
||||||
|
f 128/155/6 127/154/38 129/156/99 130/157/100
|
||||||
|
f 121/148/95 130/103/100 129/58/99 122/149/96
|
||||||
|
f 122/149/96 131/158/101 132/159/102 123/150/97
|
||||||
|
f 123/150/97 132/159/102 133/160/34 125/152/39
|
||||||
|
f 125/152/39 133/160/34 134/161/33 127/154/38
|
||||||
|
f 127/154/38 134/161/33 135/162/103 129/156/99
|
||||||
|
f 129/58/99 135/57/103 131/158/101 122/149/96
|
||||||
|
f 131/158/101 136/163/26 137/164/104 132/159/102
|
||||||
|
f 132/159/102 137/164/104 138/165/105 133/160/34
|
||||||
|
f 133/160/34 138/165/105 139/166/28 134/161/33
|
||||||
|
f 134/161/33 139/166/28 140/167/106 135/162/103
|
||||||
|
f 135/57/103 140/68/106 136/163/26 131/158/101
|
||||||
|
f 136/163/26 141/168/21 142/169/25 137/164/104
|
||||||
|
f 137/164/104 142/169/25 143/170/24 138/165/105
|
||||||
|
f 138/165/105 143/170/24 144/171/23 139/166/28
|
||||||
|
f 139/166/28 144/171/23 145/172/22 140/167/106
|
||||||
|
f 140/68/106 145/74/22 141/168/21 136/163/26
|
||||||
|
f 141/168/21 146/173/16 147/174/107 142/169/25
|
||||||
|
f 142/169/25 147/174/107 148/175/19 143/170/24
|
||||||
|
f 143/170/24 148/175/19 149/176/18 144/171/23
|
||||||
|
f 144/171/23 149/176/18 150/177/108 145/172/22
|
||||||
|
f 145/74/22 150/80/108 146/173/16 141/168/21
|
||||||
|
f 146/178/16 151/179/109 152/180/110 147/181/107
|
||||||
|
f 147/181/107 152/180/110 153/182/14 148/183/19
|
||||||
|
f 148/183/19 153/182/14 154/184/13 149/185/18
|
||||||
|
f 149/185/18 154/184/13 155/186/111 150/187/108
|
||||||
|
f 150/88/108 155/87/111 151/179/109 146/178/16
|
||||||
|
f 151/179/109 156/188/112 157/189/113 152/180/110
|
||||||
|
f 152/180/110 157/189/113 158/190/7 153/182/14
|
||||||
|
f 153/182/14 158/190/7 159/191/5 154/184/13
|
||||||
|
f 154/184/13 159/191/5 160/192/114 155/186/111
|
||||||
|
f 155/87/111 160/97/114 156/188/112 151/179/109
|
||||||
|
f 156/188/112 121/148/95 124/151/98 157/189/113
|
||||||
|
f 157/189/113 124/151/98 126/153/8 158/190/7
|
||||||
|
f 158/190/7 126/153/8 128/155/6 159/191/5
|
||||||
|
f 159/191/5 128/155/6 130/157/100 160/192/114
|
||||||
|
f 121/148/95 156/188/112 160/97/114 130/103/100
|
||||||
|
f 161/193/80 162/194/115 163/60/82 164/59/83
|
||||||
|
f 164/195/83 163/196/82 165/197/78 166/198/48
|
||||||
|
f 166/198/48 165/197/78 167/199/77 168/200/46
|
||||||
|
f 168/200/46 167/199/77 169/201/84 170/202/85
|
||||||
|
f 161/193/80 170/202/85 169/201/84 162/194/115
|
||||||
|
f 162/194/115 171/203/86 172/69/87 163/60/82
|
||||||
|
f 163/196/82 172/204/87 173/205/73 165/197/78
|
||||||
|
f 165/197/78 173/205/73 174/206/72 167/199/77
|
||||||
|
f 167/199/77 174/206/72 175/207/88 169/201/84
|
||||||
|
f 169/201/84 175/207/88 171/203/86 162/194/115
|
||||||
|
f 171/203/86 176/208/116 177/75/69 172/69/87
|
||||||
|
f 172/204/87 177/209/69 178/210/68 173/205/73
|
||||||
|
f 173/205/73 178/210/68 179/211/67 174/206/72
|
||||||
|
f 174/206/72 179/211/67 180/212/66 175/207/88
|
||||||
|
f 175/207/88 180/212/66 176/208/116 171/203/86
|
||||||
|
f 176/208/116 181/213/21 182/81/64 177/75/69
|
||||||
|
f 177/209/69 182/214/64 183/215/63 178/210/68
|
||||||
|
f 178/210/68 183/215/63 184/216/62 179/211/67
|
||||||
|
f 179/211/67 184/216/62 185/217/61 180/212/66
|
||||||
|
f 180/212/66 185/217/61 181/213/21 176/208/116
|
||||||
|
f 181/34/21 186/218/117 187/89/60 182/35/64
|
||||||
|
f 182/36/64 187/219/60 188/220/59 183/31/63
|
||||||
|
f 183/31/63 188/220/59 189/221/58 184/32/62
|
||||||
|
f 184/32/62 189/221/58 190/222/57 185/33/61
|
||||||
|
f 185/33/61 190/222/57 186/218/117 181/34/21
|
||||||
|
f 186/218/117 191/223/89 192/98/90 187/89/60
|
||||||
|
f 187/219/60 192/224/90 193/225/54 188/220/59
|
||||||
|
f 188/220/59 193/225/54 194/226/53 189/221/58
|
||||||
|
f 189/221/58 194/226/53 195/227/91 190/222/57
|
||||||
|
f 190/222/57 195/227/91 191/223/89 186/218/117
|
||||||
|
f 191/223/89 196/228/92 197/104/93 192/98/90
|
||||||
|
f 192/224/90 197/229/93 198/230/47 193/225/54
|
||||||
|
f 193/225/54 198/230/47 199/231/45 194/226/53
|
||||||
|
f 194/226/53 199/231/45 200/232/94 195/227/91
|
||||||
|
f 195/227/91 200/232/94 196/228/92 191/223/89
|
||||||
|
f 196/228/92 161/193/80 164/59/83 197/104/93
|
||||||
|
f 197/229/93 164/195/83 166/198/48 198/230/47
|
||||||
|
f 198/230/47 166/198/48 168/200/46 199/231/45
|
||||||
|
f 199/231/45 168/200/46 170/202/85 200/232/94
|
||||||
|
f 161/193/80 196/228/92 200/232/94 170/202/85
|
||||||
|
f 201/233/1 202/234/2 203/235/118 204/236/119
|
||||||
|
f 204/111/119 203/110/118 205/237/5 206/238/6
|
||||||
|
f 206/238/6 205/237/5 207/239/7 208/240/8
|
||||||
|
f 208/240/8 207/239/7 209/241/120 210/242/121
|
||||||
|
f 201/233/1 210/242/121 209/241/120 202/234/2
|
||||||
|
f 202/234/2 211/243/11 212/244/12 203/235/118
|
||||||
|
f 203/110/118 212/119/12 213/245/13 205/237/5
|
||||||
|
f 205/237/5 213/245/13 214/246/14 207/239/7
|
||||||
|
f 207/239/7 214/246/14 215/247/15 209/241/120
|
||||||
|
f 209/241/120 215/247/15 211/243/11 202/234/2
|
||||||
|
f 211/243/11 216/248/16 217/249/108 212/244/12
|
||||||
|
f 212/119/12 217/124/108 218/250/18 213/245/13
|
||||||
|
f 213/245/13 218/250/18 219/251/19 214/246/14
|
||||||
|
f 214/246/14 219/251/19 220/252/107 215/247/15
|
||||||
|
f 215/247/15 220/252/107 216/248/16 211/243/11
|
||||||
|
f 216/248/16 221/185/21 222/187/22 217/249/108
|
||||||
|
f 217/124/108 222/88/22 223/178/23 218/250/18
|
||||||
|
f 218/250/18 223/178/23 224/181/24 219/251/19
|
||||||
|
f 219/251/19 224/181/24 225/183/25 220/252/107
|
||||||
|
f 220/252/107 225/183/25 221/185/21 216/248/16
|
||||||
|
f 221/253/21 226/254/26 227/255/106 222/256/22
|
||||||
|
f 222/131/22 227/130/106 228/257/122 223/258/23
|
||||||
|
f 223/258/23 228/257/122 229/259/29 224/260/24
|
||||||
|
f 224/260/24 229/259/29 230/261/104 225/262/25
|
||||||
|
f 225/262/25 230/261/104 226/254/26 221/253/21
|
||||||
|
f 226/254/26 231/263/31 232/264/32 227/255/106
|
||||||
|
f 227/130/106 232/139/32 233/265/33 228/257/122
|
||||||
|
f 228/257/122 233/265/33 234/266/34 229/259/29
|
||||||
|
f 229/259/29 234/266/34 235/267/123 230/261/104
|
||||||
|
f 230/261/104 235/267/123 231/263/31 226/254/26
|
||||||
|
f 231/263/31 236/268/36 237/269/37 232/264/32
|
||||||
|
f 232/139/32 237/144/37 238/270/124 233/265/33
|
||||||
|
f 233/265/33 238/270/124 239/271/125 234/266/34
|
||||||
|
f 234/266/34 239/271/125 240/272/40 235/267/123
|
||||||
|
f 235/267/123 240/272/40 236/268/36 231/263/31
|
||||||
|
f 236/268/36 201/233/1 204/236/119 237/269/37
|
||||||
|
f 237/144/37 204/111/119 206/238/6 238/270/124
|
||||||
|
f 238/270/124 206/238/6 208/240/8 239/271/125
|
||||||
|
f 239/271/125 208/240/8 210/242/121 240/272/40
|
||||||
|
f 201/233/1 236/268/36 240/272/40 210/242/121
|
55
basic_materials/plastics.lua
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
-- Translation support
|
||||||
|
local S = minetest.get_translator("basic_materials")
|
||||||
|
|
||||||
|
-- items
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:plastic_sheet", {
|
||||||
|
description = S("Plastic sheet"),
|
||||||
|
inventory_image = "basic_materials_plastic_sheet.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:plastic_strip", {
|
||||||
|
description = S("Plastic strips"),
|
||||||
|
inventory_image = "basic_materials_plastic_strip.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("basic_materials:empty_spool", {
|
||||||
|
description = S("Empty wire spool"),
|
||||||
|
inventory_image = "basic_materials_empty_spool.png"
|
||||||
|
})
|
||||||
|
|
||||||
|
-- crafts
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "cooking",
|
||||||
|
output = "basic_materials:plastic_sheet",
|
||||||
|
recipe = "basic_materials:paraffin",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "basic_materials:plastic_sheet",
|
||||||
|
burntime = 30,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:plastic_strip 9",
|
||||||
|
recipe = {
|
||||||
|
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_materials:empty_spool 3",
|
||||||
|
recipe = {
|
||||||
|
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
|
||||||
|
{ "", "basic_materials:plastic_sheet", "" },
|
||||||
|
{ "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" }
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- aliases
|
||||||
|
|
||||||
|
minetest.register_alias("homedecor:plastic_sheeting", "basic_materials:plastic_sheet")
|
||||||
|
minetest.register_alias("homedecor:plastic_strips", "basic_materials:plastic_strip")
|
||||||
|
minetest.register_alias("homedecor:empty_spool", "basic_materials:empty_spool")
|
BIN
basic_materials/textures/basic_materials_brass_block.png
Normal file
After Width: | Height: | Size: 272 B |
BIN
basic_materials/textures/basic_materials_brass_ingot.png
Normal file
After Width: | Height: | Size: 223 B |
BIN
basic_materials/textures/basic_materials_cement_block.png
Normal file
After Width: | Height: | Size: 243 B |
BIN
basic_materials/textures/basic_materials_chain_brass.png
Normal file
After Width: | Height: | Size: 344 B |
BIN
basic_materials/textures/basic_materials_chain_brass_inv.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
basic_materials/textures/basic_materials_chain_steel.png
Normal file
After Width: | Height: | Size: 386 B |
BIN
basic_materials/textures/basic_materials_chain_steel_inv.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
basic_materials/textures/basic_materials_chainlink_brass.png
Normal file
After Width: | Height: | Size: 178 B |
BIN
basic_materials/textures/basic_materials_chainlink_steel.png
Normal file
After Width: | Height: | Size: 175 B |
BIN
basic_materials/textures/basic_materials_concrete_block.png
Normal file
After Width: | Height: | Size: 252 B |
BIN
basic_materials/textures/basic_materials_copper_strip.png
Normal file
After Width: | Height: | Size: 326 B |
BIN
basic_materials/textures/basic_materials_copper_wire.png
Normal file
After Width: | Height: | Size: 306 B |
BIN
basic_materials/textures/basic_materials_empty_spool.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
basic_materials/textures/basic_materials_energy_crystal.png
Normal file
After Width: | Height: | Size: 817 B |
BIN
basic_materials/textures/basic_materials_gear_steel.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
basic_materials/textures/basic_materials_gold_wire.png
Normal file
After Width: | Height: | Size: 286 B |
BIN
basic_materials/textures/basic_materials_heating_element.png
Normal file
After Width: | Height: | Size: 369 B |
BIN
basic_materials/textures/basic_materials_ic.png
Normal file
After Width: | Height: | Size: 293 B |
BIN
basic_materials/textures/basic_materials_motor.png
Normal file
After Width: | Height: | Size: 247 B |
BIN
basic_materials/textures/basic_materials_oil_extract.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
basic_materials/textures/basic_materials_padlock.png
Normal file
After Width: | Height: | Size: 215 B |
BIN
basic_materials/textures/basic_materials_paraffin.png
Normal file
After Width: | Height: | Size: 345 B |
BIN
basic_materials/textures/basic_materials_plastic_sheet.png
Normal file
After Width: | Height: | Size: 293 B |
BIN
basic_materials/textures/basic_materials_plastic_strip.png
Normal file
After Width: | Height: | Size: 160 B |
BIN
basic_materials/textures/basic_materials_silicon.png
Normal file
After Width: | Height: | Size: 769 B |
BIN
basic_materials/textures/basic_materials_silver_wire.png
Normal file
After Width: | Height: | Size: 251 B |
BIN
basic_materials/textures/basic_materials_steel_bar.png
Normal file
After Width: | Height: | Size: 311 B |
BIN
basic_materials/textures/basic_materials_steel_strip.png
Normal file
After Width: | Height: | Size: 326 B |
BIN
basic_materials/textures/basic_materials_steel_wire.png
Normal file
After Width: | Height: | Size: 284 B |
BIN
basic_materials/textures/basic_materials_terracotta_base.png
Normal file
After Width: | Height: | Size: 775 B |
BIN
basic_materials/textures/basic_materials_wet_cement.png
Normal file
After Width: | Height: | Size: 366 B |
2
compost/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Backup files
|
||||||
|
*~
|
19
compost/LICENSE.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
License for Code
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Copyright (C) 2016 cdqwertz <cdqwertz@gmail.com>
|
||||||
|
|
||||||
|
This program 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.
|
||||||
|
|
||||||
|
http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
|
|
||||||
|
License for Media
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
CC-BY-SA 3.0 UNPORTED. Created by cdqwertz
|
||||||
|
|
||||||
|
Note: screenshot.png contains textures from minetest_game.
|
||||||
|
|
25
compost/README.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Compost Mod
|
||||||
|
With this mod, you are able to compost grass, leaves, flowers...
|
||||||
|
|
||||||
|
Adapted to techage/minecart by joe7575
|
||||||
|
|
||||||
|
|
||||||
|
## License
|
||||||
|
see LICENSE.txt
|
||||||
|
|
||||||
|
## Crafting
|
||||||
|
Wood barrel:
|
||||||
|
|
||||||
|
| W | | W |
|
||||||
|
|---|---|---|
|
||||||
|
| W | | W |
|
||||||
|
| W | S | W |
|
||||||
|
|
||||||
|
W : wood
|
||||||
|
S : wood slab
|
||||||
|
|
||||||
|
## Bugs
|
||||||
|
Report bugs on the forum topic or open a issue on GitHub.
|
||||||
|
|
||||||
|
## created by
|
||||||
|
cdqwertz - cdqwertz.github.io
|
3
compost/depends.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
default
|
||||||
|
minecart?
|
||||||
|
techage?
|
12
compost/description.txt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
With this mod, you are able to compost grass, leaves, flowers...
|
||||||
|
|
||||||
|
Crafting:
|
||||||
|
Wood barrel:
|
||||||
|
W W
|
||||||
|
W W
|
||||||
|
W S W
|
||||||
|
|
||||||
|
W : wood
|
||||||
|
S : wood slab
|
||||||
|
|
||||||
|
created by cd2 (cdqwertz) - cdqwertz.github.io
|
308
compost/init.lua
Normal file
@ -0,0 +1,308 @@
|
|||||||
|
compost = {}
|
||||||
|
|
||||||
|
-- Version for compatibility checks
|
||||||
|
compost.version = 1.0
|
||||||
|
|
||||||
|
if minetest.global_exists("techage") and techage.version < 0.06 then
|
||||||
|
minetest.log("error", "[compost] Compost requires techage version 0.06 or newer!")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
compost.items = {}
|
||||||
|
compost.groups = {}
|
||||||
|
|
||||||
|
function compost.register_item(name)
|
||||||
|
compost.items[name] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
function compost.register_group(name)
|
||||||
|
compost.groups[name] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
function compost.can_compost(name)
|
||||||
|
if compost.items[name] then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
for k, i in pairs(minetest.registered_items[name].groups) do
|
||||||
|
if i > 0 then
|
||||||
|
if compost.groups[tostring(k)] then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- grass
|
||||||
|
compost.register_item("default:grass_1")
|
||||||
|
compost.register_item("default:junglegrass")
|
||||||
|
|
||||||
|
-- leaves
|
||||||
|
compost.register_group("leaves")
|
||||||
|
|
||||||
|
-- dirt
|
||||||
|
compost.register_item("default:dirt")
|
||||||
|
compost.register_item("default:dirt_with_grass")
|
||||||
|
|
||||||
|
-- stick
|
||||||
|
compost.register_item("default:stick")
|
||||||
|
|
||||||
|
-- food
|
||||||
|
compost.register_item("farming:bread")
|
||||||
|
compost.register_item("farming:wheat")
|
||||||
|
|
||||||
|
-- groups
|
||||||
|
compost.register_group("plant")
|
||||||
|
compost.register_group("flower")
|
||||||
|
|
||||||
|
-- flowers
|
||||||
|
minetest.after(1, function()
|
||||||
|
for name,_ in pairs(minetest.registered_decorations) do
|
||||||
|
if type(name) == "string" then
|
||||||
|
local mod = string.split(name, ":")[1]
|
||||||
|
if mod == "flowers" then
|
||||||
|
compost.register_item(name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
local function next_state(pos, elapsed)
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
if node.name == "compost:wood_barrel_1" then
|
||||||
|
minetest.set_node(pos, {name = "compost:wood_barrel_2"})
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
if node.name == "compost:wood_barrel_2" then
|
||||||
|
minetest.set_node(pos, {name = "compost:wood_barrel_3"})
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local function minecart_hopper_additem(pos, stack)
|
||||||
|
if compost.can_compost(stack:get_name()) then
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
-- 4 leaves for one compost node
|
||||||
|
local num = (meta:get_int("num") or 0) + stack:get_count()
|
||||||
|
if num >= 4 then
|
||||||
|
num = num - 4
|
||||||
|
minetest.set_node(pos, {name = "compost:wood_barrel_1"})
|
||||||
|
-- speed up the process by means of a timer
|
||||||
|
minetest.get_node_timer(pos):start(10)
|
||||||
|
end
|
||||||
|
meta:set_int("num", num)
|
||||||
|
stack:set_count(0)
|
||||||
|
return stack
|
||||||
|
end
|
||||||
|
return stack
|
||||||
|
end
|
||||||
|
|
||||||
|
local function minecart_hopper_takeitem(pos, num)
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
minetest.set_node(pos, {name = "compost:wood_barrel"})
|
||||||
|
return ItemStack("compost:compost")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function minecart_hopper_untakeitem(pos, in_dir, stack)
|
||||||
|
minetest.set_node(pos, {name = "compost:wood_barrel_2"})
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("compost:wood_barrel", {
|
||||||
|
description = "Wood Barrel",
|
||||||
|
tiles = {"default_wood.png"},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {{-1/2, -1/2, -1/2, 1/2, -3/8, 1/2},
|
||||||
|
{-1/2, -1/2, -1/2, -3/8, 1/2, 1/2},
|
||||||
|
{3/8, -1/2, -1/2, 1/2, 1/2, 1/2},
|
||||||
|
{-1/2, -1/2, -1/2, 1/2, 1/2, -3/8},
|
||||||
|
{-1/2, -1/2, 3/8, 1/2, 1/2, 1/2}},
|
||||||
|
},
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {choppy = 3},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_punch = function(pos, node, puncher, pointed_thing)
|
||||||
|
local wielded_item = puncher:get_wielded_item():get_name()
|
||||||
|
if compost.can_compost(wielded_item) then
|
||||||
|
minetest.set_node(pos, {name = "compost:wood_barrel_1"})
|
||||||
|
local w = puncher:get_wielded_item()
|
||||||
|
if not(minetest.setting_getbool("creative_mode")) then
|
||||||
|
w:take_item(1)
|
||||||
|
puncher:set_wielded_item(w)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
minecart_hopper_additem = minecart_hopper_additem,
|
||||||
|
minecart_hopper_untakeitem = minecart_hopper_untakeitem,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("compost:wood_barrel_1", {
|
||||||
|
description = "Wood Barrel with compost",
|
||||||
|
tiles = {"default_wood.png^compost_compost_1.png", "default_wood.png"},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {{-1/2, -1/2, -1/2, 1/2, -3/8, 1/2},
|
||||||
|
{-1/2, -1/2, -1/2, -3/8, 1/2, 1/2},
|
||||||
|
{3/8, -1/2, -1/2, 1/2, 1/2, 1/2},
|
||||||
|
{-1/2, -1/2, -1/2, 1/2, 1/2, -3/8},
|
||||||
|
{-1/2, -1/2, 3/8, 1/2, 1/2, 1/2},
|
||||||
|
{-3/8, -1/2, -3/8, 3/8, 3/8, 3/8}},
|
||||||
|
},
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {choppy = 3, not_in_creative_inventory=1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_timer = next_state,
|
||||||
|
minecart_hopper_untakeitem = minecart_hopper_untakeitem,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("compost:wood_barrel_2", {
|
||||||
|
description = "Wood Barrel with compost",
|
||||||
|
tiles = {"default_wood.png^compost_compost_2.png", "default_wood.png"},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {{-1/2, -1/2, -1/2, 1/2, -3/8, 1/2},
|
||||||
|
{-1/2, -1/2, -1/2, -3/8, 1/2, 1/2},
|
||||||
|
{3/8, -1/2, -1/2, 1/2, 1/2, 1/2},
|
||||||
|
{-1/2, -1/2, -1/2, 1/2, 1/2, -3/8},
|
||||||
|
{-1/2, -1/2, 3/8, 1/2, 1/2, 1/2},
|
||||||
|
{-3/8, -1/2, -3/8, 3/8, 3/8, 3/8}},
|
||||||
|
},
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {choppy = 3, not_in_creative_inventory=1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_timer = next_state,
|
||||||
|
minecart_hopper_untakeitem = minecart_hopper_untakeitem,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("compost:wood_barrel_3", {
|
||||||
|
description = "Wood Barrel",
|
||||||
|
tiles = {"default_wood.png^compost_compost_3.png", "default_wood.png"},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {{-1/2, -1/2, -1/2, 1/2, -3/8, 1/2},
|
||||||
|
{-1/2, -1/2, -1/2, -3/8, 1/2, 1/2},
|
||||||
|
{3/8, -1/2, -1/2, 1/2, 1/2, 1/2},
|
||||||
|
{-1/2, -1/2, -1/2, 1/2, 1/2, -3/8},
|
||||||
|
{-1/2, -1/2, 3/8, 1/2, 1/2, 1/2},
|
||||||
|
{-3/8, -1/2, -3/8, 3/8, 3/8, 3/8}},
|
||||||
|
},
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {choppy = 3, not_in_creative_inventory=1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_punch = function(pos, node, player, pointed_thing)
|
||||||
|
local p = {x = pos.x + math.random(0, 5)/5 - 0.5, y = pos.y+1, z = pos.z + math.random(0, 5)/5 - 0.5}
|
||||||
|
minetest.add_item(p, {name = "compost:compost"})
|
||||||
|
minetest.set_node(pos, {name = "compost:wood_barrel"})
|
||||||
|
end,
|
||||||
|
minecart_hopper_takeitem = minecart_hopper_takeitem,
|
||||||
|
minecart_hopper_untakeitem = minecart_hopper_untakeitem,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"compost:wood_barrel_1"},
|
||||||
|
interval = 40,
|
||||||
|
chance = 5,
|
||||||
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
minetest.set_node(pos, {name = "compost:wood_barrel_2"})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"compost:wood_barrel_2"},
|
||||||
|
interval = 40,
|
||||||
|
chance = 5,
|
||||||
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
minetest.set_node(pos, {name = "compost:wood_barrel_3"})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "compost:wood_barrel",
|
||||||
|
recipe = {
|
||||||
|
{"default:wood", "", "default:wood"},
|
||||||
|
{"default:wood", "", "default:wood"},
|
||||||
|
{"default:wood", "stairs:slab_wood", "default:wood"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("compost:compost", {
|
||||||
|
description = "Compost",
|
||||||
|
tiles = {"compost_compost.png"},
|
||||||
|
groups = {crumbly = 3},
|
||||||
|
sounds = default.node_sound_dirt_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("compost:garden_soil", {
|
||||||
|
description = "Garden Soil",
|
||||||
|
tiles = {"compost_garden_soil.png"},
|
||||||
|
groups = {crumbly = 3, soil=3, grassland = 1, wet = 1},
|
||||||
|
sounds = default.node_sound_dirt_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "compost:garden_soil",
|
||||||
|
recipe = {
|
||||||
|
{"compost:compost", "compost:compost"},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "default:dirt",
|
||||||
|
recipe = {
|
||||||
|
{"compost:garden_soil"},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if minetest.global_exists("techage") then
|
||||||
|
techage.register_node(
|
||||||
|
{
|
||||||
|
"compost:wood_barrel",
|
||||||
|
"compost:wood_barrel_1",
|
||||||
|
"compost:wood_barrel_2",
|
||||||
|
"compost:wood_barrel_3",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
on_pull_item = function(pos, in_dir, num)
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
if node.name == "compost:wood_barrel_3" then
|
||||||
|
minetest.set_node(pos, {name = "compost:wood_barrel"})
|
||||||
|
return ItemStack("compost:compost")
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end,
|
||||||
|
on_push_item = function(pos, in_dir, stack)
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
if node.name == "compost:wood_barrel" and compost.can_compost(stack:get_name()) then
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
-- 4 leaves for one compost node
|
||||||
|
local num = (meta:get_int("num") or 0) + 1
|
||||||
|
if num >= 4 then
|
||||||
|
num = 0
|
||||||
|
minetest.set_node(pos, {name = "compost:wood_barrel_1"})
|
||||||
|
-- speed up the process by means of a timer
|
||||||
|
minetest.get_node_timer(pos):start(10)
|
||||||
|
end
|
||||||
|
meta:set_int("num", num)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end,
|
||||||
|
on_unpull_item = function(pos, in_dir, stack)
|
||||||
|
minetest.set_node(pos, {name = "compost:wood_barrel_2"})
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
BIN
compost/screenshot.png
Normal file
After Width: | Height: | Size: 286 KiB |
BIN
compost/textures/compost_compost.png
Normal file
After Width: | Height: | Size: 785 B |
BIN
compost/textures/compost_compost_1.png
Normal file
After Width: | Height: | Size: 483 B |
BIN
compost/textures/compost_compost_2.png
Normal file
After Width: | Height: | Size: 487 B |
BIN
compost/textures/compost_compost_3.png
Normal file
After Width: | Height: | Size: 461 B |
BIN
compost/textures/compost_garden_soil.png
Normal file
After Width: | Height: | Size: 698 B |
22
datastorage/README.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
datastorage
|
||||||
|
===========
|
||||||
|
|
||||||
|
Helper mod to manage players data.
|
||||||
|
All the mods can acces a single file (container) and easily have the data saved/loaded for them.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
|
|
||||||
|
local data = datastorage.get(id, ...)
|
||||||
|
|
||||||
|
Returns a reference to a data container. The id is normally a player name.
|
||||||
|
Following arguments are keys to recurse into, normally only one, a string
|
||||||
|
describing the type of data, is used. If the container doesn't exist it will
|
||||||
|
be created, otherwise it will contain all previously stored data. The table
|
||||||
|
can store any data. Player's containers will be saved to disk when the player
|
||||||
|
leaves, and all references to the player's data should be dropped. All of the
|
||||||
|
containers will be saved on server shutdown. To forcibly save a container's
|
||||||
|
data use:
|
||||||
|
|
||||||
|
datastorage.save(id)
|
||||||
|
|
1
datastorage/depends.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
98
datastorage/init.lua
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
datastorage = {data = {}}
|
||||||
|
|
||||||
|
local DIR_DELIM = DIR_DELIM or "/"
|
||||||
|
local data_path = minetest.get_worldpath()..DIR_DELIM.."datastorage"..DIR_DELIM
|
||||||
|
|
||||||
|
function datastorage.save(id)
|
||||||
|
local data = datastorage.data[id]
|
||||||
|
-- Check if the container is empty
|
||||||
|
if not data or not next(data) then return end
|
||||||
|
for _, sub_data in pairs(data) do
|
||||||
|
if not next(sub_data) then return end
|
||||||
|
end
|
||||||
|
|
||||||
|
local file = io.open(data_path..id, "w")
|
||||||
|
if not file then
|
||||||
|
-- Most likely the data directory doesn't exist, create it
|
||||||
|
-- and try again.
|
||||||
|
if minetest.mkdir then
|
||||||
|
minetest.mkdir(data_path)
|
||||||
|
else
|
||||||
|
-- Using os.execute like this is not very platform
|
||||||
|
-- independent or safe, but most platforms name their
|
||||||
|
-- directory creation utility mkdir, the data path is
|
||||||
|
-- unlikely to contain special characters, and the
|
||||||
|
-- data path is only mutable by the admin.
|
||||||
|
os.execute('mkdir "'..data_path..'"')
|
||||||
|
end
|
||||||
|
file = io.open(data_path..id, "w")
|
||||||
|
if not file then return end
|
||||||
|
end
|
||||||
|
|
||||||
|
local datastr = minetest.serialize(data)
|
||||||
|
if not datastr then return end
|
||||||
|
|
||||||
|
file:write(datastr)
|
||||||
|
file:close()
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
function datastorage.load(id)
|
||||||
|
local file = io.open(data_path..id, "r")
|
||||||
|
if not file then return end
|
||||||
|
|
||||||
|
local data = minetest.deserialize(file:read("*all"))
|
||||||
|
datastorage.data[id] = data
|
||||||
|
|
||||||
|
file:close()
|
||||||
|
return data
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Compatability
|
||||||
|
function datastorage.get_container(player, id)
|
||||||
|
return datastorage.get(player:get_player_name(), id)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Retrieves a value from the data storage
|
||||||
|
function datastorage.get(id, ...)
|
||||||
|
local last = datastorage.data[id]
|
||||||
|
if last == nil then last = datastorage.load(id) end
|
||||||
|
if last == nil then
|
||||||
|
last = {}
|
||||||
|
datastorage.data[id] = last
|
||||||
|
end
|
||||||
|
local cur = last
|
||||||
|
for _, sub_id in ipairs({...}) do
|
||||||
|
last = cur
|
||||||
|
cur = cur[sub_id]
|
||||||
|
if cur == nil then
|
||||||
|
cur = {}
|
||||||
|
last[sub_id] = cur
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return cur
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Saves a container and reomves it from memory
|
||||||
|
function datastorage.finish(id)
|
||||||
|
datastorage.save(id)
|
||||||
|
datastorage.data[id] = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Compatability
|
||||||
|
function datastorage.save_container(player)
|
||||||
|
return datastorage.save(player:get_player_name())
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
local player_name = player:get_player_name()
|
||||||
|
datastorage.save(player_name)
|
||||||
|
datastorage.data[player_name] = nil
|
||||||
|
end)
|
||||||
|
|
||||||
|
minetest.register_on_shutdown(function()
|
||||||
|
for id in pairs(datastorage.data) do
|
||||||
|
datastorage.save(id)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
539
doc/API.md
Normal file
@ -0,0 +1,539 @@
|
|||||||
|
# API documentation for the Documentation System
|
||||||
|
## Core concepts
|
||||||
|
As a modder, you are free to write basically about everything and are also
|
||||||
|
relatively free in the presentation of information. There are no
|
||||||
|
restrictions on content whatsoever.
|
||||||
|
|
||||||
|
### Categories and entries
|
||||||
|
In the Documentation System, everything is built on categories and entries.
|
||||||
|
An entry is a single piece of documentation and is the basis of all actual
|
||||||
|
documentation. Categories group multiple entries of the same topic together.
|
||||||
|
|
||||||
|
Categories also define a template function which is used to determine how the
|
||||||
|
final result in the tab “Entry list” looks like. Entries themselves have
|
||||||
|
a data field attached to them, this is a table containing arbitrary metadata
|
||||||
|
which is used to construct the final formspec in the Entry tab. It may also
|
||||||
|
be used for sorting entries in the entry list.
|
||||||
|
|
||||||
|
## Advanced concepts
|
||||||
|
### Viewed and hidden entries
|
||||||
|
The mod keeps track of which entries have been viewed on a per-player basis.
|
||||||
|
Any entry which has been accessed by a player is immediately marked as
|
||||||
|
“viewed”.
|
||||||
|
|
||||||
|
Entries can also be hidden. Hidden entries are not visible or otherwise
|
||||||
|
accessible to players until they become revealed by function calls.
|
||||||
|
|
||||||
|
Marking an entry as viewed or revealed is not reversible with this API.
|
||||||
|
The viewed and hidden states are stored in the file `doc.mt` inside the
|
||||||
|
world directory. You can safely delete this file if you want to reset
|
||||||
|
the player states.
|
||||||
|
|
||||||
|
### Entry aliases
|
||||||
|
Entry aliases are alternative identifiers for entry identifiers. With the
|
||||||
|
exception of the alias functions themselves, for functions demanding an
|
||||||
|
`entry_id` you can either supply the original `entry_id` or any alias of the
|
||||||
|
`entry_id`.
|
||||||
|
|
||||||
|
## Possible use cases
|
||||||
|
This section shows some possible use cases to give you a rough idea what
|
||||||
|
this mod is capable of and how these use cases could be implemented.
|
||||||
|
|
||||||
|
### Simple use case: Minetest basics
|
||||||
|
Let's say you want to write in free form short help texts about the basic
|
||||||
|
concepts of Minetest or your game. First you could define a category
|
||||||
|
called “Basics”, the data for each of its entry is just a free form text.
|
||||||
|
The template function simply creates a formspec where this free form
|
||||||
|
text is displayed.
|
||||||
|
|
||||||
|
This is one of the most simple use cases and the mod `doc_basics` does
|
||||||
|
exactly that.
|
||||||
|
|
||||||
|
### Complex use case: Blocks
|
||||||
|
You could create a category called “Blocks”, and this category is supposed to
|
||||||
|
contain entries for every single block (i.e. node) in the game. For this use
|
||||||
|
case, a free form approach would be very inefficient and error-prone, as a
|
||||||
|
lot of data can be reused.
|
||||||
|
|
||||||
|
Here the template function comes in handy: The internal entry data
|
||||||
|
contain a lot of different things about a block, like block name, identifier,
|
||||||
|
custom description and most importantly, the definition table of the block.
|
||||||
|
|
||||||
|
Finally, the template function takes all that data and turns it into
|
||||||
|
sentences which are just concatenated, telling as many useful facts about
|
||||||
|
this block as possible.
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
This is a list of all publicly available functions.
|
||||||
|
|
||||||
|
### Overview
|
||||||
|
The most important functions are `doc.add_category` and `doc.ad_entry`. All other functions
|
||||||
|
are mostly used for utility and examination purposes.
|
||||||
|
|
||||||
|
If not mentioned otherwise, the return value of all functions is `nil`.
|
||||||
|
|
||||||
|
These functions are available:
|
||||||
|
|
||||||
|
#### Core
|
||||||
|
* `doc.add_category`: Adds a new category
|
||||||
|
* `doc.add_entry`: Adds a new entry
|
||||||
|
|
||||||
|
#### Display
|
||||||
|
* `doc.show_entry`: Shows a particular entry to a player
|
||||||
|
* `doc.show_category`: Shows the entry list of a category to a player
|
||||||
|
* `doc.show_doc`: Opens the main help form for a player
|
||||||
|
|
||||||
|
#### Query
|
||||||
|
* `doc.get_category_definition`: Returns the definition table of a category
|
||||||
|
* `doc.get_entry_definition`: Returns the definition table of an entry
|
||||||
|
* `doc.entry_exists`: Checks whether an entry exists
|
||||||
|
* `doc.entry_viewed`: Checks whether an entry has been viewed/read by a player
|
||||||
|
* `doc.entry_revealed`: Checks whether an entry is visible and normally accessible to a player
|
||||||
|
* `doc.get_category_count`: Returns the total number of categories
|
||||||
|
* `doc.get_entry_count`: Returns the total number of entries in a category
|
||||||
|
* `doc.get_viewed_count`: Returns the number of entries a player has viewed in a category
|
||||||
|
* `doc.get_revealed_count`: Returns the number of entries a player has access to in a category
|
||||||
|
* `doc.get_hidden_count`: Returns the number of entries which are hidden from a player in a category
|
||||||
|
* `doc.get_selection`: Returns the currently viewed entry/category of a player
|
||||||
|
|
||||||
|
#### Modify
|
||||||
|
* `doc.set_category_order`: Sets the order of categories in the category list
|
||||||
|
* `doc.mark_entry_as_viewed`: Manually marks an entry as viewed/read by a player
|
||||||
|
* `doc.mark_entry_as_revealed`: Make a hidden entry visible and accessible to a player
|
||||||
|
* `doc.mark_all_entries_as_revealed`: Make all hidden entries visible and accessible to a player
|
||||||
|
|
||||||
|
#### Aliases
|
||||||
|
* `doc.add_entry_alias`: Add an alternative name which can be used to access an entry
|
||||||
|
|
||||||
|
#### Special widgets
|
||||||
|
This API provides functions to add unique “widgets” for functionality
|
||||||
|
you may find useful when creating entry templates. You find these
|
||||||
|
functions in `doc.widgets`.
|
||||||
|
Currently there is a widget for scrollable multi-line text and a
|
||||||
|
widget providing an image gallery.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### `doc.add_category(id, def)`
|
||||||
|
Adds a new category. You have to define an unique identifier, a name
|
||||||
|
and a template function to build the entry formspec from the entry
|
||||||
|
data.
|
||||||
|
|
||||||
|
**Important**: You must call this function *before* any player joins.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `id`: Unique category identifier as a string
|
||||||
|
* `def`: Definition table with the following fields:
|
||||||
|
* `name`: Category name to be shown in the interface
|
||||||
|
* `description`: (optional) Short description of the category,
|
||||||
|
will be shown as tooltip. Recommended style (in English):
|
||||||
|
First letter capitalized, no punctuation at the end,
|
||||||
|
max. 100 characters
|
||||||
|
* `build_formspec`: The template function (see below). Takes entry data
|
||||||
|
as its first parameter (has the data type of the entry data) and the
|
||||||
|
name of the player who views the entry as its second parameter. It must
|
||||||
|
return a formspec which is inserted in the Entry tab.
|
||||||
|
* `sorting`: (optional) Sorting algorithm for display order of entries
|
||||||
|
* `"abc"`: Alphabetical (default)
|
||||||
|
* `"nosort"`: Entries appear in no particular order
|
||||||
|
* `"custom"`: Manually define the order of entries in `sorting_data`
|
||||||
|
* `"function"`: Sort by function defined in `sorting_data`
|
||||||
|
* `sorting_data`: (optional) Additional data for special sorting methods.
|
||||||
|
* If `sorting=="custom"`, this field must contain a table (list form) in which
|
||||||
|
the entry IDs are specified in the order they are supposed to appear in the
|
||||||
|
entry list. All entries which are missing in this table will appear in no
|
||||||
|
particular order below the final specified one.
|
||||||
|
* If `sorting=="function"`, this field is a compare function to be used as
|
||||||
|
the `comp` parameter of `table.sort`. The parameters given are two entries.
|
||||||
|
* This field is not required if `sorting` has any other value
|
||||||
|
* `hide_entries_by_default` (optional): If `true`, all entries
|
||||||
|
added to this category will start as hidden, unless explicitly specified otherwise
|
||||||
|
(default: `false`)
|
||||||
|
|
||||||
|
Note: For function-based sorting, the entries provided to the compare function
|
||||||
|
will have the following format:
|
||||||
|
|
||||||
|
{
|
||||||
|
eid = e, -- unique entry identifier
|
||||||
|
name = n, -- entry name
|
||||||
|
data = d, -- arbitrary entry data
|
||||||
|
}
|
||||||
|
|
||||||
|
#### Using `build_formspec`
|
||||||
|
For `build_formspec` you can either define your own function which
|
||||||
|
procedurally generates the entry formspec or you use one of the
|
||||||
|
following predefined convenience functions:
|
||||||
|
|
||||||
|
* `doc.entry_builders.text`: Expects entry data to be a string.
|
||||||
|
It will be inserted directly into the entry. Useful for entries with
|
||||||
|
a free form text.
|
||||||
|
* `doc.entry_builders.text_and_gallery`: For entries with text and
|
||||||
|
an optional standard gallery (3 rows, 3:2 aspect ratio). Expects
|
||||||
|
entry data to be a table with these fields:
|
||||||
|
* `text`: The entry text
|
||||||
|
* `images`: The images of the gallery, the format is the same as the
|
||||||
|
`imagedata` parameter of `doc.widgets.gallery`. Can be `nil`, in
|
||||||
|
which case no gallery is shown for the entry
|
||||||
|
* `doc.entry_builders.formspec`: Entry data is expected to contain the
|
||||||
|
complete entry formspec as a string. Useful if your entries. Useful
|
||||||
|
if you expect your entries to differ wildly in layouts.
|
||||||
|
|
||||||
|
##### Formspec restrictions
|
||||||
|
When building your formspec, you have to respect the size limitations.
|
||||||
|
The help form currently uses a size of 15×10.5 and you must make sure
|
||||||
|
all entry widgets are inside a boundary box. The remaining space is
|
||||||
|
reserved for widgets of the help form and should not be used to avoid
|
||||||
|
overlapping.
|
||||||
|
Read from the following variables to calculate the final formspec coordinates:
|
||||||
|
|
||||||
|
* `doc.FORMSPEC.WIDTH`: Width of help formspec
|
||||||
|
* `doc.FORMSPEC.HEIGHT`: Height of help formspec
|
||||||
|
* `doc.FORMSPEC.ENTRY_START_X`: Leftmost X point of bounding box
|
||||||
|
* `doc.FORMSPEC.ENTRY_START_Y`: Topmost Y point of bounding box
|
||||||
|
* `doc.FORMSPEC.ENTRY_END_X`: Rightmost X point of bounding box
|
||||||
|
* `doc.FORMSPEC.ENTRY_END_Y`: Bottom Y point of bounding box
|
||||||
|
* `doc.FORMSPEC.ENTRY_WIDTH`: Width of the entry widgets bounding box
|
||||||
|
* `doc.FORMSPEC.ENTRY_HEIGHT`: Height of the entry widgets bounding box
|
||||||
|
|
||||||
|
Finally, to avoid naming collisions, you must make sure that all identifiers
|
||||||
|
of your own formspec elements do *not* begin with “`doc_`”.
|
||||||
|
|
||||||
|
##### Receiving formspec events
|
||||||
|
You can even use the formspec elements you have added with `build_formspec` to
|
||||||
|
receive formspec events, just like with any other formspec. For receiving, use
|
||||||
|
the standard function `minetest.register_on_player_receive_fields` to register
|
||||||
|
your event handling. The `formname` parameter will be `doc:entry`. Use
|
||||||
|
`doc.get_selection` to get the category ID and entry ID of the entry in question.
|
||||||
|
|
||||||
|
### `doc.add_entry(category_id, entry_id, def)`
|
||||||
|
Adds a new entry into an existing category. You have to define the category
|
||||||
|
to which to insert the entry, the entry's identifier, a name and some
|
||||||
|
data which defines the entry. Note you do not directly define here how the
|
||||||
|
end result of an entry looks like, this is done by `build_formspec` from
|
||||||
|
the category definition.
|
||||||
|
|
||||||
|
**Important**: You must call this function *before* any player joins.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `category_id`: Identifier of the category to add the entry into
|
||||||
|
* `entry_id`: Unique identifier of the new entry, as a string
|
||||||
|
* `def`: Definition table, it has the following fields:
|
||||||
|
* `name`: Entry name to be shown in the interface
|
||||||
|
* `hidden`: (optional) If `true`, entry will not be displayed in entry list
|
||||||
|
initially (default: `false`); it can be revealed later
|
||||||
|
* `data`: Arbitrary data attached to the entry. Any data type is allowed;
|
||||||
|
The data in this field will be used to create the actual formspec
|
||||||
|
with `build_formspec` from the category definition
|
||||||
|
|
||||||
|
### `doc.set_category_order(category_list)`
|
||||||
|
Sets the order of categories in the category list.
|
||||||
|
The help starts with this default order:
|
||||||
|
|
||||||
|
{"basics", "nodes", "tools", "craftitems", "advanced"}
|
||||||
|
|
||||||
|
This function can be called at any time, but it recommended to only call
|
||||||
|
this function once for the entire server session and to only call it
|
||||||
|
from game mods, to avoid contradictions. If this function is called a
|
||||||
|
second time by any mod, a warning is written into the log.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `category_list`: List of category IDs in the order they should appear
|
||||||
|
in the category list. All unspecified categories will be appended to
|
||||||
|
the end
|
||||||
|
|
||||||
|
|
||||||
|
### `doc.show_doc(playername)`
|
||||||
|
Opens the main help formspec for the player (“Category list” tab).
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `playername`: Name of the player to show the formspec to
|
||||||
|
|
||||||
|
### `doc.show_category(playername, category_id)`
|
||||||
|
Opens the help formspec for the player at the specified category
|
||||||
|
(“Entry list” tab).
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `playername`: Name of the player to show the formspec to
|
||||||
|
* `category_id`: Category identifier of the selected category
|
||||||
|
|
||||||
|
### `doc.show_entry(playername, category_id, entry_id, ignore_hidden)`
|
||||||
|
Opens the help formspec for the player showing the specified entry
|
||||||
|
of a category (“Entry” tab). If the entry is hidden, an error message
|
||||||
|
is displayed unless `ignore_hidden==true`.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `playername`: Name of the player to show the formspec to
|
||||||
|
* `category_id`: Category identifier of the selected category
|
||||||
|
* `entry_id`: Entry identifier of the entry to show
|
||||||
|
* `ignore_hidden`: (optional) If `true`, shows entry even if it is still hidden
|
||||||
|
to the player; this will automatically reveal the entry to this player for the
|
||||||
|
rest of the game
|
||||||
|
|
||||||
|
### `doc.get_category_definition(category_id)`
|
||||||
|
Returns the definition of the specified category.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `category_id`: Category identifier of the category to the the definition
|
||||||
|
for
|
||||||
|
|
||||||
|
#### Return value
|
||||||
|
The category's definition table as specified in the `def` argument of
|
||||||
|
`doc.add_category`. The table fields are the same.
|
||||||
|
|
||||||
|
### `doc.get_entry_definition(category_id, entry_id)`
|
||||||
|
Returns the definition of the specified entry.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `category_id`: Category identifier of entry's category
|
||||||
|
* `entry_id`: Entry identifier of the entry to get the definition for
|
||||||
|
|
||||||
|
#### Return value
|
||||||
|
The entry's definition table as specified in the `def` argument of
|
||||||
|
`doc.add_entry`. The table fields are the same.
|
||||||
|
|
||||||
|
### `doc.entry_exists(category_id, entry_id)`
|
||||||
|
Checks whether the specified entry exists and returns `true` or `false`.
|
||||||
|
Entry aliases are taken into account.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `category_id`: Category identifier of the category to check
|
||||||
|
* `entry_id`: Entry identifier of the entry to check for its existence
|
||||||
|
|
||||||
|
#### Return value
|
||||||
|
Returns `true` if and only if:
|
||||||
|
|
||||||
|
* The specified category exists
|
||||||
|
* It contains the specified entry
|
||||||
|
|
||||||
|
Otherwise, returns `false`.
|
||||||
|
|
||||||
|
### `doc.entry_viewed(playername, category_id, entry_id)`
|
||||||
|
Tells whether the specified entry is marked as “viewed” (or read) by
|
||||||
|
the player.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `playername`: Name of the player to check
|
||||||
|
* `category_id`: Category identifier of the category to check
|
||||||
|
* `entry_id`: Entry identifier of the entry to check
|
||||||
|
|
||||||
|
#### Return value
|
||||||
|
`true`, if entry is viewed, `false` otherwise.
|
||||||
|
|
||||||
|
### `doc.entry_revealed(playername, category_id, entry_id)`
|
||||||
|
Tells whether the specified entry is marked as “revealed” to the player
|
||||||
|
and thus visible and accessible to the player.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `playername`: Name of the player to check
|
||||||
|
* `category_id`: Category identifier of the category to check
|
||||||
|
* `entry_id`: Entry identifier of the entry to check
|
||||||
|
|
||||||
|
#### Return value
|
||||||
|
`true`, if entry is revealed, `false` otherwise.
|
||||||
|
|
||||||
|
### `doc.mark_entry_as_viewed(playername, category_id, entry_id)`
|
||||||
|
Marks a particular entry as “viewed” (or read) by a player. This will
|
||||||
|
also automatically reveal the entry to the player for the rest of
|
||||||
|
the game.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `playername`: Name of the player for whom to mark an entry as “viewed”
|
||||||
|
* `category_id`: Category identifier of the category of the entry to mark
|
||||||
|
* `entry_id`: Entry identifier of the entry to mark
|
||||||
|
|
||||||
|
### `doc.mark_entry_as_revealed(playername, category_id, entry_id)`
|
||||||
|
Marks a particular entry as “revealed” to a player. If the entry is
|
||||||
|
declared as hidden, it will become visible in the list of entries for
|
||||||
|
this player and will always be accessible with `doc.show_entry`. This
|
||||||
|
change remains for the rest of the game.
|
||||||
|
|
||||||
|
For entries which are not normally hidden, this function has no direct
|
||||||
|
effect.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `playername`: Name of the player for whom to reveal the entry
|
||||||
|
* `category_id`: Category identifier of the category of the entry to reveal
|
||||||
|
* `entry_id`: Entry identifier of the entry to reveal
|
||||||
|
|
||||||
|
### `doc.mark_all_entries_as_revealed(playername)`
|
||||||
|
Marks all entries as “revealed” to a player. This change remains for the
|
||||||
|
rest of the game.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `playername`: Name of the player for whom to reveal the entries
|
||||||
|
|
||||||
|
### `doc.add_entry_alias(category_id_orig, entry_id_orig, category_id_alias, entry_id_alias)`
|
||||||
|
Adds a single alias for an entry. If an entry has an alias, supplying the
|
||||||
|
alias to a function which demand `category_id` and `entry_id` will work as expected.
|
||||||
|
When using this function, you must make sure the category already exists.
|
||||||
|
|
||||||
|
This function could be useful for legacy support after changing an entry ID or
|
||||||
|
moving an entry to a different category.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `category_id_orig`: Category identifier of the category of the entry in question
|
||||||
|
* `entry_id_orig`: The original (!) entry identifier of the entry to create an alias
|
||||||
|
for
|
||||||
|
* `category_id_alias`: The category ID of the alias
|
||||||
|
* `entry_id_alias`: The entry ID of the alias
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
doc.add_entry_alias("nodes", "test", "craftitems", "test2")
|
||||||
|
|
||||||
|
When calling a function with category ID “craftitems” and entry ID “test2”, it will
|
||||||
|
act as if you supplied “nodes” as category ID and “test” as entry ID.
|
||||||
|
|
||||||
|
### `doc.get_category_count()`
|
||||||
|
Returns the number of registered categories.
|
||||||
|
|
||||||
|
#### Return value
|
||||||
|
Number of registered categories.
|
||||||
|
|
||||||
|
### `doc.get_entry_count(category_id)`
|
||||||
|
Returns the number of entries in a category.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `category_id`: Category identifier of the category in which to count entries
|
||||||
|
|
||||||
|
#### Return value
|
||||||
|
Number of entries in the specified category.
|
||||||
|
|
||||||
|
### `doc.get_viewed_count(playername, category_id)`
|
||||||
|
Returns how many entries have been viewed by a player.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `playername`: Name of the player to count the viewed entries for
|
||||||
|
* `category_id`: Category identifier of the category in which to count the
|
||||||
|
viewed entries
|
||||||
|
|
||||||
|
#### Return value
|
||||||
|
Amount of entries the player has viewed in the specified category. If the
|
||||||
|
player does not exist, this function returns `nil`.
|
||||||
|
|
||||||
|
### `doc.get_revealed_count(playername, category_id)`
|
||||||
|
Returns how many entries the player has access to (non-hidden entries)
|
||||||
|
in this category.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `playername`: Name of the player to count the revealed entries for
|
||||||
|
* `category_id`: Category identifier of the category in which to count the
|
||||||
|
revealed entries
|
||||||
|
|
||||||
|
#### Return value
|
||||||
|
Amount of entries the player has access to in the specified category. If the
|
||||||
|
player does not exist, this function returns `nil`.
|
||||||
|
|
||||||
|
### `doc.get_hidden_count(playername, category_id)`
|
||||||
|
Returns how many entries are hidden from the player in this category.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `playername`: Name of the player to count the hidden entries for
|
||||||
|
* `category_id`: Category identifier of the category in which to count the
|
||||||
|
hidden entries
|
||||||
|
|
||||||
|
#### Return value
|
||||||
|
Amount of entries hidden from the player. If the player does not exist,
|
||||||
|
this function returns `nil`.
|
||||||
|
|
||||||
|
### `doc.get_selection(playername)`
|
||||||
|
Returns the currently or last viewed entry and/or category of a player.
|
||||||
|
|
||||||
|
#### Parameter
|
||||||
|
* `playername`: Name of the player to query
|
||||||
|
|
||||||
|
#### Return value
|
||||||
|
It returns up to 2 values. The first one is the category ID, the second one
|
||||||
|
is the entry ID of the entry/category which the player is currently viewing
|
||||||
|
or is the last entry the player viewed in this session. If the player only
|
||||||
|
viewed a category so far, the second value is `nil`. If the player has not
|
||||||
|
viewed a category as well, both returned values are `nil`.
|
||||||
|
|
||||||
|
|
||||||
|
### `doc.widgets.text(data, x, y, width, height)`
|
||||||
|
This is a convenience function for creating a special formspec widget. It creates
|
||||||
|
a widget in which you can insert scrollable multi-line text.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
* `data`: Text to be written inside the widget
|
||||||
|
* `x`: Formspec X coordinate (optional)
|
||||||
|
* `y`: Formspec Y coordinate (optional)
|
||||||
|
* `width`: Width of the widget in formspec units (optional)
|
||||||
|
* `height`: Height of the widget in formspec units (optional)
|
||||||
|
|
||||||
|
The default values for the optional parameters result in a widget which fills
|
||||||
|
nearly the entire entry page.
|
||||||
|
|
||||||
|
#### Return value
|
||||||
|
Two values are returned, in this order:
|
||||||
|
|
||||||
|
* string: Contains a complete formspec definition building the widget
|
||||||
|
* string: Formspec element ID of the created widget
|
||||||
|
|
||||||
|
#### Note
|
||||||
|
If you use this function to build a formspec string, do not use identifiers
|
||||||
|
beginning with `doc_widget_text` to avoid naming collisions, as this function
|
||||||
|
makes use of such identifiers internally.
|
||||||
|
|
||||||
|
|
||||||
|
### `doc.widgets.gallery(imagedata, playername, x, y, aspect_ratio, width, rows, align_left, align_top)`
|
||||||
|
This function creates an image gallery which allows you to display an
|
||||||
|
arbitrary amount of images aligned horizontally. It is possible to add more
|
||||||
|
images than the space of an entry would normally held, this is done by adding
|
||||||
|
“scroll” buttons to the left and right which allows the user to see more images
|
||||||
|
of the gallery.
|
||||||
|
|
||||||
|
This function is useful for adding multiple illustration to your entry without
|
||||||
|
worrying about space too much. Adding illustrations can help you to create
|
||||||
|
entry templates which aren't just lengthy walls of text. ;-)
|
||||||
|
|
||||||
|
You can define the position, image aspect ratio, total gallery width and the
|
||||||
|
number of images displayed at once. You can *not* directly define the image
|
||||||
|
size, nor the resulting height of the overall gallery, those values will
|
||||||
|
be derived from the parameters.
|
||||||
|
|
||||||
|
You can only really use this function efficiently inside a *custom*
|
||||||
|
`build_formspec` function definition. This is because you need to pass a
|
||||||
|
`playername`. You can currently also only add up to one gallery per entry;
|
||||||
|
adding more galleries is not supported and will lead to bugs.
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `imagedata`: List of images to be displayed in the specified order. All images must
|
||||||
|
have the same aspect ratio. It's a table of tables with this format:
|
||||||
|
* `imagetype`: Type of image to be used (optional):
|
||||||
|
* `"image"`: Texture file (default)
|
||||||
|
* `"item"`: Item image, specified as itemstring
|
||||||
|
* `image`: What to display. Depending on `imagetype`, a texture file or itemstring
|
||||||
|
* `playername`: Name of the player who is viewing the entry in question
|
||||||
|
* `x`: Formspec X coordinate of the top left corner (optional)
|
||||||
|
* `y`: Formspec Y coordinate of the top left corner (optional)
|
||||||
|
* `aspect_ratio`: Aspect ratio of all the images (width/height)
|
||||||
|
* `width`: Total gallery width in formspec units (optional)
|
||||||
|
* `rows`: Number of images which can be seen at once (optional)
|
||||||
|
* `align_left`: If `false`, gallery is aligned to the left instead of the right (optional)
|
||||||
|
* `align_right`: If `false`, gallery is aligned to the bottom instead of the top (optional)
|
||||||
|
|
||||||
|
The default values for the optional parameters result in a gallery with
|
||||||
|
3 rows which is placed at the top left corner and spans the width of the
|
||||||
|
entry and assumes an aspect ratio of two thirds.
|
||||||
|
|
||||||
|
If the number of images is greater than `rows`, “scroll” buttons will appear
|
||||||
|
at the left and right side of the images.
|
||||||
|
|
||||||
|
#### Return values
|
||||||
|
Two values are returned, in this order:
|
||||||
|
|
||||||
|
* string: Contains a complete formspec definition building the gallery
|
||||||
|
* number: The height the gallery occupies in the formspec
|
||||||
|
|
||||||
|
## Extending this mod (naming conventions)
|
||||||
|
If you want to extend this mod with your own functionality, it is recommended
|
||||||
|
that you put all API functions into `doc.sub.<name>`.
|
||||||
|
As a naming convention, if you mod *primarily* depends on `doc`, it is recommended
|
||||||
|
to use a short mod name which starts with “`doc_`”, like `doc_items`,
|
||||||
|
`doc_minetest_game`, or `doc_identifier`.
|
||||||
|
|
||||||
|
One mod which uses this convention is `doc_items` which uses the `doc.sub.items`
|
||||||
|
table.
|
||||||
|
|
||||||
|
|
52
doc/README.md
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# Documentation System [`doc`]
|
||||||
|
This mod provides a simple and highly extensible form in which the user
|
||||||
|
can access help pages about various things and the modder can add those pages.
|
||||||
|
The mod itself does not provide any help texts, just the framework.
|
||||||
|
It is the heart of the Help modpack, on which the other Help mods depend.
|
||||||
|
|
||||||
|
Current version: 1.2.1
|
||||||
|
|
||||||
|
## For players
|
||||||
|
### Accessing the help
|
||||||
|
To open the help, there are multiple ways:
|
||||||
|
|
||||||
|
- Use the `/helpform` chat command. This works always.
|
||||||
|
- If you use one of these mods, there's a help button in the inventory menu:
|
||||||
|
- Unified Inventory [`unified_inventory`]
|
||||||
|
- Simple Fast Inventory Buttons [`sfinv_buttons`]
|
||||||
|
- Inventory++ [`inventory_plus`]
|
||||||
|
|
||||||
|
The help itself should be more or less self-explanatory.
|
||||||
|
|
||||||
|
This mod is useless on its own, you will only need this mod as a dependency
|
||||||
|
for mods which actually add some help entries.
|
||||||
|
|
||||||
|
### Hidden entries
|
||||||
|
Some entries are initially hidden from you. You can't see them until you
|
||||||
|
unlocked them. Mods can decide for themselves how particular entries are
|
||||||
|
revealed. Normally you just have to proceed in the game to unlock more
|
||||||
|
entries. Hidden entries exist to avoid spoilers and give players a small
|
||||||
|
sense of progress.
|
||||||
|
|
||||||
|
Players with the `help_reveal` privilege can use the `/help_reveal` chat
|
||||||
|
command to reveal all hidden entries instantly.
|
||||||
|
|
||||||
|
### Maintenance
|
||||||
|
The information of which player has viewed and revealed which entries is
|
||||||
|
stored in the world directory in the file `doc.mt`. You can safely reset
|
||||||
|
the viewed/revealed state of all players by deleting this file. Players
|
||||||
|
then need to start over revealing all entries.
|
||||||
|
|
||||||
|
## For modders and game authors
|
||||||
|
This mod helps you in creating extensive and flexible help entries for your
|
||||||
|
mods or game. You can write about basically anything in the presentation
|
||||||
|
you prefer.
|
||||||
|
|
||||||
|
To get started, read `API.md` in the directory of this mod.
|
||||||
|
|
||||||
|
Note: If you want to add help texts for items and nodes, refer to the API
|
||||||
|
documentation of `doc_items`, instead of manually adding entries.
|
||||||
|
For custom entities, you may also want to add support for `doc_identifier`.
|
||||||
|
|
||||||
|
## License of everything
|
||||||
|
MIT License
|
1220
doc/init.lua
Normal file
51
doc/locale/doc.de.tr
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# textdomain:doc
|
||||||
|
<=<
|
||||||
|
>=>
|
||||||
|
Access to the requested entry has been denied; this entry is secret. You may unlock access by progressing in the game. Figure out on your own how to unlock this entry.=Der Zugriff auf den angeforderten Eintrag wurde verweigert; dieser Eintrag ist geheim. Sie können durch weiteren Spielfortschritt den Zugriff freischalten. Finden Sie selbst heraus, wie Sie diesen Eintrag freischalten können.
|
||||||
|
All entries read.=Alle Einträge gelesen.
|
||||||
|
All help entries revealed!=Alle Hilfseinträge aufgedeckt!
|
||||||
|
All help entries are already revealed.=Alle Hilfseinträge sind schon aufgedeckt.
|
||||||
|
Allows you to reveal all hidden help entries with /help_reveal=Ermöglicht es Ihnen, alle verborgenen Hilfseinträge mit /help_reveal freizuschalten
|
||||||
|
Category list=Kategorienliste
|
||||||
|
Currently all entries in this category are hidden from you.=Momentan sind alle Einträge in dieser Kategorie vor Ihnen verborgen.
|
||||||
|
Unlock new entries by progressing in the game.=Schalten Sie neue Einträge frei, indem Sie im Spiel fortschreiten.
|
||||||
|
Help=Hilfe
|
||||||
|
Entry=Eintrag
|
||||||
|
Entry list=Eintragsliste
|
||||||
|
Error: Access denied.=Fehler: Zugriff verweigert.
|
||||||
|
Error: No help available.=Fehler: Keine Hilfe verfügbar.
|
||||||
|
Go to category list=Zur Kategorienliste
|
||||||
|
Go to entry list=Zur Eintragsliste
|
||||||
|
Help > (No Category)=Hilfe > (Keine Kategorie)
|
||||||
|
Help > @1=Hilfe > @1
|
||||||
|
Help > @1 > @2=Hilfe > @1 > @2
|
||||||
|
Help > @1 > (No Entry)=Hilfe > @1 > (Kein Eintrag)
|
||||||
|
Hidden entries: @1=Verborgene Einträge: @1
|
||||||
|
New entries: @1=Neue Einträge: @1
|
||||||
|
New help entry unlocked: @1 > @2=Neuen Hilfseintrag freigeschaltet: @1 > @2
|
||||||
|
No categories have been registered, but they are required to provide help.=Es wurden keine Kategorien registriert, aber sie werden benötigt, um die Hilfe anbieten zu können.
|
||||||
|
The Documentation System [doc] does not come with help contents on its own, it needs additional mods to add help content. Please make sure such mods are enabled on for this world, and try again.=Das Dokumentationssystem [doc] bringt von sich aus keine eigenen Hilfsinhalte mit, es benötigt zusätzliche Mods, um sie hinzuzufügen. Bitte stellen Sie sicher, dass solche Mods für diese Welt aktiviert sind und versuchen Sie es erneut.
|
||||||
|
Number of entries: @1=Anzahl der Einträge: @1
|
||||||
|
OK=OK
|
||||||
|
Open a window providing help entries about Minetest and more=Ein Fenster mit Hilfseinträgen über Minetest und mehr öffnen
|
||||||
|
Please select a category you wish to learn more about:=Bitte wählen Sie eine Kategorie, über die Sie mehr erfahren möchten, aus:
|
||||||
|
Recommended mods: doc_basics, doc_items, doc_identifier, doc_encyclopedia.=Empfohlene Mods: doc_basics, doc_items, doc_identifier, doc_encyclopedia.
|
||||||
|
Reveal all hidden help entries to you=Alle für Sie verborgenen Hilfseinträge freischalten
|
||||||
|
Show entry=Eintrag zeigen
|
||||||
|
Show category=Kategorie zeigen
|
||||||
|
Show next entry=Nächsten Eintrag zeigen
|
||||||
|
Show previous entry=Vorherigen Eintrag zeigen
|
||||||
|
This category does not have any entries.=Diese Kategorie hat keine Einträge.
|
||||||
|
This category has the following entries:=Diese Kategorie hat die folgenden Einträge:
|
||||||
|
This category is empty.=Diese Kategorie ist leer.
|
||||||
|
This is the help.=Dies ist die Hilfe.
|
||||||
|
You haven't chosen a category yet. Please choose one in the category list first.=Sie haben noch keine Kategorie gewählt, Bitte wählen Sie zuerst eine aus.
|
||||||
|
You haven't chosen an entry yet. Please choose one in the entry list first.=Sie haben noch keinen Eintrag gewählt. Bitte wählen Sie zuerst einen aus.
|
||||||
|
Nameless entry (@1)=Namenloser Eintrag (@1)
|
||||||
|
Collection of help texts=Sammlung von Hilfstexten
|
||||||
|
Notify me when new help is available=Benachrichtigen, wenn neue Hilfe verfügbar ist
|
||||||
|
Play notification sound when new help is available=Toneffekt abspielen, wenn neue Hilfe verfügbar ist
|
||||||
|
Show previous image=Vorheriges Bild zeigen
|
||||||
|
Show previous gallery page=Vorherige Galerieseite zeigen
|
||||||
|
Show next image=Nächstes Bild zeigen
|
||||||
|
Show next gallery page=Nächste Galerieseite zeigen
|
43
doc/locale/doc.pt.tr
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# textdomain:doc
|
||||||
|
<=
|
||||||
|
>=
|
||||||
|
Access to the requested entry has been denied; this entry is secret. You may unlock access by progressing in the game. Figure out on your own how to unlock this entry.=O acesso à entrada solicitada foi negado; essa entrada é secreta. Você pode desbloquear o acesso progredindo no jogo. Descobrir por conta própria como desbloquear essa entrada.
|
||||||
|
All entries read.=Todas as entradas lidas.
|
||||||
|
All help entries revealed!=Todas as entradas de ajuda reveladas!
|
||||||
|
All help entries are already revealed.=Todas as entradas de ajuda já foram reveladas.
|
||||||
|
Allows you to reveal all hidden help entries with /help_reveal=Permite revelar todas as entradas de ajuda ocultas com /help_reveal
|
||||||
|
Category list=Lista de Categorias
|
||||||
|
Currently all entries in this category are hidden from you.\\nUnlock new entries by progressing in the game.=Atualmente, todas as entradas nessa categoria estão ocultas a você.\\nDesbloqueie novas entradas progredindo no jogo.
|
||||||
|
Help=Ajuda
|
||||||
|
Entry=Entrada
|
||||||
|
Entry list=Lista de Entradas
|
||||||
|
Error: Access denied.=Erro: Acesso negado.
|
||||||
|
Error: No help available.=Erro: Nenhuma ajuda disponível.
|
||||||
|
Go to category list=Ver categorias
|
||||||
|
Go to entry list=Ir para a lista de entradas
|
||||||
|
Help > @1=Ajuda > @1
|
||||||
|
Help > @1 > @2=Ajuda > @1 > @2
|
||||||
|
Help > @1 > (No Entry)=Ajuda > @1 > (Nenhuma Entrada)
|
||||||
|
Help > (No Category)=Ajuda > (Nenhuma Categoria)
|
||||||
|
Hidden entries: @1=Entradas ocultas: @1
|
||||||
|
Nameless entry (@1)=Entrada sem nome (@1)
|
||||||
|
New entries: @1=Novas entradas: (@1)
|
||||||
|
New help entry unlocked: @1 > @2=Nova entrada de ajuda desbloqueada: @1 > @2
|
||||||
|
No categories have been registered, but they are required to provide help.\nThe Documentation System [doc] does not come with help contents on its own, it needs additional mods to add help content. Please make sure such mods are enabled on for this world, and try again.=Nenhuma categoria foi registrada, mas é necessário fornecer ajuda.\nO Sistema de Documentação [doc] não vem com o conteúdo de ajuda, ele precisa de mods adicionais para adicionar conteúdo de ajuda. Por favor, certifique-se de que os mods estão habilitados para este mundo e tente novamente.
|
||||||
|
Number of entries: @1=Número de entradas: @1
|
||||||
|
OK=OK
|
||||||
|
Open a window providing help entries about Minetest and more=Abra uma janela fornecendo entradas de ajuda sobre o Minetest e mais
|
||||||
|
Please select a category you wish to learn more about:=Por favor, selecione uma categoria sobre a qual você deseja saber mais:
|
||||||
|
Recommended mods: doc_basics, doc_items, doc_identifier, doc_encyclopedia.=Mods recomendados: doc_basics, doc_items, doc_identifier, doc_encyclopedia.
|
||||||
|
Reveal all hidden help entries to you=Revela todas as entradas de ajuda ocultas para você
|
||||||
|
Show entry=Ver entrada
|
||||||
|
Show category=Ver categoria
|
||||||
|
Show next entry=Ver próxima entrada
|
||||||
|
Show previous entry=Ver entrada anterior
|
||||||
|
This category does not have any entries.=Essa categoria não possui entradas.
|
||||||
|
This category has the following entries:=Essa categoria tem as seguintes entradas:
|
||||||
|
This category is empty.=Essa categoria está vazia.
|
||||||
|
This is the help.=Essa é a ajuda.
|
||||||
|
You haven't chosen a category yet. Please choose one in the category list first.=Você ainda não escolheu uma categoria. Por favor, escolha uma na lista de categorias primeiro.
|
||||||
|
You haven't chosen an entry yet. Please choose one in the entry list first.=Você ainda não escolheu uma entrada. Por favor, escolha uma na lista de entrada primeiro.
|
||||||
|
Collection of help texts=Coleção de textos de ajuda
|
43
doc/locale/doc.pt_BR.tr
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# textdomain:doc
|
||||||
|
<=
|
||||||
|
>=
|
||||||
|
Access to the requested entry has been denied; this entry is secret. You may unlock access by progressing in the game. Figure out on your own how to unlock this entry.=O acesso à entrada solicitada foi negado; essa entrada é secreta. Você pode desbloquear o acesso progredindo no jogo. Descobrir por conta própria como desbloquear essa entrada.
|
||||||
|
All entries read.=Todas as entradas lidas.
|
||||||
|
All help entries revealed!=Todas as entradas de ajuda reveladas!
|
||||||
|
All help entries are already revealed.=Todas as entradas de ajuda já foram reveladas.
|
||||||
|
Allows you to reveal all hidden help entries with /help_reveal=Permite revelar todas as entradas de ajuda ocultas com /help_reveal
|
||||||
|
Category list=Lista de Categorias
|
||||||
|
Currently all entries in this category are hidden from you.\\nUnlock new entries by progressing in the game.=Atualmente, todas as entradas nessa categoria estão ocultas a você.\\nDesbloqueie novas entradas progredindo no jogo.
|
||||||
|
Help=Ajuda
|
||||||
|
Entry=Entrada
|
||||||
|
Entry list=Lista de Entradas
|
||||||
|
Error: Access denied.=Erro: Acesso negado.
|
||||||
|
Error: No help available.=Erro: Nenhuma ajuda disponível.
|
||||||
|
Go to category list=Ver categorias
|
||||||
|
Go to entry list=Ir para a lista de entradas
|
||||||
|
Help > @1=Ajuda > @1
|
||||||
|
Help > @1 > @2=Ajuda > @1 > @2
|
||||||
|
Help > @1 > (No Entry)=Ajuda > @1 > (Nenhuma Entrada)
|
||||||
|
Help > (No Category)=Ajuda > (Nenhuma Categoria)
|
||||||
|
Hidden entries: @1=Entradas ocultas: @1
|
||||||
|
Nameless entry (@1)=Entrada sem nome (@1)
|
||||||
|
New entries: @1=Novas entradas: (@1)
|
||||||
|
New help entry unlocked: @1 > @2=Nova entrada de ajuda desbloqueada: @1 > @2
|
||||||
|
No categories have been registered, but they are required to provide help.\nThe Documentation System [doc] does not come with help contents on its own, it needs additional mods to add help content. Please make sure such mods are enabled on for this world, and try again.=Nenhuma categoria foi registrada, mas é necessário fornecer ajuda.\nO Sistema de Documentação [doc] não vem com o conteúdo de ajuda, ele precisa de mods adicionais para adicionar conteúdo de ajuda. Por favor, certifique-se de que os mods estão habilitados para este mundo e tente novamente.
|
||||||
|
Number of entries: @1=Número de entradas: @1
|
||||||
|
OK=OK
|
||||||
|
Open a window providing help entries about Minetest and more=Abra uma janela fornecendo entradas de ajuda sobre o Minetest e mais
|
||||||
|
Please select a category you wish to learn more about:=Por favor, selecione uma categoria sobre a qual você deseja saber mais:
|
||||||
|
Recommended mods: doc_basics, doc_items, doc_identifier, doc_encyclopedia.=Mods recomendados: doc_basics, doc_items, doc_identifier, doc_encyclopedia.
|
||||||
|
Reveal all hidden help entries to you=Revela todas as entradas de ajuda ocultas para você
|
||||||
|
Show entry=Ver entrada
|
||||||
|
Show category=Ver categoria
|
||||||
|
Show next entry=Ver próxima entrada
|
||||||
|
Show previous entry=Ver entrada anterior
|
||||||
|
This category does not have any entries.=Essa categoria não possui entradas.
|
||||||
|
This category has the following entries:=Essa categoria tem as seguintes entradas:
|
||||||
|
This category is empty.=Essa categoria está vazia.
|
||||||
|
This is the help.=Essa é a ajuda.
|
||||||
|
You haven't chosen a category yet. Please choose one in the category list first.=Você ainda não escolheu uma categoria. Por favor, escolha uma na lista de categorias primeiro.
|
||||||
|
You haven't chosen an entry yet. Please choose one in the entry list first.=Você ainda não escolheu uma entrada. Por favor, escolha uma na lista de entrada primeiro.
|
||||||
|
Collection of help texts=Coleção de textos de ajuda
|
51
doc/locale/template.txt
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# textdomain:doc
|
||||||
|
<=
|
||||||
|
>=
|
||||||
|
Access to the requested entry has been denied; this entry is secret. You may unlock access by progressing in the game. Figure out on your own how to unlock this entry.=
|
||||||
|
All entries read.=
|
||||||
|
All help entries revealed!=
|
||||||
|
All help entries are already revealed.=
|
||||||
|
Allows you to reveal all hidden help entries with /help_reveal=
|
||||||
|
Category list=
|
||||||
|
Currently all entries in this category are hidden from you.
|
||||||
|
Unlock new entries by progressing in the game.=
|
||||||
|
Help=
|
||||||
|
Entry=
|
||||||
|
Entry list=
|
||||||
|
Error: Access denied.=
|
||||||
|
Error: No help available.=
|
||||||
|
Go to category list=
|
||||||
|
Go to entry list=
|
||||||
|
Help > @1=
|
||||||
|
Help > @1 > @2=
|
||||||
|
Help > @1 > (No Entry)=
|
||||||
|
Help > (No Category)=
|
||||||
|
Hidden entries: @1=
|
||||||
|
Nameless entry (@1)=
|
||||||
|
New entries: @1=
|
||||||
|
New help entry unlocked: @1 > @2=
|
||||||
|
No categories have been registered, but they are required to provide help.=
|
||||||
|
The Documentation System [doc] does not come with help contents on its own, it needs additional mods to add help content. Please make sure such mods are enabled on for this world, and try again.=
|
||||||
|
Number of entries: @1=
|
||||||
|
OK=
|
||||||
|
Open a window providing help entries about Minetest and more=
|
||||||
|
Please select a category you wish to learn more about:=
|
||||||
|
Recommended mods: doc_basics, doc_items, doc_identifier, doc_encyclopedia.=
|
||||||
|
Reveal all hidden help entries to you=
|
||||||
|
Show entry=
|
||||||
|
Show category=
|
||||||
|
Show next entry=
|
||||||
|
Show previous entry=
|
||||||
|
This category does not have any entries.=
|
||||||
|
This category has the following entries:=
|
||||||
|
This category is empty.=
|
||||||
|
This is the help.=
|
||||||
|
You haven't chosen a category yet. Please choose one in the category list first.=
|
||||||
|
You haven't chosen an entry yet. Please choose one in the entry list first.=
|
||||||
|
Collection of help texts=
|
||||||
|
Notify me when new help is available=
|
||||||
|
Play notification sound when new help is available=
|
||||||
|
Show previous image=
|
||||||
|
Show previous gallery page=
|
||||||
|
Show next image=
|
||||||
|
Show next gallery page=
|
3
doc/mod.conf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
name = doc
|
||||||
|
optional_depends = unified_inventory, sfinv_buttons, central_message, inventory_plus
|
||||||
|
description = A simple in-game documentation system which enables mods to add help entries based on templates.
|
BIN
doc/screenshot.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
doc/sounds/doc_reveal.ogg
Normal file
BIN
doc/textures/doc_awards_icon_generic.png
Normal file
After Width: | Height: | Size: 639 B |
BIN
doc/textures/doc_button_icon_hires.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
doc/textures/doc_button_icon_lores.png
Normal file
After Width: | Height: | Size: 722 B |
BIN
doc/textures/inventory_plus_doc_inventory_plus.png
Normal file
After Width: | Height: | Size: 722 B |
13
hyperloop/LICENSE.txt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
90
hyperloop/README.md
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
# Hyperloop v2
|
||||||
|
|
||||||
|
**A new evolution in the voxel word:**
|
||||||
|
|
||||||
|
## Minetest goes Hyperloop!
|
||||||
|
|
||||||
|
Hyperloop is passenger transportation system for travelling through evacuated tubes my means of passenger pods.
|
||||||
|
It is the fast and modern way of travelling.
|
||||||
|
* Hyperloop allows travelling from point to point in seconds (900 km/h) :-)
|
||||||
|
* The tubes system with all stations and pods have to be build by players
|
||||||
|
* It can be used even on small servers without lagging
|
||||||
|
* No configuration or programming of the tube network is necessary (only the station names have to be entered)
|
||||||
|
|
||||||
|
|
||||||
|
**![See Wiki Page for more info](https://github.com/joe7575/Minetest-Hyperloop/wiki)**
|
||||||
|
|
||||||
|
![screenshot](https://github.com/joe7575/Minetest-Hyperloop/blob/master/screenshot.png)
|
||||||
|
|
||||||
|
|
||||||
|
The mod includes many different kind of blocks:
|
||||||
|
- Hyperloop Stations Block to automatically build the pod/car
|
||||||
|
- Hyperloop Booking Machine for the station to select the destination
|
||||||
|
- Hyperloop Tube to connect two stations
|
||||||
|
- Hyperloop Junction Block to connect up to 6 tubes for complex network structures
|
||||||
|
- Hyperloop Stations Signs
|
||||||
|
- Hyperloop Promo Poster for station advertisement
|
||||||
|
- Hyperloop Elevator to reach other levels
|
||||||
|
- Hyperloop Elevator Shaft to connect two elevator cars
|
||||||
|
- Hyperloop Station Book with all available stations (for builders/engineers)
|
||||||
|
- Hyperloop Tube Crowbar to crack/repair tube lines (for admins)
|
||||||
|
- Hyperloop WiFi Tubes for very large distances (optional)
|
||||||
|
- chat command to repair WorldEdit placed tubes
|
||||||
|
..and more.
|
||||||
|
|
||||||
|
|
||||||
|
Browse on: ![GitHub](https://github.com/joe7575/Minetest-Hyperloop)
|
||||||
|
|
||||||
|
Download: ![GitHub](https://github.com/joe7575/Minetest-Hyperloop/archive/master.zip)
|
||||||
|
|
||||||
|
|
||||||
|
## Migration from v1 to v2
|
||||||
|
The logic behind the tubes/shafts has changed. Hyperloop now uses tubelib2 as tube library.
|
||||||
|
That means, available worlds have to be migrated for the new tubes. This is done automatically but
|
||||||
|
has some risks. Therefore:
|
||||||
|
|
||||||
|
**I recommend to backup your world or test the migration from v1 to v2 on a copy of your world!!!**
|
||||||
|
|
||||||
|
|
||||||
|
## What is new in v2
|
||||||
|
- some textures changed
|
||||||
|
- the Elevator Shafts can now be used as ladder/climbing shafts
|
||||||
|
- the Crowbar is public available, but cracking a tube line need 'hyperloop' privs
|
||||||
|
- the Station Book is improved and simplified to find stations, junctions, and open tube ends
|
||||||
|
- a Waypoint plate is added to mark and easier find the tube destination
|
||||||
|
- Elevator shafts can be build in all directions (optional)
|
||||||
|
- WiFi Tubes can be crafted and placed by players (optional)
|
||||||
|
- intllib support added (German translation available)
|
||||||
|
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
**![See Wiki Page for more info](https://github.com/joe7575/Minetest-Hyperloop/wiki)**
|
||||||
|
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
The following can be changed in the minetest menu (Settings -> Advanced Settings -> Mods -> hyperloop) or directly in 'minetest.conf'
|
||||||
|
* "WiFi block enabled" - To enable the usage of WiFi blocks
|
||||||
|
* "WiFi block crafting enabled" - To enable the crafting of WiFi blocks
|
||||||
|
* "free tube placement enabled" - If enabled Hyperloop Tubes and Elevator Shafts can be build in all directions.
|
||||||
|
When this option is disabled, Hyperloop tubes can only be built in the horizontal direction and elevator shafts in the vertical direction.
|
||||||
|
|
||||||
|
Example for 'minetest.conf':
|
||||||
|
```LUA
|
||||||
|
hyperloop_wifi_enabled = true
|
||||||
|
hyperloop_wifi_crafting_enabled = false
|
||||||
|
hyperloop_free_tube_placement_enabled = true
|
||||||
|
```
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
tubelib2 (![GitHub](https://github.com/joe7575/tubelib2))
|
||||||
|
default
|
||||||
|
intllib
|
||||||
|
optional: worldedit, techage
|
||||||
|
|
||||||
|
|
||||||
|
# License
|
||||||
|
Copyright (C) 2017,2020 Joachim Stolberg
|
||||||
|
Code: Licensed under the GNU LGPL version 2.1 or later. See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt
|
||||||
|
Textures: CC0
|
||||||
|
Display: Derived from the work of kaeza, sofar and others (digilines) LGPLv2.1+
|
84
hyperloop/booking.lua
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
--[[
|
||||||
|
|
||||||
|
Hyperloop Mod
|
||||||
|
=============
|
||||||
|
|
||||||
|
Copyright (C) 2017-2019 Joachim Stolberg
|
||||||
|
|
||||||
|
LGPLv2.1+
|
||||||
|
See LICENSE.txt for more information
|
||||||
|
|
||||||
|
Station reservation/blocking and trip booking
|
||||||
|
]]--
|
||||||
|
|
||||||
|
-- for lazy programmers
|
||||||
|
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||||
|
local P = minetest.string_to_pos
|
||||||
|
local M = minetest.get_meta
|
||||||
|
|
||||||
|
local S = hyperloop.S
|
||||||
|
local NS = hyperloop.NS
|
||||||
|
|
||||||
|
local tBlockingTime = {}
|
||||||
|
local tBookings = {} -- open bookings: tBookings[SP(departure_pos)] = arrival_pos
|
||||||
|
|
||||||
|
local Stations = hyperloop.Stations
|
||||||
|
|
||||||
|
-- Reserve departure and arrival stations for some time
|
||||||
|
function hyperloop.reserve(departure_pos, arrival_pos, player)
|
||||||
|
if Stations:get(departure_pos) == nil then
|
||||||
|
hyperloop.chat(player, S("Station data is corrupted. Please rebuild the station!"))
|
||||||
|
return false
|
||||||
|
elseif Stations:get(arrival_pos) == nil then
|
||||||
|
hyperloop.chat(player, S("Station data is corrupted. Please rebuild the station!"))
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
if (tBlockingTime[SP(departure_pos)] or 0) > minetest.get_gametime() then
|
||||||
|
hyperloop.chat(player, S("Station is still blocked. Please try again in a few seconds!"))
|
||||||
|
return false
|
||||||
|
elseif (tBlockingTime[SP(arrival_pos)] or 0) > minetest.get_gametime() then
|
||||||
|
hyperloop.chat(player, S("Station is still blocked. Please try again in a few seconds!"))
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- place a reservation for 20 seconds to start the trip
|
||||||
|
tBlockingTime[SP(departure_pos)] = minetest.get_gametime() + 20
|
||||||
|
tBlockingTime[SP(arrival_pos)] = minetest.get_gametime() + 20
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
-- block the already reserved stations
|
||||||
|
function hyperloop.block(departure_pos, arrival_pos, seconds)
|
||||||
|
if Stations:get(departure_pos) == nil then
|
||||||
|
return false
|
||||||
|
elseif Stations:get(arrival_pos) == nil then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
tBlockingTime[SP(departure_pos)] = minetest.get_gametime() + seconds
|
||||||
|
tBlockingTime[SP(arrival_pos)] = minetest.get_gametime() + seconds
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
-- check if station is blocked
|
||||||
|
function hyperloop.is_blocked(pos)
|
||||||
|
if not pos then return false end
|
||||||
|
if Stations:get(pos) == nil then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
return (tBlockingTime[SP(pos)] or 0) > minetest.get_gametime()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function hyperloop.set_arrival(departure_pos, arrival_pos)
|
||||||
|
tBookings[SP(departure_pos)] = arrival_pos
|
||||||
|
end
|
||||||
|
|
||||||
|
function hyperloop.get_arrival(departure_pos)
|
||||||
|
-- Return and delete the arrival pos
|
||||||
|
local arrival_pos = tBookings[SP(departure_pos)]
|
||||||
|
tBookings[SP(departure_pos)] = nil
|
||||||
|
return arrival_pos
|
||||||
|
end
|
288
hyperloop/booking_node.lua
Normal file
@ -0,0 +1,288 @@
|
|||||||
|
--[[
|
||||||
|
|
||||||
|
Hyperloop Mod
|
||||||
|
=============
|
||||||
|
|
||||||
|
Copyright (C) 2017-2019 Joachim Stolberg
|
||||||
|
|
||||||
|
LGPLv2.1+
|
||||||
|
See LICENSE.txt for more information
|
||||||
|
|
||||||
|
Booking/ticket machine
|
||||||
|
]]--
|
||||||
|
|
||||||
|
-- for lazy programmers
|
||||||
|
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||||
|
local P = minetest.string_to_pos
|
||||||
|
local M = minetest.get_meta
|
||||||
|
|
||||||
|
-- Load support for intllib.
|
||||||
|
local S = hyperloop.S
|
||||||
|
local NS = hyperloop.NS
|
||||||
|
|
||||||
|
-- Used to store the Station list for each booking machine:
|
||||||
|
-- tStationList[SP(pos)] = {pos1, pos2, ...}
|
||||||
|
local tStationList = {}
|
||||||
|
|
||||||
|
local Stations = hyperloop.Stations
|
||||||
|
|
||||||
|
|
||||||
|
-- Form spec for the station list
|
||||||
|
local function generate_string(sortedList)
|
||||||
|
local tRes = {"size[12,8]"..
|
||||||
|
default.gui_bg..
|
||||||
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
"item_image[0,0;1,1;hyperloop:booking]"..
|
||||||
|
"label[4,0; "..S("Select your destination").."]"}
|
||||||
|
tRes[2] = "tablecolumns[text,width=20;text,width=6,align=right;text]"
|
||||||
|
|
||||||
|
local stations = {}
|
||||||
|
for idx,tDest in ipairs(sortedList) do
|
||||||
|
local name = tDest.name or S("<unknown>")
|
||||||
|
local distance = tDest.distance or 0
|
||||||
|
local info = tDest.booking_info or ""
|
||||||
|
|
||||||
|
stations[#stations+1] = minetest.formspec_escape(string.sub(name, 1, 28))
|
||||||
|
stations[#stations+1] = distance.."m"
|
||||||
|
stations[#stations+1] = minetest.formspec_escape(info)
|
||||||
|
end
|
||||||
|
|
||||||
|
if #stations>0 then
|
||||||
|
tRes[#tRes+1] = "table[0,1;11.8,7.2;button;"..table.concat(stations, ",").."]"
|
||||||
|
else
|
||||||
|
tRes[#tRes+1] = "button_exit[4,4;3,1;button;Update]"
|
||||||
|
end
|
||||||
|
|
||||||
|
return table.concat(tRes)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function store_station_list(pos, sortedList)
|
||||||
|
local tbl = {}
|
||||||
|
for idx,item in ipairs(sortedList) do
|
||||||
|
tbl[#tbl+1] = item.pos
|
||||||
|
end
|
||||||
|
tStationList[SP(pos)] = tbl
|
||||||
|
end
|
||||||
|
|
||||||
|
local function remove_junctions(sortedList)
|
||||||
|
local tbl = {}
|
||||||
|
for idx,item in ipairs(sortedList) do
|
||||||
|
if not item.junction and item.booking_pos then
|
||||||
|
tbl[#tbl+1] = item
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return tbl
|
||||||
|
end
|
||||||
|
|
||||||
|
local function station_list_as_string(pos)
|
||||||
|
-- Generate a distance sorted list of all connected stations
|
||||||
|
local sortedList = Stations:station_list(pos, pos, "dist")
|
||||||
|
-- Delete the own station from list
|
||||||
|
table.remove(sortedList, 1)
|
||||||
|
-- remove all junctions from the list
|
||||||
|
sortedList = remove_junctions(sortedList)
|
||||||
|
-- store the list for later use
|
||||||
|
store_station_list(pos, sortedList)
|
||||||
|
-- Generate the formspec string
|
||||||
|
return generate_string(sortedList)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function naming_formspec(pos)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local formspec = "size[6,4]"..
|
||||||
|
default.gui_bg..
|
||||||
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
"label[0,0;"..S("Please enter the station name to\nwhich this booking machine belongs.").."]" ..
|
||||||
|
"field[0.5,1.5;5,1;name;"..S("Station name")..";MyTown]" ..
|
||||||
|
"field[0.5,2.7;5,1;info;"..S("Additional station information")..";]" ..
|
||||||
|
"button_exit[2,3.6;2,1;exit;Save]"
|
||||||
|
meta:set_string("formspec", formspec)
|
||||||
|
meta:set_int("change_counter", 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function booking_machine_update(pos)
|
||||||
|
local meta = M(pos)
|
||||||
|
local sStationPos = meta:get_string("sStationPos")
|
||||||
|
if sStationPos ~= "" then
|
||||||
|
local station_pos = P(sStationPos)
|
||||||
|
local counter = meta:get_int("change_counter") or 0
|
||||||
|
local changed, newcounter = Stations:changed(counter)
|
||||||
|
if changed then
|
||||||
|
meta:set_string("formspec", station_list_as_string(station_pos))
|
||||||
|
meta:set_int("change_counter", newcounter)
|
||||||
|
end
|
||||||
|
if not tStationList[sStationPos] then
|
||||||
|
local sortedList = Stations:station_list(station_pos, station_pos, "dist")
|
||||||
|
-- Delete the own station from list
|
||||||
|
table.remove(sortedList, 1)
|
||||||
|
-- remove all junctions from the list
|
||||||
|
sortedList = remove_junctions(sortedList)
|
||||||
|
-- store the list for later use
|
||||||
|
store_station_list(station_pos, sortedList)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function on_receive_fields(pos, formname, fields, player)
|
||||||
|
booking_machine_update(pos)
|
||||||
|
-- station name entered?
|
||||||
|
if fields.name ~= nil then
|
||||||
|
local station_name = string.trim(fields.name)
|
||||||
|
if station_name == "" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local stationPos = Stations:get_next_station(pos)
|
||||||
|
if stationPos then
|
||||||
|
if Stations:get(stationPos).booking_pos then
|
||||||
|
hyperloop.chat(player, S("Station has already a booking machine!"))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- store meta and generate station formspec
|
||||||
|
Stations:update(stationPos, {
|
||||||
|
name = station_name,
|
||||||
|
booking_pos = pos,
|
||||||
|
booking_info = string.trim(fields.info),
|
||||||
|
})
|
||||||
|
|
||||||
|
local meta = M(pos)
|
||||||
|
meta:set_string("sStationPos", SP(stationPos))
|
||||||
|
meta:set_string("infotext", "Station: "..station_name)
|
||||||
|
meta:set_string("formspec", station_list_as_string(stationPos))
|
||||||
|
else
|
||||||
|
hyperloop.chat(player, S("Invalid station name!"))
|
||||||
|
end
|
||||||
|
elseif fields.button ~= nil then -- destination selected?
|
||||||
|
local te = minetest.explode_table_event(fields.button)
|
||||||
|
local idx = tonumber(te.row)
|
||||||
|
if idx and te.type=="CHG" then
|
||||||
|
local tStation, src_pos = hyperloop.get_base_station(pos)
|
||||||
|
local dest_pos = tStationList[SP(src_pos)] and tStationList[SP(src_pos)][idx]
|
||||||
|
if dest_pos and tStation then
|
||||||
|
-- place booking if not already blocked
|
||||||
|
if hyperloop.reserve(src_pos, dest_pos, player) then
|
||||||
|
hyperloop.set_arrival(src_pos, dest_pos)
|
||||||
|
-- open the pod door
|
||||||
|
hyperloop.open_pod_door(tStation)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- data is corrupt, try an update
|
||||||
|
M(pos):set_int("change_counter", 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.close_formspec(player:get_player_name(), formname)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_destruct(pos)
|
||||||
|
local sStationPos = M(pos):get_string("sStationPos")
|
||||||
|
if sStationPos ~= "" then
|
||||||
|
Stations:update(P(sStationPos), {
|
||||||
|
booking_pos = "nil",
|
||||||
|
booking_info = "nil",
|
||||||
|
name = "Station",
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- wap from wall to ground
|
||||||
|
local function swap_node(pos, placer)
|
||||||
|
pos.y = pos.y - 1
|
||||||
|
if minetest.get_node_or_nil(pos).name ~= "air" then
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
node.name = "hyperloop:booking_ground"
|
||||||
|
node.param2 = hyperloop.get_facedir(placer)
|
||||||
|
pos.y = pos.y + 1
|
||||||
|
minetest.swap_node(pos, node)
|
||||||
|
else
|
||||||
|
pos.y = pos.y + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- wall mounted booking machine
|
||||||
|
minetest.register_node("hyperloop:booking", {
|
||||||
|
description = S("Hyperloop Booking Machine"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_booking.png",
|
||||||
|
"hyperloop_booking.png",
|
||||||
|
"hyperloop_booking.png",
|
||||||
|
"hyperloop_booking.png",
|
||||||
|
"hyperloop_booking.png",
|
||||||
|
"hyperloop_booking_front.png",
|
||||||
|
},
|
||||||
|
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -8/16, 2/16, 8/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||||
|
naming_formspec(pos)
|
||||||
|
swap_node(pos, placer)
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
on_receive_fields = on_receive_fields,
|
||||||
|
on_destruct = on_destruct,
|
||||||
|
|
||||||
|
paramtype = 'light',
|
||||||
|
light_source = 2,
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = {cracky=2},
|
||||||
|
is_ground_content = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ground mounted booking machine
|
||||||
|
minetest.register_node("hyperloop:booking_ground", {
|
||||||
|
description = S("Hyperloop Booking Machine"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_booking.png",
|
||||||
|
"hyperloop_booking.png",
|
||||||
|
"hyperloop_booking.png",
|
||||||
|
"hyperloop_booking.png",
|
||||||
|
"hyperloop_booking.png",
|
||||||
|
"hyperloop_booking_front.png",
|
||||||
|
},
|
||||||
|
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -8/16, -3/16, 8/16, 8/16, 3/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||||
|
naming_formspec(pos)
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_receive_fields = on_receive_fields,
|
||||||
|
on_destruct = on_destruct,
|
||||||
|
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
drop = "hyperloop:booking",
|
||||||
|
light_source = 2,
|
||||||
|
paramtype = 'light',
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = {cracky=2, not_in_creative_inventory=1},
|
||||||
|
is_ground_content = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_lbm({
|
||||||
|
label = "[Hyperloop] Booking machine update",
|
||||||
|
name = "hyperloop:update",
|
||||||
|
nodenames = {"hyperloop:booking", "hyperloop:booking_ground"},
|
||||||
|
run_at_every_load = true,
|
||||||
|
action = booking_machine_update
|
||||||
|
})
|
270
hyperloop/characters.data
Normal file
@ -0,0 +1,270 @@
|
|||||||
|
A
|
||||||
|
_a_
|
||||||
|
7
|
||||||
|
B
|
||||||
|
_b_
|
||||||
|
5
|
||||||
|
C
|
||||||
|
_c_
|
||||||
|
6
|
||||||
|
D
|
||||||
|
_d_
|
||||||
|
6
|
||||||
|
E
|
||||||
|
_e_
|
||||||
|
5
|
||||||
|
F
|
||||||
|
_f_
|
||||||
|
5
|
||||||
|
G
|
||||||
|
_g_
|
||||||
|
6
|
||||||
|
H
|
||||||
|
_h_
|
||||||
|
6
|
||||||
|
I
|
||||||
|
_i_
|
||||||
|
1
|
||||||
|
J
|
||||||
|
_j_
|
||||||
|
4
|
||||||
|
K
|
||||||
|
_k_
|
||||||
|
5
|
||||||
|
L
|
||||||
|
_l_
|
||||||
|
4
|
||||||
|
M
|
||||||
|
_m_
|
||||||
|
7
|
||||||
|
N
|
||||||
|
_n_
|
||||||
|
6
|
||||||
|
O
|
||||||
|
_o_
|
||||||
|
6
|
||||||
|
P
|
||||||
|
_p_
|
||||||
|
5
|
||||||
|
Q
|
||||||
|
_q_
|
||||||
|
7
|
||||||
|
R
|
||||||
|
_r_
|
||||||
|
5
|
||||||
|
S
|
||||||
|
_s_
|
||||||
|
5
|
||||||
|
T
|
||||||
|
_t_
|
||||||
|
5
|
||||||
|
U
|
||||||
|
_u_
|
||||||
|
6
|
||||||
|
V
|
||||||
|
_v_
|
||||||
|
7
|
||||||
|
W
|
||||||
|
_w_
|
||||||
|
9
|
||||||
|
X
|
||||||
|
_x_
|
||||||
|
5
|
||||||
|
Y
|
||||||
|
_y_
|
||||||
|
7
|
||||||
|
Z
|
||||||
|
_z_
|
||||||
|
5
|
||||||
|
a
|
||||||
|
_a
|
||||||
|
5
|
||||||
|
b
|
||||||
|
_b
|
||||||
|
5
|
||||||
|
c
|
||||||
|
_c
|
||||||
|
4
|
||||||
|
d
|
||||||
|
_d
|
||||||
|
5
|
||||||
|
e
|
||||||
|
_e
|
||||||
|
4
|
||||||
|
f
|
||||||
|
_f
|
||||||
|
4
|
||||||
|
g
|
||||||
|
_g
|
||||||
|
5
|
||||||
|
h
|
||||||
|
_h
|
||||||
|
5
|
||||||
|
i
|
||||||
|
_i
|
||||||
|
1
|
||||||
|
j
|
||||||
|
_j
|
||||||
|
1
|
||||||
|
k
|
||||||
|
_k
|
||||||
|
4
|
||||||
|
l
|
||||||
|
_l
|
||||||
|
1
|
||||||
|
m
|
||||||
|
_m
|
||||||
|
7
|
||||||
|
n
|
||||||
|
_n
|
||||||
|
5
|
||||||
|
o
|
||||||
|
_o
|
||||||
|
5
|
||||||
|
p
|
||||||
|
_p
|
||||||
|
5
|
||||||
|
q
|
||||||
|
_q
|
||||||
|
5
|
||||||
|
r
|
||||||
|
_r
|
||||||
|
3
|
||||||
|
s
|
||||||
|
_s
|
||||||
|
4
|
||||||
|
t
|
||||||
|
_t
|
||||||
|
3
|
||||||
|
u
|
||||||
|
_u
|
||||||
|
4
|
||||||
|
v
|
||||||
|
_v
|
||||||
|
5
|
||||||
|
w
|
||||||
|
_w
|
||||||
|
7
|
||||||
|
x
|
||||||
|
_x
|
||||||
|
5
|
||||||
|
y
|
||||||
|
_y
|
||||||
|
4
|
||||||
|
z
|
||||||
|
_z
|
||||||
|
4
|
||||||
|
|
||||||
|
_sp
|
||||||
|
2
|
||||||
|
0
|
||||||
|
_0
|
||||||
|
4
|
||||||
|
1
|
||||||
|
_1
|
||||||
|
2
|
||||||
|
2
|
||||||
|
_2
|
||||||
|
4
|
||||||
|
3
|
||||||
|
_3
|
||||||
|
4
|
||||||
|
4
|
||||||
|
_4
|
||||||
|
4
|
||||||
|
5
|
||||||
|
_5
|
||||||
|
4
|
||||||
|
6
|
||||||
|
_6
|
||||||
|
4
|
||||||
|
7
|
||||||
|
_7
|
||||||
|
4
|
||||||
|
8
|
||||||
|
_8
|
||||||
|
4
|
||||||
|
9
|
||||||
|
_9
|
||||||
|
4
|
||||||
|
(
|
||||||
|
_bl
|
||||||
|
2
|
||||||
|
)
|
||||||
|
_br
|
||||||
|
2
|
||||||
|
{
|
||||||
|
_cl
|
||||||
|
3
|
||||||
|
}
|
||||||
|
_cr
|
||||||
|
3
|
||||||
|
[
|
||||||
|
_sl
|
||||||
|
2
|
||||||
|
]
|
||||||
|
_sr
|
||||||
|
2
|
||||||
|
!
|
||||||
|
_ex
|
||||||
|
1
|
||||||
|
?
|
||||||
|
_qu
|
||||||
|
4
|
||||||
|
#
|
||||||
|
_hs
|
||||||
|
5
|
||||||
|
$
|
||||||
|
_dl
|
||||||
|
4
|
||||||
|
%
|
||||||
|
_pr
|
||||||
|
5
|
||||||
|
^
|
||||||
|
_ca
|
||||||
|
3
|
||||||
|
_
|
||||||
|
_un
|
||||||
|
3
|
||||||
|
+
|
||||||
|
_ps
|
||||||
|
3
|
||||||
|
-
|
||||||
|
_mn
|
||||||
|
3
|
||||||
|
=
|
||||||
|
_eq
|
||||||
|
3
|
||||||
|
;
|
||||||
|
_sm
|
||||||
|
1
|
||||||
|
:
|
||||||
|
_co
|
||||||
|
1
|
||||||
|
,
|
||||||
|
_cm
|
||||||
|
2
|
||||||
|
"
|
||||||
|
_qo
|
||||||
|
3
|
||||||
|
/
|
||||||
|
_dv
|
||||||
|
5
|
||||||
|
~
|
||||||
|
_tl
|
||||||
|
4
|
||||||
|
<
|
||||||
|
_lt
|
||||||
|
3
|
||||||
|
>
|
||||||
|
_gt
|
||||||
|
3
|
||||||
|
\
|
||||||
|
_re
|
||||||
|
5
|
||||||
|
|
|
||||||
|
_vb
|
||||||
|
1
|
||||||
|
.
|
||||||
|
_dt
|
||||||
|
1
|
60
hyperloop/data_base.lua
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
--[[
|
||||||
|
|
||||||
|
Hyperloop Mod
|
||||||
|
=============
|
||||||
|
|
||||||
|
Copyright (C) 2017-2019 Joachim Stolberg
|
||||||
|
|
||||||
|
LGPLv2.1+
|
||||||
|
See LICENSE.txt for more information
|
||||||
|
|
||||||
|
mod storage and data integrity
|
||||||
|
]]--
|
||||||
|
|
||||||
|
-- for lazy programmers
|
||||||
|
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||||
|
local P = minetest.string_to_pos
|
||||||
|
local M = minetest.get_meta
|
||||||
|
|
||||||
|
hyperloop.Stations = hyperloop.Network:new()
|
||||||
|
hyperloop.Elevators = hyperloop.Network:new()
|
||||||
|
|
||||||
|
|
||||||
|
-- Check all nodes on the map and delete useless data base entries
|
||||||
|
local function check_data_base()
|
||||||
|
-- used for VM get_node
|
||||||
|
local tube = tubelib2.Tube:new({})
|
||||||
|
|
||||||
|
hyperloop.Stations:filter(function(pos)
|
||||||
|
local _,node = tube:get_node(pos)
|
||||||
|
return node.name == "hyperloop:station" or node.name == "hyperloop:junction"
|
||||||
|
end)
|
||||||
|
|
||||||
|
hyperloop.Elevators:filter(function(pos)
|
||||||
|
local _,node = tube:get_node(pos)
|
||||||
|
return node.name == "hyperloop:elevator_bottom"
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
local storage = minetest.get_mod_storage()
|
||||||
|
hyperloop.Stations:deserialize(storage:get_string("Stations"))
|
||||||
|
hyperloop.Elevators:deserialize(storage:get_string("Elevators"))
|
||||||
|
|
||||||
|
local function update_mod_storage()
|
||||||
|
minetest.log("action", "[Hyperloop] Store data...")
|
||||||
|
storage:set_string("Stations", hyperloop.Stations:serialize())
|
||||||
|
storage:set_string("Elevators", hyperloop.Elevators:serialize())
|
||||||
|
-- store data each hour
|
||||||
|
minetest.after(60*60, update_mod_storage)
|
||||||
|
minetest.log("action", "[Hyperloop] Data stored")
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_on_shutdown(function()
|
||||||
|
update_mod_storage()
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- delete data base entries without corresponding nodes
|
||||||
|
minetest.after(5, check_data_base)
|
||||||
|
|
||||||
|
-- store data after one hour
|
||||||
|
minetest.after(60*60, update_mod_storage)
|
242
hyperloop/deco.lua
Normal file
@ -0,0 +1,242 @@
|
|||||||
|
--[[
|
||||||
|
|
||||||
|
Hyperloop Mod
|
||||||
|
=============
|
||||||
|
|
||||||
|
Copyright (C) 2017 Joachim Stolberg
|
||||||
|
|
||||||
|
LGPLv2.1+
|
||||||
|
See LICENSE.txt for more information
|
||||||
|
|
||||||
|
History:
|
||||||
|
see init.lua
|
||||||
|
|
||||||
|
]]--
|
||||||
|
|
||||||
|
-- Load support for intllib.
|
||||||
|
local S = hyperloop.S
|
||||||
|
local NS = hyperloop.NS
|
||||||
|
|
||||||
|
local tilesL = {"hyperloop_alpsL.png", "hyperloop_seaL.png", "hyperloop_agyptL.png"}
|
||||||
|
local tilesR = {"hyperloop_alpsR.png", "hyperloop_seaR.png", "hyperloop_agyptR.png"}
|
||||||
|
|
||||||
|
-- determine facedir and pos on the right hand side from the given pos
|
||||||
|
function right_hand_side(pos, placer)
|
||||||
|
local facedir = hyperloop.get_facedir(placer)
|
||||||
|
pos = hyperloop.new_pos(pos, facedir, "1R", 0)
|
||||||
|
return facedir,pos
|
||||||
|
end
|
||||||
|
|
||||||
|
for idx = 1,3 do
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:poster"..idx.."L", {
|
||||||
|
description = S("Hyperloop Promo Poster ")..idx,
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_skin2.png",
|
||||||
|
"hyperloop_skin2.png",
|
||||||
|
"hyperloop_skin2.png",
|
||||||
|
"hyperloop_skin2.png",
|
||||||
|
"hyperloop_skin2.png",
|
||||||
|
tilesL[idx],
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -8/16, -6/16, 8/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = { -8/16, -8/16, -6/16, 24/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
|
||||||
|
after_place_node = function(pos, placer)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local facedir
|
||||||
|
facedir, pos = right_hand_side(pos, placer)
|
||||||
|
meta:set_string("pos", minetest.pos_to_string(pos))
|
||||||
|
if minetest.get_node_or_nil(pos).name == "air" then
|
||||||
|
minetest.add_node(pos, {name="hyperloop:poster"..idx.."R", param2=facedir})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_destruct = function(pos)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
pos = minetest.string_to_pos(meta:get_string("pos"))
|
||||||
|
if pos ~= nil and minetest.get_node_or_nil(pos).name == "hyperloop:poster"..idx.."R" then
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
light_source = 4,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky = 2, stone = 2},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:poster"..idx.."R", {
|
||||||
|
description = S("Hyperloop Promo Poster ")..idx,
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_skin2.png",
|
||||||
|
"hyperloop_skin2.png",
|
||||||
|
"hyperloop_skin2.png",
|
||||||
|
"hyperloop_skin2.png",
|
||||||
|
"hyperloop_skin2.png",
|
||||||
|
tilesR[idx],
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -8/16, -6/16, 8/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
light_source = 4,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky = 2, stone = 2, not_in_creative_inventory=1},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:sign", {
|
||||||
|
description = S("Hyperloop Station Sign"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_sign_top.png",
|
||||||
|
"hyperloop_sign.png",
|
||||||
|
},
|
||||||
|
light_source = 4,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky = 2, stone = 2},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:signR", {
|
||||||
|
description = S("Hyperloop Station Sign Right"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_sign3.png^[transformR90]",
|
||||||
|
"hyperloop_sign3.png^[transformR90]",
|
||||||
|
"hyperloop_sign3.png",
|
||||||
|
"hyperloop_sign3.png",
|
||||||
|
"hyperloop_sign2.png^[transformFX",
|
||||||
|
"hyperloop_sign2.png",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -5/16, 6/16, 8/16, 5/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||||
|
pos.y = pos.y - 1
|
||||||
|
if minetest.get_node_or_nil(pos).name ~= "air" then
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
node.name = "hyperloop:signR_ground"
|
||||||
|
node.param2 = hyperloop.get_facedir(placer)
|
||||||
|
pos.y = pos.y + 1
|
||||||
|
minetest.swap_node(pos, node)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
paramtype = 'light',
|
||||||
|
light_source = 4,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky = 2, stone = 2},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:signL", {
|
||||||
|
description = S("Hyperloop Station Sign Left"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_sign3.png^[transformR90]",
|
||||||
|
"hyperloop_sign3.png^[transformR90]",
|
||||||
|
"hyperloop_sign3.png",
|
||||||
|
"hyperloop_sign3.png",
|
||||||
|
"hyperloop_sign2.png",
|
||||||
|
"hyperloop_sign2.png^[transformFX",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -5/16, 6/16, 8/16, 5/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||||
|
pos.y = pos.y - 1
|
||||||
|
if minetest.get_node_or_nil(pos).name ~= "air" then
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
node.name = "hyperloop:signL_ground"
|
||||||
|
node.param2 = hyperloop.get_facedir(placer)
|
||||||
|
pos.y = pos.y + 1
|
||||||
|
minetest.swap_node(pos, node)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
paramtype = 'light',
|
||||||
|
light_source = 4,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky = 2, stone = 2},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:signR_ground", {
|
||||||
|
description = S("Hyperloop Station Sign Right"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_sign3.png^[transformR90]",
|
||||||
|
"hyperloop_sign3.png^[transformR90]",
|
||||||
|
"hyperloop_sign3.png",
|
||||||
|
"hyperloop_sign3.png",
|
||||||
|
"hyperloop_sign2_ground.png^[transformFX",
|
||||||
|
"hyperloop_sign2_ground.png",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -8/16, -1/16, 8/16, 2/16, 1/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "hyperloop:signR",
|
||||||
|
paramtype = 'light',
|
||||||
|
light_source = 4,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky = 2, stone = 2, not_in_creative_inventory=1},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:signL_ground", {
|
||||||
|
description = S("Hyperloop Station Sign Left"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_sign3.png^[transformR90]",
|
||||||
|
"hyperloop_sign3.png^[transformR90]",
|
||||||
|
"hyperloop_sign3.png",
|
||||||
|
"hyperloop_sign3.png",
|
||||||
|
"hyperloop_sign2_ground.png",
|
||||||
|
"hyperloop_sign2_ground.png^[transformFX",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -8/16, -1/16, 8/16, 2/16, 1/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "hyperloop:signL",
|
||||||
|
paramtype = 'light',
|
||||||
|
light_source = 4,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky = 2, stone = 2, not_in_creative_inventory=1},
|
||||||
|
})
|
4
hyperloop/depends.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
tubelib2
|
||||||
|
default
|
||||||
|
worldedit?
|
||||||
|
techage?
|
1
hyperloop/description.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Hyperloop Mod, the fast and modern way of traveling.
|
201
hyperloop/door.lua
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
--[[
|
||||||
|
|
||||||
|
Hyperloop Mod
|
||||||
|
=============
|
||||||
|
|
||||||
|
Copyright (C) 2017-2019 Joachim Stolberg
|
||||||
|
|
||||||
|
LGPLv2.1+
|
||||||
|
See LICENSE.txt for more information
|
||||||
|
|
||||||
|
]]--
|
||||||
|
|
||||||
|
-- for lazy programmers
|
||||||
|
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||||
|
local P = minetest.string_to_pos
|
||||||
|
local M = minetest.get_meta
|
||||||
|
|
||||||
|
--- Load support for intllib.
|
||||||
|
local S = hyperloop.S
|
||||||
|
local NS = hyperloop.NS
|
||||||
|
|
||||||
|
-- Open the door for an emergency
|
||||||
|
local function door_on_punch(pos, node, puncher, pointed_thing)
|
||||||
|
local station = hyperloop.get_base_station(pos)
|
||||||
|
if station then
|
||||||
|
if station.name == "Station" then
|
||||||
|
hyperloop.chat(puncher, S("The Booking Machine for this station is missing!"))
|
||||||
|
elseif not hyperloop.is_blocked(station.pos) then
|
||||||
|
hyperloop.open_pod_door(station)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Open/close/animate the pod door
|
||||||
|
-- door_pos1: position of the bottom door
|
||||||
|
-- cmnd: "close", "open", or "animate"
|
||||||
|
local function door_command(door_pos1, facedir, cmnd)
|
||||||
|
-- one step up
|
||||||
|
local door_pos2 = vector.add(door_pos1, {x=0, y=1, z=0})
|
||||||
|
|
||||||
|
local node1 = minetest.get_node(door_pos1)
|
||||||
|
local node2 = minetest.get_node(door_pos2)
|
||||||
|
local meta = minetest.get_meta(door_pos1)
|
||||||
|
if cmnd == "open" then
|
||||||
|
minetest.sound_play("door", {
|
||||||
|
pos = door_pos1,
|
||||||
|
gain = 0.5,
|
||||||
|
max_hear_distance = 10,
|
||||||
|
})
|
||||||
|
node1.name = "air"
|
||||||
|
minetest.swap_node(door_pos1, node1)
|
||||||
|
node2.name = "air"
|
||||||
|
minetest.swap_node(door_pos2, node2)
|
||||||
|
elseif cmnd == "close" then
|
||||||
|
minetest.sound_play("door", {
|
||||||
|
pos = door_pos1,
|
||||||
|
gain = 0.5,
|
||||||
|
max_hear_distance = 10,
|
||||||
|
})
|
||||||
|
node1.name = "hyperloop:doorBottom"
|
||||||
|
node1.param2 = facedir
|
||||||
|
minetest.swap_node(door_pos1, node1)
|
||||||
|
node2.name = "hyperloop:doorTopPassive"
|
||||||
|
node2.param2 = facedir
|
||||||
|
minetest.swap_node(door_pos2, node2)
|
||||||
|
elseif cmnd == "animate" then
|
||||||
|
node2.name = "hyperloop:doorTopActive"
|
||||||
|
node2.param2 = facedir
|
||||||
|
minetest.swap_node(door_pos2, node2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- door command based on the station data table
|
||||||
|
function hyperloop.open_pod_door(tStation)
|
||||||
|
if tStation ~= nil then
|
||||||
|
local door_pos = hyperloop.new_pos(tStation.pos, tStation.facedir, "1F1L", 1)
|
||||||
|
local door_facedir = (tStation.facedir + 1) % 4
|
||||||
|
door_command(door_pos, door_facedir, "open")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- door command based on the station data table
|
||||||
|
function hyperloop.close_pod_door(tStation)
|
||||||
|
if tStation ~= nil then
|
||||||
|
local door_pos = hyperloop.new_pos(tStation.pos, tStation.facedir, "1F1L", 1)
|
||||||
|
local door_facedir = (tStation.facedir + 1) % 4
|
||||||
|
door_command(door_pos, door_facedir, "close")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- door command based on the station data table
|
||||||
|
function hyperloop.animate_pod_door(tStation)
|
||||||
|
if tStation ~= nil then
|
||||||
|
local door_pos = hyperloop.new_pos(tStation.pos, tStation.facedir, "1F1L", 1)
|
||||||
|
local door_facedir = (tStation.facedir + 1) % 4
|
||||||
|
door_command(door_pos, door_facedir, "animate")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:doorTopPassive", {
|
||||||
|
description = S("Hyperloop Door Top"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_skin_door.png",
|
||||||
|
"hyperloop_skin_door.png",
|
||||||
|
"hyperloop_skin_door.png",
|
||||||
|
"hyperloop_skin_door.png",
|
||||||
|
"hyperloop_door1OUT.png",
|
||||||
|
"hyperloop_door1OUT.png",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-8/16, -8/16, -5/16, 8/16, 8/16, 5/16},
|
||||||
|
},
|
||||||
|
|
||||||
|
on_punch = door_on_punch,
|
||||||
|
|
||||||
|
auto_place_node = function(pos, facedir, sStationPos)
|
||||||
|
M(pos):set_int("facedir", facedir)
|
||||||
|
M(pos):set_string("sStationPos", sStationPos)
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
paramtype = 'light',
|
||||||
|
light_source = 1,
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "",
|
||||||
|
sounds = default.node_sound_metal_defaults(),
|
||||||
|
groups = {cracky=1, not_in_creative_inventory=1},
|
||||||
|
is_ground_content = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:doorTopActive", {
|
||||||
|
description = S("Hyperloop Door Top"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_skin_door.png",
|
||||||
|
"hyperloop_skin_door.png",
|
||||||
|
"hyperloop_skin_door.png",
|
||||||
|
"hyperloop_skin_door.png",
|
||||||
|
{
|
||||||
|
name = "hyperloop_door1IN.png",
|
||||||
|
animation = {
|
||||||
|
type = "vertical_frames",
|
||||||
|
aspect_w = 32,
|
||||||
|
aspect_h = 32,
|
||||||
|
length = 1.0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"hyperloop_door1OUT.png",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-8/16, -8/16, -5/16, 8/16, 8/16, 5/16},
|
||||||
|
},
|
||||||
|
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "",
|
||||||
|
light_source = 2,
|
||||||
|
sounds = default.node_sound_metal_defaults(),
|
||||||
|
groups = {cracky=1, not_in_creative_inventory=1},
|
||||||
|
is_ground_content = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:doorBottom", {
|
||||||
|
description = S("Hyperloop Door Bottom"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_skin_door.png",
|
||||||
|
"hyperloop_skin_door.png",
|
||||||
|
"hyperloop_skin_door.png",
|
||||||
|
"hyperloop_skin_door.png",
|
||||||
|
"hyperloop_door2IN.png",
|
||||||
|
"hyperloop_door2OUT.png",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-8/16, -8/16, -5/16, 8/16, 8/16, 5/16},
|
||||||
|
},
|
||||||
|
|
||||||
|
on_punch = door_on_punch,
|
||||||
|
|
||||||
|
auto_place_node = function(pos, facedir, sStationPos)
|
||||||
|
M(pos):set_int("facedir", facedir)
|
||||||
|
M(pos):set_string("sStationPos", sStationPos)
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
paramtype = 'light',
|
||||||
|
light_source = 1,
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
drop = "",
|
||||||
|
sounds = default.node_sound_metal_defaults(),
|
||||||
|
groups = {cracky=1, not_in_creative_inventory=1},
|
||||||
|
is_ground_content = false,
|
||||||
|
})
|
||||||
|
|
645
hyperloop/elevator.lua
Normal file
@ -0,0 +1,645 @@
|
|||||||
|
--[[
|
||||||
|
|
||||||
|
Hyperloop Mod
|
||||||
|
=============
|
||||||
|
|
||||||
|
Copyright (C) 2017-2019 Joachim Stolberg
|
||||||
|
|
||||||
|
LGPLv2.1+
|
||||||
|
See LICENSE.txt for more information
|
||||||
|
|
||||||
|
]]--
|
||||||
|
|
||||||
|
-- for lazy programmers
|
||||||
|
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||||
|
local P = minetest.string_to_pos
|
||||||
|
local M = minetest.get_meta
|
||||||
|
|
||||||
|
-- Load support for intllib.
|
||||||
|
local S = hyperloop.S
|
||||||
|
local NS = hyperloop.NS
|
||||||
|
|
||||||
|
-- To store elevator floors and formspecs
|
||||||
|
local Cache = {}
|
||||||
|
|
||||||
|
local kPLAYER_OVER_GROUND = 0.5
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
-- Elevator Shaft
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- Down, Up
|
||||||
|
local dirs_to_check = {5,6} -- vertical only
|
||||||
|
if hyperloop.free_tube_placement_enabled then
|
||||||
|
dirs_to_check = {1,2,3,4,5,6} -- all directions
|
||||||
|
end
|
||||||
|
|
||||||
|
local Shaft = tubelib2.Tube:new({
|
||||||
|
dirs_to_check = dirs_to_check,
|
||||||
|
max_tube_length = 1000,
|
||||||
|
show_infotext = true,
|
||||||
|
primary_node_names = {"hyperloop:shaft", "hyperloop:shaft2", "hyperloop:shaftA", "hyperloop:shaftA2"},
|
||||||
|
secondary_node_names = {"hyperloop:elevator_bottom", "hyperloop:elevator_top"},
|
||||||
|
after_place_tube = function(pos, param2, tube_type, num_tubes)
|
||||||
|
if tube_type == "S" then
|
||||||
|
if num_tubes == 2 then
|
||||||
|
minetest.swap_node(pos, {name = "hyperloop:shaft2", param2 = param2})
|
||||||
|
else
|
||||||
|
minetest.swap_node(pos, {name = "hyperloop:shaft", param2 = param2})
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if num_tubes == 2 then
|
||||||
|
minetest.swap_node(pos, {name = "hyperloop:shaftA2", param2 = param2})
|
||||||
|
else
|
||||||
|
minetest.swap_node(pos, {name = "hyperloop:shaftA", param2 = param2})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
hyperloop.Shaft = Shaft
|
||||||
|
local Elevators = hyperloop.Elevators
|
||||||
|
|
||||||
|
Shaft:register_on_tube_update(function(node, pos, out_dir, peer_pos, peer_in_dir)
|
||||||
|
if out_dir == 6 then -- to the top?
|
||||||
|
-- switch to elevator_bottom node
|
||||||
|
pos = Shaft:get_pos(pos, 5)
|
||||||
|
elseif peer_pos then
|
||||||
|
local _,node = Shaft:get_node(peer_pos)
|
||||||
|
if node.name == "hyperloop:elevator_top" then
|
||||||
|
peer_pos = Shaft:get_pos(peer_pos, 5)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Elevators:update_connections(pos, out_dir, peer_pos)
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:shaft", {
|
||||||
|
description = S("Hyperloop Elevator Shaft"),
|
||||||
|
inventory_image = 'hyperloop_shaft_inv.png',
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_tube_closed.png^[transformR90]",
|
||||||
|
"hyperloop_tube_closed.png^[transformR90]",
|
||||||
|
"hyperloop_tube_closed.png",
|
||||||
|
"hyperloop_tube_closed.png",
|
||||||
|
'hyperloop_tube.png',
|
||||||
|
'hyperloop_tube.png',
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-8/16, -8/16, -8/16, -7/16, 8/16, 8/16},
|
||||||
|
{ 7/16, -8/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
{-8/16, 7/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-8/16, -8/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
|
||||||
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||||
|
if not Shaft:after_place_tube(pos, placer, pointed_thing) then
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end,
|
||||||
|
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
Shaft:after_dig_tube(pos, oldnode, oldmetadata)
|
||||||
|
end,
|
||||||
|
|
||||||
|
climbable = true,
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
paramtype = "light",
|
||||||
|
light_source = 2,
|
||||||
|
sunlight_propagates = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky = 1},
|
||||||
|
sounds = default.node_sound_metal_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:shaftA", {
|
||||||
|
description = S("Hyperloop Elevator Shaft"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_tube_closed.png^[transformR90]",
|
||||||
|
'hyperloop_tube.png',
|
||||||
|
"hyperloop_tube_closed.png",
|
||||||
|
"hyperloop_tube_closed.png",
|
||||||
|
"hyperloop_tube_closed.png",
|
||||||
|
'hyperloop_tube.png',
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-8/16, -8/16, -8/16, -7/16, 8/16, 8/16},
|
||||||
|
{ 7/16, -8/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
{-8/16, 7/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
{-8/16, -8/16, 7/16, 8/16, 8/16, 8/16},
|
||||||
|
{-8/16, -8/16, -8/16, 8/16, -7/16, -7/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-8/16, -8/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
|
||||||
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||||
|
if not Shaft:after_place_tube(pos, placer, pointed_thing) then
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end,
|
||||||
|
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
Shaft:after_dig_tube(pos, oldnode, oldmetadata)
|
||||||
|
end,
|
||||||
|
|
||||||
|
climbable = true,
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
paramtype = "light",
|
||||||
|
light_source = 2,
|
||||||
|
sunlight_propagates = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky = 1, not_in_creative_inventory=1},
|
||||||
|
drop = "hyperloop:shaft",
|
||||||
|
sounds = default.node_sound_metal_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:shaft2", {
|
||||||
|
description = S("Hyperloop Elevator Shaft"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_tube_locked.png^hyperloop_elogo.png^[transformR270]",
|
||||||
|
"hyperloop_tube_locked.png^hyperloop_elogo.png^[transformR90]",
|
||||||
|
"hyperloop_tube_locked.png^hyperloop_elogo.png^[transformR180]",
|
||||||
|
"hyperloop_tube_locked.png^hyperloop_elogo.png",
|
||||||
|
'hyperloop_tube.png',
|
||||||
|
'hyperloop_tube.png',
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-8/16, -8/16, -8/16, -7/16, 8/16, 8/16},
|
||||||
|
{ 7/16, -8/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
{-8/16, 7/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-8/16, -8/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
Shaft:after_dig_tube(pos, oldnode, oldmetadata)
|
||||||
|
end,
|
||||||
|
|
||||||
|
climbable = true,
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
paramtype = "light",
|
||||||
|
light_source = 2,
|
||||||
|
sunlight_propagates = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
diggable = false,
|
||||||
|
groups = {cracky = 1, not_in_creative_inventory=1},
|
||||||
|
sounds = default.node_sound_metal_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:shaftA2", {
|
||||||
|
description = S("Hyperloop Elevator Shaft"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_tube_locked.png^hyperloop_elogo.png^[transformR270]",
|
||||||
|
'hyperloop_tube.png',
|
||||||
|
"hyperloop_tube_locked.png^hyperloop_elogo.png^[transformR180]",
|
||||||
|
"hyperloop_tube_locked.png^hyperloop_elogo.png^[transformR180]",
|
||||||
|
"hyperloop_tube_locked.png^hyperloop_elogo.png^[transformR90]",
|
||||||
|
'hyperloop_tube.png',
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-8/16, -8/16, -8/16, -7/16, 8/16, 8/16},
|
||||||
|
{ 7/16, -8/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
{-8/16, 7/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
{-8/16, -8/16, 7/16, 8/16, 8/16, 8/16},
|
||||||
|
{-8/16, -8/16, -8/16, 8/16, -7/16, -7/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-8/16, -8/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
Shaft:after_dig_tube(pos, oldnode, oldmetadata)
|
||||||
|
end,
|
||||||
|
|
||||||
|
climbable = true,
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
paramtype = "light",
|
||||||
|
light_source = 2,
|
||||||
|
sunlight_propagates = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
diggable = false,
|
||||||
|
groups = {cracky = 1, not_in_creative_inventory=1},
|
||||||
|
sounds = default.node_sound_metal_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
-- Elevator Car
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- Form spec for the floor list
|
||||||
|
local function formspec(pos, lFloors)
|
||||||
|
local tRes = {"size[5,10]label[0.5,0; "..S("Select your destination").."]"}
|
||||||
|
tRes[2] = "label[1,0.6;"..S("Destination").."]label[2.5,0.6;"..S("Floor").."]"
|
||||||
|
for idx,floor in ipairs(lFloors) do
|
||||||
|
if idx >= 12 then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
local ypos = 0.5 + idx*0.8
|
||||||
|
local ypos2 = ypos - 0.2
|
||||||
|
tRes[#tRes+1] = "button_exit[1,"..ypos2..";1,1;button;"..(#lFloors-idx).."]"
|
||||||
|
if vector.equals(floor.pos, pos) then
|
||||||
|
tRes[#tRes+1] = "label[2.5,"..ypos..";"..S("(current position)").."]"
|
||||||
|
else
|
||||||
|
tRes[#tRes+1] = "label[2.5,"..ypos..";"..(floor.name or "<unknown>").."]"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if #tRes == 2 then
|
||||||
|
tRes[#tRes+1] = "button_exit[1,3;3,1;button;Update]"
|
||||||
|
end
|
||||||
|
return table.concat(tRes)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function update_formspec(pos)
|
||||||
|
local meta = M(pos)
|
||||||
|
local counter = meta:get_int("change_counter") or 0
|
||||||
|
local changed, newcounter = Elevators:changed(counter)
|
||||||
|
local sKey = SP(pos)
|
||||||
|
if changed or not Cache[sKey] then
|
||||||
|
local lFloors = Elevators:station_list(pos, pos, "level")
|
||||||
|
Cache[sKey] = {}
|
||||||
|
Cache[sKey].lFloors = lFloors
|
||||||
|
Cache[sKey].formspec = formspec(pos, lFloors)
|
||||||
|
meta:set_int("change_counter", newcounter)
|
||||||
|
end
|
||||||
|
M(pos):set_string("formspec", Cache[sKey].formspec)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- Open/close/darken the elevator door
|
||||||
|
-- floor_pos: position of elevator floor
|
||||||
|
-- cmnd: "close", "open", or "darken"
|
||||||
|
local function door_command(floor_pos, facedir, cmnd, sound)
|
||||||
|
-- one step up
|
||||||
|
local door_pos1 = hyperloop.new_pos(floor_pos, facedir, "1B", 0)
|
||||||
|
local door_pos2 = hyperloop.new_pos(floor_pos, facedir, "1B", 1)
|
||||||
|
local node1 = minetest.get_node(door_pos1)
|
||||||
|
local node2 = minetest.get_node(door_pos2)
|
||||||
|
|
||||||
|
if sound then
|
||||||
|
minetest.sound_play("ele_door", {
|
||||||
|
pos = floor_pos,
|
||||||
|
gain = 0.8,
|
||||||
|
max_hear_distance = 10,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
if cmnd == "open" then
|
||||||
|
node1.name = "air"
|
||||||
|
minetest.swap_node(door_pos1, node1)
|
||||||
|
node2.name = "air"
|
||||||
|
minetest.swap_node(door_pos2, node2)
|
||||||
|
elseif cmnd == "close" then
|
||||||
|
M(door_pos1):set_string("floor_pos", SP(floor_pos))
|
||||||
|
M(door_pos2):set_string("floor_pos", SP(floor_pos))
|
||||||
|
node1.name = "hyperloop:elevator_door"
|
||||||
|
node1.param2 = facedir
|
||||||
|
minetest.swap_node(door_pos1, node1)
|
||||||
|
node2.name = "hyperloop:elevator_door_top"
|
||||||
|
node2.param2 = facedir
|
||||||
|
minetest.swap_node(door_pos2, node2)
|
||||||
|
elseif cmnd == "darken" then
|
||||||
|
node1.name = "hyperloop:elevator_door_dark"
|
||||||
|
node1.param2 = facedir
|
||||||
|
minetest.swap_node(door_pos1, node1)
|
||||||
|
node2.name = "hyperloop:elevator_door_dark_top"
|
||||||
|
node2.param2 = facedir
|
||||||
|
minetest.swap_node(door_pos2, node2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_final_close_door(tArrival)
|
||||||
|
-- close the door and play sound if no player is around
|
||||||
|
if hyperloop.is_player_around(tArrival.pos) then
|
||||||
|
-- try again later
|
||||||
|
minetest.after(3.0, on_final_close_door, tArrival)
|
||||||
|
else
|
||||||
|
door_command(tArrival.pos, tArrival.facedir, "close", true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_open_door(tArrival)
|
||||||
|
door_command(tArrival.pos, tArrival.facedir, "open", true)
|
||||||
|
minetest.after(5.0, on_final_close_door, tArrival)
|
||||||
|
tArrival.busy = false
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_arrival_floor(tDeparture, tArrival, player_name, snd)
|
||||||
|
local player = minetest.get_player_by_name(player_name)
|
||||||
|
door_command(tDeparture.pos, tDeparture.facedir, "close", false)
|
||||||
|
door_command(tArrival.pos, tArrival.facedir, "close", false)
|
||||||
|
tDeparture.busy = false
|
||||||
|
if player ~= nil then
|
||||||
|
tArrival.pos.y = tArrival.pos.y - kPLAYER_OVER_GROUND
|
||||||
|
player:set_pos(tArrival.pos)
|
||||||
|
tArrival.pos.y = tArrival.pos.y + kPLAYER_OVER_GROUND
|
||||||
|
end
|
||||||
|
minetest.sound_stop(snd)
|
||||||
|
minetest.after(1.0, on_open_door, tArrival)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_travel(tDeparture, tArrival, player_name, seconds)
|
||||||
|
door_command(tDeparture.pos, tDeparture.facedir, "darken", false)
|
||||||
|
door_command(tArrival.pos, tArrival.facedir, "darken", false)
|
||||||
|
local snd = minetest.sound_play("ele_norm", {
|
||||||
|
pos = tDeparture.pos,
|
||||||
|
gain = 0.5,
|
||||||
|
max_hear_distance = 3,
|
||||||
|
loop = true,
|
||||||
|
})
|
||||||
|
minetest.after(seconds, on_arrival_floor, tDeparture, tArrival, player_name, snd)
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:elevator_bottom", {
|
||||||
|
description = S("Hyperloop Elevator"),
|
||||||
|
tiles = {
|
||||||
|
"hyperloop_elevator_bottom.png",
|
||||||
|
"hyperloop_elevator_bottom.png",
|
||||||
|
"hyperloop_elevator.png",
|
||||||
|
"hyperloop_elevator.png",
|
||||||
|
"hyperloop_elevator.png",
|
||||||
|
"hyperloop_elevator.png",
|
||||||
|
},
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -8/16, -8/16, -7/16, 8/16, 8/16},
|
||||||
|
{ 7/16, -8/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
{ -7/16, -8/16, 7/16, 7/16, 8/16, 8/16},
|
||||||
|
{ -8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = { -8/16, -8/16, -8/16, 8/16, 23/16, 8/16 },
|
||||||
|
},
|
||||||
|
inventory_image = "hyperloop_elevator_inventory.png",
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
drawtype = "nodebox",
|
||||||
|
paramtype = 'light',
|
||||||
|
light_source = 6,
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {snappy = 3},
|
||||||
|
|
||||||
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||||
|
local _,node = Shaft:get_node(pos, 6)
|
||||||
|
if node.name == "air" then
|
||||||
|
local facedir = hyperloop.get_facedir(placer)
|
||||||
|
Elevators:set(pos, "<unknown>", {facedir=facedir, busy=false})
|
||||||
|
|
||||||
|
Shaft:after_place_node(pos, {5})
|
||||||
|
|
||||||
|
-- formspec
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local formspec = "size[6,4]"..
|
||||||
|
"label[0,0;"..S("Please insert floor name").."]" ..
|
||||||
|
"field[0.5,1.5;5,1;floor;"..S("Floor name")..";"..S("Base").."]" ..
|
||||||
|
"button_exit[2,3;2,1;exit;"..S("Save").."]"
|
||||||
|
meta:set_string("formspec", formspec)
|
||||||
|
|
||||||
|
-- add upper part of the car
|
||||||
|
pos = Shaft:get_pos(pos, 6)
|
||||||
|
minetest.add_node(pos, {name="hyperloop:elevator_top", param2=facedir})
|
||||||
|
Shaft:after_place_node(pos, {6})
|
||||||
|
else
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_receive_fields = function(pos, formname, fields, player)
|
||||||
|
-- floor name entered?
|
||||||
|
if fields.floor ~= nil then
|
||||||
|
local floor = string.trim(fields.floor)
|
||||||
|
if floor == "" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
Elevators:update(pos, {name=floor})
|
||||||
|
update_formspec(pos)
|
||||||
|
elseif fields.button ~= nil then -- destination selected?
|
||||||
|
update_formspec(pos)
|
||||||
|
local floor = Elevators:get(pos)
|
||||||
|
if floor then
|
||||||
|
floor = table.copy(floor)
|
||||||
|
floor.pos = pos
|
||||||
|
local sKey = SP(pos)
|
||||||
|
local idx = tonumber(fields.button)
|
||||||
|
if idx then
|
||||||
|
local lFloors = Cache[sKey].lFloors
|
||||||
|
local dest = lFloors[#lFloors-idx]
|
||||||
|
if dest and dest.pos and floor.pos then
|
||||||
|
local dist = hyperloop.distance(dest.pos, floor.pos)
|
||||||
|
if dist ~= 0 and floor.busy ~= true then
|
||||||
|
if player ~= nil then
|
||||||
|
pos.y = pos.y - kPLAYER_OVER_GROUND
|
||||||
|
player:set_pos(pos)
|
||||||
|
pos.y = pos.y + kPLAYER_OVER_GROUND
|
||||||
|
end
|
||||||
|
-- due to the missing display, a trip needs 20 sec maximum
|
||||||
|
local seconds = math.min(1 + math.floor(dist/30), 20)
|
||||||
|
floor.busy = true
|
||||||
|
door_command(floor.pos, floor.facedir, "close", true)
|
||||||
|
door_command(dest.pos, dest.facedir, "close", true)
|
||||||
|
minetest.after(1.0, on_travel, floor, dest, player:get_player_name(), seconds)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_punch = function(pos, node, puncher, pointed_thing)
|
||||||
|
update_formspec(pos)
|
||||||
|
local floor = Elevators:get(pos)
|
||||||
|
if floor and floor.busy ~= true then
|
||||||
|
door_command(pos, floor.facedir, "open", true)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
Shaft:after_dig_node(pos, {5})
|
||||||
|
Elevators:delete(pos)
|
||||||
|
-- remove the bottom also
|
||||||
|
pos = Shaft:get_pos(pos, 6)
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
Shaft:after_dig_node(pos, {6})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:elevator_top", {
|
||||||
|
description = S("Hyperloop Elevator"),
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_elevator_bottom.png",
|
||||||
|
"hyperloop_elevator_bottom.png",
|
||||||
|
"hyperloop_elevator_top.png",
|
||||||
|
"hyperloop_elevator.png",
|
||||||
|
"hyperloop_elevator.png",
|
||||||
|
"hyperloop_elevator.png",
|
||||||
|
},
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, 7/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
{ -8/16, -8/16, -8/16, -7/16, 8/16, 8/16},
|
||||||
|
{ 7/16, -8/16, -8/16, 8/16, 8/16, 8/16},
|
||||||
|
{ -7/16, -8/16, 7/16, 7/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
drawtype = "nodebox",
|
||||||
|
paramtype = 'light',
|
||||||
|
light_source = 6,
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
diggable = false,
|
||||||
|
groups = {not_in_creative_inventory=1},
|
||||||
|
drop = "",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:elevator_door_top", {
|
||||||
|
description = "Hyperloop Elevator Door",
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_elevator_door_top.png",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -8/16, 7/16, 8/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
drop = "",
|
||||||
|
paramtype = 'light',
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {snappy = 3, not_in_creative_inventory=1},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:elevator_door", {
|
||||||
|
description = "Hyperloop Elevator Door",
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_elevator_door.png",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -8/16, 7/16, 8/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = { -8/16, -8/16, 6.5/16, 8/16, 24/16, 8/16 },
|
||||||
|
},
|
||||||
|
|
||||||
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
|
local floor_pos = P(M(pos):get_string("floor_pos"))
|
||||||
|
if floor_pos ~= nil then
|
||||||
|
update_formspec(floor_pos)
|
||||||
|
local floor = Elevators:get(floor_pos)
|
||||||
|
if floor and floor.busy ~= true then
|
||||||
|
door_command(floor_pos, floor.facedir, "open", true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
drop = "",
|
||||||
|
paramtype = 'light',
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {snappy = 3, not_in_creative_inventory=1},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:elevator_door_dark_top", {
|
||||||
|
description = "Hyperloop Elevator Door",
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_elevator_dark_top.png",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -8/16, 7/16, 8/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
drop = "",
|
||||||
|
paramtype = 'light',
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {snappy = 3, not_in_creative_inventory=1},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("hyperloop:elevator_door_dark", {
|
||||||
|
description = "Hyperloop Elevator Door",
|
||||||
|
tiles = {
|
||||||
|
-- up, down, right, left, back, front
|
||||||
|
"hyperloop_elevator_dark.png",
|
||||||
|
},
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{ -8/16, -8/16, 7/16, 8/16, 8/16, 8/16},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = { -8/16, -8/16, 7/16, 8/16, 24/16, 8/16 },
|
||||||
|
},
|
||||||
|
|
||||||
|
on_rotate = screwdriver.disallow,
|
||||||
|
drop = "",
|
||||||
|
paramtype = 'light',
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {snappy = 3, not_in_creative_inventory=1},
|
||||||
|
})
|
92
hyperloop/init.lua
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
--[[
|
||||||
|
|
||||||
|
Hyperloop Mod
|
||||||
|
=============
|
||||||
|
|
||||||
|
v2.04 by JoSt
|
||||||
|
|
||||||
|
Copyright (C) 2017-2019 Joachim Stolberg
|
||||||
|
|
||||||
|
LGPLv2.1+
|
||||||
|
See LICENSE.txt for more information
|
||||||
|
|
||||||
|
History:
|
||||||
|
2017-06-18 v0.01 First version
|
||||||
|
2017-07-06 v0.02 Version on GitHub
|
||||||
|
2017-07-07 v0.03 Recipes added, settingstypes added
|
||||||
|
2017-07-08 v0.04 Door removal issue fixed
|
||||||
|
2017-07-16 v0.05 Doors can be opened manually
|
||||||
|
2017-07-24 v0.06 Tubes with limited slope, elevator and deco blocks added
|
||||||
|
2017-07-28 v0.07 Slope removed, Station auto-builder added
|
||||||
|
2017-07-30 v0.08 Signs added, tube robot added, crowbar added
|
||||||
|
2017-07-31 v0.09 Some bug fixes on the Bocking Machine
|
||||||
|
2017-08-01 v0.10 Elevator now with sound and travel animation plus minor bug fixes
|
||||||
|
2017-08-06 v0.11 Crowbar now allows repairing of illegally detroyed tubes
|
||||||
|
2018-03-27 v0.12 Some minor improvements with player position, arrival time,
|
||||||
|
Wifi node improvements, Podshell cheating bugfix,
|
||||||
|
forceload_block removed.
|
||||||
|
2018-04-13 v0.13 Potential "Never Store ObjectRefs" bug fixed
|
||||||
|
2018-10-27 v1.00 Release
|
||||||
|
2018-10-27 v2.00 Switched to lubelib2 for shafts and tubes
|
||||||
|
2018-12-16 v2.01 Adapted to lubelib2 v0.5
|
||||||
|
2018-12-20 v2.02 Intllib support added, bugs fixed
|
||||||
|
2019-03-23 v2.03 Elevator duplication bugfix
|
||||||
|
2020-01-03 v2.04 Elevator door bugfix (MT 5+)
|
||||||
|
2020-03-12 v2.05 minetest translator added (thanks to acmgit/Clyde)
|
||||||
|
|
||||||
|
]]--
|
||||||
|
|
||||||
|
hyperloop = {}
|
||||||
|
|
||||||
|
-- Version for compatibility checks, see history
|
||||||
|
hyperloop.version = 2.05
|
||||||
|
|
||||||
|
if minetest.global_exists("techage") and techage.version < 0.06 then
|
||||||
|
minetest.log("error", "[hyperloop] Hyperloop requires techage version 0.06 or newer!")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if minetest.get_translator ~= nil then
|
||||||
|
hyperloop.S = minetest.get_translator(minetest.get_current_modname())
|
||||||
|
|
||||||
|
else
|
||||||
|
-- Load support for intllib.
|
||||||
|
local MP = minetest.get_modpath("hyperloop")
|
||||||
|
hyperloop.S, hyperloop.NS = dofile(MP.."/intllib.lua")
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
if tubelib2.version < 1.7 then
|
||||||
|
minetest.log("error", "Hyperloop requires tubelib2 version 1.7 or newer!!!")
|
||||||
|
else
|
||||||
|
-- Configuration settings
|
||||||
|
hyperloop.wifi_enabled = minetest.settings:get_bool("hyperloop_wifi_enabled")
|
||||||
|
hyperloop.wifi_crafting_enabled = minetest.settings:get_bool("hyperloop_wifi_crafting_enabled")
|
||||||
|
hyperloop.free_tube_placement_enabled = minetest.settings:get_bool("hyperloop_free_tube_placement_enabled")
|
||||||
|
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/network.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/data_base.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/booking.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/utils.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/elevator.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/tube.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/tubecrowbar.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/junction.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/station.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/booking_node.lua")
|
||||||
|
if hyperloop.wifi_enabled then
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/wifi.lua")
|
||||||
|
end
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/map.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/door.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/seat.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/lcd.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/waypoint.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/deco.lua")
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/recipes.lua")
|
||||||
|
---- Migration from v1 to v2
|
||||||
|
dofile(minetest.get_modpath("hyperloop") .. "/migrate.lua")
|
||||||
|
|
||||||
|
print ("[MOD] Hyperloop loaded")
|
||||||
|
end
|