Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
226ccd07b7 |
0
.gitignore
vendored
Normal file → Executable file
21
.luacheckrc
@ -1,21 +0,0 @@
|
|||||||
unused_args = false
|
|
||||||
allow_defined_top = true
|
|
||||||
|
|
||||||
read_globals = {
|
|
||||||
"DIR_DELIM",
|
|
||||||
"minetest", "core",
|
|
||||||
"dump",
|
|
||||||
"vector",
|
|
||||||
"VoxelManip", "VoxelArea",
|
|
||||||
"PseudoRandom", "ItemStack",
|
|
||||||
"Settings",
|
|
||||||
"unpack",
|
|
||||||
-- Silence "accessing undefined field copy of global table".
|
|
||||||
table = { fields = { "copy" } }
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Overwrites minetest.handle_node_drops
|
|
||||||
files["mods/creative/init.lua"].globals = { "minetest" }
|
|
||||||
|
|
||||||
-- Don't report on legacy definitions of globals.
|
|
||||||
files["mods/default/legacy.lua"].global = false
|
|
12
.travis.yml
@ -1,12 +0,0 @@
|
|||||||
language: generic
|
|
||||||
sudo: false
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- luarocks
|
|
||||||
before_install:
|
|
||||||
- luarocks install --local luacheck
|
|
||||||
script:
|
|
||||||
- $HOME/.luarocks/bin/luacheck --no-color ./mods
|
|
||||||
notifications:
|
|
||||||
email: false
|
|
519
LICENSE.txt
@ -1,519 +0,0 @@
|
|||||||
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!
|
|
31
README.txt
Normal file → Executable file
@ -22,7 +22,32 @@ When stable releases are made, Minetest Game is packaged and made available in
|
|||||||
and in case the repository has grown too much, it may be reset. In that sense,
|
and in case the repository has grown too much, it may be reset. In that sense,
|
||||||
this is not a "real" git repository. (Package maintainers please note!)
|
this is not a "real" git repository. (Package maintainers please note!)
|
||||||
|
|
||||||
Licensing
|
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.
|
||||||
|
|
||||||
See LICENSE.txt
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2.1 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License along
|
||||||
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
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
|
||||||
|
2
game.conf
Normal file → Executable file
@ -1 +1 @@
|
|||||||
name = Minetest Game
|
name = MinetestForFun Game
|
||||||
|
266
game_api.txt
Normal file → Executable file
@ -70,23 +70,7 @@ Beds API
|
|||||||
Creative API
|
Creative API
|
||||||
------------
|
------------
|
||||||
|
|
||||||
Use `creative.register_tab(name, title, items)` to add a tab with filtered items.
|
A global string called `creative.formspec_add` was added which allows mods to add additional formspec elements onto the default creative inventory formspec to be drawn after each update.
|
||||||
For example,
|
|
||||||
|
|
||||||
creative.register_tab("tools", "Tools", minetest.registered_tools)
|
|
||||||
|
|
||||||
is used to show all tools. Name is used in the sfinv page name, title is the
|
|
||||||
human readable title.
|
|
||||||
|
|
||||||
`is_enabled_for` is used to check whether a player is in creative mode:
|
|
||||||
|
|
||||||
creative.is_enabled_for(name)
|
|
||||||
|
|
||||||
Override this to allow per-player game modes.
|
|
||||||
|
|
||||||
The contents of `creative.formspec_add` is appended to every creative inventory
|
|
||||||
page. Mods can use it to add additional formspec elements onto the default
|
|
||||||
creative inventory formspec to be drawn after each update.
|
|
||||||
|
|
||||||
Doors API
|
Doors API
|
||||||
---------
|
---------
|
||||||
@ -282,6 +266,18 @@ Give Initial Stuff API
|
|||||||
^ str is a comma separated list of initial stuff
|
^ str is a comma separated list of initial stuff
|
||||||
^ Adds items to the list of items to be given
|
^ Adds items to the list of items to be given
|
||||||
|
|
||||||
|
Nyancat API
|
||||||
|
-----------
|
||||||
|
|
||||||
|
`nyancat.place(pos, facedir, length)`
|
||||||
|
|
||||||
|
^ Place a cat at `pos` facing `facedir` with tail length `length`
|
||||||
|
Only accepts facedir 0-3, if facedir > 3 then it will be interpreted as facedir = 0
|
||||||
|
|
||||||
|
`nyancat.generate(minp, maxp, seed)`
|
||||||
|
|
||||||
|
^ Called by `minetest.register_on_generated`. To disable nyancat generation,
|
||||||
|
you can redefine nyancat.generate() to be an empty function
|
||||||
|
|
||||||
TNT API
|
TNT API
|
||||||
----------
|
----------
|
||||||
@ -312,10 +308,8 @@ TNT API
|
|||||||
|
|
||||||
`tnt.burn(position, [nodename])`
|
`tnt.burn(position, [nodename])`
|
||||||
|
|
||||||
^ Ignite node at position, triggering its `on_ignite` callback (see fire mod).
|
^ Ignite TNT at position, nodename isn't required unless already known.
|
||||||
If no such callback exists, fallback to turn tnt group nodes to their
|
|
||||||
"_burning" variant.
|
|
||||||
nodename isn't required unless already known.
|
|
||||||
|
|
||||||
To make dropping items from node inventories easier, you can use the
|
To make dropping items from node inventories easier, you can use the
|
||||||
following helper function from 'default':
|
following helper function from 'default':
|
||||||
@ -397,110 +391,6 @@ set a players home position and teleport a player to home position.
|
|||||||
* return value: false if player cannot be sent home, otherwise true
|
* return value: false if player cannot be sent home, otherwise true
|
||||||
|
|
||||||
|
|
||||||
Sfinv API
|
|
||||||
---------
|
|
||||||
|
|
||||||
### sfinv Methods
|
|
||||||
|
|
||||||
**Pages**
|
|
||||||
|
|
||||||
* sfinv.set_page(player, pagename) - changes the page
|
|
||||||
* sfinv.get_homepage_name(player) - get the page name of the first page to show to a player
|
|
||||||
* sfinv.register_page(name, def) - register a page, see section below
|
|
||||||
* sfinv.override_page(name, def) - overrides fields of an page registered with register_page.
|
|
||||||
* Note: Page must already be defined, (opt)depend on the mod defining it.
|
|
||||||
* sfinv.set_player_inventory_formspec(player) - (re)builds page formspec
|
|
||||||
and calls set_inventory_formspec().
|
|
||||||
* sfinv.get_formspec(player, context) - builds current page's formspec
|
|
||||||
|
|
||||||
**Contexts**
|
|
||||||
|
|
||||||
* sfinv.get_or_create_context(player) - gets the player's context
|
|
||||||
* sfinv.set_context(player, context)
|
|
||||||
|
|
||||||
**Theming**
|
|
||||||
|
|
||||||
* sfinv.make_formspec(player, context, content, show_inv, size) - adds a theme to a formspec
|
|
||||||
* show_inv, defaults to false. Whether to show the player's main inventory
|
|
||||||
* size, defaults to `size[8,8.6]` if not specified
|
|
||||||
* sfinv.get_nav_fs(player, context, nav, current_idx) - creates tabheader or ""
|
|
||||||
|
|
||||||
### sfinv Members
|
|
||||||
|
|
||||||
* pages - table of pages[pagename] = def
|
|
||||||
* pages_unordered - array table of pages in order of addition (used to build navigation tabs).
|
|
||||||
* contexts - contexts[playername] = player_context
|
|
||||||
* enabled - set to false to disable. Good for inventory rehaul mods like unified inventory
|
|
||||||
|
|
||||||
### Context
|
|
||||||
|
|
||||||
A table with these keys:
|
|
||||||
|
|
||||||
* page - current page name
|
|
||||||
* nav - a list of page names
|
|
||||||
* nav_titles - a list of page titles
|
|
||||||
* nav_idx - current nav index (in nav and nav_titles)
|
|
||||||
* any thing you want to store
|
|
||||||
* sfinv will clear the stored data on log out / log in
|
|
||||||
|
|
||||||
### sfinv.register_page
|
|
||||||
|
|
||||||
sfinv.register_page(name, def)
|
|
||||||
|
|
||||||
def is a table containing:
|
|
||||||
|
|
||||||
* `title` - human readable page name (required)
|
|
||||||
* `get(self, player, context)` - returns a formspec string. See formspec variables. (required)
|
|
||||||
* `is_in_nav(self, player, context)` - return true to show in the navigation (the tab header, by default)
|
|
||||||
* `on_player_receive_fields(self, player, context, fields)` - on formspec submit.
|
|
||||||
* `on_enter(self, player, context)` - called when the player changes pages, usually using the tabs.
|
|
||||||
* `on_leave(self, player, context)` - when leaving this page to go to another, called before other's on_enter
|
|
||||||
|
|
||||||
### get formspec
|
|
||||||
|
|
||||||
Use sfinv.make_formspec to apply a layout:
|
|
||||||
|
|
||||||
return sfinv.make_formspec(player, context, [[
|
|
||||||
list[current_player;craft;1.75,0.5;3,3;]
|
|
||||||
list[current_player;craftpreview;5.75,1.5;1,1;]
|
|
||||||
image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]
|
|
||||||
listring[current_player;main]
|
|
||||||
listring[current_player;craft]
|
|
||||||
image[0,4.25;1,1;gui_hb_bg.png]
|
|
||||||
image[1,4.25;1,1;gui_hb_bg.png]
|
|
||||||
image[2,4.25;1,1;gui_hb_bg.png]
|
|
||||||
image[3,4.25;1,1;gui_hb_bg.png]
|
|
||||||
image[4,4.25;1,1;gui_hb_bg.png]
|
|
||||||
image[5,4.25;1,1;gui_hb_bg.png]
|
|
||||||
image[6,4.25;1,1;gui_hb_bg.png]
|
|
||||||
image[7,4.25;1,1;gui_hb_bg.png]
|
|
||||||
]], true)
|
|
||||||
|
|
||||||
See above (methods section) for more options.
|
|
||||||
|
|
||||||
### Customising themes
|
|
||||||
|
|
||||||
Simply override this function to change the navigation:
|
|
||||||
|
|
||||||
function sfinv.get_nav_fs(player, context, nav, current_idx)
|
|
||||||
return "navformspec"
|
|
||||||
end
|
|
||||||
|
|
||||||
And override this function to change the layout:
|
|
||||||
|
|
||||||
function sfinv.make_formspec(player, context, content, show_inv, size)
|
|
||||||
local tmp = {
|
|
||||||
size or "size[8,8.6]",
|
|
||||||
theme_main,
|
|
||||||
sfinv.get_nav_fs(player, context, context.nav_titles, context.nav_idx),
|
|
||||||
content
|
|
||||||
}
|
|
||||||
if show_inv then
|
|
||||||
tmp[4] = theme_inv
|
|
||||||
end
|
|
||||||
return table.concat(tmp, "")
|
|
||||||
end
|
|
||||||
|
|
||||||
Stairs API
|
Stairs API
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -648,36 +538,20 @@ default.player_get_animation(player)
|
|||||||
Leafdecay
|
Leafdecay
|
||||||
---------
|
---------
|
||||||
|
|
||||||
To enable leaf decay for leaves when a tree is cut down by a player,
|
To enable leaf decay for a node, add it to the `leafdecay` group.
|
||||||
register the tree with the default.register_leafdecay(leafdecaydef)
|
|
||||||
function.
|
|
||||||
|
|
||||||
If `param2` of any registered node is ~= 0, the node will always be
|
The rating of the group determines how far from a node in the group `tree`
|
||||||
preserved. Thus, if the player places a node of that kind, you will
|
the node can be without decaying.
|
||||||
want to set `param2 = 1` or so.
|
|
||||||
|
|
||||||
The function `default.after_place_leaves` can be set as
|
If `param2` of the node is ~= 0, the node will always be preserved. Thus, if
|
||||||
`after_place_node of a node` to set param2 to 1 if the player places
|
the player places a node of that kind, you will want to set `param2 = 1` or so.
|
||||||
the node (should not be used for nodes that use param2 otherwise
|
|
||||||
(e.g. facedir)).
|
|
||||||
|
|
||||||
If the node is in the `leafdecay_drop` group then it will always be
|
The function `default.after_place_leaves` can be set as `after_place_node of a node`
|
||||||
dropped as an item.
|
to set param2 to 1 if the player places the node (should not be used for nodes
|
||||||
|
that use param2 otherwise (e.g. facedir)).
|
||||||
`default.register_leafdecay(leafdecaydef)`
|
|
||||||
|
|
||||||
`leafdecaydef` is a table, with following members:
|
|
||||||
{
|
|
||||||
trunks = {"default:tree"}, -- nodes considered trunks
|
|
||||||
leaves = {"default:leaves", "default:apple"},
|
|
||||||
-- nodes considered for removal
|
|
||||||
radius = 3, -- radius to consider for searching
|
|
||||||
}
|
|
||||||
|
|
||||||
Note: all the listed nodes in `trunks` have their `on_after_destruct`
|
|
||||||
callback overridden. All the nodes listed in `leaves` have their
|
|
||||||
`on_timer` callback overridden.
|
|
||||||
|
|
||||||
|
If the node is in the `leafdecay_drop` group then it will always be dropped as an
|
||||||
|
item.
|
||||||
|
|
||||||
Dyes
|
Dyes
|
||||||
----
|
----
|
||||||
@ -768,97 +642,11 @@ Trees
|
|||||||
* `default.grow_new_pine_tree(pos)`
|
* `default.grow_new_pine_tree(pos)`
|
||||||
* Grows a new design pine tree at pos
|
* Grows a new design pine tree at pos
|
||||||
|
|
||||||
* `default.grow_new_snowy_pine_tree(pos)`
|
|
||||||
* Grows a new design snowy pine tree at pos
|
|
||||||
|
|
||||||
* `default.grow_new_acacia_tree(pos)`
|
* `default.grow_new_acacia_tree(pos)`
|
||||||
* Grows a new design acacia tree at pos
|
* Grows a new design acacia tree at pos
|
||||||
|
|
||||||
* `default.grow_new_aspen_tree(pos)`
|
* `default.grow_new_aspen_tree(pos)`
|
||||||
* Grows a new design aspen tree at pos
|
* Grows a new design aspen tree at pos
|
||||||
|
|
||||||
* `default.grow_bush(pos)`
|
* `default.grow_new_snowy_pine_tree(pos)`
|
||||||
* Grows a bush at pos
|
* Grows a new design snowy pine tree at pos
|
||||||
|
|
||||||
* `default.grow_acacia_bush(pos)`
|
|
||||||
* Grows an acaia bush at pos
|
|
||||||
|
|
||||||
Carts
|
|
||||||
-----
|
|
||||||
|
|
||||||
carts.register_rail(
|
|
||||||
"mycarts:myrail", -- Rail name
|
|
||||||
nodedef, -- standard nodedef
|
|
||||||
railparams -- rail parameter struct (optional)
|
|
||||||
)
|
|
||||||
|
|
||||||
railparams = {
|
|
||||||
on_step(obj, dtime), -- Event handler called when
|
|
||||||
-- cart is on rail
|
|
||||||
acceleration, -- integer acceleration factor (negative
|
|
||||||
-- values to brake)
|
|
||||||
}
|
|
||||||
|
|
||||||
The event handler is called after all default calculations
|
|
||||||
are made, so the custom on_step handler can override things
|
|
||||||
like speed, acceleration, player attachment. The handler will
|
|
||||||
likely be called many times per second, so the function needs
|
|
||||||
to make sure that the event is handled properly.
|
|
||||||
|
|
||||||
Key API
|
|
||||||
-------
|
|
||||||
|
|
||||||
The key API allows mods to add key functionality to nodes that have
|
|
||||||
ownership or specific permissions. Using the API will make it so
|
|
||||||
that a node owner can use skeleton keys on their nodes to create keys
|
|
||||||
for that node in that location, and give that key to other players,
|
|
||||||
allowing them some sort of access that they otherwise would not have
|
|
||||||
due to node protection.
|
|
||||||
|
|
||||||
To make your new nodes work with the key API, you need to register
|
|
||||||
two callback functions in each nodedef:
|
|
||||||
|
|
||||||
|
|
||||||
`on_key_use(pos, player)`
|
|
||||||
* Is called when a player right-clicks (uses) a normal key on your
|
|
||||||
* node.
|
|
||||||
* `pos` - position of the node
|
|
||||||
* `player` - PlayerRef
|
|
||||||
* return value: none, ignored
|
|
||||||
|
|
||||||
The `on_key_use` callback should validate that the player is wielding
|
|
||||||
a key item with the right key meta secret. If needed the code should
|
|
||||||
deny access to the node functionality.
|
|
||||||
|
|
||||||
If formspecs are used, the formspec callbacks should duplicate these
|
|
||||||
checks in the metadata callback functions.
|
|
||||||
|
|
||||||
|
|
||||||
`on_skeleton_key_use(pos, player, newsecret)`
|
|
||||||
|
|
||||||
* Is called when a player right-clicks (uses) a skeleton key on your
|
|
||||||
* node.
|
|
||||||
* `pos` - position of the node
|
|
||||||
* `player` - PlayerRef
|
|
||||||
* `newsecret` - a secret value(string)
|
|
||||||
* return values:
|
|
||||||
* `secret` - `nil` or the secret value that unlocks the door
|
|
||||||
* `name` - a string description of the node ("a locked chest")
|
|
||||||
* `owner` - name of the node owner
|
|
||||||
|
|
||||||
The `on_skeleton_key_use` function should validate that the player has
|
|
||||||
the right permissions to make a new key for the item. The newsecret
|
|
||||||
value is useful if the node has no secret value. The function should
|
|
||||||
store this secret value somewhere so that in the future it may compare
|
|
||||||
key secrets and match them to allow access. If a node already has a
|
|
||||||
secret value, the function should return that secret value instead
|
|
||||||
of the newsecret value. The secret value stored for the node should
|
|
||||||
not be overwritten, as this would invalidate existing keys.
|
|
||||||
|
|
||||||
Aside from the secret value, the function should retun a descriptive
|
|
||||||
name for the node and the owner name. The return values are all
|
|
||||||
encoded in the key that will be given to the player in replacement
|
|
||||||
for the wielded skeleton key.
|
|
||||||
|
|
||||||
if `nil` is returned, it is assumed that the wielder did not have
|
|
||||||
permissions to create a key for this node, and no key is created.
|
|
||||||
|
BIN
menu/header.png
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 904 B |
0
menu/icon.png
Normal file → Executable file
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
3
minetest.conf
Normal file → Executable file
@ -0,0 +1,3 @@
|
|||||||
|
# Enable jungles on new worlds, disable biome blend and mud flow (faster, looks better).
|
||||||
|
mgv6_spflags = jungles, nobiomeblend, nomudflow
|
||||||
|
disable_fire = true
|
||||||
|
6
minetest.conf.example
Normal file → Executable file
@ -24,12 +24,6 @@
|
|||||||
# 'permanent flame' nodes will remain with either setting.
|
# 'permanent flame' nodes will remain with either setting.
|
||||||
#enable_fire = true
|
#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
|
# Whether the stuff in initial_stuff should be given to new players
|
||||||
#give_initial_stuff = false
|
#give_initial_stuff = false
|
||||||
#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,default:torch 99,default:cobble 99
|
#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,default:torch 99,default:cobble 99
|
||||||
|
9
mods/_misc_init/init.lua
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
----------------------------------------
|
||||||
|
-- Server Misc Mod - pre-default init --
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
local cwd = minetest.get_modpath(minetest.get_current_modname())
|
||||||
|
|
||||||
|
-- Inventory refill function override
|
||||||
|
-- see https://github.com/MinetestForFun/server-minetestforfun/issues/462
|
||||||
|
dofile(cwd.."/inventory_rotate_node.lua")
|
22
mods/_misc_init/inventory_rotate_node.lua
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
--rewrite function minetest.rotate_node(itemstack, placer, pointed_thing) to refill inventory
|
||||||
|
local old_rotate_node = minetest.rotate_node
|
||||||
|
function minetest.rotate_node(itemstack, placer, pointed_thing)
|
||||||
|
local stack_name = itemstack:get_name()
|
||||||
|
local ret = old_rotate_node(itemstack, placer, pointed_thing)
|
||||||
|
if ret:get_count() == 0 and not minetest.setting_getbool("creative_mode") then
|
||||||
|
local index = placer:get_wield_index()
|
||||||
|
local inv = placer:get_inventory()
|
||||||
|
if inv:get_list("main") then
|
||||||
|
for i, stack in ipairs(inv:get_list("main")) do
|
||||||
|
if i ~= index and stack:get_name() == stack_name then
|
||||||
|
ret:add_item(stack)
|
||||||
|
stack:clear()
|
||||||
|
inv:set_stack("main", i, stack)
|
||||||
|
minetest.log("action", "Inventory Tweaks: refilled stack("..stack_name..") of " .. placer:get_player_name())
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return ret
|
||||||
|
end
|
44
mods/beds/README.txt
Normal file → Executable file
@ -1,26 +1,30 @@
|
|||||||
Minetest Game mod: beds
|
Minetest Game mod: beds
|
||||||
=======================
|
=======================
|
||||||
See license.txt for license information.
|
by BlockMen (c) 2014-2015
|
||||||
|
|
||||||
Authors of source code
|
Version: 1.1.1
|
||||||
----------------------
|
|
||||||
Originally by BlockMen (MIT)
|
|
||||||
Various Minetest developers and contributors (MIT)
|
|
||||||
|
|
||||||
Authors of media (textures)
|
About
|
||||||
---------------------------
|
~~~~~
|
||||||
BlockMen (CC BY-SA 3.0)
|
This mod adds a bed to Minetest which allows to skip the night. To sleep rightclick the bed, if playing
|
||||||
|
in singleplayer mode the night gets skipped imideatly. If playing on server you get shown how many other
|
||||||
|
players are in bed too. If all players are sleeping the night gets skipped aswell. Also the night skip can be forced
|
||||||
|
if more than 50% of the players are lying in bed and use this option.
|
||||||
|
|
||||||
This mod adds a bed to Minetest which allows to skip the night.
|
Another feature is a controled respawning. If you have slept in bed (not just lying in it) your respawn point
|
||||||
To sleep, rightclick the bed. If playing in singleplayer mode the night gets skipped
|
is set to the beds location and you will respawn there after death.
|
||||||
immediately. If playing multiplayer you get shown how many other players are in bed too,
|
You can disable the respawn at beds by setting "enable_bed_respawn = false" in minetest.conf
|
||||||
if all players are sleeping the night gets skipped. The night skip can be forced if more
|
You can also disable the night skip feature by setting "enable_bed_night_skip = false" in minetest.conf or by using
|
||||||
than 50% of the players are lying in bed and use this option.
|
the /set command ingame.
|
||||||
|
|
||||||
Another feature is a controlled respawning. If you have slept in bed (not just lying in
|
|
||||||
it) your respawn point is set to the beds location and you will respawn there after
|
License of source code, textures: WTFPL
|
||||||
death.
|
---------------------------------------
|
||||||
You can disable the respawn at beds by setting "enable_bed_respawn = false" in
|
(c) Copyright BlockMen (2014-2015)
|
||||||
minetest.conf.
|
|
||||||
You can disable the night skip feature by setting "enable_bed_night_skip = false" in
|
|
||||||
minetest.conf or by using the /set command in-game.
|
This program is free software. It comes without any warranty, to
|
||||||
|
the extent permitted by applicable law. You can redistribute it
|
||||||
|
and/or modify it under the terms of the Do What The Fuck You Want
|
||||||
|
To Public License, Version 2, as published by Sam Hocevar. See
|
||||||
|
http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||||
|
132
mods/beds/api.lua
Normal file → Executable file
@ -1,27 +1,3 @@
|
|||||||
|
|
||||||
local reverse = true
|
|
||||||
|
|
||||||
local function destruct_bed(pos, n)
|
|
||||||
local node = minetest.get_node(pos)
|
|
||||||
local other
|
|
||||||
|
|
||||||
if n == 2 then
|
|
||||||
local dir = minetest.facedir_to_dir(node.param2)
|
|
||||||
other = vector.subtract(pos, dir)
|
|
||||||
elseif n == 1 then
|
|
||||||
local dir = minetest.facedir_to_dir(node.param2)
|
|
||||||
other = vector.add(pos, dir)
|
|
||||||
end
|
|
||||||
|
|
||||||
if reverse then
|
|
||||||
reverse = not reverse
|
|
||||||
minetest.remove_node(other)
|
|
||||||
minetest.check_for_falling(other)
|
|
||||||
else
|
|
||||||
reverse = not reverse
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function beds.register_bed(name, def)
|
function beds.register_bed(name, def)
|
||||||
minetest.register_node(name .. "_bottom", {
|
minetest.register_node(name .. "_bottom", {
|
||||||
description = def.description,
|
description = def.description,
|
||||||
@ -33,8 +9,8 @@ function beds.register_bed(name, def)
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1},
|
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1},
|
||||||
sounds = def.sounds or default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = def.nodebox.bottom,
|
fixed = def.nodebox.bottom,
|
||||||
@ -43,68 +19,42 @@ function beds.register_bed(name, def)
|
|||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = def.selectionbox,
|
fixed = def.selectionbox,
|
||||||
},
|
},
|
||||||
|
after_place_node = function(pos, placer, itemstack)
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
local n = minetest.get_node_or_nil(pos)
|
||||||
local under = pointed_thing.under
|
if not n or not n.param2 then
|
||||||
local node = minetest.get_node(under)
|
minetest.remove_node(pos)
|
||||||
local udef = minetest.registered_nodes[node.name]
|
return true
|
||||||
if udef and udef.on_rightclick and
|
|
||||||
not (placer and placer:get_player_control().sneak) then
|
|
||||||
return udef.on_rightclick(under, node, placer, itemstack,
|
|
||||||
pointed_thing) or itemstack
|
|
||||||
end
|
end
|
||||||
|
local dir = minetest.facedir_to_dir(n.param2)
|
||||||
local pos
|
local p = vector.add(pos, dir)
|
||||||
if minetest.registered_items[minetest.get_node(under).name].buildable_to then
|
local n2 = minetest.get_node_or_nil(p)
|
||||||
pos = under
|
local def = n2 and minetest.registered_items[n2.name]
|
||||||
else
|
if not def or not def.buildable_to then
|
||||||
pos = pointed_thing.above
|
minetest.remove_node(pos)
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
minetest.set_node(p, {name = n.name:gsub("%_bottom", "_top"), param2 = n.param2})
|
||||||
if minetest.is_protected(pos, placer:get_player_name()) and
|
return false
|
||||||
not minetest.check_player_privs(placer, "protection_bypass") then
|
|
||||||
minetest.record_protection_violation(pos, placer:get_player_name())
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
|
|
||||||
local node_def = minetest.registered_nodes[minetest.get_node(pos).name]
|
|
||||||
if not node_def or not node_def.buildable_to then
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
|
|
||||||
local dir = minetest.dir_to_facedir(placer:get_look_dir())
|
|
||||||
local botpos = vector.add(pos, minetest.facedir_to_dir(dir))
|
|
||||||
|
|
||||||
if minetest.is_protected(botpos, placer:get_player_name()) and
|
|
||||||
not minetest.check_player_privs(placer, "protection_bypass") then
|
|
||||||
minetest.record_protection_violation(botpos, placer:get_player_name())
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
|
|
||||||
local botdef = minetest.registered_nodes[minetest.get_node(botpos).name]
|
|
||||||
if not botdef or not botdef.buildable_to then
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.set_node(pos, {name = name .. "_bottom", param2 = dir})
|
|
||||||
minetest.set_node(botpos, {name = name .. "_top", param2 = dir})
|
|
||||||
|
|
||||||
if not (creative and creative.is_enabled_for
|
|
||||||
and creative.is_enabled_for(placer:get_player_name())) then
|
|
||||||
itemstack:take_item()
|
|
||||||
end
|
|
||||||
return itemstack
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_destruct = function(pos)
|
on_destruct = function(pos)
|
||||||
destruct_bed(pos, 1)
|
local n = minetest.get_node_or_nil(pos)
|
||||||
|
if not n then return end
|
||||||
|
local dir = minetest.facedir_to_dir(n.param2)
|
||||||
|
local p = vector.add(pos, dir)
|
||||||
|
local n2 = minetest.get_node(p)
|
||||||
|
if minetest.get_item_group(n2.name, "bed") == 2 and n.param2 == n2.param2 then
|
||||||
|
minetest.remove_node(p)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
local name = digger:get_player_name()
|
||||||
|
if not name or name == "" then return end
|
||||||
|
beds.spawn[name] = nil
|
||||||
|
beds.save_spawns()
|
||||||
|
end,
|
||||||
|
on_rightclick = function(pos, node, clicker)
|
||||||
beds.on_rightclick(pos, clicker)
|
beds.on_rightclick(pos, clicker)
|
||||||
return itemstack
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_rotate = function(pos, node, user, mode, new_param2)
|
on_rotate = function(pos, node, user, mode, new_param2)
|
||||||
local dir = minetest.facedir_to_dir(node.param2)
|
local dir = minetest.facedir_to_dir(node.param2)
|
||||||
local p = vector.add(pos, dir)
|
local p = vector.add(pos, dir)
|
||||||
@ -122,8 +72,8 @@ function beds.register_bed(name, def)
|
|||||||
end
|
end
|
||||||
local newp = vector.add(pos, minetest.facedir_to_dir(new_param2))
|
local newp = vector.add(pos, minetest.facedir_to_dir(new_param2))
|
||||||
local node3 = minetest.get_node_or_nil(newp)
|
local node3 = minetest.get_node_or_nil(newp)
|
||||||
local node_def = node3 and minetest.registered_nodes[node3.name]
|
local def = node3 and minetest.registered_nodes[node3.name]
|
||||||
if not node_def or not node_def.buildable_to then
|
if not def or not def.buildable_to then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if minetest.is_protected(newp, user:get_player_name()) then
|
if minetest.is_protected(newp, user:get_player_name()) then
|
||||||
@ -131,10 +81,9 @@ function beds.register_bed(name, def)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
node.param2 = new_param2
|
node.param2 = new_param2
|
||||||
-- do not remove_node here - it will trigger destroy_bed()
|
minetest.swap_node(pos, node)
|
||||||
minetest.set_node(p, {name = "air"})
|
minetest.remove_node(p)
|
||||||
minetest.set_node(pos, node)
|
minetest.set_node(newp, {name = node.name:gsub("%_bottom", "_top"), param2 = new_param2})
|
||||||
minetest.set_node(newp, {name = name .. "_top", param2 = new_param2})
|
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
@ -146,20 +95,17 @@ function beds.register_bed(name, def)
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
pointable = false,
|
pointable = false,
|
||||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2},
|
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2},
|
||||||
sounds = def.sounds or default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
drop = name .. "_bottom",
|
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = def.nodebox.top,
|
fixed = def.nodebox.top,
|
||||||
},
|
},
|
||||||
on_destruct = function(pos)
|
|
||||||
destruct_bed(pos, 2)
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_alias(name, name .. "_bottom")
|
minetest.register_alias(name, name .. "_bottom")
|
||||||
|
|
||||||
|
-- register recipe
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = name,
|
output = name,
|
||||||
recipe = def.recipe
|
recipe = def.recipe
|
||||||
|
148
mods/beds/beds.lua
Normal file → Executable file
@ -1,37 +1,36 @@
|
|||||||
-- Fancy shaped bed
|
for _, colour in pairs({"red", "white", "black", "blue", "green"}) do-- fancy shaped bed
|
||||||
|
beds.register_bed("beds:fancy_bed_" .. colour, {
|
||||||
beds.register_bed("beds:fancy_bed", {
|
description = "Fancy Bed (" .. colour .. ")",
|
||||||
description = "Fancy Bed",
|
inventory_image = "beds_bed_fancy_" .. colour .. ".png",
|
||||||
inventory_image = "beds_bed_fancy.png",
|
wield_image = "beds_bed_fancy_" .. colour .. ".png",
|
||||||
wield_image = "beds_bed_fancy.png",
|
tiles = {
|
||||||
tiles = {
|
bottom = {
|
||||||
bottom = {
|
"beds_bed_top1_" .. colour .. ".png",
|
||||||
"beds_bed_top1.png",
|
|
||||||
"default_wood.png",
|
"default_wood.png",
|
||||||
"beds_bed_side1.png",
|
"beds_bed_side1_" .. colour .. ".png",
|
||||||
"beds_bed_side1.png^[transformFX",
|
"beds_bed_side1_" .. colour .. ".png^[transformFX",
|
||||||
"default_wood.png",
|
"default_wood.png",
|
||||||
"beds_bed_foot.png",
|
"beds_bed_foot_" .. colour .. ".png",
|
||||||
},
|
},
|
||||||
top = {
|
top = {
|
||||||
"beds_bed_top2.png",
|
"beds_bed_top2_" .. colour .. ".png",
|
||||||
"default_wood.png",
|
"default_wood.png",
|
||||||
"beds_bed_side2.png",
|
"beds_bed_side2_" .. colour .. ".png",
|
||||||
"beds_bed_side2.png^[transformFX",
|
"beds_bed_side2_" .. colour .. ".png^[transformFX",
|
||||||
"beds_bed_head.png",
|
"beds_bed_head.png",
|
||||||
"default_wood.png",
|
"default_wood.png",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
nodebox = {
|
nodebox = {
|
||||||
bottom = {
|
bottom = {
|
||||||
{-0.5, -0.5, -0.5, -0.375, -0.065, -0.4375},
|
{-0.5, -0.5, -0.5, -0.375, -0.065, -0.4375},
|
||||||
{0.375, -0.5, -0.5, 0.5, -0.065, -0.4375},
|
{0.375, -0.5, -0.5, 0.5, -0.065, -0.4375},
|
||||||
{-0.5, -0.375, -0.5, 0.5, -0.125, -0.4375},
|
{-0.5, -0.375, -0.5, 0.5, -0.125, -0.4375},
|
||||||
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
|
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
|
||||||
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
|
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
|
||||||
{-0.4375, -0.3125, -0.4375, 0.4375, -0.0625, 0.5},
|
{-0.4375, -0.3125, -0.4375, 0.4375, -0.0625, 0.5},
|
||||||
},
|
},
|
||||||
top = {
|
top = {
|
||||||
{-0.5, -0.5, 0.4375, -0.375, 0.1875, 0.5},
|
{-0.5, -0.5, 0.4375, -0.375, 0.1875, 0.5},
|
||||||
{0.375, -0.5, 0.4375, 0.5, 0.1875, 0.5},
|
{0.375, -0.5, 0.4375, 0.5, 0.1875, 0.5},
|
||||||
{-0.5, 0, 0.4375, 0.5, 0.125, 0.5},
|
{-0.5, 0, 0.4375, 0.5, 0.125, 0.5},
|
||||||
@ -39,66 +38,55 @@ beds.register_bed("beds:fancy_bed", {
|
|||||||
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
|
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
|
||||||
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
|
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
|
||||||
{-0.4375, -0.3125, -0.5, 0.4375, -0.0625, 0.4375},
|
{-0.4375, -0.3125, -0.5, 0.4375, -0.0625, 0.4375},
|
||||||
}
|
}
|
||||||
},
|
|
||||||
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
|
|
||||||
recipe = {
|
|
||||||
{"", "", "group:stick"},
|
|
||||||
{"wool:red", "wool:red", "wool:white"},
|
|
||||||
{"group:wood", "group:wood", "group:wood"},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Simple shaped bed
|
|
||||||
|
|
||||||
beds.register_bed("beds:bed", {
|
|
||||||
description = "Simple Bed",
|
|
||||||
inventory_image = "beds_bed.png",
|
|
||||||
wield_image = "beds_bed.png",
|
|
||||||
tiles = {
|
|
||||||
bottom = {
|
|
||||||
"beds_bed_top_bottom.png^[transformR90",
|
|
||||||
"default_wood.png",
|
|
||||||
"beds_bed_side_bottom_r.png",
|
|
||||||
"beds_bed_side_bottom_r.png^[transformfx",
|
|
||||||
"beds_transparent.png",
|
|
||||||
"beds_bed_side_bottom.png"
|
|
||||||
},
|
},
|
||||||
top = {
|
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
|
||||||
"beds_bed_top_top.png^[transformR90",
|
recipe = {
|
||||||
|
{"", "", "group:stick"},
|
||||||
|
{"wool:" .. colour, "wool:" .. colour, "wool:white"},
|
||||||
|
{"group:wood", "group:wood", "group:wood"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- simple shaped bed
|
||||||
|
beds.register_bed("beds:bed_" .. colour, {
|
||||||
|
description = "Simple Bed (" .. colour .. ")",
|
||||||
|
inventory_image = "beds_bed_" .. colour .. ".png",
|
||||||
|
wield_image = "beds_bed_" .. colour .. ".png",
|
||||||
|
tiles = {
|
||||||
|
bottom = {
|
||||||
|
"beds_bed_top_bottom_" .. colour .. ".png^[transformR90",
|
||||||
"default_wood.png",
|
"default_wood.png",
|
||||||
"beds_bed_side_top_r.png",
|
"beds_bed_side_bottom_r_" .. colour .. ".png",
|
||||||
"beds_bed_side_top_r.png^[transformfx",
|
"beds_bed_side_bottom_r_" .. colour .. ".png^[transformfx",
|
||||||
|
"beds_transparent.png",
|
||||||
|
"beds_bed_side_bottom_" .. colour .. ".png"
|
||||||
|
},
|
||||||
|
top = {
|
||||||
|
"beds_bed_top_top_" .. colour .. ".png^[transformR90",
|
||||||
|
"default_wood.png",
|
||||||
|
"beds_bed_side_top_r_" .. colour .. ".png",
|
||||||
|
"beds_bed_side_top_r_" .. colour .. ".png^[transformfx",
|
||||||
"beds_bed_side_top.png",
|
"beds_bed_side_top.png",
|
||||||
"beds_transparent.png",
|
"beds_transparent.png",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
nodebox = {
|
nodebox = {
|
||||||
bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
|
bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
|
||||||
top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
|
top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
|
||||||
},
|
},
|
||||||
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
|
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
|
||||||
recipe = {
|
recipe = {
|
||||||
{"wool:red", "wool:red", "wool:white"},
|
{"wool:" .. colour, "wool:" .. colour, "wool:white"},
|
||||||
{"group:wood", "group:wood", "group:wood"}
|
{"group:wood", "group:wood", "group:wood"}
|
||||||
},
|
},
|
||||||
})
|
|
||||||
|
|
||||||
-- Aliases for PilzAdam's beds mod
|
})
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_alias("beds:bed_bottom_red", "beds:bed_bottom")
|
minetest.register_alias("beds:bed", "beds:bed_red")
|
||||||
minetest.register_alias("beds:bed_top_red", "beds:bed_top")
|
minetest.register_alias("beds:fancy_bed", "beds:fancy_bed_red")
|
||||||
|
minetest.register_alias("beds:bed_bottom", "beds:bed_red_bottom")
|
||||||
-- Fuel
|
minetest.register_alias("beds:bed_top", "beds:bed_red_top")
|
||||||
|
minetest.register_alias("beds:fancy_bed_top", "beds:fancy_bed_red_top")
|
||||||
minetest.register_craft({
|
minetest.register_alias("beds:fancy_bed_bottom", "beds:fancy_bed_red_bottom")
|
||||||
type = "fuel",
|
|
||||||
recipe = "beds:fancy_bed_bottom",
|
|
||||||
burntime = 13,
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "fuel",
|
|
||||||
recipe = "beds:bed_bottom",
|
|
||||||
burntime = 12,
|
|
||||||
})
|
|
||||||
|
1
mods/beds/depends.txt
Normal file → Executable file
@ -1,2 +1,3 @@
|
|||||||
default
|
default
|
||||||
wool
|
wool
|
||||||
|
areas
|
||||||
|
105
mods/beds/functions.lua
Normal file → Executable file
@ -1,19 +1,20 @@
|
|||||||
local pi = math.pi
|
local pi = math.pi
|
||||||
local player_in_bed = 0
|
local player_in_bed = 0
|
||||||
local is_sp = minetest.is_singleplayer()
|
local is_sp = minetest.is_singleplayer()
|
||||||
local enable_respawn = minetest.settings:get_bool("enable_bed_respawn")
|
local enable_respawn = minetest.setting_getbool("enable_bed_respawn")
|
||||||
if enable_respawn == nil then
|
if enable_respawn == nil then
|
||||||
enable_respawn = true
|
enable_respawn = true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Helper functions
|
|
||||||
|
-- helper functions
|
||||||
|
|
||||||
local function get_look_yaw(pos)
|
local function get_look_yaw(pos)
|
||||||
local n = minetest.get_node(pos)
|
local n = minetest.get_node(pos)
|
||||||
if n.param2 == 1 then
|
if n.param2 == 1 then
|
||||||
return pi / 2, n.param2
|
return pi/2, n.param2
|
||||||
elseif n.param2 == 3 then
|
elseif n.param2 == 3 then
|
||||||
return -pi / 2, n.param2
|
return -pi/2, n.param2
|
||||||
elseif n.param2 == 0 then
|
elseif n.param2 == 0 then
|
||||||
return pi, n.param2
|
return pi, n.param2
|
||||||
else
|
else
|
||||||
@ -22,7 +23,7 @@ local function get_look_yaw(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function is_night_skip_enabled()
|
local function is_night_skip_enabled()
|
||||||
local enable_night_skip = minetest.settings:get_bool("enable_bed_night_skip")
|
local enable_night_skip = minetest.setting_getbool("enable_bed_night_skip")
|
||||||
if enable_night_skip == nil then
|
if enable_night_skip == nil then
|
||||||
enable_night_skip = true
|
enable_night_skip = true
|
||||||
end
|
end
|
||||||
@ -69,8 +70,8 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- physics, eye_offset, etc
|
-- physics, eye_offset, etc
|
||||||
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
player:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0})
|
||||||
player:set_look_horizontal(math.random(1, 180) / 100)
|
player:set_look_yaw(math.random(1, 180)/100)
|
||||||
default.player_attached[name] = false
|
default.player_attached[name] = false
|
||||||
player:set_physics_override(1, 1, 1)
|
player:set_physics_override(1, 1, 1)
|
||||||
hud_flags.wielditem = true
|
hud_flags.wielditem = true
|
||||||
@ -83,11 +84,11 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
|||||||
player_in_bed = player_in_bed + 1
|
player_in_bed = player_in_bed + 1
|
||||||
|
|
||||||
-- physics, eye_offset, etc
|
-- physics, eye_offset, etc
|
||||||
player:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = 0, z = 0})
|
player:set_eye_offset({x=0,y=-13,z=0}, {x=0,y=0,z=0})
|
||||||
local yaw, param2 = get_look_yaw(bed_pos)
|
local yaw, param2 = get_look_yaw(bed_pos)
|
||||||
player:set_look_horizontal(yaw)
|
player:set_look_yaw(yaw)
|
||||||
local dir = minetest.facedir_to_dir(param2)
|
local dir = minetest.facedir_to_dir(param2)
|
||||||
local p = {x = bed_pos.x + dir.x / 2, y = bed_pos.y, z = bed_pos.z + dir.z / 2}
|
local p = {x=bed_pos.x+dir.x/2,y=bed_pos.y,z=bed_pos.z+dir.z/2}
|
||||||
player:set_physics_override(0, 0, 0)
|
player:set_physics_override(0, 0, 0)
|
||||||
player:setpos(p)
|
player:setpos(p)
|
||||||
default.player_attached[name] = true
|
default.player_attached[name] = true
|
||||||
@ -100,16 +101,18 @@ end
|
|||||||
|
|
||||||
local function update_formspecs(finished)
|
local function update_formspecs(finished)
|
||||||
local ges = #minetest.get_connected_players()
|
local ges = #minetest.get_connected_players()
|
||||||
local form_n
|
local form_n = ""
|
||||||
local is_majority = (ges / 2) < player_in_bed
|
local is_majority = (ges/2) < player_in_bed
|
||||||
|
|
||||||
if finished then
|
if finished then
|
||||||
form_n = beds.formspec .. "label[2.7,11; Good morning.]"
|
form_n = beds.formspec ..
|
||||||
|
"label[2.7,11; Good morning.]"
|
||||||
else
|
else
|
||||||
form_n = beds.formspec .. "label[2.2,11;" .. tostring(player_in_bed) ..
|
form_n = beds.formspec ..
|
||||||
" of " .. tostring(ges) .. " players are in bed]"
|
"label[2.2,11;"..tostring(player_in_bed).." of "..tostring(ges).." players are in bed]"
|
||||||
if is_majority and is_night_skip_enabled() then
|
if is_majority and is_night_skip_enabled() then
|
||||||
form_n = form_n .. "button_exit[2,8;4,0.75;force;Force night skip]"
|
form_n = form_n ..
|
||||||
|
"button_exit[2,8;4,0.75;force;Force night skip]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -119,10 +122,10 @@ local function update_formspecs(finished)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Public functions
|
-- public functions
|
||||||
|
|
||||||
function beds.kick_players()
|
function beds.kick_players()
|
||||||
for name, _ in pairs(beds.player) do
|
for name,_ in pairs(beds.player) do
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
lay_down(player, nil, nil, false)
|
lay_down(player, nil, nil, false)
|
||||||
end
|
end
|
||||||
@ -130,6 +133,7 @@ end
|
|||||||
|
|
||||||
function beds.skip_night()
|
function beds.skip_night()
|
||||||
minetest.set_timeofday(0.23)
|
minetest.set_timeofday(0.23)
|
||||||
|
beds.set_spawns()
|
||||||
end
|
end
|
||||||
|
|
||||||
function beds.on_rightclick(pos, player)
|
function beds.on_rightclick(pos, player)
|
||||||
@ -148,7 +152,6 @@ function beds.on_rightclick(pos, player)
|
|||||||
-- move to bed
|
-- move to bed
|
||||||
if not beds.player[name] then
|
if not beds.player[name] then
|
||||||
lay_down(player, ppos, pos)
|
lay_down(player, ppos, pos)
|
||||||
beds.set_spawns() -- save respawn positions when entering bed
|
|
||||||
else
|
else
|
||||||
lay_down(player, nil, nil, false)
|
lay_down(player, nil, nil, false)
|
||||||
end
|
end
|
||||||
@ -172,20 +175,68 @@ function beds.on_rightclick(pos, player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Callbacks
|
-- callbacks
|
||||||
-- Only register respawn callback if respawn enabled
|
--[[ --MFF (Crabman) It's useless to read each join player, read only once at load. function moved/called in spawn.lua
|
||||||
if enable_respawn then
|
minetest.register_on_joinplayer(function(player)
|
||||||
-- respawn player at bed if enabled and valid position is found
|
beds.read_spawns()
|
||||||
minetest.register_on_respawnplayer(function(player)
|
end)
|
||||||
local name = player:get_player_name()
|
--]]
|
||||||
local pos = beds.spawn[name]
|
|
||||||
|
|
||||||
|
local dead_players = {}
|
||||||
|
local have_areas_mod = false
|
||||||
|
if (minetest.get_modpath("areas") ~= nil) and areas.getSpawn then
|
||||||
|
have_areas_mod = true
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function teleport_player(player, clear)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not name or name == "" then return false end
|
||||||
|
if have_areas_mod and dead_players[name] ~= nil then
|
||||||
|
local pos = areas:getSpawn(dead_players[name])
|
||||||
|
if clear then
|
||||||
|
dead_players[name] = nil
|
||||||
|
end
|
||||||
if pos then
|
if pos then
|
||||||
player:setpos(pos)
|
player:setpos(pos)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end)
|
end
|
||||||
|
if not enable_respawn then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local name = player:get_player_name()
|
||||||
|
local pos = beds.spawn[name] or nil
|
||||||
|
if pos then
|
||||||
|
player:setpos(pos)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
--if not areas or bed spawnpoint, tp to the spawn
|
||||||
|
local spawn = minetest.string_to_pos(minetest.setting_get("static_spawnpoint") or "0,0,0")
|
||||||
|
player:setpos(spawn)
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_on_dieplayer(function(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not name or name == "" then return end
|
||||||
|
if have_areas_mod then
|
||||||
|
local pos = player:getpos()
|
||||||
|
if pos then
|
||||||
|
dead_players[name] = pos
|
||||||
|
end
|
||||||
|
end
|
||||||
|
minetest.after(0.20, teleport_player, player) -- tp after all others on_dieplayer callback otherwise their pos is wrong
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- respawn player at bed if enabled and valid position is found
|
||||||
|
minetest.register_on_respawnplayer(function(player)
|
||||||
|
return teleport_player(player, true)
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_leaveplayer(function(player)
|
minetest.register_on_leaveplayer(function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
lay_down(player, nil, nil, false, true)
|
lay_down(player, nil, nil, false, true)
|
||||||
|
17
mods/beds/init.lua
Normal file → Executable file
@ -3,15 +3,14 @@ beds.player = {}
|
|||||||
beds.pos = {}
|
beds.pos = {}
|
||||||
beds.spawn = {}
|
beds.spawn = {}
|
||||||
|
|
||||||
beds.formspec = "size[8,15;true]" ..
|
beds.formspec = "size[8,15;true]"..
|
||||||
"bgcolor[#080808BB; true]" ..
|
"bgcolor[#080808BB; true]"..
|
||||||
"button_exit[2,12;4,0.75;leave;Leave Bed]"
|
"button_exit[2,12;4,0.75;leave;Leave Bed]"
|
||||||
|
|
||||||
local modpath = minetest.get_modpath("beds")
|
local modpath = minetest.get_modpath("beds")
|
||||||
|
|
||||||
-- Load files
|
-- load files
|
||||||
|
dofile(modpath.."/functions.lua")
|
||||||
dofile(modpath .. "/functions.lua")
|
dofile(modpath.."/api.lua")
|
||||||
dofile(modpath .. "/api.lua")
|
dofile(modpath.."/beds.lua")
|
||||||
dofile(modpath .. "/beds.lua")
|
dofile(modpath.."/spawns.lua")
|
||||||
dofile(modpath .. "/spawns.lua")
|
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
License of source code
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
The MIT License (MIT)
|
|
||||||
Copyright (C) 2014-2016 BlockMen
|
|
||||||
Copyright (C) 2014-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) 2014-2016 BlockMen
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
For more details:
|
|
||||||
http://creativecommons.org/licenses/by-sa/3.0/
|
|
160
mods/beds/models/fancy_bed.obj
Executable file
@ -0,0 +1,160 @@
|
|||||||
|
# Blender v2.69 (sub 0) OBJ File: ''
|
||||||
|
# www.blender.org
|
||||||
|
mtllib fancy_bed.mtl
|
||||||
|
o mattress_Mattress_nodebox-6_none.001_fancy_bed.png.001
|
||||||
|
v 0.437500 -0.312500 -0.437501
|
||||||
|
v 0.437500 -0.062500 -0.437501
|
||||||
|
v 0.437500 -0.062500 1.437499
|
||||||
|
v 0.437500 -0.312500 1.437499
|
||||||
|
v -0.437500 -0.312500 -0.437501
|
||||||
|
v -0.437500 -0.312500 1.437499
|
||||||
|
v -0.437500 -0.062500 1.437499
|
||||||
|
v -0.437500 -0.062500 -0.437501
|
||||||
|
v 0.437500 -0.176793 -0.437501
|
||||||
|
v -0.437500 -0.176793 -0.437501
|
||||||
|
vt 0.000171 0.499972
|
||||||
|
vt 0.000161 0.000182
|
||||||
|
vt 0.999791 0.000253
|
||||||
|
vt 0.999873 0.500022
|
||||||
|
vt 0.749576 0.000208
|
||||||
|
vt 0.749876 0.499854
|
||||||
|
vt 0.999848 0.999750
|
||||||
|
vt 0.000152 0.999750
|
||||||
|
vt 0.749276 0.130648
|
||||||
|
vt 0.000112 0.130648
|
||||||
|
g mattress_Mattress_nodebox-6_none.001_fancy_bed.png.001_none.001_fancy_bed.png.001
|
||||||
|
usemtl none.001_fancy_bed.png.001
|
||||||
|
s off
|
||||||
|
f 1/1 2/2 3/3 4/4
|
||||||
|
f 5/2 6/3 7/4 8/1
|
||||||
|
f 4/5 3/2 7/1 6/6
|
||||||
|
f 1/1 4/4 6/7 5/8
|
||||||
|
f 2/1 8/2 7/3 3/4
|
||||||
|
f 8/2 2/5 9/9 10/10
|
||||||
|
o wood_structure_Wood_structure_nodebox-4.001_none.002
|
||||||
|
v 0.374999 -0.375000 1.437499
|
||||||
|
v 0.374999 -0.125000 1.437499
|
||||||
|
v 0.374999 -0.125000 1.499999
|
||||||
|
v 0.374999 -0.375000 1.499999
|
||||||
|
v -0.374999 -0.375000 1.437499
|
||||||
|
v -0.374999 -0.375000 1.499999
|
||||||
|
v -0.374999 -0.125000 1.499999
|
||||||
|
v -0.374999 -0.125000 1.437499
|
||||||
|
v -0.375000 -0.500000 1.437499
|
||||||
|
v -0.375000 0.187500 1.437499
|
||||||
|
v -0.375000 0.187500 1.499999
|
||||||
|
v -0.375000 -0.500000 1.499999
|
||||||
|
v -0.500000 -0.500000 1.437499
|
||||||
|
v -0.500000 -0.500000 1.499999
|
||||||
|
v -0.500000 0.187500 1.499999
|
||||||
|
v -0.500000 0.187500 1.437499
|
||||||
|
v -0.437500 -0.375000 -0.437501
|
||||||
|
v -0.437500 -0.125000 -0.437501
|
||||||
|
v -0.437500 -0.125000 1.437498
|
||||||
|
v -0.437500 -0.375000 1.437498
|
||||||
|
v -0.500000 -0.375000 -0.437501
|
||||||
|
v -0.500000 -0.375000 1.437498
|
||||||
|
v -0.500000 -0.125000 1.437498
|
||||||
|
v -0.500000 -0.125000 -0.437501
|
||||||
|
v 0.375001 -0.000000 1.437499
|
||||||
|
v 0.375001 0.125000 1.437499
|
||||||
|
v 0.375001 0.125000 1.499999
|
||||||
|
v 0.375001 -0.000000 1.499999
|
||||||
|
v -0.375001 -0.000000 1.437499
|
||||||
|
v -0.375001 -0.000000 1.499999
|
||||||
|
v -0.375001 0.125000 1.499999
|
||||||
|
v -0.375001 0.125000 1.437499
|
||||||
|
v 0.500000 -0.500000 1.437499
|
||||||
|
v 0.500000 0.187500 1.437499
|
||||||
|
v 0.500000 0.187500 1.499999
|
||||||
|
v 0.500000 -0.500000 1.499999
|
||||||
|
v 0.375000 -0.500000 1.437499
|
||||||
|
v 0.375000 -0.500000 1.499999
|
||||||
|
v 0.375000 0.187500 1.499999
|
||||||
|
v 0.375000 0.187500 1.437499
|
||||||
|
v 0.500000 -0.375000 -0.437501
|
||||||
|
v 0.500000 -0.125000 -0.437501
|
||||||
|
v 0.500000 -0.125000 1.437499
|
||||||
|
v 0.500000 -0.375000 1.437499
|
||||||
|
v 0.437500 -0.375000 -0.437501
|
||||||
|
v 0.437500 -0.375000 1.437499
|
||||||
|
v 0.437500 -0.125000 1.437499
|
||||||
|
v 0.437500 -0.125000 -0.437501
|
||||||
|
v -0.375000 -0.500000 -0.500000
|
||||||
|
v -0.375000 -0.065000 -0.500000
|
||||||
|
v -0.375000 -0.065000 -0.437500
|
||||||
|
v -0.375000 -0.500000 -0.437500
|
||||||
|
v -0.500000 -0.500000 -0.500000
|
||||||
|
v -0.500000 -0.500000 -0.437500
|
||||||
|
v -0.500000 -0.065000 -0.437500
|
||||||
|
v -0.500000 -0.065000 -0.500000
|
||||||
|
v 0.375006 -0.375000 -0.500000
|
||||||
|
v 0.375006 -0.125000 -0.500000
|
||||||
|
v 0.375006 -0.125000 -0.437500
|
||||||
|
v 0.375006 -0.375000 -0.437500
|
||||||
|
v -0.375006 -0.375000 -0.500000
|
||||||
|
v -0.375006 -0.375000 -0.437500
|
||||||
|
v -0.375006 -0.125000 -0.437500
|
||||||
|
v -0.375006 -0.125000 -0.500000
|
||||||
|
v 0.500000 -0.500000 -0.500000
|
||||||
|
v 0.500000 -0.065000 -0.500000
|
||||||
|
v 0.500000 -0.065000 -0.437500
|
||||||
|
v 0.500000 -0.500000 -0.437500
|
||||||
|
v 0.375000 -0.500000 -0.500000
|
||||||
|
v 0.375000 -0.500000 -0.437500
|
||||||
|
v 0.375000 -0.065000 -0.437500
|
||||||
|
v 0.375000 -0.065000 -0.500000
|
||||||
|
vt 0.377610 0.378205
|
||||||
|
vt 0.622484 0.378175
|
||||||
|
vt 0.622515 0.623120
|
||||||
|
vt 0.377671 0.623151
|
||||||
|
g wood_structure_Wood_structure_nodebox-4.001_none.002_none.002
|
||||||
|
usemtl none.002
|
||||||
|
s off
|
||||||
|
f 59/11 60/12 61/13 62/14
|
||||||
|
f 63/14 64/11 65/12 66/13
|
||||||
|
f 59/11 63/14 66/13 60/12
|
||||||
|
f 62/14 61/13 65/12 64/11
|
||||||
|
f 59/11 62/14 64/13 63/12
|
||||||
|
f 60/12 66/11 65/14 61/13
|
||||||
|
f 67/11 71/12 74/13 68/14
|
||||||
|
f 70/14 69/11 73/12 72/13
|
||||||
|
f 67/11 70/12 72/13 71/14
|
||||||
|
f 68/11 74/12 73/13 69/14
|
||||||
|
f 75/11 76/12 77/13 78/14
|
||||||
|
f 79/14 80/11 81/12 82/13
|
||||||
|
f 75/14 79/11 82/12 76/13
|
||||||
|
f 78/11 77/12 81/13 80/14
|
||||||
|
f 75/11 78/12 80/13 79/14
|
||||||
|
f 76/11 82/12 81/13 77/14
|
||||||
|
g wood_structure_Wood_structure_nodebox-4.001_none.002_none.003
|
||||||
|
usemtl none.003
|
||||||
|
f 15/11 16/12 17/13 18/14
|
||||||
|
f 11/13 15/14 18/11 12/12
|
||||||
|
f 14/14 13/11 17/12 16/13
|
||||||
|
f 11/14 14/11 16/12 15/13
|
||||||
|
f 12/11 18/12 17/13 13/14
|
||||||
|
f 19/11 20/12 21/13 22/14
|
||||||
|
f 23/14 24/11 25/12 26/13
|
||||||
|
f 19/14 23/11 26/12 20/13
|
||||||
|
f 22/11 21/12 25/13 24/14
|
||||||
|
f 19/11 22/12 24/13 23/14
|
||||||
|
f 20/11 26/12 25/13 21/14
|
||||||
|
f 27/14 28/11 29/12 30/13
|
||||||
|
f 31/11 32/12 33/13 34/14
|
||||||
|
f 27/11 30/12 32/13 31/14
|
||||||
|
f 28/14 34/11 33/12 29/13
|
||||||
|
f 35/11 39/12 42/13 36/14
|
||||||
|
f 38/14 37/11 41/12 40/13
|
||||||
|
f 35/14 38/11 40/12 39/13
|
||||||
|
f 36/11 42/12 41/13 37/14
|
||||||
|
f 43/11 44/12 45/13 46/14
|
||||||
|
f 47/14 48/11 49/12 50/13
|
||||||
|
f 43/14 47/11 50/12 44/13
|
||||||
|
f 46/11 45/12 49/13 48/14
|
||||||
|
f 43/11 46/12 48/13 47/14
|
||||||
|
f 44/11 50/12 49/13 45/14
|
||||||
|
f 51/14 52/11 53/12 54/13
|
||||||
|
f 55/13 56/14 57/11 58/12
|
||||||
|
f 51/11 54/12 56/13 55/14
|
||||||
|
f 52/14 58/11 57/12 53/13
|
32
mods/beds/models/simple_bed.obj
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
# Blender v2.69 (sub 0) OBJ File: ''
|
||||||
|
# www.blender.org
|
||||||
|
mtllib simple_bed.mtl
|
||||||
|
o Simple_Bed
|
||||||
|
v 0.500000 -0.500000 -0.500000
|
||||||
|
v 0.500000 0.060000 -0.500000
|
||||||
|
v 0.500000 0.060000 1.500000
|
||||||
|
v 0.500000 -0.500000 1.500000
|
||||||
|
v -0.500000 -0.500000 -0.500000
|
||||||
|
v -0.500000 -0.500000 1.500000
|
||||||
|
v -0.500000 0.060000 1.500000
|
||||||
|
v -0.500000 0.060000 -0.500000
|
||||||
|
vt 0.000112 0.780442
|
||||||
|
vt 0.000110 0.999969
|
||||||
|
vt 0.780324 0.999889
|
||||||
|
vt 0.780377 0.780471
|
||||||
|
vt 0.780636 0.390284
|
||||||
|
vt 0.999906 0.780382
|
||||||
|
vt 0.999906 0.390284
|
||||||
|
vt 0.780636 0.000047
|
||||||
|
vt 0.999906 0.000094
|
||||||
|
vt 0.390235 0.780320
|
||||||
|
vt 0.390235 0.000071
|
||||||
|
vt 0.000142 0.000142
|
||||||
|
usemtl none.002
|
||||||
|
s off
|
||||||
|
f 1/1 2/2 3/3 4/4
|
||||||
|
f 5/1 6/4 7/3 8/2
|
||||||
|
f 1/5 5/4 8/6 2/7
|
||||||
|
f 4/8 3/9 7/7 6/5
|
||||||
|
f 1/8 4/4 6/10 5/11
|
||||||
|
f 2/11 8/12 7/1 3/10
|
21
mods/beds/spawns.lua
Normal file → Executable file
@ -18,8 +18,8 @@ function beds.read_spawns()
|
|||||||
repeat
|
repeat
|
||||||
local x = input:read("*n")
|
local x = input:read("*n")
|
||||||
if x == nil then
|
if x == nil then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
local y = input:read("*n")
|
local y = input:read("*n")
|
||||||
local z = input:read("*n")
|
local z = input:read("*n")
|
||||||
local name = input:read("*l")
|
local name = input:read("*l")
|
||||||
@ -32,21 +32,19 @@ function beds.read_spawns()
|
|||||||
beds.save_spawns()
|
beds.save_spawns()
|
||||||
os.rename(file, file .. ".backup")
|
os.rename(file, file .. ".backup")
|
||||||
file = org_file
|
file = org_file
|
||||||
|
else
|
||||||
|
spawns = {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
beds.read_spawns()
|
|
||||||
|
|
||||||
function beds.save_spawns()
|
function beds.save_spawns()
|
||||||
if not beds.spawn then
|
if not beds.spawn then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local data = {}
|
|
||||||
local output = io.open(org_file, "w")
|
local output = io.open(org_file, "w")
|
||||||
for k, v in pairs(beds.spawn) do
|
for i, v in pairs(beds.spawn) do
|
||||||
table.insert(data, string.format("%.1f %.1f %.1f %s\n", v.x, v.y, v.z, k))
|
output:write(v.x.." "..v.y.." "..v.z.." "..i.."\n")
|
||||||
end
|
end
|
||||||
output:write(table.concat(data))
|
|
||||||
io.close(output)
|
io.close(output)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -54,10 +52,9 @@ function beds.set_spawns()
|
|||||||
for name,_ in pairs(beds.player) do
|
for name,_ in pairs(beds.player) do
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
local p = player:getpos()
|
local p = player:getpos()
|
||||||
-- but don't change spawn location if borrowing a bed
|
beds.spawn[name] = p
|
||||||
if not minetest.is_protected(p, name) then
|
|
||||||
beds.spawn[name] = p
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
beds.save_spawns()
|
beds.save_spawns()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
beds.read_spawns()
|
||||||
|
BIN
mods/beds/textures/beds_bed_black.png
Executable file
After Width: | Height: | Size: 429 B |
BIN
mods/beds/textures/beds_bed_blue.png
Executable file
After Width: | Height: | Size: 545 B |
BIN
mods/beds/textures/beds_bed_fancy_black.png
Executable file
After Width: | Height: | Size: 432 B |
BIN
mods/beds/textures/beds_bed_fancy_blue.png
Executable file
After Width: | Height: | Size: 545 B |
BIN
mods/beds/textures/beds_bed_fancy_green.png
Executable file
After Width: | Height: | Size: 521 B |
0
mods/beds/textures/beds_bed_fancy.png → mods/beds/textures/beds_bed_fancy_red.png
Normal file → Executable file
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 537 B |
BIN
mods/beds/textures/beds_bed_fancy_white.png
Executable file
After Width: | Height: | Size: 540 B |
BIN
mods/beds/textures/beds_bed_foot_black.png
Executable file
After Width: | Height: | Size: 366 B |
BIN
mods/beds/textures/beds_bed_foot_blue.png
Executable file
After Width: | Height: | Size: 416 B |
BIN
mods/beds/textures/beds_bed_foot_green.png
Executable file
After Width: | Height: | Size: 400 B |
0
mods/beds/textures/beds_bed_foot.png → mods/beds/textures/beds_bed_foot_red.png
Normal file → Executable file
Before Width: | Height: | Size: 390 B After Width: | Height: | Size: 390 B |
BIN
mods/beds/textures/beds_bed_foot_white.png
Executable file
After Width: | Height: | Size: 408 B |
BIN
mods/beds/textures/beds_bed_green.png
Executable file
After Width: | Height: | Size: 523 B |
BIN
mods/beds/textures/beds_bed_head.png
Normal file → Executable file
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 347 B |
0
mods/beds/textures/beds_bed.png → mods/beds/textures/beds_bed_red.png
Normal file → Executable file
Before Width: | Height: | Size: 540 B After Width: | Height: | Size: 540 B |
Before Width: | Height: | Size: 296 B |
BIN
mods/beds/textures/beds_bed_side1_black.png
Executable file
After Width: | Height: | Size: 274 B |
BIN
mods/beds/textures/beds_bed_side1_blue.png
Executable file
After Width: | Height: | Size: 308 B |
BIN
mods/beds/textures/beds_bed_side1_green.png
Executable file
After Width: | Height: | Size: 299 B |
BIN
mods/beds/textures/beds_bed_side1_red.png
Executable file
After Width: | Height: | Size: 271 B |
BIN
mods/beds/textures/beds_bed_side1_white.png
Executable file
After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 316 B |
BIN
mods/beds/textures/beds_bed_side2_black.png
Executable file
After Width: | Height: | Size: 317 B |
BIN
mods/beds/textures/beds_bed_side2_blue.png
Executable file
After Width: | Height: | Size: 331 B |
BIN
mods/beds/textures/beds_bed_side2_green.png
Executable file
After Width: | Height: | Size: 326 B |
BIN
mods/beds/textures/beds_bed_side2_red.png
Executable file
After Width: | Height: | Size: 283 B |
BIN
mods/beds/textures/beds_bed_side2_white.png
Executable file
After Width: | Height: | Size: 326 B |
Before Width: | Height: | Size: 561 B |
BIN
mods/beds/textures/beds_bed_side_bottom_black.png
Executable file
After Width: | Height: | Size: 358 B |
BIN
mods/beds/textures/beds_bed_side_bottom_blue.png
Executable file
After Width: | Height: | Size: 456 B |
BIN
mods/beds/textures/beds_bed_side_bottom_green.png
Executable file
After Width: | Height: | Size: 427 B |
BIN
mods/beds/textures/beds_bed_side_bottom_r_black.png
Executable file
After Width: | Height: | Size: 343 B |
BIN
mods/beds/textures/beds_bed_side_bottom_r_blue.png
Executable file
After Width: | Height: | Size: 456 B |
BIN
mods/beds/textures/beds_bed_side_bottom_r_green.png
Executable file
After Width: | Height: | Size: 422 B |
0
mods/beds/textures/beds_bed_side_bottom_r.png → mods/beds/textures/beds_bed_side_bottom_r_red.png
Normal file → Executable file
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 537 B |
BIN
mods/beds/textures/beds_bed_side_bottom_r_white.png
Executable file
After Width: | Height: | Size: 434 B |
BIN
mods/beds/textures/beds_bed_side_bottom_red.png
Executable file
After Width: | Height: | Size: 523 B |
BIN
mods/beds/textures/beds_bed_side_bottom_white.png
Executable file
After Width: | Height: | Size: 439 B |
BIN
mods/beds/textures/beds_bed_side_top.png
Normal file → Executable file
Before Width: | Height: | Size: 611 B After Width: | Height: | Size: 574 B |
Before Width: | Height: | Size: 596 B |
BIN
mods/beds/textures/beds_bed_side_top_r_black.png
Executable file
After Width: | Height: | Size: 429 B |
BIN
mods/beds/textures/beds_bed_side_top_r_blue.png
Executable file
After Width: | Height: | Size: 478 B |
BIN
mods/beds/textures/beds_bed_side_top_r_green.png
Executable file
After Width: | Height: | Size: 463 B |
BIN
mods/beds/textures/beds_bed_side_top_r_red.png
Executable file
After Width: | Height: | Size: 560 B |
BIN
mods/beds/textures/beds_bed_side_top_r_white.png
Executable file
After Width: | Height: | Size: 460 B |
Before Width: | Height: | Size: 583 B |
BIN
mods/beds/textures/beds_bed_top1_black.png
Executable file
After Width: | Height: | Size: 241 B |
BIN
mods/beds/textures/beds_bed_top1_blue.png
Executable file
After Width: | Height: | Size: 494 B |
BIN
mods/beds/textures/beds_bed_top1_green.png
Executable file
After Width: | Height: | Size: 448 B |
BIN
mods/beds/textures/beds_bed_top1_red.png
Executable file
After Width: | Height: | Size: 548 B |
BIN
mods/beds/textures/beds_bed_top1_white.png
Executable file
After Width: | Height: | Size: 478 B |
BIN
mods/beds/textures/beds_bed_top2_black.png
Executable file
After Width: | Height: | Size: 465 B |
BIN
mods/beds/textures/beds_bed_top2_blue.png
Executable file
After Width: | Height: | Size: 609 B |
BIN
mods/beds/textures/beds_bed_top2_green.png
Executable file
After Width: | Height: | Size: 586 B |
0
mods/beds/textures/beds_bed_top2.png → mods/beds/textures/beds_bed_top2_red.png
Normal file → Executable file
Before Width: | Height: | Size: 616 B After Width: | Height: | Size: 616 B |
BIN
mods/beds/textures/beds_bed_top2_white.png
Executable file
After Width: | Height: | Size: 573 B |
BIN
mods/beds/textures/beds_bed_top_bottom_black.png
Executable file
After Width: | Height: | Size: 126 B |
BIN
mods/beds/textures/beds_bed_top_bottom_blue.png
Executable file
After Width: | Height: | Size: 434 B |
BIN
mods/beds/textures/beds_bed_top_bottom_green.png
Executable file
After Width: | Height: | Size: 343 B |
0
mods/beds/textures/beds_bed_top_bottom.png → mods/beds/textures/beds_bed_top_bottom_red.png
Normal file → Executable file
Before Width: | Height: | Size: 495 B After Width: | Height: | Size: 495 B |
BIN
mods/beds/textures/beds_bed_top_bottom_white.png
Executable file
After Width: | Height: | Size: 339 B |
BIN
mods/beds/textures/beds_bed_top_top_black.png
Executable file
After Width: | Height: | Size: 376 B |
BIN
mods/beds/textures/beds_bed_top_top_blue.png
Executable file
After Width: | Height: | Size: 568 B |
BIN
mods/beds/textures/beds_bed_top_top_green.png
Executable file
After Width: | Height: | Size: 525 B |
0
mods/beds/textures/beds_bed_top_top.png → mods/beds/textures/beds_bed_top_top_red.png
Normal file → Executable file
Before Width: | Height: | Size: 556 B After Width: | Height: | Size: 556 B |
BIN
mods/beds/textures/beds_bed_top_top_white.png
Executable file
After Width: | Height: | Size: 480 B |
BIN
mods/beds/textures/beds_bed_white.png
Executable file
After Width: | Height: | Size: 525 B |
BIN
mods/beds/textures/beds_transparent.png
Normal file → Executable file
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 96 B |
BIN
mods/beds/textures/fancy_bed_black.png
Executable file
After Width: | Height: | Size: 705 B |
BIN
mods/beds/textures/fancy_bed_blue.png
Executable file
After Width: | Height: | Size: 1.0 KiB |
BIN
mods/beds/textures/fancy_bed_green.png
Executable file
After Width: | Height: | Size: 969 B |
BIN
mods/beds/textures/fancy_bed_red.png
Executable file
After Width: | Height: | Size: 552 B |
BIN
mods/beds/textures/fancy_bed_white.png
Executable file
After Width: | Height: | Size: 1.0 KiB |
BIN
mods/beds/textures/simple_bed_black.png
Executable file
After Width: | Height: | Size: 1.7 KiB |
BIN
mods/beds/textures/simple_bed_blue.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
mods/beds/textures/simple_bed_green.png
Executable file
After Width: | Height: | Size: 2.1 KiB |
BIN
mods/beds/textures/simple_bed_red.png
Executable file
After Width: | Height: | Size: 1.1 KiB |