Compare commits

...

No commits in common. 'master' and 'stairfix' have entirely different histories.

  1. 16
      .github/workflows/build.yml
  2. 22
      .gitignore
  3. 27
      .luacheckrc
  4. 519
      LICENSE.txt
  5. 34
      README.md
  6. 3
      game.conf
  7. 1112
      game_api.txt
  8. BIN
      menu/header.png
  9. BIN
      menu/icon.png
  10. 0
      minetest.conf
  11. 81
      minetest.conf.example
  12. 30
      mods/beds/README.txt
  13. 184
      mods/beds/api.lua
  14. 109
      mods/beds/beds.lua
  15. 300
      mods/beds/functions.lua
  16. 26
      mods/beds/init.lua
  17. 61
      mods/beds/license.txt
  18. 10
      mods/beds/locale/beds.de.tr
  19. 10
      mods/beds/locale/beds.eo.tr
  20. 10
      mods/beds/locale/beds.es.tr
  21. 10
      mods/beds/locale/beds.fr.tr
  22. 10
      mods/beds/locale/beds.id.tr
  23. 10
      mods/beds/locale/beds.it.tr
  24. 10
      mods/beds/locale/beds.ja.tr
  25. 10
      mods/beds/locale/beds.jbo.tr
  26. 10
      mods/beds/locale/beds.ms.tr
  27. 10
      mods/beds/locale/beds.pt_BR.tr
  28. 10
      mods/beds/locale/beds.ru.tr
  29. 10
      mods/beds/locale/beds.sk.tr
  30. 10
      mods/beds/locale/beds.sv.tr
  31. 10
      mods/beds/locale/beds.uk.tr
  32. 10
      mods/beds/locale/beds.zh_CN.tr
  33. 10
      mods/beds/locale/beds.zh_TW.tr
  34. 10
      mods/beds/locale/template.txt
  35. 3
      mods/beds/mod.conf
  36. 72
      mods/beds/spawns.lua
  37. BIN
      mods/beds/textures/beds_bed.png
  38. BIN
      mods/beds/textures/beds_bed_fancy.png
  39. BIN
      mods/beds/textures/beds_bed_foot.png
  40. BIN
      mods/beds/textures/beds_bed_head.png
  41. BIN
      mods/beds/textures/beds_bed_side1.png
  42. BIN
      mods/beds/textures/beds_bed_side2.png
  43. BIN
      mods/beds/textures/beds_bed_side_bottom.png
  44. BIN
      mods/beds/textures/beds_bed_side_bottom_r.png
  45. BIN
      mods/beds/textures/beds_bed_side_top.png
  46. BIN
      mods/beds/textures/beds_bed_side_top_r.png
  47. BIN
      mods/beds/textures/beds_bed_top1.png
  48. BIN
      mods/beds/textures/beds_bed_top2.png
  49. BIN
      mods/beds/textures/beds_bed_top_bottom.png
  50. BIN
      mods/beds/textures/beds_bed_top_top.png
  51. BIN
      mods/beds/textures/beds_bed_under.png
  52. BIN
      mods/beds/textures/beds_transparent.png
  53. 37
      mods/binoculars/README.txt
  54. 73
      mods/binoculars/init.lua
  55. 59
      mods/binoculars/license.txt
  56. 3
      mods/binoculars/locale/binoculars.de.tr
  57. 3
      mods/binoculars/locale/binoculars.eo.tr
  58. 3
      mods/binoculars/locale/binoculars.es.tr
  59. 3
      mods/binoculars/locale/binoculars.fr.tr
  60. 3
      mods/binoculars/locale/binoculars.id.tr
  61. 3
      mods/binoculars/locale/binoculars.it.tr
  62. 3
      mods/binoculars/locale/binoculars.ja.tr
  63. 3
      mods/binoculars/locale/binoculars.jbo.tr
  64. 3
      mods/binoculars/locale/binoculars.ms.tr
  65. 3
      mods/binoculars/locale/binoculars.pt_BR.tr
  66. 3
      mods/binoculars/locale/binoculars.ru.tr
  67. 3
      mods/binoculars/locale/binoculars.sk.tr
  68. 3
      mods/binoculars/locale/binoculars.sv.tr
  69. 3
      mods/binoculars/locale/binoculars.uk.tr
  70. 3
      mods/binoculars/locale/binoculars.zh_CN.tr
  71. 3
      mods/binoculars/locale/binoculars.zh_TW.tr
  72. 3
      mods/binoculars/locale/template.txt
  73. 3
      mods/binoculars/mod.conf
  74. BIN
      mods/binoculars/textures/binoculars_binoculars.png
  75. 31
      mods/boats/README.txt
  76. 290
      mods/boats/init.lua
  77. 63
      mods/boats/license.txt
  78. 4
      mods/boats/locale/boats.de.tr
  79. 4
      mods/boats/locale/boats.eo.tr
  80. 4
      mods/boats/locale/boats.es.tr
  81. 4
      mods/boats/locale/boats.fr.tr
  82. 4
      mods/boats/locale/boats.id.tr
  83. 4
      mods/boats/locale/boats.it.tr
  84. 4
      mods/boats/locale/boats.ja.tr
  85. 4
      mods/boats/locale/boats.jbo.tr
  86. 4
      mods/boats/locale/boats.ms.tr
  87. 4
      mods/boats/locale/boats.pt_BR.tr
  88. 4
      mods/boats/locale/boats.ru.tr
  89. 4
      mods/boats/locale/boats.sk.tr
  90. 4
      mods/boats/locale/boats.sv.tr
  91. 4
      mods/boats/locale/boats.uk.tr
  92. 4
      mods/boats/locale/boats.zh_CN.tr
  93. 4
      mods/boats/locale/boats.zh_TW.tr
  94. 4
      mods/boats/locale/template.txt
  95. 3
      mods/boats/mod.conf
  96. 358
      mods/boats/models/boats_boat.obj
  97. BIN
      mods/boats/textures/boats_inventory.png
  98. BIN
      mods/boats/textures/boats_wield.png
  99. 12
      mods/bones/README.txt
  100. 291
      mods/bones/init.lua

16
.github/workflows/build.yml

@ -0,0 +1,16 @@
name: build
on: [push, pull_request]
jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Luarocks
run: |
sudo apt-get update -qyy
sudo apt-get install luarocks -qyy
- name: Install Luacheck
run: luarocks install --local luacheck
- name: Run Luacheck
run: $HOME/.luarocks/bin/luacheck mods

22
.gitignore

@ -0,0 +1,22 @@
## Files related to minetest development cycle
/*.patch
# GNU Patch reject file
*.rej
## Editors and Development environments
*~
*.swp
*.bak*
*.orig
# Vim
*.vim
# Kate
.*.kate-swp
.swp.*
# Eclipse (LDT)
.project
.settings/
.buildpath
.metadata
# Idea IDE
.idea/*

27
.luacheckrc

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

519
LICENSE.txt

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

34
README.md

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

3
game.conf

@ -0,0 +1,3 @@
name = 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.

1112
game_api.txt
File diff suppressed because it is too large
View File

BIN
menu/header.png

After

Width: 192  |  Height: 16  |  Size: 935 B

BIN
menu/icon.png

After

Width: 96  |  Height: 96  |  Size: 2.9 KiB

0
minetest.conf

81
minetest.conf.example

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

30
mods/beds/README.txt

@ -0,0 +1,30 @@
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.

184
mods/beds/api.lua

@ -0,0 +1,184 @@
local reverse = true
local function destruct_bed(pos, n)
local node = minetest.get_node(pos)
local other
if n == 2 then
local dir = minetest.facedir_to_dir(node.param2)
other = vector.subtract(pos, dir)
elseif n == 1 then
local dir = minetest.facedir_to_dir(node.param2)
other = vector.add(pos, dir)
end
if reverse then
reverse = not reverse
minetest.remove_node(other)
minetest.check_for_falling(other)
beds.remove_spawns_at(pos)
beds.remove_spawns_at(other)
else
reverse = not reverse
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)
local p = vector.add(pos, dir)
local node2 = minetest.get_node_or_nil(p)
if not node2 or not minetest.get_item_group(node2.name, "bed") == 2 or
not 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
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
-- do not remove_node here - it will trigger destroy_bed()
minetest.set_node(p, {name = "air"})
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

109
mods/beds/beds.lua

@ -0,0 +1,109 @@
-- 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",
"beds_transparent.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",
"beds_transparent.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,
})

300
mods/beds/functions.lua

@ -0,0 +1,300 @@
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
function beds.on_rightclick(pos, player)
local name = player:get_player_name()
local ppos = player:get_pos()
local tod = minetest.get_timeofday()
if tod > 0.2 and tod < 0.805 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
-- skip the night and let all players stand up
if check_in_beds() then
minetest.after(2, function()
if not is_sp then
update_formspecs(is_night_skip_enabled())
end
if is_night_skip_enabled() then
beds.skip_night()
beds.kick_players()
end
end)
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 enabled and valid position is found
minetest.register_on_respawnplayer(function(player)
local name = player:get_player_name()
local pos = beds.spawn[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
minetest.after(2, function()
update_formspecs(is_night_skip_enabled())
if is_night_skip_enabled() then
beds.skip_night()
beds.kick_players()
end
end)
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)

26
mods/beds/init.lua

@ -0,0 +1,26 @@
-- 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")) .. "]"
local modpath = minetest.get_modpath("beds")
-- Load files
dofile(modpath .. "/functions.lua")
dofile(modpath .. "/api.lua")
dofile(modpath .. "/beds.lua")
dofile(modpath .. "/spawns.lua")

61
mods/beds/license.txt

@ -0,0 +1,61 @@
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/

10
mods/beds/locale/beds.de.tr

@ -0,0 +1,10 @@
# 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

10
mods/beds/locale/beds.eo.tr

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Luksa Lito
Simple Bed=Simpla Lito
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=Bonan matenon.
@1 of @2 players are in bed=@1 el @2 ludantoj estas en lito.
Force night skip=Devigu nokta salton
You can only sleep at night.=Vi povas nur dormi en la nokto.
Leave Bed=Ellitiĝu

10
mods/beds/locale/beds.es.tr

@ -0,0 +1,10 @@
# 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

10
mods/beds/locale/beds.fr.tr

@ -0,0 +1,10 @@
# 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

10
mods/beds/locale/beds.id.tr

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Ranjang Mewah
Simple Bed=Ranjang Sederhana
This bed is already occupied!=
You have to stop moving before going to bed!=
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 dapat tidur pada waktu malam.
Leave Bed=Tinggalkan Ranjang

10
mods/beds/locale/beds.it.tr

@ -0,0 +1,10 @@
# 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

10
mods/beds/locale/beds.ja.tr

@ -0,0 +1,10 @@
# 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=ベッドから出ます

10
mods/beds/locale/beds.jbo.tr

@ -0,0 +1,10 @@
# 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

10
mods/beds/locale/beds.ms.tr

@ -0,0 +1,10 @@
# textdomain: beds
Fancy Bed=Katil Beragam
Simple Bed=Katil Biasa
This bed is already occupied!=
You have to stop moving before going to bed!=
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=Bangun

10
mods/beds/locale/beds.pt_BR.tr

@ -0,0 +1,10 @@
# 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

10
mods/beds/locale/beds.ru.tr

@ -0,0 +1,10 @@
# 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=Встать с кровати

10
mods/beds/locale/beds.sk.tr

@ -0,0 +1,10 @@
# 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ľ

10
mods/beds/locale/beds.sv.tr

@ -0,0 +1,10 @@
# 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

10
mods/beds/locale/beds.uk.tr

@ -0,0 +1,10 @@
# 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=Встати з ліжка

10
mods/beds/locale/beds.zh_CN.tr

@ -0,0 +1,10 @@
# 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=离开床

10
mods/beds/locale/beds.zh_TW.tr

@ -0,0 +1,10 @@
# 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=離開床

10
mods/beds/locale/template.txt

@ -0,0 +1,10 @@
# 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=

3
mods/beds/mod.conf

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

72
mods/beds/spawns.lua

@ -0,0 +1,72 @@
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

BIN
mods/beds/textures/beds_bed.png

After

Width: 16  |  Height: 16  |  Size: 490 B

BIN
mods/beds/textures/beds_bed_fancy.png

After

Width: 16  |  Height: 16  |  Size: 486 B

BIN
mods/beds/textures/beds_bed_foot.png

After

Width: 16  |  Height: 16  |  Size: 340 B

BIN
mods/beds/textures/beds_bed_head.png

After

Width: 16  |  Height: 16  |  Size: 343 B

BIN
mods/beds/textures/beds_bed_side1.png

After

Width: 16  |  Height: 16  |  Size: 248 B

BIN
mods/beds/textures/beds_bed_side2.png

After

Width: 16  |  Height: 16  |  Size: 265 B

BIN
mods/beds/textures/beds_bed_side_bottom.png

After

Width: 16  |  Height: 16  |  Size: 431 B

BIN
mods/beds/textures/beds_bed_side_bottom_r.png

After

Width: 16  |  Height: 16  |  Size: 427 B

BIN
mods/beds/textures/beds_bed_side_top.png

After

Width: 16  |  Height: 16  |  Size: 464 B

BIN
mods/beds/textures/beds_bed_side_top_r.png

After

Width: 16  |  Height: 16  |  Size: 446 B

BIN
mods/beds/textures/beds_bed_top1.png

After

Width: 16  |  Height: 16  |  Size: 474 B

BIN
mods/beds/textures/beds_bed_top2.png

After

Width: 16  |  Height: 16  |  Size: 547 B

BIN
mods/beds/textures/beds_bed_top_bottom.png

After

Width: 16  |  Height: 16  |  Size: 425 B

BIN
mods/beds/textures/beds_bed_top_top.png

After

Width: 16  |  Height: 16  |  Size: 490 B

BIN
mods/beds/textures/beds_bed_under.png

After

Width: 16  |  Height: 16  |  Size: 251 B

BIN
mods/beds/textures/beds_transparent.png

After

Width: 16  |  Height: 16  |  Size: 83 B

37
mods/binoculars/README.txt

@ -0,0 +1,37 @@
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.

73
mods/binoculars/init.lua

@ -0,0 +1,73 @@
-- 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"},
}
})

59
mods/binoculars/license.txt

@ -0,0 +1,59 @@
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/

3
mods/binoculars/locale/binoculars.de.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Fernglas
Use with 'Zoom' key=Mit „Zoom“-Taste benutzen

3
mods/binoculars/locale/binoculars.eo.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Binokolo
Use with 'Zoom' key=Uzu per 'Zomo' klavo

3
mods/binoculars/locale/binoculars.es.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Prismáticos
Use with 'Zoom' key=Usar con la tecla 'Zoom'

3
mods/binoculars/locale/binoculars.fr.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Jumelles
Use with 'Zoom' key=Utiliser avec le bouton « Zoom »

3
mods/binoculars/locale/binoculars.id.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Teropong
Use with 'Zoom' key=Pakai dengan tombol 'Zoom'

3
mods/binoculars/locale/binoculars.it.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Binocolo
Use with 'Zoom' key=Usalo col tasto 'Ingrandimento'

3
mods/binoculars/locale/binoculars.ja.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=双眼鏡
Use with 'Zoom' key=ズームキーで使います

3
mods/binoculars/locale/binoculars.jbo.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=lo reldarvistci
Use with 'Zoom' key=.i tu'a le jvinu banro batke cu tadji lo nu pilno

3
mods/binoculars/locale/binoculars.ms.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Binokular
Use with 'Zoom' key=Guna dengan kekunci 'Zum'

3
mods/binoculars/locale/binoculars.pt_BR.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Binóculos
Use with 'Zoom' key=Use com a tecla de 'Zoom'

3
mods/binoculars/locale/binoculars.ru.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Бинокль
Use with 'Zoom' key=Используется с привилегией 'Zoom'

3
mods/binoculars/locale/binoculars.sk.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Ďalekohľad
Use with 'Zoom' key=Použi s klávesou "Priblíž"

3
mods/binoculars/locale/binoculars.sv.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Kikare
Use with 'Zoom' key=Använd med 'Zoom'-knappen

3
mods/binoculars/locale/binoculars.uk.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=Бінокль
Use with 'Zoom' key=Використовується з правами 'Zoom'

3
mods/binoculars/locale/binoculars.zh_CN.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=望远镜
Use with 'Zoom' key=与“缩放”键一起使用

3
mods/binoculars/locale/binoculars.zh_TW.tr

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=望遠鏡
Use with 'Zoom' key=與“縮放”鍵一起使用

3
mods/binoculars/locale/template.txt

@ -0,0 +1,3 @@
# textdomain: binoculars
Binoculars=
Use with 'Zoom' key=

3
mods/binoculars/mod.conf

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

BIN
mods/binoculars/textures/binoculars_binoculars.png

After

Width: 16  |  Height: 16  |  Size: 219 B

31
mods/boats/README.txt

@ -0,0 +1,31 @@
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.

290
mods/boats/init.lua

@ -0,0 +1,290 @@
-- 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,
})

63
mods/boats/license.txt

@ -0,0 +1,63 @@
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/

4
mods/boats/locale/boats.de.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=Schneller Bootsmodus an
Boat cruise mode off=Schneller Bootsmodus aus
Boat=Boot

4
mods/boats/locale/boats.eo.tr

@ -0,0 +1,4 @@
# 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

4
mods/boats/locale/boats.es.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=Modo crucero en bote activado
Boat cruise mode off=Modo crucero en bote desactivado
Boat=Bote

4
mods/boats/locale/boats.fr.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=Bateau mode rapide activé
Boat cruise mode off=Bateau mode rapide désactivé
Boat=Bateau

4
mods/boats/locale/boats.id.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=Mode perahu jelajah nyala
Boat cruise mode off=Mode perahu jelajah mati
Boat=Perahu

4
mods/boats/locale/boats.it.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=Modalità movimento automatico barca attivata
Boat cruise mode off=Modalità movimento automatico barca disattivata
Boat=Barca

4
mods/boats/locale/boats.ja.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=クルージングモード・オン
Boat cruise mode off=クルージングモード・オフ
Boat=ボート

4
mods/boats/locale/boats.jbo.tr

@ -0,0 +1,4 @@
# 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

4
mods/boats/locale/boats.ms.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=Mod bot layar makan angin dibolehkan
Boat cruise mode off=Mod bot layar makan angin dilumpuhkan
Boat=Bot

4
mods/boats/locale/boats.pt_BR.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=Modo de cruseiro do barco ligado
Boat cruise mode off=Modo de cruseiro do barco desligado
Boat=Barco

4
mods/boats/locale/boats.ru.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=Режим путешествия на лодке включен
Boat cruise mode off=Режим путешествия на лодке выключен
Boat=Лодка

4
mods/boats/locale/boats.sk.tr

@ -0,0 +1,4 @@
# 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

4
mods/boats/locale/boats.sv.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=Båtkryssningsläge på
Boat cruise mode off=Båtkryssningsläge av
Boat=Båt

4
mods/boats/locale/boats.uk.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=Режим мандрування на човні увімкнено
Boat cruise mode off=Режим мандрування на човні вимкнено
Boat=Човен

4
mods/boats/locale/boats.zh_CN.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=巡航模式开启
Boat cruise mode off=巡航模式关闭
Boat=船

4
mods/boats/locale/boats.zh_TW.tr

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=巡航模式開啟
Boat cruise mode off=巡航模式關閉
Boat=船

4
mods/boats/locale/template.txt

@ -0,0 +1,4 @@
# textdomain: boats
Boat cruise mode on=
Boat cruise mode off=
Boat=

3
mods/boats/mod.conf

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

358
mods/boats/models/boats_boat.obj

@ -0,0 +1,358 @@
# Blender v2.76 (sub 11) OBJ File: 'boat.blend'
# www.blender.org
mtllib boat.mtl
o boats_boat
v -6.786140 -3.033999 -9.415440
v -6.786140 -1.967150 -9.415440
v -6.786140 -1.967150 8.793510
v -6.786140 -3.033999 8.793510
v 5.732520 -1.967150 -9.415440
v 5.732520 -3.033999 -9.415440
v 5.732520 -3.033999 8.793510
v 5.732520 -1.967150 8.793510
v -2.233900 -3.033999 -9.415440
v -2.233900 -1.967150 -9.415440
v -2.233900 -1.967150 8.793510
v -2.233900 -3.033999 8.793510
v 2.318340 -3.033999 -9.415440
v 2.318340 -1.967150 -9.415440
v 2.318340 -1.967150 8.793510
v 2.318340 -3.033999 8.793510
v -3.371960 -3.033999 8.793510
v -3.371960 -1.967150 8.793510
v -3.371960 -1.967150 -9.415440
v -3.371960 -3.033999 -9.415440
v 2.318340 0.276645 8.793510
v 1.180280 -1.967150 8.793510
v 5.732520 0.276645 8.793510
v 5.732520 1.039180 8.793510
v 6.870580 0.276645 8.793510
v 6.870580 -1.967150 8.793510
v 2.318340 1.039180 8.793510
v 1.180280 0.276645 8.793510
v 1.180280 1.039180 8.793510
v 1.180280 -3.033999 8.793510
v -2.233900 0.276645 8.793510
v -3.371960 0.276645 8.793510
v -2.233900 1.039180 8.793510
v -3.371960 1.039180 8.793510
v -6.786140 0.276645 8.793510
v -7.786200 0.276645 8.793510
v -7.786200 -1.967150 8.793510
v -6.786140 1.039180 8.793510
v 1.180280 -1.967150 -9.415440
v 1.180280 -3.033999 -9.415440
v 2.318340 0.276645 -9.415440
v 1.180280 0.276645 -9.415440
v 2.318340 1.039180 -9.415440
v 5.732520 0.276645 -9.415440
v 6.870580 -1.967150 -9.415440
v 5.732520 1.039180 -9.415440
v 6.870580 0.276645 -9.415440
v 0.042220 1.039180 -9.415440
v 1.180280 1.039180 -9.415440
v 0.042220 -1.967150 -9.415440
v -1.095840 -1.967150 -9.415440
v -2.233900 0.276645 -9.415440
v -3.371960 0.276645 -9.415440
v -2.233900 1.039180 -9.415440
v -1.095840 1.039180 -9.415440
v -3.371960 1.039180 -9.415440
v -6.786140 0.276645 -9.415440
v -6.786140 1.039180 -9.415440
v -7.786200 -1.967150 -9.415440
v -7.786200 0.276645 -9.415440
v -1.095840 0.156645 -12.044100
v -1.095840 -4.601110 -9.415440
v -1.095840 1.039181 -10.802900
v -1.095840 2.868579 -10.802900
v -1.095840 2.868580 -7.883420
v -1.095840 3.746069 -12.034100
v -1.095840 3.746070 -7.883420
v -1.095840 0.156645 -14.294900
v -1.095840 -4.601110 -14.284900
v 0.042220 -4.601110 -14.284900
v 0.042220 -4.601110 -9.415440
v 0.042220 1.039181 -10.802900
v 0.042220 0.156645 -12.044100
v 0.042220 2.868579 -10.802900
v 0.042220 0.156645 -14.294900
v 0.042220 3.746069 -12.034100
v 0.042220 3.746070 -7.883420
v 0.042220 2.868580 -7.883420
v -1.096322 -3.033999 -9.415440
v 0.044046 -3.035397 -9.415440
vt 1.000000 0.187500
vt -1.000000 0.312500
vt 1.000000 0.312500
vt 0.687500 1.000000
vt 0.500000 0.875000
vt 0.500000 0.625000
vt -1.000000 0.062500
vt 1.000000 0.062500
vt 1.000000 -0.000000
vt -1.000000 0.125000
vt 1.000000 0.125000
vt 0.437500 0.125000
vt 0.312500 0.500000
vt 0.312500 0.125000
vt 1.000000 0.625000
vt -1.000000 0.500000
vt 1.000000 0.500000
vt 0.187500 0.687500
vt -0.187500 0.687500
vt -0.187500 0.312500
vt 1.000000 0.812500
vt -1.000000 0.937500
vt -1.000000 0.812500
vt 0.812500 0.687500
vt 1.187500 0.687500
vt 0.812500 0.312500
vt 1.000000 0.562500
vt 0.312500 0.437500
vt 1.000000 0.437500
vt 1.000000 0.750000
vt -1.000000 0.875000
vt -1.000000 0.750000
vt -1.000000 1.000000
vt 1.000000 1.000000
vt 0.437500 0.625000
vt 0.562500 0.437500
vt 0.562500 0.625000
vt -1.000000 0.437500
vt -1.000000 0.000000
vt 0.500000 0.062500
vt 0.375000 0.750000
vt 0.500000 0.750000
vt -1.000000 0.250000
vt -1.000000 0.687500
vt 1.000000 0.687500
vt 0.625000 0.375000
vt 1.000000 0.375000
vt 1.000000 0.250000
vt 1.000000 0.937500
vt 0.437500 0.812500
vt 0.312500 0.312500
vt 0.312500 0.812500
vt 0.437500 0.312500
vt 0.437500 0.437500
vt 0.687500 0.812500
vt 0.000000 0.687500
vt 0.000000 0.812500
vt -1.000000 0.562500
vt 0.875000 0.812500
vt 0.875000 0.687500
vt 0.250000 0.312500
vt 0.562500 0.187500
vt 0.250000 0.187500
vt -1.000000 0.187500
vt 0.312500 0.625000
vt 0.312500 0.187500
vt 0.312500 -0.187500
vt 1.000000 -0.187500
vt 0.687500 0.500000
vt -0.000000 1.000000
vt 0.000000 0.875000
vt 0.437500 0.500000
vt -1.000000 0.625000
vt 0.812500 0.187500
vt 1.187500 0.187500
vt 1.187500 0.312500
vt 1.312500 0.312500
vt 1.312500 0.687500
vt 0.687500 0.187500
vt 0.687500 0.312500
vt 1.187500 0.812500
vt 0.812500 0.812500
vt 0.187500 0.312500
vt 0.312500 0.687500
vt 0.687500 0.687500
vt -0.187500 0.187500
vt 0.187500 0.187500
vt -0.312500 0.687500
vt -0.312500 0.312500
vt 0.187500 0.812500
vt -0.187500 0.812500
vt 0.437500 0.687500
vt 0.437500 0.187500
vt 0.562500 0.812500
vt 0.562500 0.687500
vt 0.312500 0.562500
vt 1.000000 0.875000
vt 0.375000 0.062500
vt -1.000000 0.375000
vt 0.625000 0.500000
vt 0.875000 0.562500
vt 0.937500 0.812500
vt 0.937500 0.687500
vt 0.875000 0.937500
vt 0.562500 0.312500
vn -1.000000 0.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 0.000000 -1.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 -0.002100 -1.000000
vn 0.001200 -1.000000 0.000000
vn 0.000000 0.002800 -1.000000
vn -0.001200 -1.000000 0.000200
g boats_boat_boats_boat_None
usemtl None
s off
f 41/1/1 27/2/1 43/3/1
f 76/4/2 74/5/2 72/6/2
f 8/7/2 6/1/2 5/8/2
f 15/9/1 13/10/1 16/11/1
f 51/12/3 71/13/3 50/14/3
f 56/15/2 32/16/2 53/17/2
f 15/18/3 8/19/3 23/20/3
f 22/21/2 40/22/2 39/23/2
f 19/24/4 2/25/4 53/26/4
f 70/27/5 62/28/5 69/29/5
f 11/30/5 19/31/5 10/32/5
f 4/15/5 20/33/5 17/34/5
f 72/35/3 64/36/3 63/37/3
f 13/8/5 7/38/5 16/7/5
f 23/39/6 47/11/6 44/9/6
f 68/40/7 70/41/7 69/42/7
f 80/43/8 40/10/8 30/11/8
f 3/15/1 1/32/1 4/30/1
f 20/44/2 18/27/2 17/45/2
f 74/17/5 65/46/5 64/47/5
f 31/43/1 54/47/1 52/48/1
f 22/47/5 14/43/5 15/48/5
f 46/1/2 23/7/2 44/8/2
f 57/21/1 38/22/1 58/49/1
f 61/50/9 76/51/9 73/52/9
f 37/45/5 2/23/5 3/21/5
f 78/28/3 67/53/3 65/54/3
f 64/5/1 66/4/1 63/6/1
f 76/55/6 67/56/6 77/57/6
f 47/17/2 26/10/2 45/11/2
f 5/16/5 26/47/5 8/17/5
f 33/58/6 48/59/6 55/60/6
f 29/38/2 42/3/2 49/29/2
f 32/44/6 52/21/6 53/45/6
f 58/15/6 34/33/6 56/34/6
f 27/7/6 46/29/6 43/8/6
f 73/61/6 68/62/6 61/63/6
f 21/58/6 42/29/6 28/38/6
f 11/29/1 9/58/1 12/27/1
f 59/45/1 36/2/1 60/3/1
f 60/9/6 35/10/6 57/11/6
f 41/1/1 21/64/1 27/2/1
f 72/6/2 48/65/2 50/66/2
f 50/66/2 71/67/2 70/68/2
f 70/68/2 75/17/2 73/69/2
f 76/4/2 77/70/2 74/5/2
f 77/70/2 78/71/2 74/5/2
f 50/66/2 70/68/2 73/69/2
f 73/69/2 76/4/2 72/6/2
f 72/6/2 50/66/2 73/69/2
f 8/7/2 7/64/2 6/1/2
f 15/9/1 14/39/1 13/10/1
f 51/12/3 62/72/3 71/13/3
f 56/15/2 34/73/2 32/16/2
f 32/26/3 34/74/3 38/75/3
f 35/76/3 36/77/3 37/78/3
f 32/26/3 38/75/3 35/76/3
f 29/66/3 33/79/3 31/80/3
f 32/26/3 35/76/3 3/25/3
f 28/51/3 29/66/3 31/80/3
f 31/80/3 32/26/3 18/24/3
f 3/25/3 4/81/3 17/82/3
f 35/76/3 37/78/3 3/25/3
f 21/83/3 28/51/3 22/84/3
f 3/25/3 17/82/3 18/24/3
f 11/85/3 12/55/3 30/52/3
f 32/26/3 3/25/3 18/24/3
f 11/85/3 30/52/3 22/84/3
f 31/80/3 18/24/3 11/85/3
f 24/86/3 27/87/3 21/83/3
f 28/51/3 31/80/3 11/85/3
f 11/85/3 22/84/3 28/51/3
f 24/86/3 21/83/3 23/20/3
f 26/88/3 25/89/3 23/20/3
f 23/20/3 21/83/3 15/18/3
f 15/18/3 16/90/3 7/91/3
f 21/83/3 22/84/3 15/18/3
f 8/19/3 26/88/3 23/20/3
f 15/18/3 7/91/3 8/19/3
f 22/21/2 30/49/2 40/22/2
f 47/89/4 45/88/4 5/19/4
f 5/19/4 6/91/4 13/90/4
f 5/19/4 13/90/4 14/18/4
f 44/20/4 47/89/4 5/19/4
f 43/87/4 46/86/4 44/20/4
f 41/83/4 43/87/4 44/20/4
f 44/20/4 5/19/4 14/18/4
f 39/84/4 40/52/4 80/50/4
f 44/20/4 14/18/4 41/83/4
f 42/51/4 41/83/4 39/84/4
f 39/84/4 80/50/4 50/92/4
f 41/83/4 14/18/4 39/84/4
f 48/93/4 49/66/4 42/51/4
f 50/92/4 48/93/4 42/51/4
f 80/50/4 79/94/4 50/92/4
f 50/92/4 42/51/4 39/84/4
f 54/79/4 55/62/4 52/80/4
f 50/92/4 79/94/4 51/95/4
f 52/80/4 55/62/4 51/95/4
f 51/95/4 79/94/4 10/85/4
f 79/94/4 9/55/4 10/85/4
f 53/26/4 52/80/4 10/85/4
f 58/75/4 56/74/4 53/26/4
f 59/78/4 60/77/4 57/76/4
f 57/76/4 58/75/4 53/26/4
f 52/80/4 51/95/4 10/85/4
f 19/24/4 20/82/4 1/81/4
f 53/26/4 10/85/4 19/24/4
f 59/78/4 57/76/4 2/25/4
f 19/24/4 1/81/4 2/25/4
f 2/25/4 57/76/4 53/26/4
f 70/27/5 71/96/5 62/28/5
f 11/30/5 18/97/5 19/31/5
f 4/15/5 1/73/5 20/33/5
f 72/35/3 74/54/3 64/36/3
f 13/8/5 6/29/5 7/38/5
f 23/39/6 25/10/6 47/11/6
f 68/40/7 75/98/7 70/41/7
f 30/11/5 12/17/5 79/99/5
f 79/99/10 80/43/10 30/11/10
f 12/17/5 9/16/5 79/99/5
f 3/15/1 2/73/1 1/32/1
f 20/44/2 19/58/2 18/27/2
f 74/17/5 78/100/5 65/46/5
f 31/43/1 33/99/1 54/47/1
f 22/47/5 39/99/5 14/43/5
f 46/1/2 24/64/2 23/7/2
f 57/21/1 35/23/1 38/22/1
f 61/50/9 66/53/9 76/51/9
f 37/45/5 59/44/5 2/23/5
f 78/28/3 77/51/3 67/53/3
f 62/67/1 51/66/1 69/68/1
f 51/66/1 55/65/1 63/6/1
f 68/17/1 69/68/1 61/69/1
f 61/69/1 69/68/1 51/66/1
f 61/69/1 51/66/1 63/6/1
f 65/71/1 67/70/1 64/5/1
f 61/69/1 63/6/1 66/4/1
f 64/5/1 67/70/1 66/4/1
f 76/55/6 66/85/6 67/56/6
f 47/17/2 25/16/2 26/10/2
f 5/16/5 45/99/5 26/47/5
f 55/60/6 54/101/6 33/58/6
f 33/58/6 29/22/6 48/59/6
f 48/59/6 72/102/6 63/103/6
f 29/22/6 49/104/6 48/59/6
f 48/59/6 63/103/6 55/60/6
f 29/38/2 28/2/2 42/3/2
f 32/44/6 31/23/6 52/21/6
f 58/15/6 38/73/6 34/33/6
f 27/7/6 24/38/6 46/29/6
f 73/61/6 75/105/6 68/62/6
f 21/58/6 41/27/6 42/29/6
f 11/29/1 10/38/1 9/58/1
f 59/45/1 37/44/1 36/2/1
f 60/9/6 36/39/6 35/10/6

BIN
mods/boats/textures/boats_inventory.png

After

Width: 32  |  Height: 32  |  Size: 851 B

BIN
mods/boats/textures/boats_wield.png

After

Width: 32  |  Height: 32  |  Size: 546 B

12
mods/bones/README.txt

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

291
mods/bones/init.lua

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

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

Loading…
Cancel
Save