Initial upload of Minetest Game: Mushroom Fork

master
Alexand(er|ra) Yst 2020-12-17 01:09:07 -08:00
parent 4acdd0fc40
commit 6329e5da09
1183 changed files with 36543 additions and 177 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/mods/worldmods

27
.luacheckrc Normal file
View File

@ -0,0 +1,27 @@
unused_args = false
allow_defined_top = true
read_globals = {
"DIR_DELIM",
"minetest",
"dump",
"vector",
"VoxelManip", "VoxelArea",
"PseudoRandom", "PcgRandom",
"ItemStack",
"Settings",
"unpack",
-- Silence errors about custom table methods.
table = { fields = { "copy", "indexof" } },
-- Silence warnings about accessing undefined fields of global 'math'
math = { fields = { "sign" } }
}
-- Overwrites minetest.handle_node_drops
files["mods/creative/init.lua"].globals = { "minetest" }
-- Overwrites minetest.calculate_knockback
files["mods/player_api/api.lua"].globals = { "minetest" }
-- Don't report on legacy definitions of globals.
files["mods/default/legacy.lua"].global = false

11
.travis.yml Normal file
View File

@ -0,0 +1,11 @@
language: generic
addons:
apt:
packages:
- luarocks
before_install:
- luarocks install --local luacheck
script:
- $HOME/.luarocks/bin/luacheck ./mods
notifications:
email: false

174
LICENSE
View File

@ -1,174 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
one line to give the library's name and an idea of what it does.
Copyright (C) year name of author
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
signature of Ty Coon, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

519
LICENSE.txt Normal file
View File

@ -0,0 +1,519 @@
License of media (textures and sounds)
--------------------------------------
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
See README.txt in each mod directory for information about other authors.
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
License of menu/header.png
Copyright (C) 2015 paramat CC BY-SA 3.0
License of source code
----------------------
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
See README.txt in each mod directory for information about other authors.
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -1,3 +0,0 @@
# Minetest_Game_Mushroom_Fork
A fork of Minetest Game

35
README.txt Normal file
View File

@ -0,0 +1,35 @@
# Minetest Game
The default game bundled in the Minetest engine.
For further information, check
[this forum topic](https://forum.minetest.net/viewtopic.php?f=15&t=9724).
Also see the [Minetest Wiki](https://wiki.minetest.net/Subgames/Minetest_Game)
for more information.
## Installation
- Unzip the archive, rename the folder to minetest_game and
place it in .. minetest/games/
- GNU/Linux: If you use a system-wide installation place
it in ~/.minetest/games/.
The Minetest engine can be found at [GitHub](https://github.com/minetest/minetest).
For further information or help, see:
https://wiki.minetest.net/Installing_Mods
## Compatibility
The Minetest Game GitHub master HEAD is generally compatible with the GitHub
master HEAD of the Minetest engine.
Additionally, when the Minetest engine is tagged to be a certain version (e.g.
0.4.10), Minetest Game is tagged with the version too.
When stable releases are made, Minetest Game and the Minetest engine is packaged
and made available at [www.minetest.net](https://www.minetest.net/downloads/).
## Licensing
See `LICENSE.txt`

3
game.conf Normal file
View File

@ -0,0 +1,3 @@
name = Minetest Game: Mushroom Fork
author = Mostly the Minetest developers, with small alterations by Alex Yst
description = A fork of Minetest game that focuses on recording drop stats, restoring removed drops, and providing renewable versions of every major tool.

1076
game_api.txt Normal file

File diff suppressed because it is too large Load Diff

BIN
menu/header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
menu/header.xcf Normal file

Binary file not shown.

BIN
menu/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
menu/overlay.0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

BIN
menu/overlay.1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

BIN
menu/overlay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 907 KiB

0
minetest.conf Normal file
View File

77
minetest.conf.example Normal file
View File

@ -0,0 +1,77 @@
# This file contains settings of Minetest Game that can be changed in
# minetest.conf.
# By default, all the settings are commented and not functional.
# Uncomment settings by removing the preceding #.
# Whether creative mode (fast digging of all blocks, unlimited resources) should
# be enabled.
#creative_mode = false
# Sets the behaviour of the inventory items when a player dies.
# bones: Store items in a bone node but drop items if inside protected area.
# drop: Drop items on the ground.
# keep: Player keeps items.
#bones_mode = bones
# The time in seconds after which the bones of a dead player can be looted by
# everyone.
# 0 to disable.
#share_bones_time = 1200
# How much earlier the bones of a dead player can be looted by
# everyone if the player dies in a protected area they don't own.
# 0 to disable. By default it is "share_bones_time" divide by four.
#share_bones_time_early = 300
# Inform player of condition and location of new bones.
#bones_position_message = false
# Whether fire should be enabled. If disabled, 'basic_flame' nodes will
# disappear.
# 'permanent_flame' nodes will remain with either setting.
#enable_fire = true
# Enable flame sound.
#flame_sound = true
# Whether lavacooling should be enabled.
#enable_lavacooling = true
# Whether the stuff in initial_stuff should be given to new players.
#give_initial_stuff = false
#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,
default:torch 99,default:cobble 99
# Whether the TNT mod should be enabled.
#enable_tnt = <true in singleplayer, false in multiplayer>
# The radius of a TNT explosion.
#tnt_radius = 3
# Enable the stairs mod ABM that replaces the old 'upside down'
# stair and slab nodes in old maps with the new param2 versions.
#enable_stairs_replace_abm = false
# Whether to allow respawning in beds.
# Default value is true.
#enable_bed_respawn = true
# Whether players can skip night by sleeping.
# Default value is true.
#enable_bed_night_skip = true
# If enabled, fences and walls cannot be jumped over.
#enable_fence_tall = false
# Whether the engine's spawn search, which does not check for a suitable
# starting biome, is used.
# Default value is false.
#engine_spawn = false
# Whether river water source nodes create flowing sounds.
# Helps rivers create more sound, especially on level sections.
#river_source_sounds = false
# Enable cloud variation by the 'weather' mod.
# Non-functional in V6 or Singlenode mapgens.
#enable_weather = true

View File

@ -0,0 +1,12 @@
Minetest Game mod: bones
========================
See license.txt for license information.
Authors of source code
----------------------
Originally by PilzAdam (MIT)
Various Minetest developers and contributors (MIT)
Authors of media (textures)
---------------------------
All textures: paramat (CC BY-SA 3.0)

View File

@ -0,0 +1,292 @@
-- bones/init.lua
-- Minetest 0.4 mod: bones
-- See README.txt for licensing and other information.
-- Load support for MT game translation.
local S = minetest.get_translator("bones")
bones = {}
local function is_owner(pos, name)
local owner = minetest.get_meta(pos):get_string("owner")
if owner == "" or owner == name or minetest.check_player_privs(name, "protection_bypass") then
return true
end
return false
end
local bones_formspec =
"size[8,9]" ..
"list[current_name;main;0,0.3;8,4;]" ..
"list[current_player;main;0,4.85;8,1;]" ..
"list[current_player;main;0,6.08;8,3;8]" ..
"listring[current_name;main]" ..
"listring[current_player;main]" ..
default.get_hotbar_bg(0,4.85)
local share_bones_time = tonumber(minetest.settings:get("share_bones_time")) or 1200
local share_bones_time_early = tonumber(minetest.settings:get("share_bones_time_early")) or share_bones_time / 4
minetest.register_node("bones:bones", {
description = S("Bones"),
tiles = {
"bones_top.png^[transform2",
"bones_bottom.png",
"bones_side.png",
"bones_side.png",
"bones_rear.png",
"bones_front.png"
},
paramtype2 = "facedir",
groups = {dig_immediate = 2},
sounds = default.node_sound_gravel_defaults(),
can_dig = function(pos, player)
local inv = minetest.get_meta(pos):get_inventory()
local name = ""
if player then
name = player:get_player_name()
end
return is_owner(pos, name) and inv:is_empty("main")
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
if is_owner(pos, player:get_player_name()) then
return count
end
return 0
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
return 0
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
if is_owner(pos, player:get_player_name()) then
return stack:get_count()
end
return 0
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if meta:get_inventory():is_empty("main") then
local inv = player:get_inventory()
if inv:room_for_item("main", {name = "bones:bones"}) then
inv:add_item("main", {name = "bones:bones"})
else
minetest.add_item(pos, "bones:bones")
end
minetest.remove_node(pos)
end
end,
on_punch = function(pos, node, player)
if not is_owner(pos, player:get_player_name()) then
return
end
if minetest.get_meta(pos):get_string("infotext") == "" then
return
end
local inv = minetest.get_meta(pos):get_inventory()
local player_inv = player:get_inventory()
local has_space = true
for i = 1, inv:get_size("main") do
local stk = inv:get_stack("main", i)
if player_inv:room_for_item("main", stk) then
inv:set_stack("main", i, nil)
player_inv:add_item("main", stk)
else
has_space = false
break
end
end
-- remove bones if player emptied them
if has_space then
if player_inv:room_for_item("main", {name = "bones:bones"}) then
player_inv:add_item("main", {name = "bones:bones"})
else
minetest.add_item(pos,"bones:bones")
end
minetest.remove_node(pos)
end
end,
on_timer = function(pos, elapsed)
local meta = minetest.get_meta(pos)
local time = meta:get_int("time") + elapsed
if time >= share_bones_time then
meta:set_string("infotext", S("@1's old bones", meta:get_string("owner")))
meta:set_string("owner", "")
else
meta:set_int("time", time)
return true
end
end,
on_blast = function(pos)
end,
})
local function may_replace(pos, player)
local node_name = minetest.get_node(pos).name
local node_definition = minetest.registered_nodes[node_name]
-- if the node is unknown, we return false
if not node_definition then
return false
end
-- allow replacing air and liquids
--
-- No, don't hard-code to allow replacing of air and liquids. That's
-- just asinine. Further below is a check to see if the node is
-- buildable_to. Air and any liquids that are meant to be replaced have
-- their buildable_to flag set. Hard-coding for air is redundant and
-- hard-coding for all liquids causes the liquids' buildable_to flag
-- not to be respected.
--
-- if node_name == "air" or node_definition.liquidtype ~= "none" then
-- return true
-- end
-- don't replace filled chests and other nodes that don't allow it
local can_dig_func = node_definition.can_dig
if can_dig_func and not can_dig_func(pos, player) then
return false
end
-- default to each nodes buildable_to; if a placed block would replace it, why shouldn't bones?
-- flowers being squished by bones are more realistical than a squished stone, too
-- exception are of course any protected buildable_to
return node_definition.buildable_to and not minetest.is_protected(pos, player:get_player_name())
end
local drop = function(pos, itemstack)
local obj = minetest.add_item(pos, itemstack:take_item(itemstack:get_count()))
if obj then
obj:set_velocity({
x = math.random(-10, 10) / 9,
y = 5,
z = math.random(-10, 10) / 9,
})
end
end
local player_inventory_lists = { "main", "craft" }
bones.player_inventory_lists = player_inventory_lists
local function is_all_empty(player_inv)
for _, list_name in ipairs(player_inventory_lists) do
if not player_inv:is_empty(list_name) then
return false
end
end
return true
end
minetest.register_on_dieplayer(function(player)
local bones_mode = minetest.settings:get("bones_mode") or "bones"
if bones_mode ~= "bones" and bones_mode ~= "drop" and bones_mode ~= "keep" then
bones_mode = "bones"
end
local bones_position_message = minetest.settings:get_bool("bones_position_message") == true
local player_name = player:get_player_name()
local pos = vector.round(player:get_pos())
local pos_string = minetest.pos_to_string(pos)
-- return if keep inventory set or in creative mode
if bones_mode == "keep" or (creative and creative.is_enabled_for
and creative.is_enabled_for(player:get_player_name())) then
minetest.log("action", player_name .. " dies at " .. pos_string ..
". No bones placed")
if bones_position_message then
minetest.chat_send_player(player_name, S("@1 died at @2.", player_name, pos_string))
end
return
end
local player_inv = player:get_inventory()
if is_all_empty(player_inv) then
minetest.log("action", player_name .. " dies at " .. pos_string ..
". No bones placed")
if bones_position_message then
minetest.chat_send_player(player_name, S("@1 died at @2.", player_name, pos_string))
end
return
end
-- check if it's possible to place bones, if not find space near player
if bones_mode == "bones" and not may_replace(pos, player) then
local air = minetest.find_node_near(pos, 5, {"air"})
if air and not minetest.is_protected(air, player_name) then
pos = air
else
return
end
end
if bones_mode == "drop" then
for _, list_name in ipairs(player_inventory_lists) do
for i = 1, player_inv:get_size(list_name) do
drop(pos, player_inv:get_stack(list_name, i))
end
player_inv:set_list(list_name, {})
end
drop(pos, ItemStack("bones:bones"))
minetest.log("action", player_name .. " dies at " .. pos_string ..
". Inventory dropped")
if bones_position_message then
minetest.chat_send_player(player_name, S("@1 died at @2, and dropped their inventory.", player_name, pos_string))
end
return
end
local param2 = minetest.dir_to_facedir(player:get_look_dir())
minetest.set_node(pos, {name = "bones:bones", param2 = param2})
minetest.log("action", player_name .. " dies at " .. pos_string ..
". Bones placed")
if bones_position_message then
minetest.chat_send_player(player_name, S("@1 died at @2, and bones were placed.", player_name, pos_string))
end
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
inv:set_size("main", 8 * 4)
for _, list_name in ipairs(player_inventory_lists) do
for i = 1, player_inv:get_size(list_name) do
local stack = player_inv:get_stack(list_name, i)
if inv:room_for_item("main", stack) then
inv:add_item("main", stack)
else -- no space left
drop(pos, stack)
end
end
player_inv:set_list(list_name, {})
end
meta:set_string("formspec", bones_formspec)
meta:set_string("owner", player_name)
if share_bones_time ~= 0 then
meta:set_string("infotext", S("@1's fresh bones", player_name))
if share_bones_time_early == 0 or not minetest.is_protected(pos, player_name) then
meta:set_int("time", 0)
else
meta:set_int("time", (share_bones_time - share_bones_time_early))
end
minetest.get_node_timer(pos):start(10)
else
meta:set_string("infotext", S("@1's bones", player_name))
end
end)

View File

@ -0,0 +1,58 @@
License of source code
----------------------
The MIT License (MIT)
Copyright (C) 2012-2016 PilzAdam
Copyright (C) 2012-2016 Various Minetest developers and contributors
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.
For more details:
https://opensource.org/licenses/MIT
Licenses of media (textures)
----------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2016 paramat
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Knochen
@1's old bones=Alte Knochen von @1
@1 died at @2.=@1 starb bei @2.
@1 died at @2, and dropped their inventory.=@1 starb bei @2 und ließ das Inventar fallen.
@1 died at @2, and bones were placed.=@1 starb bei @2 und Knochen wurden platziert.
@1's fresh bones=Frische Knochen von @1
@1's bones=Knochen von @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Huesos
@1's old bones=Huesos antiguos de @1
@1 died at @2.=@1 murió en @2.
@1 died at @2, and dropped their inventory.=@1 murió en @2, y su inventario se desprendió.
@1 died at @2, and bones were placed.=@1 murió en @2, y sus huesos fueron depositados.
@1's fresh bones=Huesos recientes de @1
@1's bones=Huesos de @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Os
@1's old bones=Vieux os de @1
@1 died at @2.=@1 est mort à @2.
@1 died at @2, and dropped their inventory.=@1 est mort à @2 et a laissé tomber son inventaire.
@1 died at @2, and bones were placed.=@1 est mort à @2 et ses os ont été placés.
@1's fresh bones=Os frais de @1
@1's bones=Os de @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Tulang
@1's old bones=Tulang lama @1
@1 died at @2.=@1 mati di @2.
@1 died at @2, and dropped their inventory.=@1 mati di @2 dan meninggalkan barangnya.
@1 died at @2, and bones were placed.=@1 mati di @2 dan tulangnya diletakkan.
@1's fresh bones=Tulang segar @1
@1's bones=Tulang @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Ossa
@1's old bones=Ossa vecchie di @1
@1 died at @2.=@1 è morto alla posizione @2.
@1 died at @2, and dropped their inventory.=@1 è morto alla posizione @2, e ha lasciato a terra il contenuto del suo inventario.
@1 died at @2, and bones were placed.=@1 è morto alla posizione @2, e vi sono state posizionate delle ossa.
@1's fresh bones=Ossa fresche di @1
@1's bones=Ossa di @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Tulang
@1's old bones=Tulang lama @1
@1 died at @2.=@1 mati di @2.
@1 died at @2, and dropped their inventory.=@1 mati di @2, dan menjatuhkan inventorinya.
@1 died at @2, and bones were placed.=@1 mati di @2, dan tulang diletakkan.
@1's fresh bones=Tulang segar @1
@1's bones=Tulang @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Кости
@1's old bones=Старые кости @1
@1 died at @2.=@1 умер в @2.
@1 died at @2, and dropped their inventory.=@1 умер в @2 и потерял содержимое своего инвентаря.
@1 died at @2, and bones were placed.=@1 умер в @2, помещены кости.
@1's fresh bones=новые кости @1
@1's bones=кости @1

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=Ben
@1's old bones=@1s Gamla ben
@1 died at @2.=@1 dog på @a.
@1 died at @2, and dropped their inventory.=@1 dog på @a, och tappade deras saker.
@1 died at @2, and bones were placed.=@1 dog på @2, och deras ben var placerade.
@1's fresh bones=@1s färska ben
@1's bones=@1s ben

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=骨骸
@1's old bones=@1的旧骨骸
@1 died at @2.=@1在@2死亡。
@1 died at @2, and dropped their inventory.=@1在@2死亡丢掉了物品栏。
@1 died at @2, and bones were placed.=@1在@2死亡骨骸被放置。
@1's fresh bones=@1的新鲜骨骸
@1's bones=@1的骨骸

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=骨骸
@1's old bones=@1的舊骨骸
@1 died at @2.=@1在@2死亡。
@1 died at @2, and dropped their inventory.=@1在@2死亡丟掉了物品欄。
@1 died at @2, and bones were placed.=@1在@2死亡骨骸被放置。
@1's fresh bones=@1的新鮮骨骸
@1's bones=@1的骨骸

View File

@ -0,0 +1,8 @@
# textdomain: bones
Bones=
@1's old bones=
@1 died at @2.=
@1 died at @2, and dropped their inventory.=
@1 died at @2, and bones were placed.=
@1's fresh bones=
@1's bones=

View File

@ -0,0 +1,3 @@
name = bones
description = Minetest Game mod: bones
depends = default

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

View File

@ -0,0 +1,24 @@
-- brighten_cave_ice mod for Minetest
-- Copyright © 2020 Alex Yst <mailto:copyright@y.st>
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
-- This software is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
-- You should have received a copy of the GNU Lesser General Public
-- License along with this program. If not, see
-- <https://www.gnu.org./licenses/>.
-- If you're level-grinding, it can be helpful to have a visual
-- difference between glacier ice and ice sheet / placed ice.
minetest.override_item("default:cave_ice", {
tiles = {
minetest.registered_nodes["default:cave_ice"].tiles[1].."^[brighten",
},
})

View File

@ -0,0 +1,2 @@
name = brighten_cave_ice
depends = default

View File

@ -0,0 +1,40 @@
-- fix_beds mod for Minetest
-- Copyright © 2020 Alex Yst <mailto:copyright@y.st>
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
-- This software is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
-- You should have received a copy of the GNU Lesser General Public
-- License along with this program. If not, see
-- <https://www.gnu.org./licenses/>.
-- It's really annoying that you have to wait until nighttime to set
-- your spawn point. Even more annoying, moving your bed when
-- redecorating your bedroom removes your spawn point, which then
-- cannot be set again until nighttime. If you die in the meantime
-- while waiting or you decide not to wait and head out and end up
-- dying, you'll end up back at the global spawn point. This mod fixes
-- the annoying only-set-your-spawn-point-at-night idiocy. You still
-- lose your spawn point if you move your bed, meaning that you still
-- have to have a bed in the place you want to respawn, but you can set
-- a new spawn point as soon as you put your bed in its new location.
local beds_on_rightclick = beds.on_rightclick
function beds.on_rightclick(pos, player)
local tod = minetest.get_timeofday()
local player_name = player:get_player_name()
if tod > 0.2 and tod < 0.805 and not minetest.is_protected(pos, player_name) then
beds.spawn[player_name] = pos
beds.save_spawns()
minetest.chat_send_player(player_name, "Spawn point set to "..minetest.pos_to_string(beds.spawn[player_name])..".")
else
beds_on_rightclick(pos, player)
end
end

View File

@ -0,0 +1,2 @@
name = fix_beds
depends = beds

View File

@ -0,0 +1,150 @@
-- garbage_recycling mod for Minetest
-- Copyright © 2020 Alex Yst <mailto:copyright@y.st>
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
-- This software is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
-- You should have received a copy of the GNU Lesser General Public
-- License along with this program. If not, see
-- <https://www.gnu.org./licenses/>.
-- So ... a gravel node which is made up of a bunch of small rocks just
-- disappears once you locate a specific small rock from the bunch?
-- That seems to be how gravel-to-flint conversion works, but it
-- doesn't make any sense. The only reason I even care though, as
-- realism isn't really the goal of the game, is that you lose
-- perfectly good gravel that could otherwise be used for paths or
-- something. If you're not an arson but you use a lot of gravel,
-- you'll find a fair bit of it converted into useless flint whether
-- you want it to be or not. To give purpose to that flint, let's make
-- it placeable as a darker shade of gravel. With two shades of gravel,
-- you can texture your paths a bit, or at the very least, use the
-- darker gravel for other paths that require a darker feel to them.
--
-- Not to anyone reading this code: Yes, I'm aware there's a
-- minetest.override_item() function. No, I shouldn't be using it here.
-- The problem is that it doesn't allow items to switch types. For
-- example, a craft item such as flint cannot be redefined using
-- minetest.override_item() to be a placeable node.
--
-- I tried to set up a complex texture using an inventory cube with
-- flint icon overlaid on it in the corner, but Minetest seems to get
-- kind of funny when using the "[combine" modifier in combination with
-- the "[inventorycube" modifier, and starts throwing out the textures
-- when the "[multiply" modifier is used in addition to those two. It
-- also seems to have problems using the "[resize" modifier in that
-- situation too. In the end, I gave up, figuring the engine just can't
-- handle it. Through an iterative process going back and forth between
-- Minetest (for things including "[inventorycube" and "[multiply") and
-- the GIMP (for positioning and combining), I've set up a hard-coded
-- inventory texture to use for this node.
minetest.register_node(":default:flint", {
description = minetest.registered_items["default:flint"].description,
inventory_image = "garbage_recycling.flint.png",
tiles = {"default_gravel.png^[multiply:#888"},
groups = {crumbly = 2, falling_node = 1},
sounds = default.node_sound_gravel_defaults(),
})
-- This one's going to seem a bit odd out of context, so I'll explain a
-- bit. Given the mod collection this mod is intended to be a part of,
-- ocean sand is quickly used up and becomes quite hard to come by.
-- This makes kelp unplaceable, and as it can't be used in any crafting
-- recipes, it's completely unusable for anything if there's no sand to
-- place it on. Silver sand doesn't disappear so fast, so it can be
-- used as a replacement in ocean projects. The code below registers a
-- doppelgänger of the sand-with-kelp node, but using silver sand's
-- texture on the true node instead of sand's texture. If you attempt
-- to place kelp ("default:sand_with_kelp") on silver sand, it'll be
-- replaced with the silver-sand-with-kelp node, which when dug, will
-- put the silver sand back and drop the basic sand-with-kelp node.
-- There are other ways I would have preferred to do this, but I think
-- this method is most in-line with the feel of the game and is most
-- seamless to players. To players, it simply looks like kelp can now
-- be placed on ocean sand or silver sand instead of just ocean sand.
minetest.register_node("garbage_recycling:silver_sand_with_kelp", {
drawtype = "plantlike_rooted",
waving = 1,
tiles = {"default_silver_sand.png"},
special_tiles = {{name = "default_kelp.png", tileable_vertical = true}},
paramtype = "light",
paramtype2 = "leveled",
groups = {snappy = 3},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
{-2/16, 0.5, -2/16, 2/16, 3.5, 2/16},
},
},
node_dig_prediction = "default:silver_sand",
node_placement_prediction = "",
sounds = default.node_sound_sand_defaults({
dig = {name = "default_dig_snappy", gain = 0.2},
dug = {name = "default_grass_footstep", gain = 0.25},
}),
drop = {},
after_dig_node = function(pos, oldnode, oldmetadata, digger)
minetest.handle_node_drops(pos, {"default:sand_with_kelp"}, digger)
minetest.set_node(pos, {name = "default:silver_sand"})
end,
})
minetest.override_item("default:sand_with_kelp", {
on_place = function(itemstack, placer, pointed_thing)
-- Call on_rightclick if the pointed node defines it
if pointed_thing.type == "node" and placer and
not placer:get_player_control().sneak then
local node_ptu = minetest.get_node(pointed_thing.under)
local def_ptu = minetest.registered_nodes[node_ptu.name]
if def_ptu and def_ptu.on_rightclick then
return def_ptu.on_rightclick(pointed_thing.under, node_ptu, placer,
itemstack, pointed_thing)
end
end
local pos = pointed_thing.under
local node_placed_on = minetest.get_node(pos).name
local kelp_node
if node_placed_on == "default:sand" then
kelp_node = "default:sand_with_kelp"
elseif node_placed_on == "default:silver_sand" then
kelp_node = "garbage_recycling:silver_sand_with_kelp"
else
return itemstack
end
local height = math.random(4, 6)
local pos_top = {x = pos.x, y = pos.y + height, z = pos.z}
local node_top = minetest.get_node(pos_top)
local def_top = minetest.registered_nodes[node_top.name]
local player_name = placer:get_player_name()
if def_top and def_top.liquidtype == "source" and
minetest.get_item_group(node_top.name, "water") > 0 then
if not minetest.is_protected(pos, player_name) and
not minetest.is_protected(pos_top, player_name) then
minetest.set_node(pos, {name = kelp_node,
param2 = height * 16})
if not (creative and creative.is_enabled_for
and creative.is_enabled_for(player_name)) then
itemstack:take_item()
end
else
minetest.chat_send_player(player_name, "Node is protected")
minetest.record_protection_violation(pos, player_name)
end
end
return itemstack
end,
})

View File

@ -0,0 +1,2 @@
name = garbage_recycling
depends = default

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,41 @@
garbage_recycling.flint.png was derived from default_gravel.png and
default_flint.png from Minetest Game. Those textures and the derived
texture are released under the Attribution-ShareAlike 3.0 Unported
licence. The following attribution list seems to apply to all textures
in the default mod with no specific textures attributed to specific
contributors.
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2010-2018:
celeron55, Perttu Ahola <celeron55@gmail.com>
Cisoun
G4JC
VanessaE
RealBadAngel
Calinou
MirceaKitsune
Jordach
PilzAdam
jojoa1997
InfinityProject
Splizard
Zeg9
paramat
BlockMen
sofar
Neuromancer
Gambit
asl97
KevDoy
Mito551
GreenXenith
kaeza
kilbith
tobyplowy
CloudyProton
TumeniNodes
Mossmanikin
random-geek
Extex101
An0n3m0us

View File

@ -0,0 +1,73 @@
-- laddersmod mod for Minetest
-- Copyright © 2020 Alex Yst <mailto:copyright@y.st>
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
-- This software is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
-- You should have received a copy of the GNU Lesser General Public
-- License along with this program. If not, see
-- <https://www.gnu.org./licenses/>.
-- Minetest Game changed the flat signs that were thinner than paper
-- into actual 3D signs that can be seen from any angle. This same
-- treatment was never given to ladders though.
--
-- The node boxes used here are my interpretation of what the textures
-- would look like in 3D. Because ladder textures include empty space
-- on both sides, they don't really work on their own for side
-- textures. Because of that, I've combined the ladder textures with
-- the applewood and steel block textures to create something that
-- doesn't stand out too much.
for type, data in next, {
steel = {
nodebox = {
{-0.4375, -0.5, -0.5, -0.25, -0.3125, 0.5},
{0.25, -0.5, -0.5, 0.4375, -0.3125, 0.5},
{-0.25, -0.4375, -0.4375, 0.25, -0.375, -0.3125},
{-0.25, -0.4375, -0.1875, 0.25, -0.375, -0.0625},
{-0.25, -0.4375, 0.0625, 0.25, -0.375, 0.1875},
{-0.25, -0.4375, 0.3125, 0.25, -0.375, 0.4375},
},
texture = "default_steel_block.png^default_ladder_steel.png",
},
wood = {
nodebox = {
{-0.375, -0.5, -0.5, -0.25, -0.4375, 0.5},
{0.25, -0.5, -0.5, 0.375, -0.4375, 0.5},
{-0.375, -0.375, -0.5, -0.25, -0.3125, 0.5},
{0.25, -0.375, -0.5, 0.375, -0.3125, 0.5},
{-0.4375, -0.4375, -0.4375, 0.4375, -0.375, -0.3125},
{-0.4375, -0.4375, -0.1875, 0.4375, -0.375, -0.0625},
{-0.4375, -0.4375, 0.0625, 0.4375, -0.375, 0.1875},
{-0.4375, -0.4375, 0.3125, 0.4375, -0.375, 0.4375},
},
texture = "default_wood.png^default_ladder_wood.png"
},
} do
minetest.override_item("default:ladder_"..type, {
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = data.nodebox,
},
selection_box = {
type = "fixed",
fixed = data.nodebox,
},
tiles = {
data.texture,
data.texture,
data.texture.."^[transformR90",
data.texture.."^[transformR90",
data.texture,
data.texture,
},
})
end

View File

@ -0,0 +1,2 @@
name = laddersmod
depends = default

View File

@ -0,0 +1,179 @@
-- level_menu mod for Minetest
-- Copyright © 2020 Alex Yst <mailto:copyright@y.st>
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
-- This software is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
-- You should have received a copy of the GNU Lesser General Public
-- License along with this program. If not, see
-- <https://www.gnu.org./licenses/>.
-- This isn't a real tool. It gets a random name to discourage people
-- from trying to get one. Next time the server restarts, any instances
-- of the tool in-world become unknown items with little hope of
-- becoming actual items again, even temporarily.
local progress_tool = "level_menu:"..math.random(0, 65535)
minetest.register_tool(progress_tool, {})
-- We need to track what page a player is on so we don't jump back to
-- page zero when they check on a specific drop in multi-page mode.
local player_page = {}
-- It'd be a little annoying if players had to choose their sorting
-- order repeatedly, so we save that setting.
local storage = minetest.get_mod_storage()
-- This function returns a sorted list of drops the player has
-- encountered.
--
-- The intuitive way to do this would be to set list to the output of
-- liblevelup.meta.drop_list(), then set any values to nil that
-- represent drops the player hasn't encountered. However, that would
-- put holes in the list of keys. For example, there could be an index
-- three and an index five, but no index four. This would make the "#"
-- operator fail to return the correct value because of Lua's quirks.
-- To avoid that issue, we can just put the drops into a
-- newly-generated list as we go.
local function get_drop_list(player_name)
local list = {}
for _, drop_name in next, liblevelup.meta.drops_list() do
if liblevelup.get.drop_stat(player_name, drop_name) > 0 then
list[#list+1] = drop_name
end
end
local sort_order = storage:get(player_name..";sort")
if sort_order == "level" then
table.sort(list, function(a, b)
local a_level = liblevelup.get.player_material_level(player_name, a)
local b_level = liblevelup.get.player_material_level(player_name, b)
if a_level == b_level then
return liblevelup.get.next_level_at(player_name, a)
/ liblevelup.get.player_material_progress_bar_length(player_name, a)
> liblevelup.get.next_level_at(player_name, b)
/ liblevelup.get.player_material_progress_bar_length(player_name, b)
else
return a_level < b_level
end
end)
end
return list
end
local function generate_formspec(player, context, check_specific_drop)
local player_name = player:get_player_name()
local drop_list = get_drop_list(player_name)
-- If a player hasn't found any drops yet, no data will be available
-- to build the page with.
if #drop_list == 0 then
return sfinv.make_formspec(player, context, "label[1,1;No data available.]label[1,1.5;Try again after mining or farming.]", false)
end
local formspec = ""
local min_key = 1
local max_key = #drop_list
-- If there are more than 32 drops, switch from single-page mode, which
-- supports up to 32 items on a single page, to multi-page mode, which
-- supports 24 items on each page.
if #drop_list > 32 then
min_key = player_page[player_name] * 24 + 1
max_key = math.min(min_key + 23, #drop_list)
if player_page[player_name] > 0 then
formspec = formspec.."button[0,3;2.5,1;page;Page "..(player_page[player_name] - 1).."]"
end
if player_page[player_name] < math.ceil(#drop_list / 24) - 1 then
formspec = formspec.."button[5.5,3;2.5,1;page;Page "..(player_page[player_name] + 1).."]"
end
formspec = formspec.."label[3,3.25;Page "..player_page[player_name].."]"
end
for i = 0, max_key - min_key do
local row = math.floor(i/8)
local col = i%8
local drop_name = drop_list[i+min_key]
local progress = 65535 * liblevelup.get.next_level_at(player_name, drop_name) / liblevelup.get.player_material_progress_bar_length(player_name, drop_name)
formspec = formspec.."item_image["..col..","..row..".07;1,1;"..progress_tool.." 1 "..progress.."]item_image_button["..col..","..row..";1,1;"..drop_name.." "..liblevelup.get.player_material_level(player_name, drop_name)..";levels_menu:"..drop_name..";]"
end
-- If there is more than one drop, show buttons to set the player's
-- sorting mode. Sorting mode persists between player sessions and even
-- between server resets.
if #drop_list > 1 then
formspec = formspec.."button[1.25,4;2.5,1;sort;By name]button[4.25,4;2.5,1;sort;By level]"
end
-- A specific drop is always displayed for now until some sort of
-- all-drops summary page is designed. Until then, the first item in
-- the list, sorted by the player's preferred method, is defaulted to.
if not check_specific_drop then
check_specific_drop = drop_list[1]
end
local item = ItemStack(check_specific_drop)
local progress_numerator = liblevelup.get.next_level_at(player_name, check_specific_drop)
local progress_denominator = liblevelup.get.player_material_progress_bar_length(player_name, check_specific_drop)
local progress = 65535 * progress_numerator / progress_denominator
formspec = formspec.."item_image[0.7,5.15;3,3;"..check_specific_drop.."]"
formspec = formspec.."label[1,8.1;Level "..liblevelup.get.player_material_level(player_name, check_specific_drop).."]"
formspec = formspec.."label[4,5.5;"..item:get_description().."]"
formspec = formspec.."label[4,6;Next level progress:]"
formspec = formspec.."label[4.6,6.5;"..(progress_denominator - progress_numerator).." / "..progress_denominator.."]"
formspec = formspec.."item_image[4,0.4;4.5,8;"..progress_tool.." 1 "..progress.."]"
formspec = formspec.."label[4.25,6.9;(Next level in "..progress_numerator..")]"
formspec = formspec.."label[4,7.8;Total harvested:]"
formspec = formspec.."label[4.6,8.3;"..liblevelup.get.drop_stat(player_name, check_specific_drop).."]"
return sfinv.make_formspec(player, context, formspec, false)
end
sfinv.register_page("level_menu:level", {
title = "level_menu:level",
get = function(self, player, context)
player_page[player:get_player_name()] = 0
return generate_formspec(player, context)
end,
on_player_receive_fields = function(self, player, context, fields)
if fields.page then
player_page[player:get_player_name()] = tonumber(fields.page:sub(6))
player:set_inventory_formspec(generate_formspec(
player,
context
))
return true
end
if fields.sort then
storage:set_string(player:get_player_name()..";sort", fields.sort:sub(4))
player_page[player:get_player_name()] = 0
player:set_inventory_formspec(generate_formspec(
player,
context
))
return true
end
for field, _ in next, fields do
if field:sub(1, 12) == "levels_menu:" then
player:set_inventory_formspec(generate_formspec(
player,
context,
field:sub(13)
))
return true
end
end
end,
})
local sfinv_get_nav_fs = sfinv.get_nav_fs
function sfinv.get_nav_fs(player, context, nav, current_idx)
local modified_nav = table.copy(nav)
for index, title in next, modified_nav do
if title == "level_menu:level" then
modified_nav[index] = "Level "..liblevelup.get.player_level(player:get_player_name())
end
end
return sfinv_get_nav_fs(player, context, modified_nav, current_idx)
end
liblevelup.register.levelup_function(function(player, level)
sfinv.set_page(player, sfinv.get_page(player))
end)

View File

@ -0,0 +1,3 @@
name = level_menu
description = This mod adds a page to the menu allowing you to see how much you need to mine or farm in order to level up.
depends = liblevelup, sfinv

@ -0,0 +1 @@
Subproject commit af658326ab5693fd8da60d9e6be47250017649bb

View File

@ -0,0 +1,2 @@
The textures in this mod are copyright 2020 Alex Yst and are released
under the Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -0,0 +1,491 @@
-- mushroom_tools mod for Minetest
-- Copyright © 2020 Alex Yst <mailto:copyright@y.st>
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
-- This software is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
-- You should have received a copy of the GNU Lesser General Public
-- License along with this program. If not, see
-- <https://www.gnu.org./licenses/>.
-- This script includes code copied from the fire mod bundled as a part
-- of Minetest game. That mod was provided by the following people:
-- Originally by RealBadAngel, Maciej Kasatkin (LGPLv2.1+)
-- Various Minetest developers and contributors (LGPLv2.1+)
local colour = {
brown = minetest.get_color_escape_sequence("#6d544e"),
red = minetest.get_color_escape_sequence("#c36666"),
}
local function repair_tool(itemstack, player, old_craft_grid, craft_inv)
local tooldef = itemstack:get_definition()
if itemstack:get_name():sub(1, 15) == "mushroom_tools:" and tooldef.type == "tool" then
-- We gather a list of tools in the recipe that match the type of the
-- output. If there are two such tools, and no other items are
-- included, this is probably a tool repair recipe, so we should modify
-- the repair count. Repair count is pretty meaningless in-game, but
-- gives an idea of how much the tool has been kept and cared for. It's
-- just a sort of bonus feature for players.
local input_tools = {}
local input_count = 0
for _, item in next, old_craft_grid do
if not item:is_empty() then
input_count = input_count + 1
if item:get_name() == itemstack:get_name() then
input_tools[#input_tools+1] = item
end
end
end
if #input_tools == 2 and input_count == 2 then
local meta = itemstack:get_meta()
if itemstack:get_wear() == 0 then
meta:set_string("description", colour.red..tooldef.description..colour.brown.."\n(mangled)")
itemstack:set_name("mushroom_tools:mangled")
else
local repair_count = 1
for _, tool in next, input_tools do
local old_meta = tool:get_meta()
repair_count = repair_count + old_meta:get_int("repair")
end
meta:set_int("repair", repair_count)
meta:set_string("description", colour.red..tooldef.description..colour.brown.."\n(repair count: "..repair_count..")")
end
return itemstack
end
end
end
minetest.register_craft_predict(repair_tool)
minetest.register_on_craft(repair_tool)
-- Mushroom swords guarantee sapling drops and mushroom shovels
-- guarantee flint drops.
--
-- TO DO: This functionality is going to be removed from mushroom
-- swords and shovels and added as a potential buff for rune swords and
-- shovels.
for node, toolset in next, {
["default:acacia_bush_leaves" ] = {"mushroom_tools:sword"},
["default:acacia_leaves" ] = {"mushroom_tools:sword"},
["default:aspen_leaves" ] = {"mushroom_tools:sword"},
["default:blueberry_bush_leaves"] = {"mushroom_tools:sword"},
["default:bush_leaves" ] = {"mushroom_tools:sword"},
["default:gravel" ] = {"mushroom_tools:shovel"},
["default:junglegrass" ] = {"mushroom_tools:sword"},
["default:jungleleaves" ] = {"mushroom_tools:sword"},
["default:leaves" ] = {"mushroom_tools:sword"},
["default:pine_bush_needles" ] = {"mushroom_tools:sword"},
["default:pine_needles" ] = {"mushroom_tools:sword"},
} do
local old_drop = minetest.registered_nodes[node].drop.items
local new_drop_table = {
max_items = 1,
items = {
{
items = old_drop[1].items,
tools = toolset,
},
},
}
for index, drop in next, old_drop do
new_drop_table.items[index+1] = drop
end
minetest.override_item(node, {
drop = new_drop_table,
})
end
minetest.register_craftitem("mushroom_tools:lump_brown", {
description = "Brown Mushroom Lump",
inventory_image = "mushroom_tools.lump_brown.png",
})
minetest.register_craftitem("mushroom_tools:lump_red", {
description = "Red Mushroom Lump",
inventory_image = "mushroom_tools.lump_red.png",
})
minetest.register_craftitem("mushroom_tools:ingot_brown", {
description = "Brown Mushroom Ingot",
inventory_image = "mushroom_tools.ingot_brown.png",
})
minetest.register_craftitem("mushroom_tools:ingot_red", {
description = "Red Mushroom Ingot",
inventory_image = "mushroom_tools.ingot_red.png",
})
minetest.register_craftitem("mushroom_tools:mangled", {
description = "Mangled Mushroom Tool",
inventory_image = "mushroom_tools.mangled.png",
})
minetest.register_craft({
type = "cooking",
output = "mushroom_tools:ingot_brown",
recipe = "mushroom_tools:lump_brown",
cooktime = 99,
})
minetest.register_craft({
type = "cooking",
output = "mushroom_tools:ingot_red",
recipe = "mushroom_tools:lump_red",
cooktime = 99,
})
minetest.register_tool("mushroom_tools:pick", {
description = "Mushroom Pickaxe",
inventory_image = "mushroom_tools.pick.png",
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=3,
groupcaps={
cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=2427, maxlevel=3},
},
damage_groups = {fleshy=5},
},
sound = {breaks = "default_tool_breaks"},
groups = {pickaxe = 1},
})
-- TO DO: This functionality is going to be removed from mushroom
-- shovels and added as a potential buff to rune shovels.
local spread_function
for _, ABM in next, minetest.registered_abms do
if ABM.mod_origin == "default" and ABM.label == "Grass spread" then
spread_function = ABM.action
end
end
minetest.register_tool("mushroom_tools:shovel", {
description = "Mushroom Shovel",
inventory_image = "mushroom_tools.shovel.png",
wield_image = "mushroom_tools.shovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=2427, maxlevel=3},
},
damage_groups = {fleshy=4},
},
sound = {breaks = "default_tool_breaks"},
groups = {shovel = 1},
on_place = function(itemstack, user, pointed_thing)
local target = minetest.get_node(pointed_thing.under)
if target.name == "default:dirt" then
spread_function(pointed_thing.under, target)
elseif minetest.registered_nodes[target.name]
and minetest.registered_nodes[target.name].on_rightclick then
return minetest.registered_nodes[target.name].on_rightclick(pointed_thing.under, target, user, itemstack, pointed_thing)
end
end,
})
minetest.register_tool("mushroom_tools:axe", {
description = "Mushroom Axe",
inventory_image = "mushroom_tools.axe.png",
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=2427, maxlevel=3},
},
damage_groups = {fleshy=7},
},
sound = {breaks = "default_tool_breaks"},
groups = {axe = 1},
})
-- TO DO: This functionality is going to be removed from mushroom
-- swords and added as a potential buff to rune swords.
local prunable_trunk = {
["default:tree"] = {
leaves = {"default:apple", "default:apple_mark", "default:leaves"},
range = 3,
},
["default:jungletree"] = {
leaves = {"default:jungleleaves"},
range = 2,
},
["default:pine_tree"] = {
leaves = {"default:pine_needles"},
range = 3,
},
["default:acacia_tree"] = {
leaves = {"default:acacia_leaves"},
range = 2,
},
["default:aspen_tree"] = {
leaves = {"default:aspen_leaves"},
range = 3,
},
["default:bush_stem"] = {
leaves = {"default:bush_leaves"},
range = 1,
},
["default:acacia_bush_stem"] = {
leaves = {"default:acacia_bush_leaves"},
range = 1,
},
["default:pine_bush_stem"] = {
leaves = {"default:pine_bush_needles"},
range = 1,
},
}
minetest.register_tool("mushroom_tools:sword", {
description = "Mushroom Sword",
inventory_image = "mushroom_tools.sword.png",
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=1,
groupcaps={
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=2427, maxlevel=3},
},
damage_groups = {fleshy=8},
},
sound = {breaks = "default_tool_breaks"},
groups = {sword = 1},
on_place = function(itemstack, user, pointed_thing)
local potential_log = minetest.get_node(pointed_thing.under)
if prunable_trunk[potential_log.name] then
local to_prune = minetest.find_nodes_in_area({
x = pointed_thing.under.x - prunable_trunk[potential_log.name].range,
y = pointed_thing.under.y - prunable_trunk[potential_log.name].range,
z = pointed_thing.under.z - prunable_trunk[potential_log.name].range,
}, {
x = pointed_thing.under.x + prunable_trunk[potential_log.name].range,
y = pointed_thing.under.y + prunable_trunk[potential_log.name].range,
z = pointed_thing.under.z + prunable_trunk[potential_log.name].range,
}, prunable_trunk[potential_log.name].leaves)
for _, pos in next, to_prune do
local node = minetest.get_node(pos)
minetest.node_dig(pos, node, user)
-- Apple marks are dealt with separately because minetest.node_dig()
-- doesn't work on them. It's probably because players can't normally
-- dig them. We also assume that apples have left behind apple marks
-- and remove those as well.
if node.name == "default:apple_mark"
or node.name == "default:apple" then
minetest.remove_node(pos)
end
end
-- This seems a bit unclean, but I'm not sure how else to handle the
-- situation. If no value is returned, Minetest restores the tool's
-- durability that was used to prune the leaves because it sets the
-- item stack to what it was before the player used this functionality.
-- On the other hand, if we return the itemstack the engine passed to
-- our callback, we've just restored the durability ourselves because
-- that copy came from before the tool was used to prune the leaves.
-- Likewise, we shouldn't manually add the wear ourselves because we
-- don't know if each leaf was harvested successfully or not (for
-- example, an area might be protected). The only thing to do seems to
-- be to get the item now wielded and return it, basically overwriting
-- the worn item with whatever the player now holds, which should
-- hopefully always be itself (or an empty stack if it broke).
return user:get_wielded_item()
elseif minetest.registered_nodes[potential_log.name]
and minetest.registered_nodes[potential_log.name].on_rightclick then
return minetest.registered_nodes[potential_log.name].on_rightclick(pointed_thing.under, potential_log, user, itemstack, pointed_thing)
end
end,
})
minetest.register_tool("mushroom_tools:screwdriver", {
description = "Mushroom Screwdriver\n(left-click rotates face, right-click rotates axis)",
inventory_image = "mushroom_tools.screwdriver.png",
groups = {tool = 1},
on_use = function(itemstack, user, pointed_thing)
screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE, 65536)
return itemstack
end,
on_place = function(itemstack, user, pointed_thing)
screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_AXIS, 65536)
return itemstack
end,
})
local function new_tool_itemstring(tool_name)
local tool = ItemStack(tool_name)
local meta = tool:get_meta()
local tooldef = tool:get_definition()
meta:set_int("repair", 0)
meta:set_string("description", colour.red..tooldef.description..colour.brown.."\n(repair count: 0)")
return tool:to_string()
end
minetest.register_craft({
output = new_tool_itemstring("mushroom_tools:pick"),
recipe = {
{"mushroom_tools:ingot_red", "mushroom_tools:ingot_red", "mushroom_tools:ingot_red"},
{"", "mushroom_tools:ingot_brown", ""},
{"", "mushroom_tools:ingot_brown", ""},
}
})
minetest.register_craft({
output = new_tool_itemstring("mushroom_tools:shovel"),
recipe = {
{"mushroom_tools:ingot_red"},
{"mushroom_tools:ingot_brown"},
{"mushroom_tools:ingot_brown"},
}
})
minetest.register_craft({
output = new_tool_itemstring("mushroom_tools:axe"),
recipe = {
{"mushroom_tools:ingot_red", "mushroom_tools:ingot_red"},
{"mushroom_tools:ingot_red", "mushroom_tools:ingot_brown"},
{"", "mushroom_tools:ingot_brown"},
}
})
minetest.register_craft({
output = new_tool_itemstring("mushroom_tools:sword"),
recipe = {
{"mushroom_tools:ingot_red"},
{"mushroom_tools:ingot_red"},
{"mushroom_tools:ingot_brown"},
}
})
minetest.register_craft({
output = new_tool_itemstring("mushroom_tools:screwdriver"),
recipe = {
{"mushroom_tools:ingot_red"},
{"mushroom_tools:ingot_brown"}
}
})
-----------------------------------------------------------------------
-- SHAMELESSLY COPIED VERBATIM FROM THE FIRE MOD, WITH ONLY THE WEAR
-- AMOUNT ALTERED. CREDIT GOES TO:
-- Originally by RealBadAngel, Maciej Kasatkin (LGPLv2.1+)
-- Various Minetest developers and contributors (LGPLv2.1+)
-----------------------------------------------------------------------
minetest.register_tool("mushroom_tools:fire_starter", {
description = "Mushroom Fire Starter",
inventory_image = "mushroom_tools.fire_starter.png",
sound = {breaks = "default_tool_breaks"},
on_use = function(itemstack, user, pointed_thing)
local sound_pos = pointed_thing.above or user:get_pos()
minetest.sound_play(
"fire_flint_and_steel",
{pos = sound_pos, gain = 0.5, max_hear_distance = 8}
)
local player_name = user:get_player_name()
if pointed_thing.type == "node" then
local node_under = minetest.get_node(pointed_thing.under).name
local nodedef = minetest.registered_nodes[node_under]
if not nodedef then
return
end
if minetest.is_protected(pointed_thing.under, player_name) then
minetest.chat_send_player(player_name, "This area is protected")
return
end
if nodedef.on_ignite then
nodedef.on_ignite(pointed_thing.under, user)
elseif minetest.get_item_group(node_under, "flammable") >= 1
and minetest.get_node(pointed_thing.above).name == "air" then
minetest.set_node(pointed_thing.above, {name = "fire:basic_flame"})
end
end
if not (creative and creative.is_enabled_for
and creative.is_enabled_for(player_name)) then
-- Wear tool
local wdef = itemstack:get_definition()
itemstack:add_wear(1)
-- Tool break sound
if itemstack:get_count() == 0 and wdef.sound and wdef.sound.breaks then
minetest.sound_play(wdef.sound.breaks, {pos = sound_pos, gain = 0.5})
end
return itemstack
end
end,
})
minetest.register_craft({
output = new_tool_itemstring("mushroom_tools:fire_starter"),
recipe = {
{"mushroom_tools:ingot_brown", "mushroom_tools:ingot_red"}
}
})
minetest.register_craft({
output = new_tool_itemstring("mushroom_tools:lump_brown"),
recipe = {
{"piled:mushroom_brown", "piled:mushroom_brown", "piled:mushroom_brown"},
{"piled:mushroom_brown", "piled:mushroom_brown", "piled:mushroom_brown"},
{"piled:mushroom_brown", "piled:mushroom_brown", "piled:mushroom_brown"},
}
})
minetest.register_craft({
output = new_tool_itemstring("mushroom_tools:lump_red"),
recipe = {
{"piled:mushroom_red", "piled:mushroom_red", "piled:mushroom_red"},
{"piled:mushroom_red", "piled:mushroom_red", "piled:mushroom_red"},
{"piled:mushroom_red", "piled:mushroom_red", "piled:mushroom_red"},
}
})
--[[
MOVE THIS SECTION TO THE OTHER MOD!!
Update: The "other mod" was mushroom_tools_extended, which was
discontinued before release. Instead, something similar might get added
as a buff to the rune screwdriver or other rune tool.
-- Given a node name, we need to be able to look up what time-based
-- functions apply to it. Time-based functions are registered as either
-- on_timer() callbacks or ABMs. on_timer() callbacks can obviously be
-- looked up by node name easily, but to look up an ABM, we'd need to
-- search the entire table of ABMs every time and check each one
-- individually to see if it applies. That is, unless we index the ABMs
-- in terms of what nodes they apply to before we need to do any
-- lookups. Let's do that now.
local ABM_index = {}
minetest.register_on_mods_loaded(function()
for _, ABM in next, minetest.registered_abms do
local applies_to = {}
for _, affected_node in next, ABM.nodenames do
if affected_node:sub(1, 6) == "group:" then
local groups = affected_node:sub(7):split(",")
for node_name, _ in next, minetest.registered_nodes do
local is_in_groups = true
for _, group in next, groups do
if minetest.get_item_group(node_name, group) == 0 then
is_in_groups = false
end
end
if is_in_groups then
applies_to[node_name] = true
end
end
else
applies_to[affected_node] = true
end
end
for affected_node, _ in next, applies_to do
ABM_index[affected_node] = ABM_index[affected_node] or {}
ABM_index[affected_node][#ABM_index[affected_node] + 1] = ABM
end
end
end)
]]

View File

@ -0,0 +1,2 @@
name = mushroom_tools
depends = default, farming, piled, screwdriver

View File

@ -0,0 +1,2 @@
The textures in this mod are copyright 2020 Alex Yst and are released
under the Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -0,0 +1,39 @@
-- not_buildable_to mod for Minetest
-- Copyright © 2020 Alex Yst <mailto:copyright@y.st>
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
-- This software is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
-- You should have received a copy of the GNU Lesser General Public
-- License along with this program. If not, see
-- <https://www.gnu.org./licenses/>.
-- It's annoying how so many nodes can be destroyed by accidentally
-- building on them, yet they can't be gotten back in any way. For
-- example, you can permanently destroy marram grass this way, but
-- marram grass is finite in quantity and cannot be gotten back. This
-- mod removes that feature. If you want to build somewhere with such a
-- node, you'll need to move that node first just like you would if
-- there were a tree node or stone node in the way.
minetest.register_on_mods_loaded(function()
for node, def in next, minetest.registered_nodes do
if not (
def.liquidtype == "source" and (
def.liquid_renewable ~= false or (
bucket and bucket.liquids[node] and bucket.liquids[node].force_renew
)
)
) and def.liquidtype ~= "flowing" and node ~= "air" then
minetest.override_item(node, {
buildable_to = false,
})
end
end
end)

View File

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

View File

@ -0,0 +1,173 @@
-- piled mod for Minetest
-- Copyright © 2020 Alex Yst <mailto:copyright@y.st>
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
-- This software is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
-- You should have received a copy of the GNU Lesser General Public
-- License along with this program. If not, see
-- <https://www.gnu.org./licenses/>.
-- The idea behind this mod is that if you pile enough stuff together,
-- it'll take up space, but that doesn't mean it has any structural
-- stability or can be used to cover a ceiling. You can decorate an
-- aesthetic farm though with a large vat or hopper full of the item
-- that farm produces.
local S = minetest.get_translator("piled")
for nodename, details in next, {
["sapling"] = {
modname = "default",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Apple Saplings",
group = "snappy",
},
["apple"] = {
modname = "default",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Apples",
group = "choppy",
},
["junglesapling"] = {
modname = "default",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Jungle Saplings",
group = "snappy",
},
["seed_cotton"] = {
modname = "farming",
sounds = default.node_sound_gravel_defaults(),
description = "Piled Cotton Seeds",
group = "crumbly",
},
["seed_wheat"] = {
modname = "farming",
sounds = default.node_sound_gravel_defaults(),
description = "Piled Wheat Seeds",
group = "crumbly",
},
["string"] = {
modname = "farming",
sounds = default.node_sound_defaults(),
description = "Piled String",
group = "snappy",
},
["pine_sapling"] = {
modname = "default",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Pine Tree Saplings",
group = "snappy",
},
["acacia_sapling"] = {
modname = "default",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Acacia Tree Saplings",
group = "snappy",
},
["mushroom_brown"] = {
modname = "flowers",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Brown Mushrooms",
group = "snappy",
},
["mushroom_red"] = {
modname = "flowers",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Red Mushrooms",
group = "snappy",
},
["mushroom_spores_brown"] = {
modname = "flowers",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Brown Mushroom Spores",
group = "crumbly",
},
["mushroom_spores_red"] = {
modname = "flowers",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Red Mushroom Spores",
group = "crumbly",
},
["aspen_sapling"] = {
modname = "default",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Aspen Saplings",
group = "snappy",
},
["acacia_bush_sapling"] = {
modname = "default",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Acacia Bush Saplings",
group = "snappy",
},
["bush_sapling"] = {
modname = "default",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Applewood Bush Saplings",
group = "snappy",
},
["blueberries"] = {
modname = "default",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Blueberries",
group = "crumbly",
},
["blueberry_bush_sapling"] = {
modname = "default",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Blueberry Saplings",
group = "snappy",
},
["pine_bush_sapling"] = {
modname = "default",
sounds = default.node_sound_leaves_defaults(),
description = "Piled Pine Bush Saplings",
group = "snappy",
},
} do
minetest.register_node("piled:"..nodename, {
description = details.description,
tiles = {"piled."..nodename..".png"},
groups = {
[details.group] = 1,
falling_node = 1,
flammable = 1,
oddly_breakable_by_hand = 1,
float = 1,
},
sounds = details.sounds,
drop = details.modname..":"..nodename.." 9",
})
minetest.register_craft({
output = "piled:"..nodename,
recipe = {
{details.modname..":"..nodename, details.modname..":"..nodename, details.modname..":"..nodename},
{details.modname..":"..nodename, details.modname..":"..nodename, details.modname..":"..nodename},
{details.modname..":"..nodename, details.modname..":"..nodename, details.modname..":"..nodename},
},
})
minetest.register_craft({
output = details.modname..":"..nodename.." 9",
recipe = {
{"piled:"..nodename},
},
})
local burntime = minetest.get_craft_result({method="fuel", width=1, items={details.modname..":"..nodename}}).time
if burntime == 0 then
burntime = 1
else
burntime = burntime * 9
end
minetest.register_craft({
type = "fuel",
recipe = "piled:"..nodename,
burntime = burntime,
})
end

View File

@ -0,0 +1,3 @@
name = piled
depends = default, farming, flowers
optional_depends = retrodrops

View File

@ -0,0 +1,74 @@
The following textures are derived from textures in minetest Game's
default mod, and are released under the Attribution-ShareAlike 3.0
Unported (CC BY-SA 3.0) license.
piled.acacia_bush_sapling.png
piled.acacia_sapling.png
piled.apple.png
piled.aspen_sapling.png
piled.blueberries.png
piled.blueberry_bush_sapling.png
piled.bush_sapling.png
piled.junglesapling.png
piled.pine_bush_sapling.png
piled.pine_sapling.png
piled.sapling.png
Credits are as follows:
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2010-2018:
celeron55, Perttu Ahola <celeron55@gmail.com>
Cisoun
G4JC
VanessaE
RealBadAngel
Calinou
MirceaKitsune
Jordach
PilzAdam
jojoa1997
InfinityProject
Splizard
Zeg9
paramat
BlockMen
sofar
Neuromancer
Gambit
asl97
KevDoy
Mito551
GreenXenith
kaeza
kilbith
tobyplowy
CloudyProton
TumeniNodes
Mossmanikin
random-geek
Extex101
An0n3m0us
The following textures are derived from textures in minetest Game's
farming mod, and are released under the WTFPL.
piled.seed_cotton.png
piled.seed_wheat.png
They were derived from the following images released by Gambit under
the WTFPL:
farming_cotton_seed.png
farming_wheat_seed.png
The following textures were inspired by textures in Minetest game, but
not derived from them. They are copyright 2020 Alex Yst and are
released under the Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
license.
piled.mushroom_brown.png
piled.mushroom_red.png
piled.mushroom_spores_brown.png
piled.mushroom_spores_red.png
piled.string.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

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