Compare commits
No commits in common. "master" and "0.4.6" have entirely different histories.
13
.github/workflows/luacheck.yml
vendored
|
@ -1,13 +0,0 @@
|
|||
name: luacheck
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
luacheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Luacheck
|
||||
uses: lunarmodules/luacheck@master
|
||||
with:
|
||||
args: mods
|
11
.github/workflows/test.yml
vendored
|
@ -1,11 +0,0 @@
|
|||
name: test
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- run: ./utils/test/run.sh
|
25
.gitignore
vendored
|
@ -1,22 +1,7 @@
|
|||
## Files related to minetest development cycle
|
||||
/*.patch
|
||||
# GNU Patch reject file
|
||||
*.rej
|
||||
|
||||
## Editors and Development environments
|
||||
## Generic ignorable patterns and files
|
||||
*~
|
||||
*.swp
|
||||
*.bak*
|
||||
*.orig
|
||||
# Vim
|
||||
.*.swp
|
||||
*bak*
|
||||
tags
|
||||
*.vim
|
||||
# Kate
|
||||
.*.kate-swp
|
||||
.swp.*
|
||||
# Eclipse (LDT)
|
||||
.project
|
||||
.settings/
|
||||
.buildpath
|
||||
.metadata
|
||||
# Idea IDE
|
||||
.idea/*
|
||||
|
||||
|
|
31
.luacheckrc
|
@ -1,31 +0,0 @@
|
|||
unused_args = false
|
||||
allow_defined_top = true
|
||||
|
||||
globals = {
|
||||
"default"
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
"DIR_DELIM",
|
||||
"minetest",
|
||||
"dump",
|
||||
"vector",
|
||||
"VoxelManip", "VoxelArea",
|
||||
"PseudoRandom", "PcgRandom",
|
||||
"ItemStack",
|
||||
"Settings",
|
||||
"unpack",
|
||||
-- Silence errors about custom table methods.
|
||||
table = { fields = { "copy", "indexof" } },
|
||||
-- Silence warnings about accessing undefined fields of global 'math'
|
||||
math = { fields = { "sign" } }
|
||||
}
|
||||
|
||||
-- Overwrites minetest.handle_node_drops
|
||||
files["mods/creative/init.lua"].globals = { "minetest" }
|
||||
|
||||
-- Overwrites minetest.calculate_knockback
|
||||
files["mods/player_api/api.lua"].globals = { "minetest" }
|
||||
|
||||
-- Don't report on legacy definitions of globals.
|
||||
files["mods/default/legacy.lua"].global = false
|
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!
|
46
README.md
|
@ -1,46 +0,0 @@
|
|||
# Minetest Game
|
||||
|
||||
[![ContentDB](https://content.minetest.net/packages/Minetest/minetest_game/shields/title/)](https://content.minetest.net/packages/Minetest/minetest_game/)
|
||||
|
||||
Minetest Game (abbreviated MTG) is a simple and peaceful sandbox game, with no
|
||||
real goals or built-in enemy mobs.
|
||||
|
||||
While it provides a basic gameplay experience out of the box, it is best played
|
||||
with mods.
|
||||
|
||||
Minetest Game is in perpetual maintenance-only mode, meaning it will not see new
|
||||
gameplay features or anything else that breaks compatibility (see
|
||||
[#2710](https://github.com/minetest/minetest_game/issues/2710)).
|
||||
|
||||
## Installation
|
||||
|
||||
### ContentDB
|
||||
|
||||
* Content > Browse Online Content
|
||||
* Search for "[Minetest Game](https://content.minetest.net/packages/Minetest/minetest_game/)"
|
||||
* Click Install
|
||||
|
||||
### Manually
|
||||
|
||||
- Unzip the archive, rename the folder to `minetest_game` and
|
||||
place it in `.../minetest/games/`
|
||||
|
||||
- GNU/Linux: If you use a system-wide installation place it in `~/.minetest/games/`.
|
||||
|
||||
The Minetest engine can be found at [GitHub](https://github.com/minetest/minetest).
|
||||
|
||||
For further information or help, see: [Installing Mods](https://wiki.minetest.net/Installing_Mods).
|
||||
|
||||
## Compatibility
|
||||
|
||||
As of January 2024 Minetest Game follows a **rolling release** model with new changes being automatically
|
||||
published on ContentDB every day.
|
||||
|
||||
There are no stable releases or tags, all existing ones are considered legacy.
|
||||
|
||||
Minetest Game is always compatible to the latest stable release of the engine.
|
||||
Older releases may be supported too depending on circumstances.
|
||||
|
||||
## Licensing
|
||||
|
||||
See `LICENSE.txt`
|
50
README.txt
Normal file
|
@ -0,0 +1,50 @@
|
|||
The main game for the Minetest game engine [minetest_game]
|
||||
==========================================================
|
||||
|
||||
To build the wholeness of the Minetest project, insert this repository as
|
||||
/games/minetest_game
|
||||
in the Minetest Engine.
|
||||
|
||||
The Minetest Engine can be found in:
|
||||
https://github.com/minetest/minetest/
|
||||
|
||||
Compatibility
|
||||
--------------
|
||||
The minetest_game github master HEAD is generally compatible with the github
|
||||
master HEAD of minetest.
|
||||
|
||||
Additionally, when the minetest engine is tagged to be a certain version (eg.
|
||||
0.4.dev-20120326), minetest_game is tagged with the version too.
|
||||
|
||||
When stable releases are made, minetest_game is packaged and made available in
|
||||
http://minetest.net/download.php
|
||||
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!)
|
||||
|
||||
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.
|
||||
|
||||
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/
|
||||
|
|
@ -1,4 +1,2 @@
|
|||
title = Minetest Game
|
||||
author = Minetest
|
||||
description = A basic exploration, mining, crafting, and building, sandbox game with no NPCs, monsters, or animals. Minetest Game is usually used with mods added, and many mods are available for this game. Reliably maintained by Minetest Engine core developers.
|
||||
min_minetest_version = 5.8
|
||||
name = Minetest
|
||||
common_mods = default, bucket, creative, doors, dye, fire, stairs, vessels, wool
|
||||
|
|
1233
game_api.txt
BIN
menu/header.png
Before Width: | Height: | Size: 935 B |
BIN
menu/icon.png
Before Width: | Height: | Size: 2.9 KiB |
|
@ -1,81 +0,0 @@
|
|||
# This file contains settings of Minetest Game that can be changed in
|
||||
# minetest.conf.
|
||||
# By default, all the settings are commented and not functional.
|
||||
# Uncomment settings by removing the preceding #.
|
||||
|
||||
# Whether creative mode (fast digging of all blocks, unlimited resources) should
|
||||
# be enabled.
|
||||
#creative_mode = false
|
||||
|
||||
# Sets the behaviour of the inventory items when a player dies.
|
||||
# bones: Store items in a bone node but drop items if inside protected area.
|
||||
# drop: Drop items on the ground.
|
||||
# keep: Player keeps items.
|
||||
#bones_mode = bones
|
||||
|
||||
# The time in seconds after which the bones of a dead player can be looted by
|
||||
# everyone.
|
||||
# 0 to disable.
|
||||
#share_bones_time = 1200
|
||||
|
||||
# How much earlier the bones of a dead player can be looted by
|
||||
# everyone if the player dies in a protected area they don't own.
|
||||
# 0 to disable. By default it is "share_bones_time" divide by four.
|
||||
#share_bones_time_early = 300
|
||||
|
||||
# Inform player of condition and location of new bones.
|
||||
#bones_position_message = false
|
||||
|
||||
# Whether fire should be enabled. If disabled, 'basic_flame' nodes will
|
||||
# disappear.
|
||||
# 'permanent_flame' nodes will remain with either setting.
|
||||
#enable_fire = true
|
||||
|
||||
# Enable flame sound.
|
||||
#flame_sound = true
|
||||
|
||||
# Whether lavacooling should be enabled.
|
||||
#enable_lavacooling = true
|
||||
|
||||
# Whether the stuff in initial_stuff should be given to new players.
|
||||
#give_initial_stuff = false
|
||||
#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,
|
||||
default:torch 99,default:cobble 99
|
||||
|
||||
# Whether the TNT mod should be enabled.
|
||||
#enable_tnt = <true in singleplayer, false in multiplayer>
|
||||
|
||||
# The radius of a TNT explosion.
|
||||
#tnt_radius = 3
|
||||
|
||||
# Enable the stairs mod ABM that replaces the old 'upside down'
|
||||
# stair and slab nodes in old maps with the new param2 versions.
|
||||
#enable_stairs_replace_abm = false
|
||||
|
||||
# Whether to allow respawning in beds.
|
||||
# Default value is true.
|
||||
#enable_bed_respawn = true
|
||||
|
||||
# Whether players can skip night by sleeping.
|
||||
# Default value is true.
|
||||
#enable_bed_night_skip = true
|
||||
|
||||
# If enabled, fences and walls cannot be jumped over.
|
||||
#enable_fence_tall = false
|
||||
|
||||
# Whether the engine's spawn search, which does not check for a suitable
|
||||
# starting biome, is used.
|
||||
# Default value is false.
|
||||
#engine_spawn = false
|
||||
|
||||
# Whether river water source nodes create flowing sounds.
|
||||
# Helps rivers create more sound, especially on level sections.
|
||||
#river_source_sounds = false
|
||||
|
||||
# If enabled, the 'weather' mod will control cloud parameters, shadow intensity,
|
||||
# bloom and volumetric lighting.
|
||||
# Non-functional in V6 or Singlenode mapgens.
|
||||
#enable_weather = true
|
||||
|
||||
# If enabled, non-player actions are logged
|
||||
#log_non_player_actions = false
|
|
@ -1,30 +0,0 @@
|
|||
Minetest Game mod: beds
|
||||
=======================
|
||||
See license.txt for license information.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
Originally by BlockMen (MIT)
|
||||
Various Minetest developers and contributors (MIT)
|
||||
|
||||
Authors of media (textures)
|
||||
---------------------------
|
||||
BlockMen (CC BY-SA 3.0)
|
||||
All textures unless otherwise noted
|
||||
|
||||
TumeniNodes (CC BY-SA 3.0)
|
||||
beds_bed_under.png
|
||||
|
||||
This mod adds a bed to Minetest which allows players to skip the night.
|
||||
To sleep, right click on the bed. If playing in singleplayer mode the night gets skipped
|
||||
immediately. If playing multiplayer you get shown how many other players are in bed too,
|
||||
if all players are sleeping the night gets skipped. The night skip can be forced if more
|
||||
than half of the players are lying in bed and use this option.
|
||||
|
||||
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
|
||||
death.
|
||||
You can disable the respawn at beds by setting "enable_bed_respawn = false" in
|
||||
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.
|
|
@ -1,186 +0,0 @@
|
|||
-- Removes a node without calling on on_destruct()
|
||||
-- We use this to mess with bed nodes without causing unwanted recursion.
|
||||
local function remove_no_destruct(pos)
|
||||
minetest.swap_node(pos, {name = "air"})
|
||||
minetest.remove_node(pos) -- Now clear the meta
|
||||
minetest.check_for_falling(pos)
|
||||
end
|
||||
|
||||
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
|
||||
local oname = minetest.get_node(other).name
|
||||
if minetest.get_item_group(oname, "bed") ~= 0 then
|
||||
remove_no_destruct(other)
|
||||
beds.remove_spawns_at(pos)
|
||||
beds.remove_spawns_at(other)
|
||||
end
|
||||
end
|
||||
|
||||
function beds.register_bed(name, def)
|
||||
minetest.register_node(name .. "_bottom", {
|
||||
description = def.description,
|
||||
inventory_image = def.inventory_image,
|
||||
wield_image = def.wield_image,
|
||||
drawtype = "nodebox",
|
||||
tiles = def.tiles.bottom,
|
||||
use_texture_alpha = "clip",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
stack_max = 1,
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1},
|
||||
sounds = def.sounds or default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = def.nodebox.bottom,
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = def.selectionbox,
|
||||
},
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local under = pointed_thing.under
|
||||
local node = minetest.get_node(under)
|
||||
local udef = minetest.registered_nodes[node.name]
|
||||
if udef and udef.on_rightclick and
|
||||
not (placer and placer:is_player() and
|
||||
placer:get_player_control().sneak) then
|
||||
return udef.on_rightclick(under, node, placer, itemstack,
|
||||
pointed_thing) or itemstack
|
||||
end
|
||||
|
||||
local pos
|
||||
if udef and udef.buildable_to then
|
||||
pos = under
|
||||
else
|
||||
pos = pointed_thing.above
|
||||
end
|
||||
|
||||
local player_name = placer and placer:get_player_name() or ""
|
||||
|
||||
if minetest.is_protected(pos, player_name) and
|
||||
not minetest.check_player_privs(player_name, "protection_bypass") then
|
||||
minetest.record_protection_violation(pos, 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 = placer and placer:get_look_dir() and
|
||||
minetest.dir_to_facedir(placer:get_look_dir()) or 0
|
||||
local botpos = vector.add(pos, minetest.facedir_to_dir(dir))
|
||||
|
||||
if minetest.is_protected(botpos, player_name) and
|
||||
not minetest.check_player_privs(player_name, "protection_bypass") then
|
||||
minetest.record_protection_violation(botpos, 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 minetest.is_creative_enabled(player_name) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
|
||||
on_destruct = function(pos)
|
||||
destruct_bed(pos, 1)
|
||||
end,
|
||||
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
beds.on_rightclick(pos, clicker)
|
||||
return itemstack
|
||||
end,
|
||||
|
||||
on_rotate = function(pos, node, user, _, new_param2)
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
-- old position of the top node
|
||||
local p = vector.add(pos, dir)
|
||||
local node2 = minetest.get_node_or_nil(p)
|
||||
if not node2 or minetest.get_item_group(node2.name, "bed") ~= 2 or
|
||||
node.param2 ~= node2.param2 then
|
||||
return false
|
||||
end
|
||||
if minetest.is_protected(p, user:get_player_name()) then
|
||||
minetest.record_protection_violation(p, user:get_player_name())
|
||||
return false
|
||||
end
|
||||
if new_param2 % 32 > 3 then
|
||||
return false
|
||||
end
|
||||
-- new position of the top node
|
||||
local newp = vector.add(pos, minetest.facedir_to_dir(new_param2))
|
||||
local node3 = minetest.get_node_or_nil(newp)
|
||||
local node_def = node3 and minetest.registered_nodes[node3.name]
|
||||
if not node_def or not node_def.buildable_to then
|
||||
return false
|
||||
end
|
||||
if minetest.is_protected(newp, user:get_player_name()) then
|
||||
minetest.record_protection_violation(newp, user:get_player_name())
|
||||
return false
|
||||
end
|
||||
node.param2 = new_param2
|
||||
remove_no_destruct(p)
|
||||
minetest.set_node(pos, node)
|
||||
minetest.set_node(newp, {name = name .. "_top", param2 = new_param2})
|
||||
return true
|
||||
end,
|
||||
can_dig = function(pos, player)
|
||||
return beds.can_dig(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node(name .. "_top", {
|
||||
drawtype = "nodebox",
|
||||
tiles = def.tiles.top,
|
||||
use_texture_alpha = "clip",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
pointable = false,
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2,
|
||||
not_in_creative_inventory = 1},
|
||||
sounds = def.sounds or default.node_sound_wood_defaults(),
|
||||
drop = name .. "_bottom",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = def.nodebox.top,
|
||||
},
|
||||
on_destruct = function(pos)
|
||||
destruct_bed(pos, 2)
|
||||
end,
|
||||
can_dig = function(pos, player)
|
||||
local node = minetest.get_node(pos)
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
local p = vector.add(pos, dir)
|
||||
return beds.can_dig(p)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_alias(name, name .. "_bottom")
|
||||
|
||||
minetest.register_craft({
|
||||
output = name,
|
||||
recipe = def.recipe
|
||||
})
|
||||
end
|
|
@ -1,109 +0,0 @@
|
|||
-- beds/beds.lua
|
||||
|
||||
-- support for MT game translation.
|
||||
local S = beds.get_translator
|
||||
|
||||
-- Fancy shaped bed
|
||||
|
||||
beds.register_bed("beds:fancy_bed", {
|
||||
description = S("Fancy Bed"),
|
||||
inventory_image = "beds_bed_fancy.png",
|
||||
wield_image = "beds_bed_fancy.png",
|
||||
tiles = {
|
||||
bottom = {
|
||||
"beds_bed_top1.png",
|
||||
"beds_bed_under.png",
|
||||
"beds_bed_side1.png",
|
||||
"beds_bed_side1.png^[transformFX",
|
||||
"beds_bed_foot.png",
|
||||
"beds_bed_foot.png",
|
||||
},
|
||||
top = {
|
||||
"beds_bed_top2.png",
|
||||
"beds_bed_under.png",
|
||||
"beds_bed_side2.png",
|
||||
"beds_bed_side2.png^[transformFX",
|
||||
"beds_bed_head.png",
|
||||
"beds_bed_head.png",
|
||||
}
|
||||
},
|
||||
nodebox = {
|
||||
bottom = {
|
||||
{-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.5, -0.375, -0.5, 0.5, -0.125, -0.4375},
|
||||
{-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.3125, -0.4375, 0.4375, -0.0625, 0.5},
|
||||
},
|
||||
top = {
|
||||
{-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.5, 0, 0.4375, 0.5, 0.125, 0.5},
|
||||
{-0.5, -0.375, 0.4375, 0.5, -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.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:white", "wool:white", "wool:white"},
|
||||
{"group:wood", "group:wood", "group:wood"},
|
||||
},
|
||||
})
|
||||
|
||||
-- Simple shaped bed
|
||||
|
||||
beds.register_bed("beds:bed", {
|
||||
description = S("Simple Bed"),
|
||||
inventory_image = "beds_bed.png",
|
||||
wield_image = "beds_bed.png",
|
||||
tiles = {
|
||||
bottom = {
|
||||
"beds_bed_top_bottom.png^[transformR90",
|
||||
"beds_bed_under.png",
|
||||
"beds_bed_side_bottom_r.png",
|
||||
"beds_bed_side_bottom_r.png^[transformFX",
|
||||
"blank.png",
|
||||
"beds_bed_side_bottom.png"
|
||||
},
|
||||
top = {
|
||||
"beds_bed_top_top.png^[transformR90",
|
||||
"beds_bed_under.png",
|
||||
"beds_bed_side_top_r.png",
|
||||
"beds_bed_side_top_r.png^[transformFX",
|
||||
"beds_bed_side_top.png",
|
||||
"blank.png",
|
||||
}
|
||||
},
|
||||
nodebox = {
|
||||
bottom = {-0.5, -0.5, -0.5, 0.5, 0.0625, 0.5},
|
||||
top = {-0.5, -0.5, -0.5, 0.5, 0.0625, 0.5},
|
||||
},
|
||||
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.0625, 1.5},
|
||||
recipe = {
|
||||
{"wool:white", "wool:white", "wool:white"},
|
||||
{"group:wood", "group:wood", "group:wood"}
|
||||
},
|
||||
})
|
||||
|
||||
-- Aliases for PilzAdam's beds mod
|
||||
|
||||
minetest.register_alias("beds:bed_bottom_red", "beds:bed_bottom")
|
||||
minetest.register_alias("beds:bed_top_red", "beds:bed_top")
|
||||
|
||||
-- Fuel
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "beds:fancy_bed_bottom",
|
||||
burntime = 13,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "beds:bed_bottom",
|
||||
burntime = 12,
|
||||
})
|
|
@ -1,304 +0,0 @@
|
|||
local pi = math.pi
|
||||
local is_sp = minetest.is_singleplayer()
|
||||
local enable_respawn = minetest.settings:get_bool("enable_bed_respawn")
|
||||
if enable_respawn == nil then
|
||||
enable_respawn = true
|
||||
end
|
||||
|
||||
-- support for MT game translation.
|
||||
local S = beds.get_translator
|
||||
|
||||
-- Helper functions
|
||||
|
||||
local function get_look_yaw(pos)
|
||||
local rotation = minetest.get_node(pos).param2
|
||||
if rotation > 3 then
|
||||
rotation = rotation % 4 -- Mask colorfacedir values
|
||||
end
|
||||
if rotation == 1 then
|
||||
return pi / 2, rotation
|
||||
elseif rotation == 3 then
|
||||
return -pi / 2, rotation
|
||||
elseif rotation == 0 then
|
||||
return pi, rotation
|
||||
else
|
||||
return 0, rotation
|
||||
end
|
||||
end
|
||||
|
||||
local function is_night_skip_enabled()
|
||||
local enable_night_skip = minetest.settings:get_bool("enable_bed_night_skip")
|
||||
if enable_night_skip == nil then
|
||||
enable_night_skip = true
|
||||
end
|
||||
return enable_night_skip
|
||||
end
|
||||
|
||||
local function check_in_beds(players)
|
||||
local in_bed = beds.player
|
||||
if not players then
|
||||
players = minetest.get_connected_players()
|
||||
end
|
||||
|
||||
for n, player in ipairs(players) do
|
||||
local name = player:get_player_name()
|
||||
if not in_bed[name] then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return #players > 0
|
||||
end
|
||||
|
||||
local function lay_down(player, pos, bed_pos, state, skip)
|
||||
local name = player:get_player_name()
|
||||
local hud_flags = player:hud_get_flags()
|
||||
|
||||
if not player or not name then
|
||||
return
|
||||
end
|
||||
|
||||
-- stand up
|
||||
if state ~= nil and not state then
|
||||
if not beds.player[name] then
|
||||
-- player not in bed, do nothing
|
||||
return false
|
||||
end
|
||||
beds.bed_position[name] = nil
|
||||
-- skip here to prevent sending player specific changes (used for leaving players)
|
||||
if skip then
|
||||
return
|
||||
end
|
||||
player:set_pos(beds.pos[name])
|
||||
|
||||
-- physics, eye_offset, etc
|
||||
local physics_override = beds.player[name].physics_override
|
||||
beds.player[name] = nil
|
||||
player:set_physics_override({
|
||||
speed = physics_override.speed,
|
||||
jump = physics_override.jump,
|
||||
gravity = physics_override.gravity
|
||||
})
|
||||
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_api.player_attached[name] = false
|
||||
hud_flags.wielditem = true
|
||||
player_api.set_animation(player, "stand" , 30)
|
||||
|
||||
-- lay down
|
||||
else
|
||||
|
||||
-- Check if bed is occupied
|
||||
for _, other_pos in pairs(beds.bed_position) do
|
||||
if vector.distance(bed_pos, other_pos) < 0.1 then
|
||||
minetest.chat_send_player(name, S("This bed is already occupied!"))
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- Check if player is moving
|
||||
if vector.length(player:get_velocity()) > 0.001 then
|
||||
minetest.chat_send_player(name, S("You have to stop moving before going to bed!"))
|
||||
return false
|
||||
end
|
||||
|
||||
-- Check if player is attached to an object
|
||||
if player:get_attach() then
|
||||
return false
|
||||
end
|
||||
|
||||
if beds.player[name] then
|
||||
-- player already in bed, do nothing
|
||||
return false
|
||||
end
|
||||
|
||||
beds.pos[name] = pos
|
||||
beds.bed_position[name] = bed_pos
|
||||
beds.player[name] = {physics_override = player:get_physics_override()}
|
||||
|
||||
local yaw, param2 = get_look_yaw(bed_pos)
|
||||
player:set_look_horizontal(yaw)
|
||||
local dir = minetest.facedir_to_dir(param2)
|
||||
-- p.y is just above the nodebox height of the 'Simple Bed' (the highest bed),
|
||||
-- to avoid sinking down through the bed.
|
||||
local p = {
|
||||
x = bed_pos.x + dir.x / 2,
|
||||
y = bed_pos.y + 0.07,
|
||||
z = bed_pos.z + dir.z / 2
|
||||
}
|
||||
player:set_physics_override({speed = 0, jump = 0, gravity = 0})
|
||||
player:set_pos(p)
|
||||
player_api.player_attached[name] = true
|
||||
hud_flags.wielditem = false
|
||||
player_api.set_animation(player, "lay" , 0)
|
||||
end
|
||||
|
||||
player:hud_set_flags(hud_flags)
|
||||
end
|
||||
|
||||
local function get_player_in_bed_count()
|
||||
local c = 0
|
||||
for _, _ in pairs(beds.player) do
|
||||
c = c + 1
|
||||
end
|
||||
return c
|
||||
end
|
||||
|
||||
local function update_formspecs(finished)
|
||||
local ges = #minetest.get_connected_players()
|
||||
local player_in_bed = get_player_in_bed_count()
|
||||
local is_majority = (ges / 2) < player_in_bed
|
||||
|
||||
local form_n
|
||||
local esc = minetest.formspec_escape
|
||||
if finished then
|
||||
form_n = beds.formspec .. "label[2.7,9;" .. esc(S("Good morning.")) .. "]"
|
||||
else
|
||||
form_n = beds.formspec .. "label[2.2,9;" ..
|
||||
esc(S("@1 of @2 players are in bed", player_in_bed, ges)) .. "]"
|
||||
if is_majority and is_night_skip_enabled() then
|
||||
form_n = form_n .. "button_exit[2,6;4,0.75;force;" ..
|
||||
esc(S("Force night skip")) .. "]"
|
||||
end
|
||||
end
|
||||
|
||||
for name,_ in pairs(beds.player) do
|
||||
minetest.show_formspec(name, "beds_form", form_n)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Public functions
|
||||
|
||||
function beds.kick_players()
|
||||
for name, _ in pairs(beds.player) do
|
||||
local player = minetest.get_player_by_name(name)
|
||||
lay_down(player, nil, nil, false)
|
||||
end
|
||||
end
|
||||
|
||||
function beds.skip_night()
|
||||
minetest.set_timeofday(0.23)
|
||||
end
|
||||
|
||||
local update_scheduled = false
|
||||
local function schedule_update()
|
||||
if update_scheduled then
|
||||
-- there already is an update scheduled; don't schedule more to prevent races
|
||||
return
|
||||
end
|
||||
update_scheduled = true
|
||||
minetest.after(2, function()
|
||||
update_scheduled = false
|
||||
if not is_sp then
|
||||
update_formspecs(is_night_skip_enabled())
|
||||
end
|
||||
if is_night_skip_enabled() then
|
||||
-- skip the night and let all players stand up
|
||||
beds.skip_night()
|
||||
beds.kick_players()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function beds.on_rightclick(pos, player)
|
||||
local name = player:get_player_name()
|
||||
local ppos = player:get_pos()
|
||||
local tod = minetest.get_timeofday()
|
||||
|
||||
if tod > beds.day_interval.start and tod < beds.day_interval.finish then
|
||||
if beds.player[name] then
|
||||
lay_down(player, nil, nil, false)
|
||||
end
|
||||
minetest.chat_send_player(name, S("You can only sleep at night."))
|
||||
return
|
||||
end
|
||||
|
||||
-- move to bed
|
||||
if not beds.player[name] then
|
||||
lay_down(player, ppos, pos)
|
||||
beds.set_spawns() -- save respawn positions when entering bed
|
||||
else
|
||||
lay_down(player, nil, nil, false)
|
||||
end
|
||||
|
||||
if not is_sp then
|
||||
update_formspecs(false)
|
||||
end
|
||||
|
||||
if check_in_beds() then
|
||||
schedule_update()
|
||||
end
|
||||
end
|
||||
|
||||
function beds.can_dig(bed_pos)
|
||||
-- Check all players in bed which one is at the expected position
|
||||
for _, player_bed_pos in pairs(beds.bed_position) do
|
||||
if vector.equals(bed_pos, player_bed_pos) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- Callbacks
|
||||
-- Only register respawn callback if respawn enabled
|
||||
if enable_respawn then
|
||||
-- Respawn player at bed if valid position is found
|
||||
spawn.register_on_spawn(function(player, is_new)
|
||||
local pos = beds.spawn[player:get_player_name()]
|
||||
if pos then
|
||||
player:set_pos(pos)
|
||||
return true
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
lay_down(player, nil, nil, false, true)
|
||||
beds.player[name] = nil
|
||||
if check_in_beds() then
|
||||
schedule_update()
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
local in_bed = beds.player
|
||||
local pos = player:get_pos()
|
||||
local yaw = get_look_yaw(pos)
|
||||
|
||||
if in_bed[name] then
|
||||
lay_down(player, nil, pos, false)
|
||||
player:set_look_horizontal(yaw)
|
||||
player:set_pos(pos)
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if formname ~= "beds_form" then
|
||||
return
|
||||
end
|
||||
|
||||
-- Because "Force night skip" button is a button_exit, it will set fields.quit
|
||||
-- and lay_down call will change value of player_in_bed, so it must be taken
|
||||
-- earlier.
|
||||
local last_player_in_bed = get_player_in_bed_count()
|
||||
|
||||
if fields.quit or fields.leave then
|
||||
lay_down(player, nil, nil, false)
|
||||
update_formspecs(false)
|
||||
end
|
||||
|
||||
if fields.force then
|
||||
local is_majority = (#minetest.get_connected_players() / 2) < last_player_in_bed
|
||||
if is_majority and is_night_skip_enabled() then
|
||||
update_formspecs(true)
|
||||
beds.skip_night()
|
||||
beds.kick_players()
|
||||
else
|
||||
update_formspecs(false)
|
||||
end
|
||||
end
|
||||
end)
|
|
@ -1,31 +0,0 @@
|
|||
-- beds/init.lua
|
||||
|
||||
-- Load support for MT game translation.
|
||||
local S = minetest.get_translator("beds")
|
||||
local esc = minetest.formspec_escape
|
||||
|
||||
beds = {}
|
||||
beds.player = {}
|
||||
beds.bed_position = {}
|
||||
beds.pos = {}
|
||||
beds.spawn = {}
|
||||
beds.get_translator = S
|
||||
|
||||
beds.formspec = "size[8,11;true]" ..
|
||||
"no_prepend[]" ..
|
||||
"bgcolor[#080808BB;true]" ..
|
||||
"button_exit[2,10;4,0.75;leave;" .. esc(S("Leave Bed")) .. "]"
|
||||
|
||||
beds.day_interval = {
|
||||
start = 0.2,
|
||||
finish = 0.805,
|
||||
}
|
||||
|
||||
local modpath = minetest.get_modpath("beds")
|
||||
|
||||
-- Load files
|
||||
|
||||
dofile(modpath .. "/functions.lua")
|
||||
dofile(modpath .. "/api.lua")
|
||||
dofile(modpath .. "/beds.lua")
|
||||
dofile(modpath .. "/spawns.lua")
|
|
@ -1,61 +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
|
||||
Copyright (C) 2018 TumeniNodes
|
||||
|
||||
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/
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Schickes Bett
|
||||
Simple Bed=Schlichtes Bett
|
||||
This bed is already occupied!=Dieses Bett ist bereits belegt!
|
||||
You have to stop moving before going to bed!=Sie müssen stehen bleiben, bevor Sie zu Bett gehen können!
|
||||
Good morning.=Guten Morgen.
|
||||
@1 of @2 players are in bed=@1 von @2 Spielern sind im Bett
|
||||
Force night skip=Überspringen der Nacht erzwingen
|
||||
You can only sleep at night.=Sie können nur nachts schlafen.
|
||||
Leave Bed=Bett verlassen
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Luksa lito
|
||||
Simple Bed=Simpla lito
|
||||
This bed is already occupied!=Tiu lito jam estas okupata!
|
||||
You have to stop moving before going to bed!=Vi ĉesu moviĝi por enlitiĝi!
|
||||
Good morning.=Bonan matenon.
|
||||
@1 of @2 players are in bed=@1 el @2 ludantoj estas en lito
|
||||
Force night skip=Devigi noktan salton
|
||||
You can only sleep at night.=Vi povas dormi nur nokte.
|
||||
Leave Bed=Ellitiĝi
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Cama de lujo
|
||||
Simple Bed=Cama sencilla
|
||||
This bed is already occupied!=Esta cama esta ocupada
|
||||
You have to stop moving before going to bed!=Deja de moverte o no podras acostarte
|
||||
Good morning.=Buenos días.
|
||||
@1 of @2 players are in bed=@1 de @2 jugadores están durmiendo
|
||||
Force night skip=Forzar hacer de dia
|
||||
You can only sleep at night.=Sólo puedes dormir por la noche.
|
||||
Leave Bed=Levantarse
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Lit chic
|
||||
Simple Bed=Lit simple
|
||||
This bed is already occupied!=Ce lit est déjà occupé !
|
||||
You have to stop moving before going to bed!=Vous devez arrêter de bouger avant de vous coucher !
|
||||
Good morning.=Bonjour.
|
||||
@1 of @2 players are in bed=@1 joueur(s) sur @2 sont au lit
|
||||
Force night skip=Forcer le passage de la nuit
|
||||
You can only sleep at night.=Vous ne pouvez dormir que la nuit.
|
||||
Leave Bed=Se lever du lit
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Ranjang Mewah
|
||||
Simple Bed=Ranjang Sederhana
|
||||
This bed is already occupied!=Ranjang telah terisi!
|
||||
You have to stop moving before going to bed!=Anda harus diam untuk tidur!
|
||||
Good morning.=Selamat pagi.
|
||||
@1 of @2 players are in bed=@1 dari @2 pemain sedang tidur
|
||||
Force night skip=Paksa lewati malam
|
||||
You can only sleep at night.=Anda hanya bisa tidur pada waktu malam.
|
||||
Leave Bed=Tinggalkan Ranjang
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Letto decorato
|
||||
Simple Bed=Letto semplice
|
||||
This bed is already occupied!=
|
||||
You have to stop moving before going to bed!=
|
||||
Good morning.=
|
||||
@1 of @2 players are in bed=
|
||||
Force night skip=
|
||||
You can only sleep at night.=
|
||||
Leave Bed=Alzati dal letto
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=ファンシーなベッド
|
||||
Simple Bed=シンプルなベッド
|
||||
This bed is already occupied!=ベッドはすでに使われています!
|
||||
You have to stop moving before going to bed!=寝るときは動かないでください!
|
||||
Good morning.=おはようございます。
|
||||
@1 of @2 players are in bed=ベッドに@1 / @2人います
|
||||
Force night skip=強制的に夜をスキップします
|
||||
You can only sleep at night.=夜しか寝れません。
|
||||
Leave Bed=ベッドから出ます
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=lo selja'i ckana
|
||||
Simple Bed=lo sampu ckana
|
||||
This bed is already occupied!=.i lo ti ckana cu canlu
|
||||
You have to stop moving before going to bed!=lo nu do cando cu sarcu lo nu do sipna
|
||||
Good morning.=.i .uise'inai cerni
|
||||
@1 of @2 players are in bed=.i @1 cmima be lu'i @2 le pilno cu vreta lo ckana
|
||||
Force night skip=bapli le nu co'u nicte
|
||||
You can only sleep at night.=.i steci le ka nicte kei fa le ka do kakne le ka sipna ca pa ckaji be ce'u
|
||||
Leave Bed=cliva lo ckana
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Skaista gulta
|
||||
Simple Bed=Gulta
|
||||
This bed is already occupied!=Šī gulta jau ir aizņemta!
|
||||
You have to stop moving before going to bed!=Jums jāapstājas lai gulētu!
|
||||
Good morning.=Labrīt.
|
||||
@1 of @2 players are in bed=@1 no @2 spēlētājiem guļ gultās
|
||||
Force night skip=Izlaist nakti
|
||||
You can only sleep at night.=Jūs variet gulēt tikai naktī.
|
||||
Leave Bed=Celties no gultas
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Katil Beragam
|
||||
Simple Bed=Katil Biasa
|
||||
This bed is already occupied!=Katil ini sudah diduduki!
|
||||
You have to stop moving before going to bed!=Anda perlu berhenti bergerak sebelum tidur!
|
||||
Good morning.=Selamat pagi.
|
||||
@1 of @2 players are in bed=@1 daripada @2 pemain sedang tidur
|
||||
Force night skip=Paksa langkau malam
|
||||
You can only sleep at night.=Anda hanya boleh tidur pada waktu malam.
|
||||
Leave Bed=Tinggalkan Katil
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Fantazyjne łóżko
|
||||
Simple Bed=Proste łóżko
|
||||
This bed is already occupied!=To łóżko jest już zajęte!
|
||||
You have to stop moving before going to bed!=Musisz się zatrzymać aby wejść do łóżka
|
||||
Good morning.=Dzień dobry.
|
||||
@1 of @2 players are in bed=@1 z @2 graczy śpią
|
||||
Force night skip=Wymuś pominięcie nocy
|
||||
You can only sleep at night.=Możesz spać tylko w nocy.
|
||||
Leave Bed=Opuść łóżko
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Cama Bonita
|
||||
Simple Bed=Cama Simples
|
||||
This bed is already occupied!=Esta cama já está ocupada!
|
||||
You have to stop moving before going to bed!=Você precisa parar de se mover antes de ir para cama!
|
||||
Good morning.=Bom dia.
|
||||
@1 of @2 players are in bed=@1 de @2 jogadores estão na cama
|
||||
Force night skip=Forçar o amanhecer
|
||||
You can only sleep at night.=Você só pode dormir à noite
|
||||
Leave Bed=Sair da Cama
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Красивая кровать
|
||||
Simple Bed=Простая кровать
|
||||
This bed is already occupied!=Эта кровать уже занята!
|
||||
You have to stop moving before going to bed!=Вам нужно перестать двигаться чтобы лечь!
|
||||
Good morning.=Доброе утро.
|
||||
@1 of @2 players are in bed=@1 из @2 игроков в кровати
|
||||
Force night skip=Пропустить ночь
|
||||
You can only sleep at night.=Вы можете спать только ночью.
|
||||
Leave Bed=Встать с кровати
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Pekná posteľ
|
||||
Simple Bed=Jednoduchá posteľ
|
||||
This bed is already occupied!=Táto posteľ je už obsadená
|
||||
You have to stop moving before going to bed!=Predtým ako si ľahneš do postele, sa musíš prestať pohybovať!
|
||||
Good morning.=Dobré ráno.
|
||||
@1 of @2 players are in bed=@1 z @2 hráčov sú v posteli
|
||||
Force night skip=Nútene preskočiť noc
|
||||
You can only sleep at night.=Môžeš spať len v noci.
|
||||
Leave Bed=Opusti posteľ
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Fin säng
|
||||
Simple Bed=Enkel säng
|
||||
This bed is already occupied!=Den här sängen används redan!
|
||||
You have to stop moving before going to bed!=Du måste stanna innan du kan lägga dig!
|
||||
Good morning.=God morgon.
|
||||
@1 of @2 players are in bed=@1 av @2 spelare försöker sova.
|
||||
Force night skip=Tvinga att hoppa över natt
|
||||
You can only sleep at night.=Du kan bara sova på natten.
|
||||
Leave Bed=Lämna säng
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=Гарне ліжко
|
||||
Simple Bed=Просте ліжко
|
||||
This bed is already occupied!=Це ліжко вже зайняте!
|
||||
You have to stop moving before going to bed!=Зупиніться перед тим як лягти!
|
||||
Good morning.=Доброго ранку.
|
||||
@1 of @2 players are in bed=@1 з @2 гравців(-я) у ліжку
|
||||
Force night skip=Пропустити ніч
|
||||
You can only sleep at night.=Ви можете спати лише вночі.
|
||||
Leave Bed=Встати з ліжка
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=花式床
|
||||
Simple Bed=简易床
|
||||
This bed is already occupied!=床上已有人!
|
||||
You have to stop moving before going to bed!=上床前要停止移动!
|
||||
Good morning.=早安!
|
||||
@1 of @2 players are in bed=@2位玩家中的@1位在床上
|
||||
Force night skip=强制跳过夜晚
|
||||
You can only sleep at night.=你只能在晚上睡觉。
|
||||
Leave Bed=离开床
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=花式床
|
||||
Simple Bed=簡易床
|
||||
This bed is already occupied!=這個床已經被占據了!
|
||||
You have to stop moving before going to bed!=你必須在上床前停止移動!
|
||||
Good morning.=早安!
|
||||
@1 of @2 players are in bed=@2位玩家中的@1位在床上
|
||||
Force night skip=強制跳過夜晚
|
||||
You can only sleep at night.=你只能在晚上睡覺。
|
||||
Leave Bed=離開床
|
|
@ -1,10 +0,0 @@
|
|||
# textdomain: beds
|
||||
Fancy Bed=
|
||||
Simple Bed=
|
||||
This bed is already occupied!=
|
||||
You have to stop moving before going to bed!=
|
||||
Good morning.=
|
||||
@1 of @2 players are in bed=
|
||||
Force night skip=
|
||||
You can only sleep at night.=
|
||||
Leave Bed=
|
|
@ -1,3 +0,0 @@
|
|||
name = beds
|
||||
description = Minetest Game mod: beds
|
||||
depends = default, wool, spawn
|
|
@ -1,72 +0,0 @@
|
|||
local world_path = minetest.get_worldpath()
|
||||
local org_file = world_path .. "/beds_spawns"
|
||||
local file = world_path .. "/beds_spawns"
|
||||
local bkwd = false
|
||||
|
||||
-- check for PA's beds mod spawns
|
||||
local cf = io.open(world_path .. "/beds_player_spawns", "r")
|
||||
if cf ~= nil then
|
||||
io.close(cf)
|
||||
file = world_path .. "/beds_player_spawns"
|
||||
bkwd = true
|
||||
end
|
||||
|
||||
function beds.read_spawns()
|
||||
local spawns = beds.spawn
|
||||
local input = io.open(file, "r")
|
||||
if input and not bkwd then
|
||||
repeat
|
||||
local x = input:read("*n")
|
||||
if x == nil then
|
||||
break
|
||||
end
|
||||
local y = input:read("*n")
|
||||
local z = input:read("*n")
|
||||
local name = input:read("*l")
|
||||
spawns[name:sub(2)] = {x = x, y = y, z = z}
|
||||
until input:read(0) == nil
|
||||
io.close(input)
|
||||
elseif input and bkwd then
|
||||
beds.spawn = minetest.deserialize(input:read("*all"))
|
||||
input:close()
|
||||
beds.save_spawns()
|
||||
os.rename(file, file .. ".backup")
|
||||
file = org_file
|
||||
end
|
||||
end
|
||||
|
||||
beds.read_spawns()
|
||||
|
||||
function beds.save_spawns()
|
||||
if not beds.spawn then
|
||||
return
|
||||
end
|
||||
local data = {}
|
||||
local output = io.open(org_file, "w")
|
||||
for k, v in pairs(beds.spawn) do
|
||||
table.insert(data, string.format("%.1f %.1f %.1f %s\n", v.x, v.y, v.z, k))
|
||||
end
|
||||
output:write(table.concat(data))
|
||||
io.close(output)
|
||||
end
|
||||
|
||||
function beds.set_spawns()
|
||||
for name,_ in pairs(beds.player) do
|
||||
local player = minetest.get_player_by_name(name)
|
||||
local p = player:get_pos()
|
||||
-- but don't change spawn location if borrowing a bed
|
||||
if not minetest.is_protected(p, name) then
|
||||
beds.spawn[name] = p
|
||||
end
|
||||
end
|
||||
beds.save_spawns()
|
||||
end
|
||||
|
||||
function beds.remove_spawns_at(pos)
|
||||
for name, p in pairs(beds.spawn) do
|
||||
if vector.equals(vector.round(p), pos) then
|
||||
beds.spawn[name] = nil
|
||||
end
|
||||
end
|
||||
beds.save_spawns()
|
||||
end
|
Before Width: | Height: | Size: 490 B |
Before Width: | Height: | Size: 486 B |
Before Width: | Height: | Size: 340 B |
Before Width: | Height: | Size: 343 B |
Before Width: | Height: | Size: 248 B |
Before Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 431 B |
Before Width: | Height: | Size: 427 B |
Before Width: | Height: | Size: 464 B |
Before Width: | Height: | Size: 446 B |
Before Width: | Height: | Size: 474 B |
Before Width: | Height: | Size: 547 B |
Before Width: | Height: | Size: 425 B |
Before Width: | Height: | Size: 490 B |
Before Width: | Height: | Size: 251 B |
|
@ -1,37 +0,0 @@
|
|||
Minetest Game mod: binoculars
|
||||
=============================
|
||||
See license.txt for license information.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
paramat (MIT)
|
||||
|
||||
Authors of media (textures)
|
||||
---------------------------
|
||||
paramat (CC BY-SA 3.0):
|
||||
binoculars_binoculars.png
|
||||
|
||||
Crafting
|
||||
--------
|
||||
binoculars:binoculars
|
||||
|
||||
default:obsidian_glass O
|
||||
default:bronze_ingot B
|
||||
|
||||
O_O
|
||||
BBB
|
||||
O_O
|
||||
|
||||
Usage
|
||||
-----
|
||||
In survival mode, use of zoom requires the binoculars item in your inventory,
|
||||
they will allow a 10 degree field of view.
|
||||
It can take up to 5 seconds for adding to or removal from inventory to have an
|
||||
effect, however to instantly allow the use of this zoom 'use' (leftclick) the
|
||||
item.
|
||||
|
||||
Zoom with a field of view of 15 degrees is automatically allowed in creative
|
||||
mode and for any player with the 'creative' privilege.
|
||||
|
||||
The 'binoculars.update_player_property()' function is global so can be
|
||||
redefined by a mod for alternative behaviour.
|
|
@ -1,73 +0,0 @@
|
|||
-- binoculars/init.lua
|
||||
|
||||
-- Mod global namespace
|
||||
|
||||
binoculars = {}
|
||||
|
||||
-- Load support for MT game translation.
|
||||
local S = minetest.get_translator("binoculars")
|
||||
|
||||
|
||||
-- Update player property
|
||||
-- Global to allow overriding
|
||||
|
||||
function binoculars.update_player_property(player)
|
||||
local new_zoom_fov = 0
|
||||
|
||||
if player:get_inventory():contains_item(
|
||||
"main", "binoculars:binoculars") then
|
||||
new_zoom_fov = 10
|
||||
elseif minetest.is_creative_enabled(player:get_player_name()) then
|
||||
new_zoom_fov = 15
|
||||
end
|
||||
|
||||
-- Only set property if necessary to avoid player mesh reload
|
||||
if player:get_properties().zoom_fov ~= new_zoom_fov then
|
||||
player:set_properties({zoom_fov = new_zoom_fov})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Set player property 'on joinplayer'
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
binoculars.update_player_property(player)
|
||||
end)
|
||||
|
||||
|
||||
-- Cyclic update of player property
|
||||
|
||||
local function cyclic_update()
|
||||
for _, player in ipairs(minetest.get_connected_players()) do
|
||||
binoculars.update_player_property(player)
|
||||
end
|
||||
minetest.after(4.7, cyclic_update)
|
||||
end
|
||||
|
||||
minetest.after(4.7, cyclic_update)
|
||||
|
||||
|
||||
-- Binoculars item
|
||||
|
||||
minetest.register_craftitem("binoculars:binoculars", {
|
||||
description = S("Binoculars") .. "\n" .. S("Use with 'Zoom' key"),
|
||||
inventory_image = "binoculars_binoculars.png",
|
||||
stack_max = 1,
|
||||
groups = {tool = 1},
|
||||
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
binoculars.update_player_property(user)
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- Crafting
|
||||
|
||||
minetest.register_craft({
|
||||
output = "binoculars:binoculars",
|
||||
recipe = {
|
||||
{"default:obsidian_glass", "", "default:obsidian_glass"},
|
||||
{"default:bronze_ingot", "default:bronze_ingot", "default:bronze_ingot"},
|
||||
{"default:obsidian_glass", "", "default:obsidian_glass"},
|
||||
}
|
||||
})
|
|
@ -1,59 +0,0 @@
|
|||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2017 paramat
|
||||
|
||||
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) 2017 paramat
|
||||
|
||||
You are free to:
|
||||
Share — copy and redistribute the material in any medium or format.
|
||||
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
|
||||
The licensor cannot revoke these freedoms as long as you follow the license terms.
|
||||
|
||||
Under the following terms:
|
||||
|
||||
Attribution — You must give appropriate credit, provide a link to the license, and
|
||||
indicate if changes were made. You may do so in any reasonable manner, but not in any way
|
||||
that suggests the licensor endorses you or your use.
|
||||
|
||||
ShareAlike — If you remix, transform, or build upon the material, you must distribute
|
||||
your contributions under the same license as the original.
|
||||
|
||||
No additional restrictions — You may not apply legal terms or technological measures that
|
||||
legally restrict others from doing anything the license permits.
|
||||
|
||||
Notices:
|
||||
|
||||
You do not have to comply with the license for elements of the material in the public
|
||||
domain or where your use is permitted by an applicable exception or limitation.
|
||||
No warranties are given. The license may not give you all of the permissions necessary
|
||||
for your intended use. For example, other rights such as publicity, privacy, or moral
|
||||
rights may limit how you use the material.
|
||||
|
||||
For more details:
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Fernglas
|
||||
Use with 'Zoom' key=Mit „Zoom“-Taste benutzen
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Binoklo
|
||||
Use with 'Zoom' key=Uzi per 'Zomo' klavo
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Prismáticos
|
||||
Use with 'Zoom' key=Usar con la tecla 'Zoom'
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Jumelles
|
||||
Use with 'Zoom' key=Utiliser avec le bouton « Zoom »
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Teropong
|
||||
Use with 'Zoom' key=Gunakan dengan tombol 'Zum'
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Binocolo
|
||||
Use with 'Zoom' key=Usalo col tasto 'Ingrandimento'
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=双眼鏡
|
||||
Use with 'Zoom' key=ズームキーで使います
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=lo reldarvistci
|
||||
Use with 'Zoom' key=.i tu'a le jvinu banro batke cu tadji lo nu pilno
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Binoklis
|
||||
Use with 'Zoom' key=Lietojiet ar 'Pietuvināt' pogu
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Binokular
|
||||
Use with 'Zoom' key=Guna dengan kekunci 'Zum'
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Lornetka
|
||||
Use with 'Zoom' key=Aby użyć naciśnij 'Zoom'
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Binóculos
|
||||
Use with 'Zoom' key=Use com a tecla de 'Zoom'
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Бинокль
|
||||
Use with 'Zoom' key=Используется клавишей 'Приближение'
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Ďalekohľad
|
||||
Use with 'Zoom' key=Použi s klávesou "Priblíž"
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Kikare
|
||||
Use with 'Zoom' key=Använd med 'Zoom'-knappen
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=Бінокль
|
||||
Use with 'Zoom' key=Використовується клавішею 'Наближення'
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=望远镜
|
||||
Use with 'Zoom' key=与“缩放”键一起使用
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=望遠鏡
|
||||
Use with 'Zoom' key=與“縮放”鍵一起使用
|
|
@ -1,3 +0,0 @@
|
|||
# textdomain: binoculars
|
||||
Binoculars=
|
||||
Use with 'Zoom' key=
|
|
@ -1,3 +0,0 @@
|
|||
name = binoculars
|
||||
description = Minetest Game mod: binoculars
|
||||
depends = default
|
Before Width: | Height: | Size: 219 B |
|
@ -1,31 +0,0 @@
|
|||
Minetest Game mod: boats
|
||||
========================
|
||||
See license.txt for license information.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
Originally by PilzAdam (MIT)
|
||||
Various Minetest developers and contributors (MIT)
|
||||
|
||||
Authors of media (textures and model)
|
||||
-------------------------------------
|
||||
Textures: Zeg9 (CC BY-SA 3.0)
|
||||
Model: thetoon and Zeg9 (CC BY-SA 3.0),
|
||||
modified by PavelS(SokolovPavel) (CC BY-SA 3.0),
|
||||
modified by sofar (CC BY-SA 3.0)
|
||||
|
||||
Controls
|
||||
--------
|
||||
Right mouse button = Enter or exit boat when pointing at boat.
|
||||
Forward = Speed up.
|
||||
Slow down when moving backwards.
|
||||
Forward + backward = Enable cruise mode: Boat will accelerate to maximum forward
|
||||
speed and remain at that speed without needing to hold the
|
||||
forward key.
|
||||
Backward = Slow down.
|
||||
Speed up when moving backwards.
|
||||
Disable cruise mode.
|
||||
Left = Turn to the left.
|
||||
Turn to the right when moving backwards.
|
||||
Right = Turn to the right.
|
||||
Turn to the left when moving backwards.
|
|
@ -1,290 +0,0 @@
|
|||
-- boats/init.lua
|
||||
|
||||
-- Load support for MT game translation.
|
||||
local S = minetest.get_translator("boats")
|
||||
|
||||
--
|
||||
-- Helper functions
|
||||
--
|
||||
|
||||
local function is_water(pos)
|
||||
local nn = minetest.get_node(pos).name
|
||||
return minetest.get_item_group(nn, "water") ~= 0
|
||||
end
|
||||
|
||||
|
||||
local function get_velocity(v, yaw, y)
|
||||
local x = -math.sin(yaw) * v
|
||||
local z = math.cos(yaw) * v
|
||||
return {x = x, y = y, z = z}
|
||||
end
|
||||
|
||||
|
||||
local function get_v(v)
|
||||
return math.sqrt(v.x ^ 2 + v.z ^ 2)
|
||||
end
|
||||
|
||||
--
|
||||
-- Boat entity
|
||||
--
|
||||
|
||||
local boat = {
|
||||
initial_properties = {
|
||||
physical = true,
|
||||
-- Warning: Do not change the position of the collisionbox top surface,
|
||||
-- lowering it causes the boat to fall through the world if underwater
|
||||
collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5},
|
||||
visual = "mesh",
|
||||
mesh = "boats_boat.obj",
|
||||
textures = {"default_wood.png"},
|
||||
},
|
||||
|
||||
driver = nil,
|
||||
v = 0,
|
||||
last_v = 0,
|
||||
removed = false,
|
||||
auto = false
|
||||
}
|
||||
|
||||
|
||||
function boat.on_rightclick(self, clicker)
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
local name = clicker:get_player_name()
|
||||
if self.driver and name == self.driver then
|
||||
-- Cleanup happens in boat.on_detach_child
|
||||
clicker:set_detach()
|
||||
|
||||
player_api.set_animation(clicker, "stand", 30)
|
||||
local pos = clicker:get_pos()
|
||||
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
|
||||
minetest.after(0.1, function()
|
||||
clicker:set_pos(pos)
|
||||
end)
|
||||
elseif not self.driver then
|
||||
clicker:set_attach(self.object, "",
|
||||
{x = 0.5, y = 1, z = -3}, {x = 0, y = 0, z = 0})
|
||||
|
||||
self.driver = name
|
||||
player_api.player_attached[name] = true
|
||||
|
||||
minetest.after(0.2, function()
|
||||
player_api.set_animation(clicker, "sit", 30)
|
||||
end)
|
||||
clicker:set_look_horizontal(self.object:get_yaw())
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- If driver leaves server while driving boat
|
||||
function boat.on_detach_child(self, child)
|
||||
if child and child:get_player_name() == self.driver then
|
||||
player_api.player_attached[child:get_player_name()] = false
|
||||
|
||||
self.driver = nil
|
||||
self.auto = false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function boat.on_activate(self, staticdata, dtime_s)
|
||||
self.object:set_armor_groups({immortal = 1})
|
||||
if staticdata then
|
||||
self.v = tonumber(staticdata)
|
||||
end
|
||||
self.last_v = self.v
|
||||
end
|
||||
|
||||
|
||||
function boat.get_staticdata(self)
|
||||
return tostring(self.v)
|
||||
end
|
||||
|
||||
|
||||
function boat.on_punch(self, puncher)
|
||||
if not puncher or not puncher:is_player() or self.removed then
|
||||
return
|
||||
end
|
||||
|
||||
local name = puncher:get_player_name()
|
||||
if self.driver and name == self.driver then
|
||||
self.driver = nil
|
||||
puncher:set_detach()
|
||||
player_api.player_attached[name] = false
|
||||
end
|
||||
if not self.driver then
|
||||
self.removed = true
|
||||
local inv = puncher:get_inventory()
|
||||
if not minetest.is_creative_enabled(name)
|
||||
or not inv:contains_item("main", "boats:boat") then
|
||||
local leftover = inv:add_item("main", "boats:boat")
|
||||
-- if no room in inventory add a replacement boat to the world
|
||||
if not leftover:is_empty() then
|
||||
minetest.add_item(self.object:get_pos(), leftover)
|
||||
end
|
||||
end
|
||||
-- delay remove to ensure player is detached
|
||||
minetest.after(0.1, function()
|
||||
self.object:remove()
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function boat.on_step(self, dtime)
|
||||
self.v = get_v(self.object:get_velocity()) * math.sign(self.v)
|
||||
if self.driver then
|
||||
local driver_objref = minetest.get_player_by_name(self.driver)
|
||||
if driver_objref then
|
||||
local ctrl = driver_objref:get_player_control()
|
||||
if ctrl.up and ctrl.down then
|
||||
if not self.auto then
|
||||
self.auto = true
|
||||
minetest.chat_send_player(self.driver, S("Boat cruise mode on"))
|
||||
end
|
||||
elseif ctrl.down then
|
||||
self.v = self.v - dtime * 2.0
|
||||
if self.auto then
|
||||
self.auto = false
|
||||
minetest.chat_send_player(self.driver, S("Boat cruise mode off"))
|
||||
end
|
||||
elseif ctrl.up or self.auto then
|
||||
self.v = self.v + dtime * 2.0
|
||||
end
|
||||
if ctrl.left then
|
||||
if self.v < -0.001 then
|
||||
self.object:set_yaw(self.object:get_yaw() - dtime * 0.9)
|
||||
else
|
||||
self.object:set_yaw(self.object:get_yaw() + dtime * 0.9)
|
||||
end
|
||||
elseif ctrl.right then
|
||||
if self.v < -0.001 then
|
||||
self.object:set_yaw(self.object:get_yaw() + dtime * 0.9)
|
||||
else
|
||||
self.object:set_yaw(self.object:get_yaw() - dtime * 0.9)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local velo = self.object:get_velocity()
|
||||
if not self.driver and
|
||||
self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
|
||||
self.object:set_pos(self.object:get_pos())
|
||||
return
|
||||
end
|
||||
-- We need to preserve velocity sign to properly apply drag force
|
||||
-- while moving backward
|
||||
local drag = dtime * math.sign(self.v) * (0.01 + 0.0796 * self.v * self.v)
|
||||
-- If drag is larger than velocity, then stop horizontal movement
|
||||
if math.abs(self.v) <= math.abs(drag) then
|
||||
self.v = 0
|
||||
else
|
||||
self.v = self.v - drag
|
||||
end
|
||||
|
||||
local p = self.object:get_pos()
|
||||
p.y = p.y - 0.5
|
||||
local new_velo
|
||||
local new_acce = {x = 0, y = 0, z = 0}
|
||||
if not is_water(p) then
|
||||
local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
|
||||
if (not nodedef) or nodedef.walkable then
|
||||
self.v = 0
|
||||
new_acce = {x = 0, y = 1, z = 0}
|
||||
else
|
||||
new_acce = {x = 0, y = -9.8, z = 0}
|
||||
end
|
||||
new_velo = get_velocity(self.v, self.object:get_yaw(),
|
||||
self.object:get_velocity().y)
|
||||
self.object:set_pos(self.object:get_pos())
|
||||
else
|
||||
p.y = p.y + 1
|
||||
if is_water(p) then
|
||||
local y = self.object:get_velocity().y
|
||||
if y >= 5 then
|
||||
y = 5
|
||||
elseif y < 0 then
|
||||
new_acce = {x = 0, y = 20, z = 0}
|
||||
else
|
||||
new_acce = {x = 0, y = 5, z = 0}
|
||||
end
|
||||
new_velo = get_velocity(self.v, self.object:get_yaw(), y)
|
||||
self.object:set_pos(self.object:get_pos())
|
||||
else
|
||||
new_acce = {x = 0, y = 0, z = 0}
|
||||
if math.abs(self.object:get_velocity().y) < 1 then
|
||||
local pos = self.object:get_pos()
|
||||
pos.y = math.floor(pos.y) + 0.5
|
||||
self.object:set_pos(pos)
|
||||
new_velo = get_velocity(self.v, self.object:get_yaw(), 0)
|
||||
else
|
||||
new_velo = get_velocity(self.v, self.object:get_yaw(),
|
||||
self.object:get_velocity().y)
|
||||
self.object:set_pos(self.object:get_pos())
|
||||
end
|
||||
end
|
||||
end
|
||||
self.object:set_velocity(new_velo)
|
||||
self.object:set_acceleration(new_acce)
|
||||
end
|
||||
|
||||
|
||||
minetest.register_entity("boats:boat", boat)
|
||||
|
||||
|
||||
minetest.register_craftitem("boats:boat", {
|
||||
description = S("Boat"),
|
||||
inventory_image = "boats_inventory.png",
|
||||
wield_image = "boats_wield.png",
|
||||
wield_scale = {x = 2, y = 2, z = 1},
|
||||
liquids_pointable = true,
|
||||
groups = {flammable = 2},
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local under = pointed_thing.under
|
||||
local node = minetest.get_node(under)
|
||||
local udef = minetest.registered_nodes[node.name]
|
||||
if udef and udef.on_rightclick and
|
||||
not (placer and placer:is_player() and
|
||||
placer:get_player_control().sneak) then
|
||||
return udef.on_rightclick(under, node, placer, itemstack,
|
||||
pointed_thing) or itemstack
|
||||
end
|
||||
|
||||
if pointed_thing.type ~= "node" then
|
||||
return itemstack
|
||||
end
|
||||
if not is_water(pointed_thing.under) then
|
||||
return itemstack
|
||||
end
|
||||
pointed_thing.under.y = pointed_thing.under.y + 0.5
|
||||
boat = minetest.add_entity(pointed_thing.under, "boats:boat")
|
||||
if boat then
|
||||
if placer then
|
||||
boat:set_yaw(placer:get_look_horizontal())
|
||||
end
|
||||
local player_name = placer and placer:get_player_name() or ""
|
||||
if not minetest.is_creative_enabled(player_name) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "boats:boat",
|
||||
recipe = {
|
||||
{"", "", "" },
|
||||
{"group:wood", "", "group:wood"},
|
||||
{"group:wood", "group:wood", "group:wood"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "boats:boat",
|
||||
burntime = 20,
|
||||
})
|
|
@ -1,63 +0,0 @@
|
|||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2012-2016 PilzAdam
|
||||
Copyright (C) 2012-2016 Various Minetest developers and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
||||
|
||||
|
||||
Licenses of media (textures and model)
|
||||
--------------------------------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2012-2016 Zeg9
|
||||
Copyright (C) 2012-2016 thetoon
|
||||
Copyright (C) 2012-2016 PavelS(SokolovPavel)
|
||||
Copyright (C) 2016 sofar (sofar@foo-projects.org)
|
||||
|
||||
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/
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Schneller Bootsmodus an
|
||||
Boat cruise mode off=Schneller Bootsmodus aus
|
||||
Boat=Boot
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=La kroza maniero de la boato estas ŝaltita.
|
||||
Boat cruise mode off=La kroza maniero de la boato estas malŝaltita.
|
||||
Boat=Boato
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Modo crucero en bote activado
|
||||
Boat cruise mode off=Modo crucero en bote desactivado
|
||||
Boat=Bote
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Bateau mode rapide activé
|
||||
Boat cruise mode off=Bateau mode rapide désactivé
|
||||
Boat=Bateau
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Mode perahu jelajah nyala
|
||||
Boat cruise mode off=Mode perahu jelajah mati
|
||||
Boat=Perahu
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Modalità movimento automatico barca attivata
|
||||
Boat cruise mode off=Modalità movimento automatico barca disattivata
|
||||
Boat=Barca
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=クルージングモード・オン
|
||||
Boat cruise mode off=クルージングモード・オフ
|
||||
Boat=ボート
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=.i lo bloti cu zmiku le ka klama
|
||||
Boat cruise mode off=.i lo bloti cu macnu le ka klama
|
||||
Boat=lo bloti
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Autopilots ieslēgts
|
||||
Boat cruise mode off=Autopilots izslēgts
|
||||
Boat=Laiva
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Mod jelajah bot dihidupkan
|
||||
Boat cruise mode off=Mod jelajah bot dimatikan
|
||||
Boat=Bot
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Tryb rejsu łodką włączony
|
||||
Boat cruise mode off=Tryb rejsu łodką wyłączony
|
||||
Boat=Łódka
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Modo de cruseiro do barco ligado
|
||||
Boat cruise mode off=Modo de cruseiro do barco desligado
|
||||
Boat=Barco
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Автоход лодки включен
|
||||
Boat cruise mode off=Автоход лодки выключен
|
||||
Boat=Лодка
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Cestovný režim loďky je zapnutý
|
||||
Boat cruise mode off=Cestovný režim loďky je vypnutý
|
||||
Boat=Loďka
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Båtkryssningsläge på
|
||||
Boat cruise mode off=Båtkryssningsläge av
|
||||
Boat=Båt
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=Режим мандрування на човні увімкнено
|
||||
Boat cruise mode off=Режим мандрування на човні вимкнено
|
||||
Boat=Човен
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=巡航模式开启
|
||||
Boat cruise mode off=巡航模式关闭
|
||||
Boat=船
|
|
@ -1,4 +0,0 @@
|
|||
# textdomain: boats
|
||||
Boat cruise mode on=巡航模式開啟
|
||||
Boat cruise mode off=巡航模式關閉
|
||||
Boat=船
|