merge sync - simgle backpacks, add floatlands, use regrow, add rspawn

This commit is contained in:
mckaygerhard 2023-06-09 01:52:26 -04:00
commit 3824582d6d
132 changed files with 3797 additions and 2 deletions

View File

@ -38,8 +38,17 @@ To download you can play this game with the following minetest engines:
#### Mods #### Mods
* minetest default * minetest default
* minetest Auth Redux as `auth_rx` [mods/auth_rx](mods/auth_rx) from https://codeberg.org/minenux/minetest-mod-auth_rx * sorceredkid auth mod
** so then minetest Formspecs as `formspecs` [mods/formspecs](mods/formspecs) from https://codeberg.org/minenux/minetest-mod-formspecs * minetest Auth Redux as `auth_rx` [mods/auth_rx](mods/auth_rx) from https://codeberg.org/minenux/minetest-mod-auth_rx
* so then minetest Formspecs as `formspecs` [mods/formspecs](mods/formspecs) from https://codeberg.org/minenux/minetest-mod-formspecs
* minetest Random Spawn as `rspawn` [mods/rspawn](mods/rspawn) from https://codeberg.org/minenux/minetest-mod-rspawn
* so then default beds as `beds` [mods/beds](mods/beds) from default 0.4
* minetest floatlands as `floatlands` [mods/floatlands](mods/floatlands) derived from Floatlands Realm made to this servers, as https://codeberg.org/minenux/minetest-mod-floatland
* so then default flowers as `flowers` are need. Later this will need ethereal modifications.
* tenplus1 customized mods
* simple_skins as `skins` [mods/skins](mods/skins) from https://codeberg.org/minenux/minetest-mod-simple_skins
* regrow as `regrow` [mods/regrow](mods/regrow) from https://codeberg.org/minenux/minetest-mod-regrow
* minenux bags as `backpacks` [mods/backpacks](mods/backpacks)
## Licensing ## Licensing

674
mods/backpacks/LICENSE.txt Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://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 <http://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
<http://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
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

55
mods/backpacks/README.md Normal file
View File

@ -0,0 +1,55 @@
# minetest mod Backpacks
========================
Backpacks allow you to clean up space in your inventory.
Information
-----------
This mod must be named `backpacks` it featured to player a
bag with shoulder straps that allow it to be carried on someone's back,
or just simple bags to carried payer items. **This mod is a
simplified version of one color and ones utility**
![screenshot.png](screenshot.png)
Tech information
----------------
Adds backpacks made of wool and leather, that can **store anything but themselves**
in an 16 slots inventory. The backpacks can only be accessed once they're placed.
Picking them up preserves their contents. They obey regular protection rules.
**This mod is a reduces simplified version of minenux one** the
original one started as a unification effors from original
https://codeberg.org/minenux/minetest-mod-backpacks
Unless all of those mods, this one is more simple and faster, and works with any version
of the engine since 0.4 version.
#### Dependencies
* default
* wool
* dye
Optional dependences:
* mobs
#### Nodes Tools
They can be crafted by placing 8 wools or lather in a square around an empty craft grid centre.
| Node name | Description name |
| -------------------------- | --------------------- |
| backpacks:backpack_wool | Wool Backpack |
| backpacks:backpack_leather | Leather Backpack |
## LICENSE
Textures were provided originaly by James Stevenson but there is no hints about
Code were started by James Stevenson and later continue by Tai Kedzierski https://github.com/taikedz
License code is GPL3+ check [LICENSE.txt](LICENSE.txt) file.

View File

@ -0,0 +1,4 @@
default
dye
wool
mobs?

View File

@ -0,0 +1 @@
BAGS mod for Minetest in real storage way usage

183
mods/backpacks/init.lua Normal file
View File

@ -0,0 +1,183 @@
local backpacks = {}
backpacks.form = "size[8,7]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
"list[current_name;main;0,0.3;8,2]" ..
"list[current_player;main;0,2.85;8,1]" ..
"list[current_player;main;0,4.08;8,3;8]" ..
"listring[current_name;main]" ..
"listring[current_player;main]"
backpacks.on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", "Backpack")
meta:set_string("formspec", backpacks.form)
local inv = meta:get_inventory()
inv:set_size("main", 8*2)
end
backpacks.after_place_node = function(pos, placer, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
local stuff = minetest.deserialize(itemstack:get_metadata())
if stuff then
meta:from_table(stuff)
end
itemstack:take_item()
end
backpacks.on_dig = function(pos, node, digger)
if minetest.is_protected(pos, digger:get_player_name()) then
return false
end
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local list = {}
for i, stack in ipairs(inv:get_list("main")) do
if stack:get_name() == "" then
list[i] = ""
else
list[i] = stack:to_string()
end
end
local new_list = {inventory = {main = list},
fields = {infotext = "Backpack", formspec = backpacks.form}}
local new_list_as_string = minetest.serialize(new_list)
local new = ItemStack(node)
new:set_metadata(new_list_as_string)
minetest.remove_node(pos)
local player_inv = digger:get_inventory()
if player_inv:room_for_item("main", new) then
player_inv:add_item("main", new)
else
minetest.add_item(pos, new)
end
end
backpacks.allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if not string.match(stack:get_name(), "backpacks:backpack_") then
return stack:get_count()
else
return 0
end
end
-- Wool backpacks
local function register_wool_backpack(colour,colourname)
minetest.register_node("backpacks:backpack_wool_"..colour, {
description = colourname.." Wool Backpack",
tiles = {
"wool_"..colour..".png^backpacks_backpack_topbottom.png", -- Top
"wool_"..colour..".png^backpacks_backpack_topbottom.png", -- Bottom
"wool_"..colour..".png^backpacks_backpack_sides.png", -- Right Side
"wool_"..colour..".png^backpacks_backpack_sides.png", -- Left Side
"wool_"..colour..".png^backpacks_backpack_back.png", -- Back
"wool_"..colour..".png^backpacks_backpack_front.png" -- Front
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.4375, -0.5, -0.375, 0.4375, 0.5, 0.375},
{0.125, -0.375, 0.4375, 0.375, 0.3125, 0.5},
{-0.375, -0.375, 0.4375, -0.125, 0.3125, 0.5},
{0.125, 0.1875, 0.375, 0.375, 0.375, 0.4375},
{-0.375, 0.1875, 0.375, -0.125, 0.375, 0.4375},
{0.125, -0.375, 0.375, 0.375, -0.25, 0.4375},
{-0.375, -0.375, 0.375, -0.125, -0.25, 0.4375},
{-0.3125, -0.375, -0.4375, 0.3125, 0.1875, -0.375},
{-0.25, -0.3125, -0.5, 0.25, 0.125, -0.4375},
}
},
groups = {dig_immediate = 3, oddly_diggable_by_hand = 3},
stack_max = 1,
on_construct = backpacks.on_construct,
after_place_node = backpacks.after_place_node,
on_dig = backpacks.on_dig,
allow_metadata_inventory_put = backpacks.allow_metadata_inventory_put,
})
minetest.register_craft({
output = "backpacks:backpack_wool_brown",
recipe = {
{"group:wool", "group:wool", "group:wool"},
{"group:wool", "", "group:wool"},
{"group:wool", "group:wool", "group:wool"},
}
})
end
local wooldyes = {
{code = "white", name = "White"},
{code = "grey", name = "Grey"},
{code = "black", name = "Black"},
{code = "red", name = "Red"},
{code = "yellow", name = "Yellow"},
{code = "green", name = "Green"},
{code = "cyan", name = "Cyan"},
{code = "blue", name = "Blue"},
{code = "magenta", name = "Magenta"},
{code = "orange", name = "Orange"},
{code = "violet", name = "Violet"},
-- {code = "brown", name = "Brown"},
{code = "pink", name = "Pink"},
{code = "dark_grey", name = "Dark Grey"},
{code = "dark_green", name = "Dark Green"},
}
for _,colourdesc in pairs(wooldyes) do
minetest.register_alias("backpacks:backpack_wool_"..wooldyes.code, "backpacks:backpack_wool")
end
minetest.register_alias("backpacks:backpack_wool", "backpacks:backpack_wool_brown")
register_wool_backpack("brown","")
-- Leather backpack
minetest.register_node("backpacks:backpack_leather", {
description = "Leather Backpack",
tiles = {
"backpacks_leather.png^backpacks_backpack_topbottom.png", -- Top
"backpacks_leather.png^backpacks_backpack_topbottom.png", -- Bottom
"backpacks_leather.png^backpacks_backpack_sides.png", -- Right Side
"backpacks_leather.png^backpacks_backpack_sides.png", -- Left Side
"backpacks_leather.png^backpacks_backpack_back.png", -- Back
"backpacks_leather.png^backpacks_backpack_front.png" -- Front
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.4375, -0.5, -0.375, 0.4375, 0.5, 0.375},
{0.125, -0.375, 0.4375, 0.375, 0.3125, 0.5},
{-0.375, -0.375, 0.4375, -0.125, 0.3125, 0.5},
{0.125, 0.1875, 0.375, 0.375, 0.375, 0.4375},
{-0.375, 0.1875, 0.375, -0.125, 0.375, 0.4375},
{0.125, -0.375, 0.375, 0.375, -0.25, 0.4375},
{-0.375, -0.375, 0.375, -0.125, -0.25, 0.4375},
{-0.3125, -0.375, -0.4375, 0.3125, 0.1875, -0.375},
{-0.25, -0.3125, -0.5, 0.25, 0.125, -0.4375},
}
},
groups = {dig_immediate = 3, oddly_diggable_by_hand = 3},
stack_max = 1,
on_construct = backpacks.on_construct,
after_place_node = backpacks.after_place_node,
on_dig = backpacks.on_dig,
allow_metadata_inventory_put = backpacks.allow_metadata_inventory_put,
})
if minetest.global_exists("mobs") and ( mobs.redo or mobs.mod == 'redo') then
minetest.register_craft({
output = "backpacks:backpack_leather",
recipe = {
{"mobs:leather", "mobs:leather", "mobs:leather"},
{"mobs:leather", "", "mobs:leather"},
{"mobs:leather", "mobs:leather", "mobs:leather"},
}
})
end

4
mods/backpacks/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = backpacks
depends = default, wool, dye
optional_depends = mobs
description = BAGS mod for Minetest in real storage way usage

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

64
mods/floatland/README.md Normal file
View File

@ -0,0 +1,64 @@
minetest mod floatland
============================
Simple mod to added rare greenbiomes to floadlands event only snown
Information
-----------
This mod is named `floatland`, it produces a large floadlands,
but the biome is more nice event simple snown when others mods like ethereal
are present.
Technical info
--------------
This is a fork for minenux project, from original work of floadlands_realm
its just to provide nice biomes when other mods like ethereal only produces snown.
it uses the setting from minetest config files of mapgen v7, specially the `mgv7_floatland_level`
and try to redefined the floatland layer of biome fully.
This is a simplified version that only provides more variety of floadlands on
older engine versions, modification of https://codeberg.org/minenux/minetest-mod-floatland_realm
#### Status
This only define some more rare nodes to look good, but similar features as normal ones,
no new tools are featured, the original mod defined at leats new nodes with new features.
#### Depends
* mgv7 mapgen only
* default mod
#### Blocks
| Node/item | tecnical names | related/drop | note |
| --------------- | ---------------------- | ------------ | ------------------------ |
| High Grass | floatland:grass | default:dirt | top block, use diamond shovel |
| High Dirt | floatland:dirt | | |
| High Stone | floatland:stone | floatland:dirt | |
| High Sand | floatland:sand | | top block, use diamond shovel |
| High Rare Sand | floatland:rare_sand | | |
| High Crystal Sand | floatland:sand_crystal_block | floatland:sand_crystals 6 | |
| High Sand Crystal | floatland:sand_crystals | | |
| High Salt | floatland:salt | | |
#### Biomes
| Name | technical names | nodes of biome |
| --------------- | ---------------- | ---------------------------------------------- |
| Floatland Beach | floatland_nicebeach | floatland:grass, floatland:dirt, floatland:stone |
| Floatland grass | floatland_nicegrass | floatland:sand, floatland:stone |
# License
CC BY SA 3 mckayshirou
Based in Amaz an archived work of it are at https://github.com/Amaz1/floatland_realm
Artwork of `sand_crystal_<>` based on runsy saltd mod https://github.com/runsy/saltd
The noise code is based on the floatlands C++ noise code.
See https://github.com/minetest/minetest/blob/28841961ba91b943b7478704181604fa3e24e81e/src/mapgen_v7.cpp#L415

View File

@ -0,0 +1,2 @@
default
flowers?

View File

@ -0,0 +1 @@
BIOME hard to dig at the floatlands, you will need a diamond shovel.

153
mods/floatland/init.lua Normal file
View File

@ -0,0 +1,153 @@
-- minetest.clear_registered_biomes() -- do not regenerate, we want to combine it!
-- Get setting or default
local mgv7_spflags = minetest.get_mapgen_setting("mgv7_spflags") or "mountains, ridges, floatlands, caverns"
local captures_float = string.match(mgv7_spflags, "floatlands")
local captures_nofloat = string.match(mgv7_spflags, "nofloatlands")
local floatland_y = minetest.get_mapgen_setting("mgv7_floatland_level") or 2280
local worldlimit = minetest.get_mapgen_setting("mapgen_limit") or 31000
local mount_height = minetest.get_mapgen_setting("mgv7_float_mount_height") or 256
local mount_dens = minetest.get_mapgen_setting("mgv7_float_mount_density") or 0.6
-- Make global for mods to use to register floatland biomes
default.mgv7_floatland_level = floatland_y
default.mgv7_shadow_limit = minetest.get_mapgen_setting("mgv7_shadow_limit") or 1024
-- Registering of the nodes
minetest.register_node("floatland:grass", {
description = "High Grass",
tiles = {"floatland_realm_grass.png", "floatland_realm_dirt.png",
{name = "floatland_realm_dirt.png^floatland_realm_grass_side.png",
tileable_vertical = false}},
groups = {crumbly = 2, soil = 1, spreading_dirt_type = 1},
drop = 'floatland:dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.25},
}),
})
minetest.register_node("floatland:sand", {
description = "High Sand",
tiles = {"floatland_realm_sand.png"},
drop = 'floatland:sand',
groups = {crumbly = 2, falling_node = 1, sand = 1},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("floatland:dirt", {
description = "High Dirt",
tiles = {"floatland_realm_dirt.png"},
drop = 'default:dirt',
groups = {crumbly = 2, soil = 1},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("floatland:stone", {
description = "High Stone",
tiles = {"floatland_realm_stone.png"},
groups = {cracky = 2, stone = 1},
drop = 'floatland:stone',
legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("floatland:rare_sand", {
description = "High Rare Sand",
tiles = {"floatland_rare_sand.png"},
drop = "floatland:salt 6",
groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.25},
}),
})
minetest.register_node("floatland:sand_crystal_block", {
description = "High Crystal Block",
drawtype = "glasslike_framed_optional",
tiles = {"floatland_sand_crystal_block.png"},
paramtype = "light",
paramtype2 = "glasslikeliquidlevel",
param2 = 255,
use_texture_alpha = "blend",
sunlight_propagates = false,
groups = {cracky = 2},
sounds = default.node_sound_glass_defaults(),
walkable = true,
drop = "floatland:sand_crystals 6"
})
-- Registering of items
minetest.register_craftitem("floatland:sand_crystals", {
description = "High Sand Crystals",
wield_image = "floatland_sand_crystals.png",
inventory_image = "floatland_sand_crystals.png",
groups = {salt= 1},
})
minetest.register_craftitem("floatland:salt", {
description = "High Salt",
wield_image = "floatland_salt.png",
inventory_image = "floatland_salt.png",
groups = {salt= 1},
})
minetest.register_craft({
type = "shapeless",
output = "floatland:salt",
recipe = {"floatland:sand_crystals"},
})
-- Registering of the biomes
minetest.register_biome({
name = "floatland_nicegrass",
node_top = "floatland:grass",
depth_top = 1,
node_filler = "floatland:dirt",
depth_filler = 2,
node_riverbed = "floatland:rare_sand",
depth_riverbed = 2,
node_water = "default:water_source",
node_river_water = "default:river_water",
depth_water_top = 15,
node_water_top = "default:water_source",
node_stone = "floatland:stone",
y_min = floatland_y + 40,
y_max = worldlimit,
heat_point = 50,
humidity_point = 50,
})
minetest.register_biome({
name = "floatland_nicebeach",
node_top = "floatland:sand",
depth_top = 3,
node_filler = "floatland:sand_crystal_block",
depth_filler = 3,
node_riverbed = "floatland:rare_sand",
depth_riverbed = 2,
node_water = "default:water_source",
node_river_water = "default:river_water",
depth_water_top = 5,
node_water_top = "default:water_source",
node_stone = "floatland:stone",
y_min = default.mgv7_shadow_limit,
y_max = floatland_y + 40,
heat_point = 50,
humidity_point = 50,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"floatland:grass"},
sidelen = 16,
fill_ratio = 0.5,
biomes = {"floatland_nicegrass"},
y_min = floatland_y + 40,
y_max = worldlimit,
decoration = "default:bush_sapling",
})

7
mods/floatland/mod.conf Normal file
View File

@ -0,0 +1,7 @@
name = floatland
title = Floatland Realm
author = mckayshirou
license = LGPL
depends = default
optional_depends =
description = BIOME hard to dig at the floatlands, you will need a diamond shovel.

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 B

View File

@ -0,0 +1 @@
FRUIT regrow instead of replanting saplings

146
mods/regrow/init.lua Normal file
View File

@ -0,0 +1,146 @@
regrow = {
-- get custom min and max growth intervals from settings
min_interval = tonumber(minetest.settings:get("regrow_min_interval")) or 600,
max_interval = tonumber(minetest.settings:get("regrow_max_interval")) or 1200
}
local is_51 = minetest.has_feature("formspec_version_element") or nil
-- hidden node that runs timer and regrows fruit stored in meta
minetest.register_node("regrow:hidden", {
drawtype = "airlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
groups = {not_in_creative_inventory = 1},
-- once placed start random timer between min and max interval setting
on_construct = function(pos)
local time = math.random(regrow.min_interval, regrow.max_interval)
minetest.get_node_timer(pos):start(time)
end,
-- when timer reached check which fruit to place if tree still exists
on_timer = function(pos, elapsed)
local meta = minetest.get_meta(pos)
if not meta then
return
end
local fruit = meta:get_string("fruit") or ""
local leaf = meta:get_string("leaf") or ""
local p2 = meta:get_int("p2") or 0
if fruit == "" or leaf == ""
or not minetest.find_node_near(pos, 1, leaf) then
fruit = "air"
end
minetest.set_node(pos, {name = fruit, param2 = p2})
end
})
-- helper function to register fruit nodes
regrow.add_fruit = function(nodename, leafname, ignore_param2)
-- does node actually exist ?
if not minetest.registered_nodes[nodename] then
return
end
-- change attached_node values so fruits regrow instead of dropping
local groups = minetest.registered_nodes[nodename].groups
groups.attached_node = 0
minetest.override_item(nodename, {
-- override on_dig to remove any special functions
on_dig = minetest.node_dig,
-- override after_dig_node to start regrowth
after_dig_node = function(pos, oldnode, oldmetadata, digger)
-- if node has been placed by player then do not regrow
if ignore_param2 ~= true and oldnode.param2 > 0 then
return
end
-- replace fruit with regrowth node, set fruit & leaf name
minetest.set_node(pos, {name = "regrow:hidden"})
local meta = minetest.get_meta(pos)
meta:set_string("fruit", nodename)
meta:set_string("leaf", leafname)
meta:set_int("p2", oldnode.param2 or 0)
end,
})
end
regrow.regrow = function()
-- default
regrow.add_fruit("default:apple", "default:leaves")
-- ethereal
regrow.add_fruit("ethereal:banana", "ethereal:bananaleaves")
regrow.add_fruit("ethereal:banana_bunch", "ethereal:bananaleaves")
regrow.add_fruit("ethereal:orange", "ethereal:orange_leaves")
regrow.add_fruit("ethereal:coconut", "ethereal:palmleaves")
regrow.add_fruit("ethereal:lemon", "ethereal:lemon_leaves")
regrow.add_fruit("ethereal:olive", "ethereal:olive_leaves")
-- regrow.add_fruit("ethereal:golden_apple", "ethereal:yellowleaves") -- too OP
-- cool trees
regrow.add_fruit("cacaotree:pod", "cacaotree:trunk", true)
regrow.add_fruit("cherrytree:cherries", "cherrytree:blossom_leaves")
regrow.add_fruit("clementinetree:clementine", "clementinetree:leaves")
regrow.add_fruit("ebony:persimmon", "ebony:leaves")
regrow.add_fruit("lemontree:lemon", "lemontree:leaves")
regrow.add_fruit("oak:acorn", "oak:leaves")
regrow.add_fruit("palm:coconut", "palm:leaves")
-- regrow.add_fruit("plumtree:plum", "plumtree:leaves") -- regrows already
regrow.add_fruit("pomegranate:pomegranate", "pomegranate:leaves")
-- farming plus
regrow.add_fruit("farming_plus:cocoa", "farming_plus:cocoa_leaves")
regrow.add_fruit("farming_plus:banana", "farming_plus:banana_leaves")
-- aotearoa
regrow.add_fruit("aotearoa:karaka_fruit", "aotearoa:karaka_leaves")
regrow.add_fruit("aotearoa:miro_fruit", "aotearoa:miro_leaves")
regrow.add_fruit("aotearoa:tawa_fruit", "aotearoa:tawa_leaves")
regrow.add_fruit("aotearoa:hinau_fruit", "aotearoa:hinau_leaves")
regrow.add_fruit("aotearoa:kawakawa_fruit", "aotearoa:kawakawa_leaves")
-- australia
regrow.add_fruit("australia:cherry", "australia:cherry_leaves")
regrow.add_fruit("australia:lilly_pilly_berries", "australia:lilly_pilly_leaves")
regrow.add_fruit("australia:macadamia", "australia:macadamia_leaves")
regrow.add_fruit("australia:mangrove_apple", "australia:mangrove_apple_leaves")
regrow.add_fruit("australia:moreton_bay_fig", "australia:moreton_bay_fig_leaves")
regrow.add_fruit("australia:quandong", "australia:quandong_leaves")
-- more trees
regrow.add_fruit("moretrees:acorn", "moretrees:oak_leaves")
regrow.add_fruit("moretrees:cedar_cone", "moretrees:cedar_leaves")
regrow.add_fruit("moretrees:fir_cone", "moretrees:fir_leaves")
regrow.add_fruit("moretrees:spruce_cone", "moretrees:spruce_leaves")
end
if is_51 then
-- wait until mods are loaded to save dependency mess
minetest.register_on_mods_loaded(regrow.regrow)
else
minetest.after(0.1, regrow.regrow)
end
print("[MOD] Regrow loaded")

21
mods/regrow/license.txt Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2018 TenPlus1
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

4
mods/regrow/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = regrow
depends =
optional_depends =
description = FRUIT regrow instead of replanting saplings.

118
mods/regrow/readme.MD Normal file
View File

@ -0,0 +1,118 @@
minetest mod REGROW
===================
Mod to regrow fruits with self-contained API
## Information
-----------
This mod helps to regrow tree fruits instead of the need for replanting
saplings each time.
![screenshot.jpg](screenshot.jpg)
## Technical info
--------------
This mod is named `regrow` a simplified optimized version
of fruits nodes to reappears on place after dig using timer parameters.
#### Dependences
none, core minetest api, the mod has a node detection inside the api function
so its secure to use no matter if the corresponding node exits or not.
### Configuration
Each fruit will grow depending of the minimun and maximun value,
the time the fruit appears is random between the two configured values:
| setting name | description | type | default | observations |
| ------------------- | ----------------------- | --- | ------- | ----------- |
| regrow_min_interval | Minimum Regrow Interval | int | 600 | Seconds |
| regrow_max_interval | Maximum Regrow Interval | int | 1200 | seconds |
### Overview:
Based on "endless_apples" by Shara RedCat (2018). Its starting
at https://forum.minetest.net/viewtopic.php?p=379158#p379158 to solve
an issue over growing fruits and now is mantained.
The mod works as is but can be used for other mods, currently the mod
has support for `ethereal`, `farming_plus`, `australia`, `aotearoa`,
and `moretrees`. It also support some special others.
#### Nodes
| MOD supported | Fruit to regrow (node) | Sustitute when growing (node) |
| ------------- | ---------------------- | ----------------------------- |
| default | default:apple | default:leaves |
| ethereal | ethereal:banana | ethereal:bananaleaves |
| ethereal | ethereal:banana_bunch | ethereal:bananaleaves |
| ethereal | ethereal:orange | ethereal:orange_leaves |
| ethereal | ethereal:coconut | ethereal:palmleaves |
| ethereal | ethereal:lemon | ethereal:lemon_leaves |
| ethereal | ethereal:olive | ethereal:olive_leaves |
| ethereal | ethereal:golden_apple | ethereal:yellowleaves (disabled) |
| cool_trees | cacaotree:pod | cacaotree:trunk (override) |
| cool_trees | cherrytree:cherries | cherrytree:blossom_leaves |
| cool_trees | clementinetree:clementine | clementinetree:leaves |
| cool_trees | ebony:persimmon | ebony:leaves |
| cool_trees | lemontree:lemon | lemontree:leaves |
| cool_trees | oak:acorn | oak:leaves |
| cool_trees | palm:coconut | palm:leaves |
| cool_trees | pomegranate:pomegranate | pomegranate:leaves |
| farming_plus | farming_plus:cocoa | farming_plus:cocoa_leaves |
| farming_plus | farming_plus:banana | farming_plus:banana_leaves |
| aotearoa | aotearoa:karaka_fruit | aotearoa:karaka_leaves |
| aotearoa | aotearoa:miro_fruit | aotearoa:miro_leaves |
| aotearoa | aotearoa:tawa_fruit | aotearoa:tawa_leaves |
| aotearoa | aotearoa:hinau_fruit | aotearoa:hinau_leaves |
| aotearoa | aotearoa:kawakawa_fruit | aotearoa:kawakawa_leaves |
| australia | australia:cherry | australia:cherry_leaves |
| australia | australia:lilly_pilly_berries | australia:lilly_pilly_leaves |
| australia | australia:macadamia | australia:macadamia_leaves |
| australia | australia:mangrove_apple | australia:mangrove_apple_leaves |
| australia | australia:moreton_bay_fig | australia:moreton_bay_fig_leaves |
| australia | australia:quandong | australia:quandong_leaves |
| moretrees | moretrees:acorn | moretrees:oak_leaves |
| moretrees | moretrees:cedar_cone | moretrees:cedar_leaves |
| moretrees | moretrees:fir_cone | moretrees:fir_leaves |
| moretrees | moretrees:spruce_cone | moretrees:spruce_leaves |
#### API usage
The `regrow.add_fruit()` function is used to override each fruits `after_dig_node`
function so that an placeholder node (nostly leaves) is placed once it is taken, then a timer is
started that will regrow the fruit on completion (unless tree is chopped down).
#### Definition
`regrow.add_fruit(fruit_node, leaves_node, param2_check_override)`
#### Examples:
```
regrow.add_fruit("default:apple", "default:leaves")
regrow.add_fruit("cacaotree:pod", "cacaotree:trunk", true)
```
Changelog
---------
- 0.1 - Initial upload.
- 0.2 - Add checks for player placed fruit and tree's nearby.
- 0.3 - Make add_fruit a global function for other mods to use.
- 0.4 - Add check for fruit tree leaf type before re-growing.
- 0.5 - Ethereal Lemons and Olives can now regrow.
- 0.6 - Add support for cool_trees, farming_plus, aotearoa, australia and moretrees
- 0.7 - Add param2 override for cacao with placement param2 check
- 0.8 - Add custom min and max time regrow interval settings (defaults are 600 and 1200)
## LICENSE
MIT see [license.txt](license.txt) file.

BIN
mods/regrow/screenshot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -0,0 +1,5 @@
# Minimum interval in seconds it takes to regrow fruits
regrow_min_interval (Minimum Regrow Interval) int 600
# Maximum interval in seconds it takes to regrow fruits
regrow_max_interval (Maximum Regrow Interval) int 1200

166
mods/rspawn/License.txt Normal file
View File

@ -0,0 +1,166 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://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.

147
mods/rspawn/README.md Normal file
View File

@ -0,0 +1,147 @@
minetest mod rspawn
===================
Randomized Spawning for Minetest
Information
-----------
This mod its named `rspawn` , it causes players to receive a spawn point anywhere on the map.
Players will likely spawn very far from eachother into prisitine areas.
### Features
* Player is assigned randomized spawnpoint on joining
* New players will not spawn into protected areas
* Player will respawn at their spawnpoint if they die.
* If `beds` spawning is active, then beds can be used to set players' re-spawn point (they still go to their main spawnpoint on invoking `/spawn`).
* Commands
* Players can return to their spawn point with the `/spawn` command if they have `spawn` privilege.
* Players can invite other players to join their spawn - see "Spawn guests" below
* Players can allow any other player to visit their spawn - see "Town hosting" below
* Players can request a new spawn point by typing `/newspawn` if they have the `newspawn` privilege.
* Players can set their spawn point by typing `/setspawn` if they have the `setspawn` privelege.
* Moderator players can assign a new random spawn for another player using `/playerspawn` if they have the `spawnadmin` privilege.
KNOWN ISSUE - Any player not yet registered with a spawn point will be given a spawn point anywhere in the world. If applying retroactively to a server, this will cause existing players to be re-spawned once.
##### Spawn guests
Randomized spawning typically causes players to spawn far from eachother. If players wish to share a single spawn point, a player can add another to join their spawn position.
The player issuing the invite (host) must typically pay a levvy when adding another player.
* `/spawn add <player>` - allow another player to visit your spawn directly (levvy must be paid), or lift their exile (no levvy to pay)
* `/spawn kick <targetplayer>`
* revoke rights to visit you
* if the exiled player gets close to your spawn, they are kicked back to their own spawn
* `/spawn visit <player>` - visit a player's spawn
* `/spawn guests` - see who you have added to your spawn
* `/spawn hosts` - see whose spawns you may visit
Guests can help the spawn owner manage bans on their town.
##### Town hosting
You can host a town from your spawn if you wish. Hosting a town means that any player who connects to the server will be able to visit your spawn. You can still `/spawn kick <playername>` individually in this mode. If you switch off town hosting, only allowed guests in your normal guestlist can visit.
There is no levvy on hosting a town.
* `/spawn town { open | close }` - switch town hosting on or off.
* `/spawn town { ban | unban } <playername> [<town>]` - ban or unban a player from a town
* Town owners can use this, as well as unexiled guests of the town owner
Explicit guests can ban/unban other players from a town.
Town owner can forcibly ban a player by first adding the player to their guest list, and then exiling them. Guests cannot override this.
Techincal information
------------------------
Note that the spawn generation is performed in the background on a timer, allowing storing a collection of random spawn points to be generated ahead of time.
### Configuration
##### Generic settings used
* `name` - used for knowing the server admin's name
* `water_level` - Spawns are always set above water level, default `1`
* `static_spawnpoint` - main position the player will start at, default `{0,0,0}`
* `enable_bed_respawn` - from `beds` mod - if active, then respawning will happen at beds, instead of randomized spawnpoint
##### rspawn-specific settings
* Settings related to spawn generation
* `rspawn.max_pregen` - maximum number of spawn points to pre-generate, default `20`
* `rspawn.search_radius` - lateral radius around random point, within which a spawn point will be sought, default `32`
* `rspawn.gen_frequency` - how frequently (in seconds) to generate a new spawn point, default `30`, increase this on slower servers
* `rspawn.spawn_anywhere` - whether to spawn anywhere in the world at sea level (limited by the bounds spawn limits, check below)
if false, only spawns at a fixed spawn locaiton, for every player.
* if `true`, (default) spawns the player somewhere else on the map within valid air node and not inside solid block
* if `false`, will randomize around the static spawn point using search radius as maximun area for.
* `rspawn.cooldown_time` - how many seconds between two uses of `/newspawn`, per player
* `rspawn.kick_on_fail` - whether to kick the player if a randomized spawn cannot be set, default `false`
* `rspawn.spawn_block` - place this custom block under the user's spawn point
* Guestlist and town related settings
* `rspawn.levvy_name` - name of the block to use as levvy charge on the player issuing an invitation, default `default:cobble`
* `rspawn.levvy_qtty` - number of blocks to levvy from the player who issued the invitation, default `10`
* `rspawn.kick_period` - how frequently to check if exiled players are too near their locus of exile, default `3` (seconds)
* `rspawn.exile_distance` - distance from exile locus at which player gets bounced back to their own spawn, default `64` (nodes)
* `rspawn.debug` - whether to print debugging messages, default `false`
* Bounds limiting - you can limit the random spawning search area to a given subsection of the global map if you wish:
* `rspawn.min_x`, `rspawn.max_x`, `rspawn.min_z`, `rspawn.max_z` as expected
## Troubleshooting
As admin, you will receive notifications of inability to generate spawns when players join without being set a spawn. Those players will join but cannot play cos cannot spawn in a "valid spawn point".
If you only wants to solve it, just define a valid fixed spawn point with `static_spawnpoint` on your minetest.conf config file, then set `rspawn.gen_frequency` to a high number like 120 seconds or 300; warnings will continue but players will join and play (withou a spawn point set yet, take note).
If you are more hacker, you can turn on `rspawn.debug = true` to see debug in logs. Spawn generation uses a temporary forceload to read the blocks in the area ; it then releases the forceload after operating, so should not depend on the `max_forceloaded_blocks` setting.
If the generation log shows `0 air nodes found within <x>` on more than 2-3 consecutive tries, you may want to check that another mod is not forceloading blocks and then not subsequently clearing them, also try to reduce the bounds limits area of rspawn in settings, always around the fixed spawn point..
You may also find some mods do permanent forceloads by design (though this should be rare). In your world folder `~/.minetest/worlds/<yourworld>` there should eb a `force_loaded.txt` - see that its contents are simply `return {}`; if there is data in the table, then something else is forceloading blocks with permanence.
Resolutions in order of best to worst:
* Define a valid fixed spawn point with `static_spawnpoint` to be a valid air node and not a solid block
* then set `rspawn.gen_frequency` to a high number like 120 seconds or 300, and reduce the bounds limits.
* identify the mod and have it clear them properly (ideal)
* on UNIX/Linux you should be able to run `grep -rl forceload ~/.minetest/mods/` to see all mod files where forceloading is being done
* increase the max number of forceloaded blocks
* (not great - you will effectively be simply mitigating a forceloaded-blocks-related memory leak)
* Stop minetest, delete the `force_loaded.txt` file, and start it again
* (bad - some things in the mods using the forceload mechanism may break)
## Optimizations
It is also suitable for single player sessions too - if you want a new location to start a creative build, but don't need to go through creating another, separate world for it, just grab yourself a new spawnpoint!
On big multiplayers servers or small single players computers you may want to tune the mod.
#### For multiplayers big servers
* Define a valid fixed spawn point on your minetest.conf config file using the `static_spawnpoint` to a valid air node, not a solid block: it will be used if you do not want players to be kicked (by usage of `rspawn.kick_on_fail`) when there are no valid respawns points available.
* Bound limit must be little.. 400 nodes around is a number to play around. Do not set the `rspawn.search_radius` to a high number, 16 to 32 in big servers with big spawn random areas.
* Set `rspawn.gen_frequency` to a high number like 120 seconds or 300
* Change the Cooldown time - default is `300` seconds (5 minutes) between uses of `/newspawn`
#### Single Player Mode
* Add `rspawn` to your world
* Go to the *Advanced Settings* area of Minetest, look for `mods > rspawn`
* Change the frequency of pregeneration as required
* Good CPUs, enough RAM and SSD hard drives might get away with a frequency of 20sec (!)
* If you find your game immediately lagging due to excessive map generation, switch the frequency to say 120
* Change the Cooldown time - default is `300` seconds (5 minutes) between uses of `/newspawn`
* Optionally, change the maximum pregen to the desired number of spawnpoints to pregenerate and hold
* Start the game session; Wait around 1 minute or so as the initial spawn point gets generated and is assigned to you
* Jump around! (with `/newspawn`)
* Until you exhaust pregens :-P
## License
(C) 2017 Tai "DuCake" Kedzierski
Provided under the terms of the LGPL v3.0

1
mods/rspawn/depends.txt Normal file
View File

@ -0,0 +1 @@
beds?

249
mods/rspawn/init.lua Normal file
View File

@ -0,0 +1,249 @@
rspawn = {}
rspawn.playerspawns = {}
local mpath = minetest.get_modpath("rspawn")
-- Water level, plus one to ensure we are above the sea.
local water_level = tonumber(minetest.settings:get("water_level", "0") )
local radial_step = 16
-- Setting with no namespace for interoperability
local static_spawnpoint = minetest.setting_get_pos("static_spawnpoint") or {x=0, y=0, z=0}
rspawn.admin = minetest.settings:get("name") or "" -- For messaging only
-- Setting from beds mod
rspawn.bedspawn = minetest.setting_getbool("enable_bed_respawn") ~= false -- from beds mod
-- rSpawn specific settings
rspawn.debug_on = minetest.settings:get_bool("rspawn.debug")
rspawn.spawnanywhere = minetest.settings:get_bool("rspawn.spawn_anywhere") ~= false
rspawn.kick_on_fail = minetest.settings:get_bool("rspawn.kick_on_fail") == true
rspawn.max_pregen_spawns = tonumber(minetest.settings:get("rspawn.max_pregen") or 5)
rspawn.search_radius = tonumber(minetest.settings:get("rspawn.search_radius") or 32)
rspawn.gen_frequency = tonumber(minetest.settings:get("rspawn.gen_frequency") or 30)
rspawn.spawn_block = minetest.settings:get("rspawn.spawn_block") or "default:dirt_with_grass"
rspawn.min_x = tonumber(minetest.settings:get("rspawn.min_x") or -31000)
rspawn.max_x = tonumber(minetest.settings:get("rspawn.max_x") or 31000)
rspawn.min_z = tonumber(minetest.settings:get("rspawn.min_z") or -31000)
rspawn.max_z = tonumber(minetest.settings:get("rspawn.max_z") or 31000)
dofile(mpath.."/lua/data.lua")
dofile(mpath.."/lua/guestlists.lua")
dofile(mpath.."/lua/commands.lua")
dofile(mpath.."/lua/forceload.lua")
dofile(mpath.."/lua/debugging.lua")
minetest.after(0,function()
if not minetest.registered_items[rspawn.spawn_block] then
rspawn.spawn_block = "default:dirt_with_grass"
end
end)
rspawn:spawnload()
local function set_default_node(pos)
if rspawn.spawn_block then
minetest.set_node(pos, {name=rspawn.spawn_block})
end
end
local function daylight_above(min_daylight, pos)
local level = minetest.get_node_light(pos, 0.5)
return min_daylight <= level
end
function rspawn:get_positions_for(pos, radius)
local breadth = radius
local altitude = water_level + radius
if rspawn.spawnanywhere then
altitude = radius
end
local pos1 = {x=pos.x-breadth, y=pos.y, z=pos.z-breadth}
local pos2 = {x=pos.x+breadth, y=pos.y+altitude, z=pos.z+breadth}
return pos1,pos2
end
function rspawn:newspawn(pos, radius)
-- Given a seed position and a radius, find an exact spawn location
-- that is an air node, walkable under it, non-walkable over it
-- bright during the day, and not leaves
rspawn:debug("Trying somewhere around "..minetest.pos_to_string(pos))
local pos1,pos2 = rspawn:get_positions_for(pos, radius)
rspawn:debug("Searching "..minetest.pos_to_string(pos1).." to "..minetest.pos_to_string(pos2))
local airnodes = minetest.find_nodes_in_area(pos1, pos2, {"air"})
local validnodes = {}
rspawn:debug("Found "..tostring(#airnodes).." air nodes within "..tostring(radius))
for _,anode in pairs(airnodes) do
local under = minetest.get_node( {x=anode.x, y=anode.y-1, z=anode.z} ).name
local over = minetest.get_node( {x=anode.x, y=anode.y+1, z=anode.z} ).name
under = minetest.registered_nodes[under]
over = minetest.registered_nodes[over]
if under == nil or over == nil then
-- `under` or `over` could be nil if a mod that defined that node was removed.
-- Not something this mod can resolve, and so we just ignore it.
rspawn:debug("Found an undefined node around "..minetest.pos_to_string(anode))
else
if under.walkable
and not over.walkable
and not minetest.is_protected(anode, "")
and not (under.groups and under.groups.leaves ) -- no spawning on treetops!
and daylight_above(7, anode) then
if under.buildable_to then
validnodes[#validnodes+1] = {x=anode.x, y=anode.y-1, z=anode.z}
else
validnodes[#validnodes+1] = anode
end
end
end
end
if #validnodes > 0 then
rspawn:debug("Valid spawn points found with radius "..tostring(radius))
local newpos = validnodes[math.random(1,#validnodes)]
return newpos
else
rspawn:debug("No valid air nodes")
end
end
function rspawn:genpos()
-- Generate a random position, and derive a new spawn position
local pos = static_spawnpoint
if rspawn.spawnanywhere then
pos = {
x = math.random(rspawn.min_x,rspawn.max_x),
y = water_level, -- always start at waterlevel
z = math.random(rspawn.min_z,rspawn.max_z),
}
end
return pos
end
function rspawn:set_player_spawn(name, newpos)
local tplayer = minetest.get_player_by_name(name)
if not tplayer then
return false
end
local spos = minetest.pos_to_string(newpos)
rspawn.debug("Saving spawn for "..name, spos)
rspawn.playerspawns[name] = newpos
rspawn:spawnsave()
minetest.chat_send_player(name, "New spawn set at "..spos)
tplayer:setpos(rspawn.playerspawns[name])
minetest.after(0.5,function()
set_default_node({x=newpos.x,y=newpos.y-1,z=newpos.z})
end)
return true
end
function rspawn:set_newplayer_spawn(player, attempts)
-- only use for new players / players who have never had a randomized spawn
if not player then return end
local playername = player:get_player_name()
if playername == "" then return end
if not rspawn.playerspawns[playername] then
local newpos = rspawn:get_next_spawn()
if newpos then
rspawn:set_player_spawn(playername, newpos)
else
-- We did not get a new position
if rspawn.kick_on_fail then
minetest.kick_player(playername, "No personalized spawn points available - please try again later.")
else
-- player just spawns (avoiting black screen) but still it not have spawn point assigned
if attempts <= 0 then
local fixedpos = rspawn:genpos()
fixedpos.y = water_level + rspawn.search_radius
player:setpos(fixedpos) -- player just spawns (avoiting black screen) but still it not have spawn point assigned
minetest.chat_send_player(rspawn.admin, "Exhausted spawns! just spawn "..playername.." without spawn point")
end
minetest.chat_send_player(playername, "Could not get custom spawn! Used fixed one and retrying in "..rspawn.gen_frequency.." seconds")
minetest.log("warning", "rspawn -- Exhausted spawns! Could not spawn "..playername.." so used fixed one")
minetest.after(rspawn.gen_frequency, function()
rspawn:set_newplayer_spawn(player, attempts-1)
end)
end
end
end
end
function rspawn:renew_player_spawn(playername)
local player = minetest.get_player_by_name(playername)
if not player then
return false
end
local newpos = rspawn:get_next_spawn()
if newpos then
return rspawn:set_player_spawn(playername, newpos)
else
minetest.chat_send_player(playername, "Could not get custom spawn!")
return false
end
end
minetest.register_on_joinplayer(function(player)
rspawn:set_newplayer_spawn(player, 5)
end)
minetest.register_on_respawnplayer(function(player)
-- return true to disable further respawn placement
local name = player:get_player_name()
if rspawn.bedspawn == true and beds.spawn then
local pos = beds.spawn[name]
if pos then
minetest.log("action", name.." respawns at "..minetest.pos_to_string(pos))
player:setpos(pos)
return true
end
end
local pos = rspawn.playerspawns[name]
-- And if no bed, nor bed spwawning not active:
if pos then
minetest.log("action", name.." respawns at "..minetest.pos_to_string(pos))
player:setpos(pos)
return true
else
minetest.chat_send_player(name, "Failed to find your spawn point!")
minetest.log("warning", "rspawn -- Could not find spawn point for "..name)
return false
end
end)
dofile(mpath.."/lua/pregeneration.lua")

View File

@ -0,0 +1,164 @@
local stepcount = 0
local newspawn_cooldown = {}
local cooldown_time = tonumber(minetest.settings:get("rspawn.cooldown_time")) or 300
-- Command privileges
minetest.register_privilege("spawn", "Can teleport to a spawn position and manage shared spawns.")
minetest.register_privilege("setspawn", "Can manually set a spawn point.")
minetest.register_privilege("newspawn", "Can get a new randomized spawn position.")
minetest.register_privilege("spawnadmin", "Can set new spawns for players.")
-- Support functions
local function request_new_spawn(username, targetname)
local timername = username
if targetname ~= username then
timername = username.." "..targetname
end
if not newspawn_cooldown[timername] then
if not rspawn:renew_player_spawn(targetname) then
minetest.chat_send_player(username, "Could not set new spawn for "..targetname)
return false
else
newspawn_cooldown[timername] = cooldown_time
return true
end
else
minetest.chat_send_player(username, tostring(math.ceil(newspawn_cooldown[timername])).."sec until you can randomize a new spawn for "..targetname)
return false
end
end
-- Commands
minetest.register_chatcommand("spawn", {
description = "Teleport to your spawn, or manage guests in your spawn.",
params = "[ add <player> | visit <player> | kick <player> | guests | hosts | town { open | close | ban <player> [<town>] | unban <player> [<town>] } ]",
privs = "spawn",
func = function(playername, args)
local target = rspawn.playerspawns[playername]
local args = args:split(" ", false, 1)
if #args == 0 then
if target then
minetest.get_player_by_name(playername):setpos(target)
return
else
minetest.chat_send_player(playername, "You have no spawn position!")
return
end
elseif #args < 4 then
for command,action in pairs({
["guests"] = function() rspawn.guestlists:listguests(playername) end,
["hosts"] = function() rspawn.guestlists:listhosts(playername) end,
["add"] = function(commandername,targetname) rspawn.guestlists:addplayer(commandername,targetname) end,
["visit"] = function(commandername,targetname) rspawn.guestlists:visitplayer(targetname, commandername) end,
["kick"] = function(commandername, params) rspawn.guestlists:kickplayer(commandername, params) end,
["town"] = function(commandername,mode) rspawn.guestlists:townset(commandername, mode) end,
}) do
if args[1] == command then
if #args == 2 then
action(playername, args[2])
return
elseif #args == 1 then
action(playername)
return
end
end
end
end
minetest.chat_send_player(playername, "Bad command. Please check '/help spawn'")
end
})
minetest.register_chatcommand("setspawn", {
description = "Assign current position as spawn position.",
params = "",
privs = "setspawn",
func = function(name)
rspawn.playerspawns[name] = minetest.get_player_by_name(name):getpos()
rspawn:spawnsave()
minetest.chat_send_player(name, "New spawn set !")
end
})
minetest.register_chatcommand("newspawn", {
description = "Randomly select a new spawn position.",
params = "",
privs = "newspawn",
func = function(name, args)
request_new_spawn(name, name)
end
})
minetest.register_chatcommand("playerspawn", {
description = "Randomly select a new spawn position for a player, or use specified position, or go to their spawn.",
params = "<playername> { new | <pos> | go }",
privs = "spawnadmin",
func = function(name, args)
if args ~= "" then
args = args:split(" ")
if #args == 2 then
local tname = args[1]
local tpos
if args[2] == "go" then
local user = minetest.get_player_by_name(name)
local dest = rspawn.playerspawns[args[1]]
if dest then
user:setpos(dest)
minetest.chat_send_player(name, "Moved to spawn point of "..args[1])
else
minetest.chat_send_player(name, "No rspawn coords for "..args[1])
end
return
elseif args[2] == "new" then
request_new_spawn(name, args[1])
return
else
tpos = minetest.string_to_pos(args[2])
if tpos then
rspawn.playerspawns[tname] = tpos
rspawn:spawnsave()
minetest.chat_send_player(name, tname.."'s spawn has been reset")
return
end
end
end
end
minetest.chat_send_player(name, "Error. See '/help playerspawn'")
end
})
-- Prevent players from spamming newspawn
minetest.register_globalstep(function(dtime)
local playername, playertime, shavetime
stepcount = stepcount + dtime
shavetime = stepcount
if stepcount > 0.5 then
stepcount = 0
else
return
end
for playername,playertime in pairs(newspawn_cooldown) do
playertime = playertime - shavetime
if playertime <= 0 then
newspawn_cooldown[playername] = nil
minetest.chat_send_player(playername, "/newspawn available")
else
newspawn_cooldown[playername] = playertime
end
end
end)

99
mods/rspawn/lua/data.lua Normal file
View File

@ -0,0 +1,99 @@
local spawnsfile = minetest.get_worldpath().."/dynamicspawns.lua.ser"
--[[ Reconcile functions
reconcile_original_spawns : convert from base implementation to invites with original spawns
reconcile_guestlist_spawns : convert from "original spawns" implementation to "guest lists"
--]]
-- Comatibility with old behaviour - players whose original spawns had not been registered receive the one they are now using
local function reconcile_original_spawns()
if not rspawn.playerspawns["original spawns"] then
rspawn.playerspawns["original spawns"] = {}
end
for playername,spawnpos in pairs(rspawn.playerspawns) do
if playername ~= "pre gen" and playername ~= "original spawns" then
if not rspawn.playerspawns["original spawns"][playername] then
rspawn.playerspawns["original spawns"][playername] = rspawn.playerspawns[playername]
end
end
end
rspawn:spawnsave()
end
local function reconcile_guest(guestname, guestspawn)
for hostname,hostspawn in pairs(rspawn.playerspawns) do
if hostname ~= "guest lists" and hostname ~= guestname and hostspawn == guestspawn then
local hostlist = rspawn.playerspawns["guest lists"][hostname] or {}
hostlist[guestname] = 1
rspawn.playerspawns["guest lists"][hostname] = hostlist
end
end
end
local function reconcile_guestlist_spawns()
if not rspawn.playerspawns["guest lists"] then rspawn.playerspawns["guest lists"] = {} end
for guestname,spawnpos in pairs(rspawn.playerspawns) do
reconcile_guest(guestname, spawnpos)
if rspawn.playerspawns["original spawns"][guestname] then
rspawn.playerspawns[guestname] = rspawn.playerspawns["original spawns"][guestname]
rspawn.playerspawns["original spawns"][guestname] = nil
else
minetest.debug("Could not return "..guestname)
end
end
if #rspawn.playerspawns["original spawns"] == 0 then
rspawn.playerspawns["original spawns"] = nil
else
minetest.log("error", "Failed to reconcile all spawns")
end
rspawn:spawnsave()
end
function rspawn:spawnsave()
local serdata = minetest.serialize(rspawn.playerspawns)
if not serdata then
minetest.log("error", "[spawn] Data serialization failed")
return
end
local file, err = io.open(spawnsfile, "w")
if err then
return err
end
file:write(serdata)
file:close()
local pregens = rspawn.playerspawns["pre gen"] or {}
minetest.debug("Wrote rspawn data with "..tostring(#pregens).." pregen nodes")
end
function rspawn:spawnload()
local file, err = io.open(spawnsfile, "r")
if not err then
rspawn.playerspawns = minetest.deserialize(file:read("*a"))
file:close()
else
minetest.log("error", "[spawn] Data read failed - initializing")
rspawn.playerspawns = {}
end
local pregens = rspawn.playerspawns["pre gen"] or {}
rspawn.playerspawns["pre gen"] = pregens
local towns = rspawn.playerspawns["town lists"] or {}
rspawn.playerspawns["town lists"] = towns
reconcile_original_spawns()
reconcile_guestlist_spawns()
minetest.debug("Loaded rspawn data with "..tostring(#pregens).." pregen nodes")
end

View File

@ -0,0 +1,20 @@
function rspawn:d(stuff)
-- Quick debugging
minetest.debug(dump(stuff))
end
function rspawn:debug(message, data)
-- Debugging from setting
if not rspawn.debug_on then
return
end
local debug_data = ""
if data ~= nil then
debug_data = " :: "..dump(data)
end
local debug_string = "[rspawn] DEBUG : "..message..debug_data
minetest.debug(debug_string)
end

View File

@ -0,0 +1,37 @@
local forceloading_happening = false
local function forceload_operate(pos1, pos2, handler, transient)
local i,j,k
for i=pos1.x,pos2.x,16 do
for j=pos1.y,pos2.y,16 do
for k=pos1.z,pos2.z,16 do
handler({x=i,y=j,z=k}, transient)
end
end
end
end
function rspawn:forceload_blocks_in(pos1, pos2)
if forceloading_happening then
rspawn:debug("Forceload operation already underway - abort")
return false
end
rspawn:debug("Forceloading blocks -----------¬", {pos1=minetest.pos_to_string(pos1),pos2=minetest.pos_to_string(pos2)})
forceloading_happening = true
minetest.emerge_area(pos1, pos2)
forceload_operate(pos1, pos2, minetest.forceload_block, true)
return true
end
function rspawn:forceload_free_blocks_in(pos1, pos2)
rspawn:debug("Freeing forceloaded blocks ____/", {pos1=minetest.pos_to_string(pos1),pos2=minetest.pos_to_string(pos2)})
-- free both cases - take no chances
forceload_operate(pos1, pos2, minetest.forceload_free_block) -- free if persistent
forceload_operate(pos1, pos2, minetest.forceload_free_block, true) -- free if transient
forceloading_happening = false
end

View File

@ -0,0 +1,429 @@
-- API holder object
rspawn.guestlists = {}
local kick_step = 0
local kick_period = tonumber(minetest.settings:get("rspawn.kick_period")) or 3
local exile_distance = tonumber(minetest.settings:get("rspawn.exile_distance")) or 64
local GUEST_BAN = 0
local GUEST_ALLOW = 1
-- Levvy helpers
-- FIXME Minetest API might actually be able to do this cross-stacks with a single call at inventory level.
local levvy_name = minetest.settings:get("rspawn.levvy_name") or "default:cobble"
local levvy_qtty = tonumber(minetest.settings:get("rspawn.levvy_qtty")) or 10
local levvy_nicename = "cobblestone"
minetest.after(0,function()
if minetest.registered_items[levvy_name] then
levvy_nicename = minetest.registered_nodes[levvy_name].description
else
minetest.debug("No such item "..levvy_name.." -- reverting to defaults.")
levvy_name = "default:cobble"
levvy_qtty = 99
end
end)
local function find_levvy(player)
-- return itemstack index, and stack itself, with qtty removed
-- or none if not found/not enough found
local i
if not player then
minetest.log("error", "[rspawn] Levvy : Tried to access undefined player")
return false
end
local pname = player:get_player_name()
local player_inv = minetest.get_inventory({type='player', name = pname})
local total_count = 0
if not player_inv then
minetest.log("error", "[rspawn] Levvy : Could not access inventory for "..pname)
return false
end
for i = 1,32 do
local itemstack = player_inv:get_stack('main', i)
local itemname = itemstack:get_name()
if itemname == levvy_name then
if itemstack:get_count() >= levvy_qtty then
return true
else
total_count = total_count + itemstack:get_count()
if total_count >= (levvy_qtty) then
return true
end
end
end
end
minetest.chat_send_player(pname, "You do not have enough "..levvy_nicename.." to pay the spawn levvy for your invitation.")
return false
end
function rspawn:consume_levvy(player)
if not player then
minetest.log("error", "[rspawn] Levvy : Tried to access undefined player")
return false
end
local i
local pname = player:get_player_name()
local player_inv = minetest.get_inventory({type='player', name = pname})
local total_count = 0
-- TODO combine find_levvy and consume_levvy so that we're
-- not scouring the inventory twice...
if find_levvy(player) then
for i = 1,32 do
local itemstack = player_inv:get_stack('main', i)
local itemname = itemstack:get_name()
if itemname == levvy_name then
if itemstack:get_count() >= levvy_qtty then
itemstack:take_item(levvy_qtty)
player_inv:set_stack('main', i, itemstack)
return true
else
total_count = total_count + itemstack:get_count()
itemstack:clear()
player_inv:set_stack('main', i, itemstack)
if total_count >= (levvy_qtty) then
return true
end
end
end
end
end
return false
end
-- Visitation rights check
local function canvisit(hostname, guestname)
local host_glist = rspawn.playerspawns["guest lists"][hostname] or {}
local town_lists = rspawn.playerspawns["town lists"] or {}
local explicitly_banned = host_glist[guestname] == GUEST_BAN
local explicitly_banned_from_town = town_lists[hostname] and
town_lists[hostname][guestname] == GUEST_BAN
local open_town = town_lists[hostname] and town_lists[hostname]["town status"] == "on"
if explicitly_banned or explicitly_banned_from_town then
return false
elseif host_glist[guestname] == GUEST_ALLOW then
return true
elseif open_town then
return true
end
return false
end
-- Operational functions (to be invoked by /command)
function rspawn.guestlists:addplayer(hostname, guestname)
local guestlist = rspawn.playerspawns["guest lists"][hostname] or {}
if guestlist[guestname] ~= nil then
if guestlist[guestname] == GUEST_BAN then
minetest.chat_send_player(guestname, hostname.." let you back into their spawn.")
minetest.log("action", "[rspawn] "..hostname.." lifted exile on "..guestname)
end
guestlist[guestname] = GUEST_ALLOW
elseif rspawn:consume_levvy(minetest.get_player_by_name(hostname) ) then -- Automatically notifies host if they don't have enough
guestlist[guestname] = GUEST_ALLOW
minetest.chat_send_player(guestname, hostname.." added you to their spawn! You can now visit them with /spawn visit "..hostname)
minetest.log("action", "[rspawn] "..hostname.." added "..guestname.." to their spawn")
else
return
end
minetest.chat_send_player(hostname, guestname.." is allowed to visit your spawn.")
rspawn.playerspawns["guest lists"][hostname] = guestlist
rspawn:spawnsave()
end
function rspawn.guestlists:exileplayer(hostname, guestname)
if hostname == guestname then
minetest.chat_send_player(hostname, "Cannot ban yourself!")
return false
end
local guestlist = rspawn.playerspawns["guest lists"][hostname] or {}
if guestlist[guestname] == GUEST_ALLOW then
guestlist[guestname] = GUEST_BAN
rspawn.playerspawns["guest lists"][hostname] = guestlist
else
minetest.chat_send_player(hostname, guestname.." is not in accepted guests list for "..hostname)
return false
end
minetest.chat_send_player(guestname, "You may no longer visit "..hostname)
minetest.log("action", "rspawn - "..hostname.." exiles "..guestname)
rspawn:spawnsave()
return true
end
function rspawn.guestlists:kickplayer(hostname, guestname)
if rspawn.guestlists:exileplayer(hostname, guestname) then
minetest.chat_send_player(hostname, "Evicted "..guestname.." from your spawn")
minetest.log("action", "rspawn - "..hostname.." evicts "..guestname)
end
end
function rspawn.guestlists:listguests(hostname)
local guests = ""
local guestlist = rspawn.playerspawns["guest lists"][hostname] or {}
local global_hosts = rspawn.playerspawns["town lists"] or {}
if global_hosts[hostname] then
guests = ", You are an active town host."
end
-- Explicit guests
for guestname,status in pairs(guestlist) do
if status == GUEST_ALLOW then status = "" else status = " (exiled guest)" end
guests = guests..", "..guestname..status
end
-- Town bans - always list so this can be maanged even when town is closed
for guestname,status in pairs(global_hosts[hostname] or {}) do
if guestname ~= "town status" then
if status == GUEST_ALLOW then status = "" else status = " (banned from town)" end
guests = guests..", "..guestname..status
end
end
if guests == "" then
guests = ", No guests, not hosting a town."
end
minetest.chat_send_player(hostname, guests:sub(3))
end
function rspawn.guestlists:listhosts(guestname)
local hosts = ""
for hostname,hostguestlist in pairs(rspawn.playerspawns["guest lists"]) do
for gname,status in pairs(hostguestlist) do
if guestname == gname then
if status == GUEST_ALLOWED then
hosts = hosts..", "..hostname
end
end
end
end
local global_hostlist = rspawn.playerspawns["town lists"] or {}
for hostname,host_banlist in pairs(global_hostlist) do
if host_banlist["town status"] == "on" and
host_banlist[guestname] ~= GUEST_BAN
then
hosts = hosts..", "..hostname.." (town)"
end
end
if hosts == "" then
hosts = ", (no visitable hosts)"
end
minetest.chat_send_player(guestname, hosts:sub(3))
end
function rspawn.guestlists:visitplayer(hostname, guestname)
if not (hostname and guestname) then return end
local guest = minetest.get_player_by_name(guestname)
local hostpos = rspawn.playerspawns[hostname]
if not hostpos then
minetest.log("error", "[rspawn] Missing spawn position data for "..hostname)
minetest.chat_send_player(guestname, "Could not find spawn position for "..hostname)
end
if guest and canvisit(hostname, guestname) then
minetest.log("action", "[rspawn] "..guestname.." visits "..hostname.." (/spawn visit)")
guest:setpos(hostpos)
else
minetest.chat_send_player(guestname, "Could not visit "..hostname)
end
end
local function act_on_behalf(hostname, callername)
return hostname == callername or -- caller is the town owner, always allow
( -- caller can act on behalf of town owner
rspawn.playerspawns["guest lists"][hostname] and
rspawn.playerspawns["guest lists"][hostname][callername] == GUEST_ALLOW
)
end
local function townban(callername, guestname, hostname)
if not (callername and guestname) then return end
hostname = hostname or callername
if act_on_behalf(hostname, callername) then
if not rspawn.playerspawns["town lists"][hostname] then
minetest.chat_send_player(callername, "No such town "..hostname)
return
end
rspawn.playerspawns["town lists"][hostname][guestname] = GUEST_BAN
minetest.chat_send_player(callername, "Evicted "..guestname.." from "..hostname.."'s spawn")
minetest.log("action", "[rspawn] - "..callername.." evicts "..guestname.." on behalf of "..hostname)
else
minetest.chat_send_player(callername, "You are not permitted to act on behalf of "..hostname)
end
rspawn:spawnsave()
end
local function townunban(callername, guestname, hostname)
if not (callername and guestname) then return end
hostname = hostname or callername
if act_on_behalf(hostname, callername) then
if not rspawn.playerspawns["town lists"][hostname] then
minetest.chat_send_player(callername, "No such town "..hostname)
return
end
rspawn.playerspawns["town lists"][hostname][guestname] = nil
minetest.chat_send_player(callername, "Allowed "..guestname.." back to town "..hostname)
minetest.log("action", "[rspawn] - "..callername.." lifts eviction on "..guestname.." on behalf of "..hostname)
else
minetest.chat_send_player(callername, "You are not permitted to act on behalf of "..hostname)
end
rspawn:spawnsave()
end
local function listtowns()
local town_lists = rspawn.playerspawns["town lists"] or {}
local open_towns = ""
for townname,banlist in pairs(town_lists) do
if banlist["town status"] == "on" then
open_towns = open_towns..", "..townname
end
end
if open_towns ~= "" then
return open_towns:sub(3)
end
end
function rspawn.guestlists:townset(hostname, params)
if not hostname then return end
params = params or ""
params = params:split(" ")
local mode = params[1]
local guestname = params[2]
local town_lists = rspawn.playerspawns["town lists"] or {}
local town_banlist = town_lists[hostname] or {}
if mode == "open" then
town_banlist["town status"] = "on"
minetest.chat_send_all(hostname.." is opens access to all!")
minetest.log("action", "[rspawn] town: "..hostname.." sets their spawn to open")
elseif mode == "close" then
town_banlist["town status"] = "off"
minetest.chat_send_all(hostname.." closes town access - only guests may directly visit.")
minetest.log("action", "[rspawn] town: "..hostname.." sets their spawn to closed")
elseif mode == "status" then
minetest.chat_send_player(hostname, "Town mode is: "..town_banlist["town status"])
return
elseif mode == "ban" and guestname and guestname ~= hostname then
townban(hostname, guestname, params[3])
elseif mode == "unban" and guestname then
townunban(hostname, guestname, params[3])
elseif mode == nil or mode == "" then
local open_towns = listtowns()
if not open_towns then
open_towns = "(none yet)"
end
minetest.chat_send_player(hostname, open_towns)
else
minetest.chat_send_player(hostname, "Unknown parameterless town operation: "..tostring(mode) )
return
end
town_lists[hostname] = town_banlist
rspawn.playerspawns["town lists"] = town_lists
rspawn:spawnsave()
end
-- Exile check
minetest.register_globalstep(function(dtime)
if kick_step < kick_period then
kick_step = kick_step + dtime
return
else
kick_step = 0
end
for _x,guest in ipairs(minetest.get_connected_players()) do
local guestname = guest:get_player_name()
local playerprivs = minetest.get_player_privs(guestname)
if not (playerprivs.basic_privs or playerprivs.server) then
local guestpos = guest:getpos()
for _y,player_list_name in ipairs({"guest lists", "town lists"}) do
for hostname,host_guestlist in pairs(rspawn.playerspawns[player_list_name] or {}) do
if host_guestlist[guestname] == GUEST_BAN then
-- Check distance of guest from banned pos
local vdist = vector.distance(guestpos, rspawn.playerspawns[hostname])
-- Check distance of guest from their own pos
-- If their spawn is very close to one they are banned from,
-- and they are close to their own, kick should not occur
local sdist = vector.distance(guestpos, rspawn.playerspawns[guestname])
if vdist < exile_distance and sdist > exile_distance then
guest:setpos(rspawn.playerspawns[guestname])
minetest.chat_send_player(guestname, "You got too close to "..hostname.."'s turf.")
minetest.log("action", "[rspawn] Auto-kicked "..guestname.." for being too close to "..hostname.."'s spawn")
elseif vdist < exile_distance*1.5 and sdist > exile_distance then
minetest.chat_send_player(guestname, "You are getting too close to "..hostname.."'s turf.")
end
end
end
end
end
end
end)
-- Announce towns!
minetest.register_on_joinplayer(function(player)
local open_towns = listtowns()
if open_towns then
minetest.chat_send_player(player:get_player_name(), "Currently open towns: "..open_towns..". Visit with '/spawn visit <townname>' !")
end
end)

View File

@ -0,0 +1,85 @@
local steptime = 0
-- Ensure pregen data is stored and saved properly
local function len_pgen()
return #rspawn.playerspawns["pre gen"]
end
local function set_pgen(idx, v)
rspawn.playerspawns["pre gen"][idx] = v
rspawn:spawnsave()
end
local function get_pgen(idx)
return rspawn.playerspawns["pre gen"][idx]
end
-- Spawn generation
local function push_new_spawn()
if len_pgen() >= rspawn.max_pregen_spawns then
rspawn:debug("Max pregenerated spawns ("..rspawn.max_pregen_spawns..") reached : "..len_pgen())
return
end
local random_pos = rspawn:genpos()
local pos1,pos2 = rspawn:get_positions_for(random_pos, rspawn.search_radius)
if rspawn:forceload_blocks_in(pos1, pos2) then
minetest.after(rspawn.gen_frequency*0.8, function()
-- Let the forceload do its thing, then act
local newpos = rspawn:newspawn(random_pos, rspawn.search_radius)
if newpos then
rspawn:debug("Generated "..minetest.pos_to_string(newpos))
set_pgen(len_pgen()+1, newpos )
else
rspawn:debug("Failed to generate new spawn point to push")
random_pos.y = random_pos.y + rspawn.search_radius
set_pgen(len_pgen()+1, random_pos )
minetest.chat_send_player(rspawn.admin, "Failed to generate new spawn.. trying fixed one")
end
rspawn:forceload_free_blocks_in(pos1, pos2)
end)
else
rspawn:debug("Failed to push new spawn point - preexisting operation took precedence.")
end
end
minetest.register_globalstep(function(dtime)
steptime = steptime + dtime
if steptime > rspawn.gen_frequency then
steptime = 0
else
return
end
push_new_spawn()
end)
-- Access pregenrated spawns
function rspawn:get_next_spawn()
local nspawn
if len_pgen() > 0 then
nspawn = get_pgen(len_pgen() )
set_pgen(len_pgen(), nil)
-- Someone might have claimed the area since.
if minetest.is_protected(nspawn, "") then
return rspawn:get_next_spawn()
else
rspawn:debug("Returning pregenerated spawn",nspawn)
end
end
return nspawn
end
-- On load...
push_new_spawn()

1
mods/rspawn/mod.conf Normal file
View File

@ -0,0 +1 @@
name = rspawn

View File

@ -0,0 +1,16 @@
rspawn.debug (Debug mode) bool false
rspawn.spawn_anywhere (Spawn anywhere) bool true
rspawn.kick_on_fail (Kick on fail) bool false
rspawn.max_pregen (Maximum blocks to pregenerate) string 10
rspawn.search_radius (Search radius) string 32
rspawn.gen_frequency (Spawnpoint generation frequency [seconds]) string 60
rspawn.spawn_block (Node to place under new spawn point) string
rspawn.levvy_name (Levvy itemstring) string "default:cobble"
rspawn.levvy_qtty (Levvy quantity) string 10
rspawn.kick_period (Exile kick check period) string 1
rspawn.exile_distance (Exile distance) string 64
rspawn.cooldown_time (Cooldown between /newspawn uses) string 300
rspawn.min_x (Westmost bounds) string -31000
rspawn.max_x (Eastmost bounds) string 31000
rspawn.min_z (Southmost bounds) string -31000
rspawn.max_z (Northmost bounds) string 31000

4
mods/skins/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*~
.previews/output
.previews/blender_out
.previews/pngcrush_output

5
mods/skins/depends.txt Normal file
View File

@ -0,0 +1,5 @@
default
sfinv?
inventory_plus?
intllib?
unified_inventory?

View File

@ -0,0 +1 @@
SKIN mnager Mod, Simple skin modified that allows players to set their individual skins.

333
mods/skins/init.lua Normal file
View File

@ -0,0 +1,333 @@
-- Simple Skins mod for minetest
-- Adds a simple skin selector to the inventory by using
-- the default sfinv or inventory_plus when running.
-- Released by TenPlus1 and based on Zeg9's code under MIT license
-- check for minetest 5.x compatibility
local is_54 = minetest.has_feature("direct_velocity_on_players") or nil
local is_50 = minetest.has_feature("object_use_texture_alpha") or nil
-- Load support for translation.
local S
if minetest.get_translator ~= nil then
S = minetest.get_translator("skins")
is_50 = true
else
if minetest.get_modpath("intllib") then
dofile(minetest.get_modpath("intllib").."/init.lua")
if intllib.make_gettext_pair then
gettext, ngettext = intllib.make_gettext_pair() -- new gettext method
else
gettext = intllib.Getter() -- old text file method
end
S = gettext
else -- boilerplate function
S = function(str, ...)
local args = {...}
return str:gsub("@%d", function(match)
return args[tonumber(match:sub(2))]
end)
end
end
end
skins = {
skins = {}, list = {}, meta = {}, formspec = {},
modpath = minetest.get_modpath("skins"),
invplus = minetest.get_modpath("inventory_plus"),
unified_inventory = minetest.get_modpath("unified_inventory"),
default_skin_tab = false,
sfinv = minetest.get_modpath("sfinv"),
transparant_list = false,
id = 1,
file = minetest.get_worldpath() .. "/skins.mt",
preview = minetest.settings:get_bool("skins_preview") or true,
translate = S,
skin_limit = tonumber(minetest.settings:get("skins_limit")) or 160
}
-- check and use specific inventory
if skins.unified_inventory then
skins.transparant_list = true
dofile(skins.modpath .. "/unified_inventory.lua")
elseif skins.invplus then
skins.transparant_list = true
dofile(skins.modpath .. "/inventory_plus.lua")
elseif skins.sfinv then
skins.default_skin_tab = not skins.invplus and not skins.unified_inventory
dofile(skins.modpath .. "/sfinv.lua")
end
-- load skin list and metadata
local f, data, skin = 1
while skins.id <= skins.skin_limit do
skin = "character_" .. skins.id
-- does skin file exist ?
f = io.open(skins.modpath .. "/textures/" .. skin .. ".png")
-- escape loop if not found and remove last entry
if not f then
skins.list[skins.id] = nil
skins.id = skins.id - 1
break
end
f:close()
table.insert(skins.list, skin)
-- does metadata exist for that skin file ?
f = io.open(skins.modpath .. "/meta/" .. skin .. ".txt")
if f then
data = minetest.deserialize("return {" .. f:read("*all") .. "}")
f:close()
end
-- add metadata to list
skins.meta[skin] = {
name = data and data.name and data.name:gsub("[%p%c]", "") or "",
author = data and data.author and data.author:gsub("[%p%c]", "") or ""
}
skins.id = skins.id + 1
end
-- load player skins file for backwards compatibility
local input = io.open(skins.file, "r")
local data = nil
if input then
data = input:read("*all")
io.close(input)
end
if data and data ~= "" then
local lines = string.split(data, "\n")
for _, line in pairs(lines) do
data = string.split(line, " ", 2)
skins.skins[data[1]] = data[2]
end
end
-- create formspec for skin selection page
skins.formspec.main = function(name)
local formspec = "label[.5,2;" .. S("Select Player Skin:") .. "]"
.. "textlist[.5,2.5;6.8,6;skins_set;"
local meta
local selected = 1
for i = 1, #skins.list do
formspec = formspec .. skins.meta[ skins.list[i] ].name
if skins.skins[name] == skins.list[i] then
selected = i
meta = skins.meta[ skins.skins[name] ]
end
if i < #skins.list then
formspec = formspec ..","
end
end
if skins.transparant_list then
formspec = formspec .. ";" .. selected .. ";true]"
else
formspec = formspec .. ";" .. selected .. ";false]"
end
if meta then
if meta.name then
formspec = formspec .. "label[2,.5;" .. S("Name: ") .. meta.name .. "]"
end
if meta.author then
formspec = formspec .. "label[2,1;" .. S("Author: ") .. meta.author .. "]"
end
end
-- if preview enabled then add player model to formspec (5.4dev only)
if skins.preview == true then
if is_54 then
formspec = formspec .. "model[6,-0.2;1.5,3;player;character.b3d;"
.. skins.skins[name] .. ".png;0,180;false;true]"
else
local head = "[combine:8x8:-8,-8="..skins.skins[name]..".png"
local body = "[combine:8x12:-20,-20="..skins.skins[name]..".png"
local left_leg = "[combine:4x12:-4,-20="..skins.skins[name]..".png"
local right_leg = "[combine:4x12:-4,-20="..skins.skins[name]..".png^[transformFX"
local left_hand = "[combine:4x12:-44,-20="..skins.skins[name]..".png"
local right_hand = "[combine:4x12:-44,-20="..skins.skins[name]..".png^[transformFX"
local back_head = "[combine:8x8:-24,-8="..skins.skins[name]..".png"
local body_back = "[combine:8x12:-32,-20="..skins.skins[name]..".png"
local legs_back = "[combine:4x12:-12,-20="..skins.skins[name]..".png"
local left_leg_back = "[combine:4x12:-12,-20="..skins.skins[name]..".png"
local right_leg_back = "[combine:4x12:-12,-20="..skins.skins[name]..".png^[transformFX"
local left_hand_back = "[combine:4x12:-52,-20="..skins.skins[name]..".png"
local right_hand_back = "[combine:4x12:-52,-20="..skins.skins[name]..".png^[transformFX"
formspec = formspec .. "image[3,1;2,2;".. head .. "] image[3,2.75;2,3;".. body .. "] image[3,5.35;1,3;".. left_leg .. "] image[3.82,5.35;1,3;".. right_leg .. "] image[2.2,2.75;1,3;".. left_hand .. "] image[4.63,2.75;1,3;".. right_hand .. "] image[7,1;2,2;".. back_head .. "] image[7,2.75;2,3;".. body_back .. "] image[7,5.35;1,3;".. left_leg_back .. "] image[7.82,5.35;1,3;".. right_leg_back .. "] image[6.2,2.75;1,3;".. left_hand_back .. "] image[8.63,2.75;1,3;".. right_hand_back .. "] image_button[0,1;2,2;"..head.."]"
end
end
return formspec
end
-- Read the image size from a PNG file. (returns width, height)
local PNG_HDR = string.char(0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A)
local function read_image_size(filename)
local f = io.open(filename, "rb")
if not f then return end
f:seek("set", 0x0)
local hdr = f:read(string.len(PNG_HDR))
if hdr ~= PNG_HDR then
f:close() ; return
end
f:seek("set", 0x13) ; local ws = f:read(1)
f:seek("set", 0x17) ; local hs = f:read(1)
f:close()
return ws:byte(), hs:byte()
end
-- update player skin
skins.update_player_skin = function(player)
if not player then
return
end
local name = player:get_player_name()
if minetest.get_modpath("player_api") then
player_api.set_textures(player, {skins.skins[name] .. ".png"})
else
default.player_set_textures(player, {skins.skins[name] .. ".png"})
end
end
skins.event_CHG = function(event, player)
local name = player:get_player_name()
local index = math.min(event.index, skins.id)
if not skins.list[index] then
return -- Do not update wrong skin number
end
skins.skins[name] = skins.list[index]
skins.update_player_skin(player)
if is_50 then
local meta = player:get_meta()
meta:set_string("skins:skin", skins.skins[name])
else
player:set_attribute("skins:skin", skins.skins[name])
end
end
-- load player skin on join
minetest.register_on_joinplayer(function(player)
local name = player:get_player_name() ; if not name then return end
local skin
if is_50 then
local meta = player:get_meta()
skin = meta:get_string("skins:skin")
else
skin = player:get_attribute("skins:skins")
end
-- do we already have a skin in player attributes?
if skin and skin ~= "" then
skins.skins[name] = skin
-- otherwise use skin from skins.mt file or default if not set
elseif not skins.skins[name] then
skins.skins[name] = "character_1"
end
skins.update_player_skin(player)
end)
-- admin command to set player skin (usually for custom skins)
minetest.register_chatcommand("setskin", {
params = "<player> <skin number>",
description = S("Admin command to set player skin"),
privs = {server = true},
func = function(name, param)
local playername, skin = string.match(param, "([^ ]+) (-?%d+)")
if not playername or not skin then
return false, S("** Insufficient or wrong parameters")
end
local player = minetest.get_player_by_name(playername)
if not player then
return false, S("** Player @1 not online!", playername)
end
-- this check is only used when custom skins aren't in use
-- if not skins.list[tonumber(skin)] then
-- return false, S("** Invalid skin number (max value is @1)", id)
-- end
skins.skins[playername] = "character_" .. tonumber(skin)
skins.update_player_skin(player)
if is_50 then
local meta = player:get_meta()
meta:set_string("skins:skin", skins.skins[playername])
else
player:set_attribute("skins:skin", skins.skins[playername])
end
minetest.chat_send_player(playername,
S("Your skin has been set to") .. " character_" .. skin)
return true, "** " .. playername .. S("'s skin set to")
.. " character_" .. skin .. ".png"
end,
})
print ("[MOD] skins (Simple Skins) loaded")

View File

@ -0,0 +1,40 @@
local S = skins.translate
minetest.register_on_joinplayer(function(player)
inventory_plus.register_button(player, "skins", S("Skins"), 0,
"inventory_plus_skins.png")
end)
minetest.register_on_player_receive_fields(function(player, formname, fields)
if skins.sfinv then
local name = player:get_player_name()
if fields.skins then
inventory_plus.set_inventory_formspec(player,
"size[8,8.6]"
.. "bgcolor[#08080822;true]"
.. skins.formspec.main(name)
.. "button[0,.75;2,.5;main;" .. S("Back") .. "]")
end
local event = minetest.explode_textlist_event(fields["skins_set"])
if event.type == "CHG" then
skins.event_CHG(event, player)
inventory_plus.set_inventory_formspec(player,
"size[8,8.6]"
.. "bgcolor[#08080822;true]"
.. skins.formspec.main(name)
.. "button[0,.75;2,.5;main;" .. S("Back") .. "]")
end
end
end)

36
mods/skins/license.txt Normal file
View File

@ -0,0 +1,36 @@
License of Media:
-----------------
Title: Minetest Skins Pack 1
Title URL: https://opengameart.org/content/minetest-skins-pack-1
Author: isaiah658
License(s): License(s): CC0 ( http://creativecommons.org/publicdomain/zero/1.0/legalcode )
Original file names: Skin_1.png to Skin_32.png and Icon.png
Simple Skins file names: character_1.png to character_31.png, character_900.png, and inventory_plus_skins.png
Modifications: None
License of Code:
----------------
The MIT License (MIT)
Copyright (c) 2016 TenPlus1
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

52
mods/skins/locale/es.po Normal file
View File

@ -0,0 +1,52 @@
# simple_skin <italian translate>.
# Copyright (C) 2018
# This file is distributed under the same license as the PACKAGE package.
# Stefano Peris <xenon77.dev@gmail.com>, 2018.
# Github: <https://github.com/XenonCoder>
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-21 07:29+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: PICCORO Lenz McKAY <mckaygerhard@gmail.com>\n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.12\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: init.lua
msgid "Select Player Skin:"
msgstr "Seleciona la apariencia:"
#: init.lua
msgid "Name: "
msgstr "Nombre"
#: init.lua
msgid "Author: "
msgstr "Autor"
#: init.lua
msgid "Admin command to set player skin"
msgstr "Comando administrativo apra asignar apariencia de skin"
#: init.lua
msgid "'s skin set to"
msgstr ", apariencia asignada a"
#: init.lua
msgid "Set player skin"
msgstr "Configura la apariencia"
#: init.lua
msgid "Close"
msgstr "Cerrar"
#: init.lua
msgid "Skins"
msgstr "Figura"

51
mods/skins/locale/fr.po Normal file
View File

@ -0,0 +1,51 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-29 07:11+0200\n"
"PO-Revision-Date: 2017-07-29 07:17+0200\n"
"Last-Translator: fat115 <fat115@framasoft.org>\n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.12\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: init.lua
msgid "Select Player Skin:"
msgstr "Sélectionner l'apparence du joueur :"
#: init.lua
msgid "Name: "
msgstr "Nom : "
#: init.lua
msgid "Author: "
msgstr "Auteur : "
#: init.lua
msgid "Admin command to set player skin"
msgstr "Commande admin pour définir l'apparence du joueur"
#: init.lua
msgid "'s skin set to"
msgstr ", apparence définie pour"
#: init.lua
msgid "Set player skin"
msgstr "Définir l'apparence du joueur"
#: init.lua
msgid "Close"
msgstr "Fermer"
#: init.lua
msgid "[MOD] Simple Skins loaded"
msgstr "[MOD] Simple Skins chargé"

52
mods/skins/locale/it.po Normal file
View File

@ -0,0 +1,52 @@
# simple_skin <italian translate>.
# Copyright (C) 2018
# This file is distributed under the same license as the PACKAGE package.
# Stefano Peris <xenon77.dev@gmail.com>, 2018.
# Github: <https://github.com/XenonCoder>
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-21 07:29+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Stefano Peris <xenon77.dev@gmail.com>\n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.12\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: init.lua
msgid "Select Player Skin:"
msgstr "Seleziona la skin del giocatore"
#: init.lua
msgid "Name: "
msgstr "Nome"
#: init.lua
msgid "Author: "
msgstr "Autore"
#: init.lua
msgid "Admin command to set player skin"
msgstr "Comando di admin per impostare la skin del giocatore"
#: init.lua
msgid "'s skin set to"
msgstr ", la skin è impostata su"
#: init.lua
msgid "Set player skin"
msgstr "Imposta la skin del giocatore"
#: init.lua
msgid "Close"
msgstr "Chiudi"
#: init.lua
msgid "[MOD] Simple Skins loaded"
msgstr "[MOD] Skins semplici caricate"

51
mods/skins/locale/ms.po Normal file
View File

@ -0,0 +1,51 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-29 07:11+0200\n"
"PO-Revision-Date: 2018-02-14 01:23+0800\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.6\n"
"Last-Translator: MuhdNurHidayat (MNH48) <mnh48mail@gmail.com>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Language: ms\n"
#: init.lua
msgid "Select Player Skin:"
msgstr "Pilih Kulit Pemain:"
#: init.lua
msgid "Name: "
msgstr "Nama: "
#: init.lua
msgid "Author: "
msgstr "Pencipta: "
#: init.lua
msgid "Admin command to set player skin"
msgstr "Perintah pentadbir untuk menetapkan kulit pemain"
#: init.lua
msgid "'s skin set to"
msgstr " telah ditukarkan kulitnya kepada"
#: init.lua
msgid "Set player skin"
msgstr "Tetapkan kulit pemain"
#: init.lua
msgid "Close"
msgstr "Tutup"
#: init.lua
msgid "[MOD] Simple Skins loaded"
msgstr "[MODS] Simple Skins telah dimuatkan"

View File

@ -0,0 +1,10 @@
# textdomain: simple_skins
Select Player Skin:=Seleciona la apariencia:
Name: =Nombre:
Author: =Autor:
Admin command to set player skin=Comando administrativo apra asignar apariencia de skin
's skin set to=, apariencia asignada a
Set player skin=Configura la apariencia
Close=Cerrar
Skins=Figura

View File

@ -0,0 +1,10 @@
# textdomain: simple_skins
Select Player Skin:=Sélectionner l'apparence du joueur:
Name: =Nom:
Author: =Auteur:
Admin command to set player skin=Commande admin pour définir l'apparence du joueur
's skin set to=, apparence définie pour
Set player skin=Définir l'apparence du joueur
Close=Fermer
Skins=Skins

View File

@ -0,0 +1,10 @@
# textdomain: simple_skins
Select Player Skin:=Seleziona la skin del giocatore
Name: =Nome:
Author: =Autore:
Admin command to set player skin=Comando di admin per impostare la skin del giocatore
's skin set to=, la skin è impostata su
Set player skin=Imposta la skin del giocatore
Close=Chiudi
Skins=Pelli

View File

@ -0,0 +1,10 @@
# textdomain: simple_skins
Select Player Skin:=Pilih Kulit Pemain:
Name: =Nama:
Author: =Pencipta:
Admin command to set player skin=Perintah pentadbir untuk menetapkan kulit pemain
's skin set to= telah ditukarkan kulitnya kepada
Set player skin=Tetapkan kulit pemain
Close=Tutup
Skins=Kulit

View File

@ -0,0 +1,11 @@
# textdomain: simple_skins
Select Player Skin:=
Name: =
Author: =
Admin command to set player skin=
's skin set to=
Set player skin=
Close=
Skins=
[MOD] Simple Skins loaded=

View File

@ -0,0 +1,2 @@
name = "Farmer",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Farm Girl",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Jerry",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Scary",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Cool Dude",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Knight",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Derp Dirt",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Ice",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Robot",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "King",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Diced",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Waffles",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Glitch",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Pink Camouflage",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Biker",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Jade",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Split",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Camouflage",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Earth",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Stone",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Lab Coat",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Skeleton",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Autumn",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Winter Boy",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Winter Girl",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Cubed",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Tux",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Cool Guy",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Cool Girl",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Retro",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "Jim",
author = "isaiah658",

View File

@ -0,0 +1,2 @@
name = "PICCORO",
author = "none",

4
mods/skins/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = skins
depends = default, player_api
optional_depends = sfinv, inventory_plus, intllib, unified_inventory
description = SKIN manager mod, Simple_Skin modified mod that allow players to set their individual skins.

93
mods/skins/readme.md Normal file
View File

@ -0,0 +1,93 @@
minetest mod Simple Skins
=========================
Mod for skin appereance change of your player in a nice tab of your inventory
Information
------------
This is a modification of origina Simple Skins mod, in sync with minenux project,
is a mod that's so easy to use you'll wonder why it hasn't been
done before... Just download and start to use it in your inventory.
Must be named `skins` and uses SfInv or Inventory Plus mods,
and Unified Inventory if you use lasted original (master branch)
version when available to allow players to select a skin/texture from the list.
![screenshot.jpg](screenshot.jpg)
Original forum https://forum.minetest.net/viewtopic.php?id=9100
Technical Information
---------------------
This mod its more basic and minimalis, no preview and no download/upload, management,
it target is to be light for huge servers and be minimal for better performance.
This version is fully compatible with 5.X and 4.X also 0.4.16 versions of minetest
Based on Zeg9's Skins mod originally from https://github.com/Zeg9/minetest-skins/ and
with some help from PilzAdam. Also implements some minimal features backported from SkinDB
like preview (disabled by default). The preview is autogenerated (2d), unless others mods.
#### Download
You can clone this repository in your minetest mods directory or in your game.
#### Depends
* default
* sfinv (optional, autodetected)
* player_api (newer version only)
* inventory_plus (optional, autodetected)
* unified_inventory (optional, autodetected)
#### Skin management
You can download a skin from skin database, set a new skin converted
from others boxel games or create it from scrat.
* **Download a mt-skin** It uses skins from Addi's **MT-Skin-DB**
skin database, currently at http://minetest.fensta.bplaced.net/
* **Download a mc-skind** Uses minecraft 1.7 skins, for 1.8+ will need newer 5.X mt,
and some images must crop it from 64x64 to 64x32.
To download a skin mt made or mc ones, just:
1. go to the web page skin, and download it, will get you a `png` file,
2. put into the textures directory and rename it accordingly e.g `character_2.png`
3. pop into the meta directory and make a new `character_2.txt` empty file
4. fill the txt file with as described in [Structure and formats](#structure-and-formats)
If you use the skindb download tool, that already generates all
the necessary files, with the requested names and formats. https://github.com/minetest-mods/skinsdb/tree/master/updater
#### Structure and formats
Each skin is made up of at least two files, a png file and a txt file,
the "png file" is placed in the `textures` directory and
the "txt file" in the `meta` directory.
the format of the txt file is:
```
name = "Skin Name",
author = "author that make the skin",
```
Change log:
-----------
- 1.01- Replace all unlicensed skins with CC0 one's (many thanks isaiah658)
- 1.0 - Added skin_limit setting to limit skins loaded, sanitized skin description
- 0.9 - Added Unified Inventory support (thanks Opvolger)
- 0.8 - Added player model preview when viewing formspec (Minetest 5.4 dev only)
- 0.7 - Add some error checks, improve /setskin and tweak & tidy code
- 0.6 - Updated to use Minetest 0.4.16 functions
- 0.5 - Added compatibility with default sfinv inventory, disabled /skin command for now
- 0.4 - Added /skin command to set player skin, no longer dependent on Inventory+, also /setskin command for server admin to set custom skins for player.
- 0.3 - Now works with Minetest 0.4.10+
- 0.2 - Added 3D_Armor mod compatibility
- 0.1 - Added addi's changes to highlight selected skin on list (thanks)
- 0.0 - Initial release

BIN
mods/skins/screenshot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -0,0 +1,5 @@
# When true character model will appear in formspec with current skin as texture
skins_preview (Simple Skins Preview) bool true
# Skin limit number to limit the number of skins read onto list
skins_limit (Skin Limit) int 300

39
mods/skins/sfinv.lua Normal file
View File

@ -0,0 +1,39 @@
local S = skins.translate
if skins.default_skin_tab then
sfinv.register_page("skins:skins", {title = S("Skins"),
get = function(self, player, context)
local name = player:get_player_name()
return sfinv.make_formspec(player, context,skins.formspec.main(name))
end,
on_player_receive_fields = function(self, player, context, fields)
local event = minetest.explode_textlist_event(fields["skins_set"])
if event.type == "CHG" then
skins.event_CHG(event, player)
sfinv.override_page("skins:skins", {
get = function(self, player, context)
local name = player:get_player_name()
return sfinv.make_formspec(player, context,
skins.formspec.main(name))
end
})
sfinv.set_player_inventory_formspec(player)
end
end
})
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Some files were not shown because too many files have changed in this diff Show More