Compare commits
152 Commits
debiankaio
...
master
Author | SHA1 | Date |
---|---|---|
kay27 | f204470052 | |
kay27 | 721e721427 | |
kay27 | e4f218fded | |
CableGuy67 | 5432c6bd92 | |
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 | c5ad0d5f33 | |
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 | b6a4c1a995 | |
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 | f0b8e8ea11 | |
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 | d0fcab11e9 | |
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 | b7f3b8edd5 | |
3raven | 940499ee7e | |
3raven | 9b04b285b7 | |
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 | 1d315c569f | |
3raven | 64766109f5 | |
3raven | c6f09e30a5 | |
3raven | a47e0d2f17 | |
3raven | a1ca0c3431 | |
3raven | c72c960e8a | |
3raven | 0184925890 | |
3raven | 44d32b5d17 | |
3raven | 07d564b5a2 | |
3raven | 1e431814bc | |
3raven | 337b4e1d05 | |
3raven | f052e26e0c | |
3raven | c55aab9360 | |
3raven | 421c1e8d00 | |
3raven | 3591ef1fae | |
3raven | 47ed81490a | |
3raven | 609653eaf2 | |
3raven | f828ee6a19 | |
3raven | e14545a2b8 | |
3raven | c3111c99b2 | |
3raven | 140fd67686 | |
3raven | 700200958d | |
3raven | 8cd3b63fae | |
3raven | 4c957a3e7c | |
3raven | 2b87fb2cd2 | |
3raven | cbfac60742 | |
3raven | f46d093038 | |
3raven | cc300971b3 | |
3raven | 9dd85f9f7b | |
3raven | 7f34c979ff | |
3raven | 6afda0af92 | |
3raven | f60588cf25 | |
3raven | fd94fba22c | |
3raven | 99c4fbfc38 | |
3raven | e4865338fc | |
3raven | c1a7d3e504 | |
3raven | b7c521bedc | |
3raven | 8f64a1e18c | |
3raven | e017d4a724 | |
3raven | 69fc0228d6 | |
3raven | c0e83aa0cd | |
3raven | 5429a259ff | |
3raven | 3e8e74b633 | |
3raven | a2933ece62 | |
3raven | 820ceceffc | |
3raven | 11a9f6baea | |
3raven | 5d214ae4bf | |
3raven | 13e92cd5b3 | |
3raven | 5fa14070d3 | |
3raven | 3129379fe9 | |
3raven | 45c3889316 | |
3raven | b0392bbeb9 | |
3raven | 7db8d3cd5f | |
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 | 86328c0822 | |
3raven | 89f835ab7b | |
3raven | 5f2ea5b073 | |
3raven | 8e98239a57 | |
3raven | 521b890612 | |
kay27 | 8eb0ba5501 | |
kabou | ed963428c0 | |
kay27 | f5ab76592c | |
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 | d424aaa5bc | |
kay27 | 05fdda96ad | |
kay27 | bba0ef15cb | |
PrairieWind | 4444437f94 | |
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 | b99fbe8f69 | |
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 | ddaa96589e | |
PrairieAstronomer | 2ea868ba79 | |
PrairieAstronomer | c9470b8262 | |
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 | 1273d59995 | |
debiankaios | 0dfe211053 | |
debiankaios | 5b8d9cd2f0 | |
chmodsayshello | d467060897 | |
chmodsayshello | dc93dd87e2 | |
chmodsayshello | da7be430ce | |
chmodsayshello | fc50c81571 | |
Mikita Wiśniewski | fa4a554b28 | |
Mikita Wiśniewski | ddb618c2e3 | |
chmodsayshello | 650e2f5c60 | |
Mikita Wiśniewski | 297f9ba11a | |
kay27 | 833e32410e | |
kay27 | a7ca121f73 | |
CableGuy67 | 9e72966f91 | |
CableGuy67 | 7ad5f7c66e | |
chmodsayshello | 1c12f3da19 | |
chmodsayshello | 63123816f0 | |
kay27 | 0b4f28d8b3 | |
chmodsayshello | 6c41b8a265 | |
chmodsayshello | fc59d05679 | |
chmodsayshello | a32531c8f6 | |
chmodsayshello | fb6315ea62 | |
chmodsayshello | d97c7b29c6 | |
chmodsayshello | 1dd81decd5 | |
chmodsayshello | 57c099943a | |
chmodsayshello | 6521e1f22e | |
chmodsayshello | f49d7da655 | |
chmodsayshello | 7117ce55db | |
kay27 | 7b0119ddd6 | |
Mark Roth | 6c196ae63a | |
Mark Roth | c282324661 | |
kay27 | 05e739390e | |
kay27 | cb4bb79224 | |
kay27 | 2f7bb481ad | |
kay27 | 7ca28d8a27 | |
kay27 | a392d59cab | |
kay27 | 2ea71e9367 | |
kay27 | 6d27d5b5af | |
kay27 | 37ff5f15bd | |
cora | ba5474f5d4 | |
kay27 | 89cbc1deed | |
kay27 | a637e4bdaf | |
kay27 | c5b9313428 | |
kay27 | 21f7738b4d | |
kay27 | 7ad310a848 | |
kay27 | 60693b2d01 | |
kay27 | 429984937c | |
kay27 | abfd2e692a | |
kay27 | 4b026a70e5 | |
kay27 | 4c671429c5 | |
kay27 | 430c3ce636 | |
kay27 | ef08bfa5d9 | |
kay27 | e2d2d4219b | |
kay27 | 1e8f5ffc74 | |
kay27 | 869154f86d | |
kay27 | 4360158ecf | |
kay27 | 887f358e1f | |
kay27 | 5119f07194 | |
CableGuy67 | 78c1f741d6 | |
CableGuy67 | 7c7ad3ef0a | |
kay27 | a605a7afe7 | |
kay27 | abe2bde998 | |
kay27 | 9d7f619a24 | |
kay27 | be3549fb8d | |
kay27 | c8aefd03ec | |
kay27 | 6f66be58b0 | |
kay27 | c055d88f59 | |
kay27 | 96bc98e716 | |
kay27 | a887708fb5 | |
kay27 | 54c06f3fe8 | |
kay27 | ed4e23902d | |
kay27 | 24b735ae53 |
|
@ -27,19 +27,35 @@ Any Pull Request that isn't a bug fix can be closed within a week unless it rece
|
|||
|
||||
Start coding!
|
||||
|
||||
Refer to Minetest Lua API, Developer Wiki and other documentation.
|
||||
Refer to [Minetest Lua API](https://github.com/minetest/minetest/blob/master/doc/lua_api.txt), [Developer Wiki](https://dev.minetest.net/), [MineClone 5 Wiki](https://git.minetest.land/MineClone5/MineClone5/wiki/) and other documentation.
|
||||
|
||||
Follow Lua code style guidelines. Use tabs, not spaces for indentation (tab size = 8). Never use `minetest.env`.
|
||||
Follow [Lua code style guidelines](https://dev.minetest.net/Lua_code_style_guidelines). Use tabs, not spaces for indentation (tab size = 8). Never use `minetest.env`.
|
||||
|
||||
Check your code works as expected.
|
||||
|
||||
Commit & push your changes to a new branch (not master, one change per branch)
|
||||
Commit & push your changes to a new branch (not master, one change per a branch).
|
||||
|
||||
Commit messages should use the present tense and be descriptive.
|
||||
|
||||
Once you are happy with your changes, submit a pull request.
|
||||
|
||||
A pull-request is considered merge-able when:
|
||||
A pull-request is considered merge-able when it looks good to one person from the community.
|
||||
|
||||
Please invite other developers to review your contribution when you know they are online. If there is no any reaction during 24 hours after posting the invitation and pinging developers - you are welcome to do a self-review and merge the request.
|
||||
|
||||
If someone else's contribution looks good to you - you are free to merge it ASAP.
|
||||
|
||||
Different git branches are welcomed! Releases by different people are welcomed! Releases from different branches are welcomed! Frequent releases are welcomed!
|
||||
|
||||
It is nice not to block other developers by your work and don't dictate them what to do, unsless they really want that. Git branches and forks are recommended to avoid conflicts at development stage.
|
||||
|
||||
It is nice to try splitting big features into small steps.
|
||||
|
||||
It is nice to create an issue for any work and mention the issue in the commit text, like `#123 Fix blast resistance of cactus`, where `#123` is the issue number.
|
||||
|
||||
Actually, it looks like we all love what we do, so any stupid situations should be carefully discussed before merging into upstreams. But nothing prevents us from releasing controversial stuff through dedicated branches. Release your contribution when you need more feedback.
|
||||
|
||||
Feel free to break the rules if you're sure you have to.
|
||||
|
||||
#### Contributors
|
||||
|
||||
|
|
|
@ -71,6 +71,7 @@ Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times
|
|||
* `coral_block=X`: Coral block (1 = alive, 2 = dead)
|
||||
* `coral_species=X`: Specifies the species of a coral; equal X means equal species
|
||||
* `set_on_fire=X`: Sets any (not fire-resistant) mob or player on fire for X seconds when touching
|
||||
* `compostability`: Amount from 1 to 100 that defines the percentage of likelyhood that the composter will advance a level.
|
||||
|
||||
#### Footnotes
|
||||
|
||||
|
|
|
@ -188,3 +188,7 @@ Technical differences from Minecraft:
|
|||
* `API.md`: For Minetest modders who want to mod this game
|
||||
* `LEGAL.md`: Legal information
|
||||
* `CREDITS.md`: List of everyone who contributed
|
||||
|
||||
## Menu music
|
||||
|
||||
* horizonchris96 — 02_what_we_ll_build_next
|
||||
|
|
|
@ -1,674 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
@ -1,9 +0,0 @@
|
|||
# mcl_bubble_column by j45
|
||||
|
||||
https://github.com/Minetest-j45/mcl_bubble_column/
|
||||
|
||||
Adds whirlpools and upwards bubble columns to Mineclone2/5
|
||||
|
||||
A bubble column is a block generated by placing magma blocks or soul sand in water (source).
|
||||
|
||||
Bubble columns push or pull entities and items in certain directions.
|
|
@ -1,195 +0,0 @@
|
|||
mcl_bubble_column = {}
|
||||
|
||||
minetest.register_abm{
|
||||
label = "bubbleColumnUpStop",
|
||||
nodenames = {"group:water"},
|
||||
interval = 0.05,
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta:get_int("bubbly") == 1 then--bubble column
|
||||
--check down if current needs to be deleted
|
||||
local downpos = vector.add(pos, {x = 0, y = -1, z = 0})
|
||||
local downposnode = minetest.get_node(downpos)
|
||||
local downmeta = minetest.get_meta(downpos)
|
||||
if (downmeta:get_int("bubbly") ~= 1 and downposnode.name ~= "mcl_nether:soul_sand") then
|
||||
meta:set_int("bubbly", 0)
|
||||
end
|
||||
--check up to see if needs to go up
|
||||
local uppos = vector.add(pos, {x = 0, y = 1, z = 0})
|
||||
local upposnode = minetest.get_node(uppos)
|
||||
local upmeta = minetest.get_meta(uppos)
|
||||
if (minetest.get_item_group(upposnode.name, "water") == 3 and upmeta:get_int("bubbly") ~= 1) then
|
||||
upmeta:set_int("bubbly", 1)
|
||||
end
|
||||
elseif meta:get_int("whirly") == 1 then--whirlpool
|
||||
--check down if current needs to be deleted
|
||||
local downpos = vector.add(pos, {x = 0, y = -1, z = 0})
|
||||
local downposnode = minetest.get_node(downpos)
|
||||
local downmeta = minetest.get_meta(downpos)
|
||||
if (downmeta:get_int("whirly") ~= 1 and downposnode.name ~= "mcl_nether:magma") then
|
||||
meta:set_int("whirly", 0)
|
||||
end
|
||||
--check up to see if needs to go up
|
||||
local uppos = vector.add(pos, {x = 0, y = 1, z = 0})
|
||||
local upposnode = minetest.get_node(uppos)
|
||||
local upmeta = minetest.get_meta(uppos)
|
||||
if (minetest.get_item_group(upposnode.name, "water") == 3 and upmeta:get_int("whirly") ~= 1) then
|
||||
upmeta:set_int("whirly", 1)
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
minetest.register_abm{
|
||||
label = "startBubbleColumn",
|
||||
nodenames = {"mcl_nether:soul_sand"},
|
||||
interval = 0.05,
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
local uppos = vector.add(pos, {x = 0, y = 1, z = 0})
|
||||
local upposnode = minetest.get_node(uppos)
|
||||
local upmeta = minetest.get_meta(uppos)
|
||||
if (minetest.get_item_group(upposnode.name, "water") == 3 and upmeta:get_int("bubbly") ~= 1) then
|
||||
upmeta:set_int("bubbly", 1)
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
minetest.register_abm{
|
||||
label = "startWhirlpool",
|
||||
nodenames = {"mcl_nether:magma"},
|
||||
interval = 0.05,
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
local uppos = vector.add(pos, {x = 0, y = 1, z = 0})
|
||||
local upposnode = minetest.get_node(uppos)
|
||||
local upmeta = minetest.get_meta(uppos)
|
||||
if (minetest.get_item_group(upposnode.name, "water") == 3 and upmeta:get_int("whirly") ~= 1) then
|
||||
upmeta:set_int("whirly", 1)
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
mcl_bubble_column.on_enter_bubble_column = function(self)
|
||||
local velocity = self:get_velocity()
|
||||
--[[if down.name == "mcl_nether:soul_sand" then
|
||||
self:add_velocity({x = 0, y = math.min(10, math.abs(velocity.y)+9.4), z = 0})
|
||||
else]]
|
||||
self:add_velocity({x = 0, y = math.min(3.6, math.abs(velocity.y)+3), z = 0})
|
||||
--end
|
||||
end
|
||||
|
||||
mcl_bubble_column.on_enter_whirlpool = function(self)
|
||||
local velocity = self:get_velocity()
|
||||
--self:add_velocity({x = 0, y = math.max(-3, (-math.abs(velocity.y))-2), z = 0})
|
||||
self:add_velocity({x = 0, y = math.max(-0.3, (-math.abs(velocity.y))-0.03), z = 0})
|
||||
end
|
||||
|
||||
mcl_bubble_column.on_enter_bubble_column_with_air_above = function(self)
|
||||
local velocity = self:get_velocity()
|
||||
--[[if down.name == "mcl_nether:soul_sand" then
|
||||
self:add_velocity({x = 0, y = math.min(4.3, math.abs(velocity.y)+2.8), z = 0})
|
||||
else]]
|
||||
self:add_velocity({x = 0, y = math.min(2.6, math.abs(velocity.y)+2), z = 0})
|
||||
--end
|
||||
end
|
||||
|
||||
mcl_bubble_column.on_enter_whirlpool_with_air_above = function(self)
|
||||
local velocity = self:get_velocity()
|
||||
--self:add_velocity({x = 0, y = math.max(-3.5, (-math.abs(velocity.y))-2), z = 0})
|
||||
self:add_velocity({x = 0, y = math.max(-0.9, (-math.abs(velocity.y))-0.03), z = 0})
|
||||
end
|
||||
|
||||
minetest.register_abm{
|
||||
label = "entGo",
|
||||
nodenames = {"group:water"},
|
||||
interval = 0.05,
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
--if not bubble column block return
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta:get_int("bubbly") == 1 then
|
||||
local up = minetest.get_node(vector.add(pos, {x = 0, y = 1, z = 0}))
|
||||
for _,entity in pairs(minetest.get_objects_inside_radius(pos, 0.75)) do
|
||||
if up.name == "air" then
|
||||
mcl_bubble_column.on_enter_bubble_column_with_air_above(entity)
|
||||
else
|
||||
mcl_bubble_column.on_enter_bubble_column(entity)
|
||||
end
|
||||
end
|
||||
elseif meta:get_int("whirly") == 1 then
|
||||
local up = minetest.get_node(vector.add(pos, {x = 0, y = 1, z = 0}))
|
||||
for _,entity in pairs(minetest.get_objects_inside_radius(pos, 0.75)) do
|
||||
if up.name == "air" then
|
||||
mcl_bubble_column.on_enter_whirlpool_with_air_above(entity)
|
||||
else
|
||||
mcl_bubble_column.on_enter_whirlpool(entity)
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
minetest.register_globalstep(function()
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
local ppos = player:get_pos()
|
||||
local eyepos = {x = ppos.x, y = ppos.y + player:get_properties().eye_height, z = ppos.z}
|
||||
local node = minetest.get_node(ppos)
|
||||
local eyenode = minetest.get_node(eyepos)
|
||||
local meta = minetest.get_meta(ppos)
|
||||
local eyemeta = minetest.get_meta(eyepos)
|
||||
|
||||
local eyemeta = minetest.get_meta(ppos)
|
||||
--if minetest.get_item_group(node.name, "water") == 3 and minetest.get_item_group(eyenode.name, "water") == 3 then return end
|
||||
if meta:get_int("bubbly") == 1 or eyemeta:get_int("bubbly") == 1 then
|
||||
local up = minetest.get_node(vector.add(eyepos, {x = 0, y = 1, z = 0}))
|
||||
if up.name == "air" then
|
||||
mcl_bubble_column.on_enter_bubble_column_with_air_above(player)
|
||||
else
|
||||
mcl_bubble_column.on_enter_bubble_column(player)
|
||||
end
|
||||
elseif meta:get_int("whirly") == 1 or eyemeta:get_int("whirly") == 1 then
|
||||
local up = minetest.get_node(vector.add(ppos, {x = 0, y = 1, z = 0}))
|
||||
if up.name == "air" then
|
||||
mcl_bubble_column.on_enter_whirlpool_with_air_above(player)
|
||||
else
|
||||
mcl_bubble_column.on_enter_whirlpool(player)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
--abms to remove and replace old bubble columns/whirlpools
|
||||
minetest.register_abm{
|
||||
label = "removeOldFlowingColumns",
|
||||
nodenames = {"mcl_bubble_column:water_flowing_up", "mcl_bubble_column:water_flowing_down"},
|
||||
interval = 1,--reduce lag
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
minetest.set_node(pos, {name = "air"})
|
||||
end,
|
||||
}
|
||||
minetest.register_abm{
|
||||
label = "replaceBubbleColumns",
|
||||
nodenames = {"mcl_bubble_column:water_source_up"},
|
||||
interval = 1,--reduce lag
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
minetest.set_node(pos, {name = "mcl_core:water_source"})
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("bubbly", 1)
|
||||
end,
|
||||
}
|
||||
minetest.register_abm{
|
||||
label = "replaceWhirlpools",
|
||||
nodenames = {"mcl_bubble_column:water_source_down"},
|
||||
interval = 1,--reduce lag
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
minetest.set_node(pos, {name = "mcl_core:water_source"})
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("whirly", 1)
|
||||
end,
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
name = mcl_bubble_column
|
|
@ -416,7 +416,7 @@ mcl_mapgen.bedrock_is_rough = normal
|
|||
overworld.min = -62
|
||||
if superflat then
|
||||
mcl_mapgen.ground = tonumber(minetest.get_mapgen_setting("mgflat_ground_level")) or 8
|
||||
overworld.min = ground - 3
|
||||
overworld.min = mcl_mapgen.ground - 3
|
||||
end
|
||||
-- if singlenode then mcl_mapgen.overworld.min = -66 end -- DONT KNOW WHY
|
||||
overworld.max = mcl_mapgen.EDGE_MAX
|
||||
|
|
|
@ -417,6 +417,7 @@ function mcl_util.deal_damage(target, damage, mcl_reason)
|
|||
-- target:punch(puncher, 1.0, {full_punch_interval = 1.0, damage_groups = {fleshy = damage}}, vector.direction(puncher:get_pos(), target:get_pos()), damage)
|
||||
if luaentity.health > 0 then
|
||||
luaentity.health = luaentity.health - damage
|
||||
luaentity.pause_timer = 0.4
|
||||
end
|
||||
return
|
||||
end
|
||||
|
|
|
@ -246,4 +246,4 @@ water-16,
|
|||
water)
|
||||
|
||||
--spawn egg
|
||||
mobs:register_egg("extra_mobs:dolphin", S("dolphin"), "extra_mobs_spawn_icon_dolphin.png", 0)
|
||||
mobs:register_egg("extra_mobs:dolphin", S("Dolphin"), "extra_mobs_spawn_icon_dolphin.png", 0)
|
||||
|
|
|
@ -18,12 +18,7 @@ local S = minetest.get_translator("extra_mobs")
|
|||
--################### fox
|
||||
--###################
|
||||
|
||||
local followitem = ""
|
||||
if minetest.get_modpath("mc_sweet_berry") then
|
||||
followitem = "mc_sweet_berry:sweet_berry"
|
||||
else
|
||||
followitem = nil
|
||||
end
|
||||
local followitem = "mcl_farming:sweet_berry"
|
||||
|
||||
local fox = {
|
||||
type = "monster",
|
||||
|
@ -123,35 +118,30 @@ local fox = {
|
|||
mobs:register_mob("extra_mobs:fox", fox)
|
||||
|
||||
-- spawning
|
||||
mobs:spawn_specific(
|
||||
"extra_mobs:fox",
|
||||
"overworld",
|
||||
"ground",
|
||||
{
|
||||
"FlowerForest",
|
||||
"Swampland",
|
||||
"Taiga",
|
||||
"ExtremeHills",
|
||||
"BirchForest",
|
||||
"MegaSpruceTaiga",
|
||||
"MegaTaiga",
|
||||
"ExtremeHills+",
|
||||
"Forest",
|
||||
"Plains",
|
||||
"ColdTaiga",
|
||||
"SunflowerPlains",
|
||||
"RoofedForest",
|
||||
"MesaPlateauFM_grasstop",
|
||||
"ExtremeHillsM",
|
||||
"BirchForestM",
|
||||
},
|
||||
0,
|
||||
minetest.LIGHT_MAX+1,
|
||||
30,
|
||||
6000,
|
||||
3,
|
||||
mobs_mc.spawn_height.water,
|
||||
mobs_mc.spawn_height.overworld_max)
|
||||
mobs:spawn_setup({
|
||||
name = "extra_mobs:fox",
|
||||
biomes = {
|
||||
"FlowerForest",
|
||||
"Swampland",
|
||||
"Taiga",
|
||||
"ExtremeHills",
|
||||
"BirchForest",
|
||||
"MegaSpruceTaiga",
|
||||
"MegaTaiga",
|
||||
"ExtremeHills+",
|
||||
"Forest",
|
||||
"Plains",
|
||||
"ColdTaiga",
|
||||
"SunflowerPlains",
|
||||
"RoofedForest",
|
||||
"MesaPlateauFM_grasstop",
|
||||
"ExtremeHillsM",
|
||||
"BirchForestM",
|
||||
},
|
||||
interval = 30,
|
||||
chance = 6000,
|
||||
min_height = mobs_mc.spawn_height.water,
|
||||
})
|
||||
|
||||
--mobs:spawn_specific("extra_mobs:fox", "overworld", "ground", 0, minetest.LIGHT_MAX+1, 30, 6000, 3, 0, 500)
|
||||
--[[
|
||||
|
|
|
@ -54,10 +54,11 @@ minetest.register_entity("extra_mobs:glow_item_frame_item",{
|
|||
end
|
||||
end,
|
||||
get_staticdata = function(self)
|
||||
if not self then return end
|
||||
if self._nodename ~= nil and self._texture ~= nil then
|
||||
local ret = self._nodename .. ';' .. self._texture
|
||||
if self._scale ~= nil then
|
||||
ret = ret .. ';' .. self._scale
|
||||
ret = ret .. ';' .. tostring(self._scale)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
# textdomain:extra_mobs
|
||||
Hoglin=Hoglin
|
||||
piglin=Piglin
|
||||
piglin Brute=Piglin Barbare
|
||||
Strider=Arpenteur
|
||||
Fox=Renard
|
||||
Cod=Poisson
|
||||
Salmon=Saumon
|
||||
dolphin=Dauphin
|
||||
Glow Squid=Pieuvre Lumineuse
|
||||
Glow Ink Sac=Sac d'Encre Lumineuse
|
||||
Use it to craft the Glow Item Frame.=Utilisez le pour fabriquer le Cadre à Objet Lumineux
|
||||
Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame.=Utiliser le Sac d'Encre Lumineuse et le Cadre à Objet normal pour fabriquer le Cadre à Objet Lumineux.
|
||||
Glow Item Frame=Cadre à Objet Lumineux
|
||||
Can hold an item and glows=Peut exposer un objet et éclairer
|
||||
Glow Item frames are decorative blocks in which items can be placed.=les Cadres à Objet Lumineux sont des blocs décoratifs pouvant contenir des objets.
|
||||
Just place any item on the item frame. Use the item frame again to retrieve the item.=Placer n'importe quel objet sur le cadre. Récupérer l'objet en faisant un clic droit sur le cadre.
|
|
@ -296,5 +296,5 @@ minetest.LIGHT_MAX+1,
|
|||
mobs_mc.spawn_height.nether_min,
|
||||
mobs_mc.spawn_height.nether_max)
|
||||
-- spawn eggs
|
||||
mobs:register_egg("extra_mobs:piglin", S("piglin"), "extra_mobs_spawn_icon_piglin.png", 0)
|
||||
mobs:register_egg("extra_mobs:piglin_brute", S("piglin Brute"), "extra_mobs_spawn_icon_piglin.png", 0)
|
||||
mobs:register_egg("extra_mobs:piglin", S("Piglin"), "extra_mobs_spawn_icon_piglin.png", 0)
|
||||
mobs:register_egg("extra_mobs:piglin_brute", S("Piglin Brute"), "extra_mobs_spawn_icon_piglin.png", 0)
|
||||
|
|
|
@ -213,20 +213,36 @@ baby_strider.child = 1
|
|||
mobs:register_mob("extra_mobs:baby_strider", baby_strider)
|
||||
|
||||
-- Regular spawning in the Nether
|
||||
mobs:spawn_specific(
|
||||
"extra_mobs:strider",
|
||||
"nether",
|
||||
"lava",
|
||||
{
|
||||
"Nether"
|
||||
},
|
||||
0,
|
||||
minetest.LIGHT_MAX+1,
|
||||
30,
|
||||
6000,
|
||||
3,
|
||||
mobs_mc.spawn_height.nether_min,
|
||||
mobs_mc.spawn_height.nether_max)
|
||||
|
||||
mobs:spawn_setup({
|
||||
name = "extra_mobs:strider",
|
||||
type_of_spawning = "lava",
|
||||
dimension = "nether",
|
||||
biomes = {
|
||||
"Nether"
|
||||
},
|
||||
min_height = mcl_mapgen.nether.min,
|
||||
max_height = mcl_mapgen.nether.max,
|
||||
chance = 2000,
|
||||
check_position = function(pos)
|
||||
return minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name:find("lava")
|
||||
end
|
||||
})
|
||||
|
||||
mobs:spawn_setup({
|
||||
name = "extra_mobs:baby_strider",
|
||||
type_of_spawning = "lava",
|
||||
dimension = "nether",
|
||||
biomes = {
|
||||
"Nether"
|
||||
},
|
||||
min_height = mcl_mapgen.nether.min,
|
||||
max_height = mcl_mapgen.nether.max,
|
||||
chance = 100,
|
||||
check_position = function(pos)
|
||||
return minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name:find("lava")
|
||||
end
|
||||
})
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("extra_mobs:strider", S("Strider"), "extra_mobs_spawn_icon_strider.png", 0)
|
||||
|
|
|
@ -175,10 +175,13 @@ function boat.on_activate(self, staticdata, dtime_s)
|
|||
end
|
||||
|
||||
function boat.get_staticdata(self)
|
||||
if not self then return end
|
||||
local object = self.object
|
||||
local object_properties = object and object.get_properties and object:get_properties()
|
||||
return minetest.serialize({
|
||||
v = self._v,
|
||||
itemstring = self._itemstring,
|
||||
textures = self.object:get_properties().textures
|
||||
textures = object_properties and object_properties.textures
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ Boats are used to travel on the surface of water.=Les bateaux sont utilisés pou
|
|||
Dark Oak Boat=Bateau en Chêne Noir
|
||||
Jungle Boat=Bateau en Acajou
|
||||
Oak Boat=Bateau en Chêne
|
||||
Obsidian Boat=Bateau en Obsidienne
|
||||
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=Faites un clic droit sur une source d'eau pour placer le bateau. Faites un clic droit sur le bateau pour y entrer. Utilisez [Gauche] et [Droite] pour diriger, [Avant] pour accélérer et [Arrière] pour ralentir ou reculer. Utilisez [Sneak] pour le quitter, frappez le bateau pour le faire tomber en tant qu'objet.
|
||||
Spruce Boat=Bateau en Sapin
|
||||
Water vehicle=Véhicule aquatique
|
||||
|
|
|
@ -89,6 +89,7 @@ minetest.register_entity(":__builtin:falling_node", {
|
|||
})
|
||||
end,
|
||||
get_staticdata = function(self)
|
||||
if not self then return end
|
||||
local meta = self.meta
|
||||
-- Workaround: Save inventory seperately from metadata.
|
||||
-- Because Minetest crashes when a node with inventory gets deactivated
|
||||
|
|
|
@ -65,6 +65,8 @@ mcl_item_entity.register_pickup_achievement("tree", "mcl:mineWood")
|
|||
mcl_item_entity.register_pickup_achievement("mcl_mobitems:blaze_rod", "mcl:blazeRod")
|
||||
mcl_item_entity.register_pickup_achievement("mcl_mobitems:leather", "mcl:killCow")
|
||||
mcl_item_entity.register_pickup_achievement("mcl_core:diamond", "mcl:diamonds")
|
||||
mcl_item_entity.register_pickup_achievement("mcl_core:crying_obsidian", "mcl:whosCuttingOnions")
|
||||
mcl_item_entity.register_pickup_achievement("mcl_nether:ancient_debris", "mcl:hiddenInTheDepths")
|
||||
|
||||
local function check_pickup_achievements(object, player)
|
||||
if has_awards then
|
||||
|
@ -486,6 +488,7 @@ minetest.register_entity(":__builtin:item", {
|
|||
end,
|
||||
|
||||
get_staticdata = function(self)
|
||||
if not self then return end
|
||||
local data = minetest.serialize({
|
||||
itemstring = self.itemstring,
|
||||
always_collect = self.always_collect,
|
||||
|
|
|
@ -503,6 +503,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
|
|||
end
|
||||
|
||||
function cart:get_staticdata()
|
||||
if not self then return end
|
||||
return minetest.serialize({_railtype = self._railtype})
|
||||
end
|
||||
|
||||
|
|
|
@ -227,6 +227,11 @@ functions needed for the mob to work properly which contains the following:
|
|||
older mobs.
|
||||
'pushable' Allows players, & other mobs to push the mob.
|
||||
|
||||
'spawn_with_armor' If set to true, the mob has a small chance of spawning with
|
||||
random matched armor. If set to a string, the string represents
|
||||
the material type of the armor. Any materials used by
|
||||
mcl_armor will work. Example: "gold"
|
||||
It is assumed that the first texture is for armor.
|
||||
|
||||
|
||||
MineClone 2 extensions:
|
||||
|
|
|
@ -375,6 +375,7 @@ function mobs:register_mob(name, def)
|
|||
--moves the wrong way
|
||||
swap_y_with_x = def.swap_y_with_x or false,
|
||||
reverse_head_yaw = def.reverse_head_yaw or false,
|
||||
_spawn_with_armor = def.spawn_with_armor,
|
||||
|
||||
--END HEAD CODE VARIABLES
|
||||
|
||||
|
@ -425,7 +426,9 @@ function mobs:register_mob(name, def)
|
|||
end,
|
||||
|
||||
get_staticdata = function(self)
|
||||
if self and mobs then
|
||||
return mobs.mob_staticdata(self)
|
||||
end
|
||||
end,
|
||||
|
||||
--harmed_by_heal = def.harmed_by_heal,
|
||||
|
|
|
@ -801,20 +801,6 @@ function mobs.mob_step(self, dtime)
|
|||
return false
|
||||
end
|
||||
|
||||
|
||||
--DEBUG TIME!
|
||||
--REMEMBER TO MOVE THIS AFTER DEATH CHECK
|
||||
|
||||
--if self.has_head then
|
||||
-- mobs.do_head_logic(self,dtime)
|
||||
--end
|
||||
|
||||
|
||||
|
||||
--if true then--DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG
|
||||
-- return
|
||||
--end
|
||||
|
||||
--despawn mechanism
|
||||
--don't despawned tamed or bred mobs
|
||||
if not self.tamed and not self.bred then
|
||||
|
@ -833,7 +819,7 @@ function mobs.mob_step(self, dtime)
|
|||
self.object:set_texture_mod("^[colorize:red:120")
|
||||
--fix double death sound
|
||||
if self.health > 0 then
|
||||
mobs.play_sound(self,"damage")
|
||||
mobs.play_sound(self, "damage")
|
||||
end
|
||||
end
|
||||
self.old_health = self.health
|
||||
|
@ -863,7 +849,7 @@ function mobs.mob_step(self, dtime)
|
|||
return
|
||||
end
|
||||
|
||||
mobs.random_sound_handling(self,dtime)
|
||||
mobs.random_sound_handling(self, dtime)
|
||||
|
||||
--mobs drowning mechanic
|
||||
if not self.breathes_in_water then
|
||||
|
@ -893,14 +879,40 @@ function mobs.mob_step(self, dtime)
|
|||
end
|
||||
end
|
||||
|
||||
--water damage
|
||||
if self.water_damage and self.water_damage ~= 0 then
|
||||
local pos = self.object:get_pos()
|
||||
local node = minetest_get_node(pos).name
|
||||
if minetest_get_item_group(node, "water") ~= 0 then
|
||||
|
||||
--water damage
|
||||
if self.water_damage and self.water_damage ~= 0 and minetest_get_item_group(node, "water") ~= 0 then
|
||||
self.water_counter = (self.water_counter or 0) + dtime
|
||||
if self.water_counter >= 1 then
|
||||
mobs.smoke_effect(self)
|
||||
self.health = self.health - self.water_damage
|
||||
self:teleport()
|
||||
self.water_counter = 0
|
||||
end
|
||||
end
|
||||
|
||||
--lava damage
|
||||
local lava_damage = self.lava_damage
|
||||
if lava_damage and lava_damage ~= 0 and minetest_get_item_group(node, "lava") ~= 0 then
|
||||
self.lava_counter = (self.lava_counter or 0) + dtime
|
||||
if self.lava_counter >= 1 then
|
||||
minetest.sound_play("default_punch", {
|
||||
object = self.object,
|
||||
max_hear_distance = 5
|
||||
}, true)
|
||||
--[[ if not mcl_burning.is_burning(self.object) then
|
||||
mcl_burning.set_on_fire(self.object, 1.1)
|
||||
else
|
||||
]] self.object:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = self.lava_damage}
|
||||
}, nil)
|
||||
-- end
|
||||
self.lava_counter = 0
|
||||
self.health = self.health - lava_damage
|
||||
self:teleport()
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -211,26 +211,6 @@ mobs.teleport = function(self, target)
|
|||
end
|
||||
end
|
||||
|
||||
--a function used for despawning mobs
|
||||
mobs.check_for_player_within_area = function(self, radius)
|
||||
local pos1 = self.object:get_pos()
|
||||
if not pos1 then return end
|
||||
--get players in radius
|
||||
for _,player in pairs(minetest_get_connected_players()) do
|
||||
if player and player:get_hp() > 0 then
|
||||
local pos2 = player:get_pos()
|
||||
local distance = vector_distance(pos1,pos2)
|
||||
if distance < radius then
|
||||
--found a player
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
--did not find a player
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
--a simple helper function for mobs following
|
||||
mobs.get_2d_distance = function(pos1,pos2)
|
||||
pos1.y = 0
|
||||
|
|
|
@ -5,9 +5,32 @@ local minetest_settings = minetest.settings
|
|||
-- CMI support check
|
||||
local use_cmi = minetest.global_exists("cmi")
|
||||
|
||||
local vector_distance = vector.distance
|
||||
local minetest_get_connected_players = minetest.get_connected_players
|
||||
local math_random = math.random
|
||||
|
||||
mobs.can_despawn = function(self)
|
||||
return (not self.tamed and not self.bred and not self.nametag and
|
||||
not mobs.check_for_player_within_area(self, 64));
|
||||
if self.tamed or self.bred or self.nametag then return false end
|
||||
local mob_pos = self.object:get_pos()
|
||||
if not mob_pos then return true end
|
||||
local players = minetest_get_connected_players()
|
||||
if #players == 0 then return false end
|
||||
-- If no players, probably this is being called from get_staticdata() at server shutdown time
|
||||
-- Minetest is to buggy (as of 5.5) to delete entities at server shutdown time anyway
|
||||
|
||||
local distance = 999
|
||||
for _, player in pairs(players) do
|
||||
if player and player:get_hp() > 0 then
|
||||
local player_pos = player:get_pos()
|
||||
local new_distance = vector_distance(player_pos, mob_pos)
|
||||
if new_distance < distance then
|
||||
distance = new_distance
|
||||
if distance < 33 then return false end
|
||||
if distance < 128 and math_random(1, 42) ~= 11 then return false end
|
||||
end
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- get entity staticdata
|
||||
|
@ -24,7 +47,7 @@ mobs.mob_staticdata = function(self)
|
|||
self.following = nil
|
||||
|
||||
if use_cmi then
|
||||
self.serialized_cmi_components = cmi.serialize_components(self._cmi_components)
|
||||
self.serialized_cmi_components = cmi and cmi.serialize_components(self._cmi_components)
|
||||
end
|
||||
|
||||
local tmp = {}
|
||||
|
@ -44,6 +67,102 @@ mobs.mob_staticdata = function(self)
|
|||
return minetest.serialize(tmp)
|
||||
end
|
||||
|
||||
mobs.armor_setup = function(self)
|
||||
if not self._armor_items then
|
||||
local armor = {}
|
||||
-- Source: https://minecraft.fandom.com/wiki/Zombie
|
||||
local materials = {
|
||||
{name = "leather", chance = 0.3706},
|
||||
{name = "gold", chance = 0.4873},
|
||||
{name = "chain", chance = 0.129},
|
||||
{name = "iron", chance = 0.0127},
|
||||
{name = "diamond", chance = 0.0004}
|
||||
}
|
||||
local types = {
|
||||
{name = "helmet", chance = 0.15},
|
||||
{name = "chestplate", chance = 0.75},
|
||||
{name = "leggings", chance = 0.75},
|
||||
{name = "boots", chance = 0.75}
|
||||
}
|
||||
|
||||
local material
|
||||
if type(self._spawn_with_armor) == "string" then
|
||||
material = self._spawn_with_armor
|
||||
else
|
||||
local chance = 0
|
||||
for i, m in pairs(materials) do
|
||||
chance = chance + m.chance
|
||||
if math.random() <= chance then
|
||||
material = m.name
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for i, t in pairs(types) do
|
||||
if math.random() <= t.chance then
|
||||
armor[t.name] = material
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
-- Save armor items in lua entity
|
||||
self._armor_items = {}
|
||||
for atype, material in pairs(armor) do
|
||||
local item = "mcl_armor:" .. atype .. "_" .. material
|
||||
self._armor_items[atype] = item
|
||||
end
|
||||
|
||||
-- Setup armor drops
|
||||
for atype, material in pairs(armor) do
|
||||
local wear = math.random(1, 65535)
|
||||
local item = "mcl_armor:" .. atype .. "_" .. material .. " 1 " .. wear
|
||||
self.drops = table.copy(self.drops)
|
||||
table.insert(self.drops, {
|
||||
name = item,
|
||||
chance = 1/0.085, -- 8.5%
|
||||
min = 1,
|
||||
max = 1,
|
||||
looting = "rare",
|
||||
looting_factor = 0.01 / 3,
|
||||
})
|
||||
end
|
||||
|
||||
-- Configure textures
|
||||
local t = ""
|
||||
local first_image = true
|
||||
for atype, material in pairs(armor) do
|
||||
if not first_image then
|
||||
t = t .. "^"
|
||||
end
|
||||
t = t .. "mcl_armor_" .. atype .. "_" .. material .. ".png"
|
||||
first_image = false
|
||||
end
|
||||
if t ~= "" then
|
||||
self.base_texture = table.copy(self.base_texture)
|
||||
self.base_texture[1] = t
|
||||
end
|
||||
|
||||
-- Configure damage groups based on armor
|
||||
-- Source: https://minecraft.fandom.com/wiki/Armor#Armor_points
|
||||
local points = 2
|
||||
for atype, material in pairs(armor) do
|
||||
local item_name = "mcl_armor:" .. atype .. "_" .. material
|
||||
points = points + minetest.get_item_group(item_name, "mcl_armor_points")
|
||||
end
|
||||
local armor_strength = 100 - 4 * points
|
||||
local armor_groups = self.object:get_armor_groups()
|
||||
armor_groups.fleshy = armor_strength
|
||||
self.armor = armor_groups
|
||||
|
||||
-- Helmet protects mob from sun damage
|
||||
if armor.helmet then
|
||||
self.ignited_by_sunlight = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- activate mob and reload settings
|
||||
mobs.mob_activate = function(self, staticdata, def, dtime)
|
||||
|
@ -87,6 +206,11 @@ mobs.mob_activate = function(self, staticdata, def, dtime)
|
|||
self.base_selbox = self.selectionbox
|
||||
end
|
||||
|
||||
-- Setup armor on mobs
|
||||
if self._spawn_with_armor then
|
||||
mobs.armor_setup(self)
|
||||
end
|
||||
|
||||
-- for current mobs that dont have this set
|
||||
if not self.base_selbox then
|
||||
self.base_selbox = self.selectionbox or self.base_colbox
|
||||
|
|
|
@ -6,11 +6,14 @@ local find_nodes_in_area_under_air = minetest.find_nodes_in_area_under_air
|
|||
local get_biome_name = minetest.get_biome_name
|
||||
local get_objects_inside_radius = minetest.get_objects_inside_radius
|
||||
local get_connected_players = minetest.get_connected_players
|
||||
|
||||
local minetest_get_perlin = minetest.get_perlin
|
||||
|
||||
local math_random = math.random
|
||||
local math_floor = math.floor
|
||||
--local max = math.max
|
||||
local math_ceil = math.ceil
|
||||
local math_cos = math.cos
|
||||
local math_sin = math.sin
|
||||
local math_round = function(x) return (x > 0) and math_floor(x + 0.5) or math_ceil(x - 0.5) end
|
||||
|
||||
--local vector_distance = vector.distance
|
||||
local vector_new = vector.new
|
||||
|
@ -22,151 +25,171 @@ local table_remove = table.remove
|
|||
local pairs = pairs
|
||||
|
||||
-- range for mob count
|
||||
local aoc_range = 48
|
||||
local aoc_range = 32
|
||||
|
||||
--do mobs spawn?
|
||||
local mobs_spawn = minetest.settings:get_bool("mobs_spawn", true) ~= false
|
||||
|
||||
--[[
|
||||
|
||||
THIS IS THE BIG LIST OF ALL BIOMES - used for programming/updating mobs
|
||||
local noise_params = {
|
||||
offset = 0,
|
||||
scale = 3,
|
||||
spread = {
|
||||
x = 301,
|
||||
y = 50,
|
||||
z = 304,
|
||||
},
|
||||
seed = 100,
|
||||
octaves = 3,
|
||||
persistence = 0.5,
|
||||
}
|
||||
|
||||
underground:
|
||||
"FlowerForest_underground",
|
||||
"JungleEdge_underground",local spawning_position = spawning_position_list[math.random(1,#spawning_position_list)]
|
||||
"ColdTaiga_underground",
|
||||
"IcePlains_underground",
|
||||
"IcePlainsSpikes_underground",
|
||||
"MegaTaiga_underground",
|
||||
"Taiga_underground",
|
||||
"ExtremeHills+_underground",
|
||||
"JungleM_underground",
|
||||
"ExtremeHillsM_underground",
|
||||
"JungleEdgeM_underground",
|
||||
-- THIS IS THE BIG LIST OF ALL BIOMES - used for programming/updating mobs
|
||||
-- Also used for missing parameter
|
||||
-- Please update the list when adding new biomes!
|
||||
|
||||
ocean:
|
||||
"RoofedForest_ocean",
|
||||
"JungleEdgeM_ocean",
|
||||
"BirchForestM_ocean",
|
||||
"BirchForest_ocean",
|
||||
"IcePlains_deep_ocean",
|
||||
"Jungle_deep_ocean",
|
||||
"Savanna_ocean",
|
||||
"MesaPlateauF_ocean",
|
||||
"ExtremeHillsM_deep_ocean",
|
||||
"Savanna_deep_ocean",
|
||||
"SunflowerPlains_ocean",
|
||||
"Swampland_deep_ocean",
|
||||
"Swampland_ocean",
|
||||
"MegaSpruceTaiga_deep_ocean",
|
||||
"ExtremeHillsM_ocean",
|
||||
"JungleEdgeM_deep_ocean",
|
||||
"SunflowerPlains_deep_ocean",
|
||||
"BirchForest_deep_ocean",
|
||||
"IcePlainsSpikes_ocean",
|
||||
"Mesa_ocean",
|
||||
"StoneBeach_ocean",
|
||||
"Plains_deep_ocean",
|
||||
"JungleEdge_deep_ocean",
|
||||
"SavannaM_deep_ocean",
|
||||
"Desert_deep_ocean",
|
||||
"Mesa_deep_ocean",
|
||||
"ColdTaiga_deep_ocean",
|
||||
"Plains_ocean",
|
||||
"MesaPlateauFM_ocean",
|
||||
"Forest_deep_ocean",
|
||||
"JungleM_deep_ocean",
|
||||
"FlowerForest_deep_ocean",
|
||||
"MushroomIsland_ocean",
|
||||
"MegaTaiga_ocean",
|
||||
"StoneBeach_deep_ocean",
|
||||
"IcePlainsSpikes_deep_ocean",
|
||||
"ColdTaiga_ocean",
|
||||
"SavannaM_ocean",
|
||||
"MesaPlateauF_deep_ocean",
|
||||
"MesaBryce_deep_ocean",
|
||||
"ExtremeHills+_deep_ocean",
|
||||
"ExtremeHills_ocean",
|
||||
"MushroomIsland_deep_ocean",
|
||||
"Forest_ocean",
|
||||
"MegaTaiga_deep_ocean",
|
||||
"JungleEdge_ocean",
|
||||
"MesaBryce_ocean",
|
||||
"MegaSpruceTaiga_ocean",
|
||||
"ExtremeHills+_ocean",
|
||||
"Jungle_ocean",
|
||||
"RoofedForest_deep_ocean",
|
||||
"IcePlains_ocean",
|
||||
"FlowerForest_ocean",
|
||||
"ExtremeHills_deep_ocean",
|
||||
"MesaPlateauFM_deep_ocean",
|
||||
"Desert_ocean",
|
||||
"Taiga_ocean",
|
||||
"BirchForestM_deep_ocean",
|
||||
"Taiga_deep_ocean",
|
||||
"JungleM_ocean",
|
||||
local list_of_all_biomes = {
|
||||
|
||||
water or beach?
|
||||
"MesaPlateauFM_sandlevel",
|
||||
"MesaPlateauF_sandlevel",
|
||||
"MesaBryce_sandlevel",
|
||||
"Mesa_sandlevel",
|
||||
-- underground:
|
||||
|
||||
beach:
|
||||
"FlowerForest_beach",
|
||||
"Forest_beach",
|
||||
"StoneBeach",
|
||||
"ColdTaiga_beach_water",
|
||||
"Taiga_beach",
|
||||
"Savanna_beach",
|
||||
"Plains_beach",
|
||||
"ExtremeHills_beach",
|
||||
"ColdTaiga_beach",
|
||||
"Swampland_shore",
|
||||
"MushroomIslandShore",
|
||||
"JungleM_shore",
|
||||
"Jungle_shore",
|
||||
"FlowerForest_underground",
|
||||
"JungleEdge_underground",
|
||||
"ColdTaiga_underground",
|
||||
"IcePlains_underground",
|
||||
"IcePlainsSpikes_underground",
|
||||
"MegaTaiga_underground",
|
||||
"Taiga_underground",
|
||||
"ExtremeHills+_underground",
|
||||
"JungleM_underground",
|
||||
"ExtremeHillsM_underground",
|
||||
"JungleEdgeM_underground",
|
||||
|
||||
dimension biome:
|
||||
"Nether",
|
||||
"End",
|
||||
-- ocean:
|
||||
|
||||
Overworld regular:
|
||||
"Mesa",
|
||||
"FlowerForest",
|
||||
"Swampland",
|
||||
"Taiga",
|
||||
"ExtremeHills",
|
||||
"Jungle",
|
||||
"Savanna",
|
||||
"BirchForest",
|
||||
"MegaSpruceTaiga",
|
||||
"MegaTaiga",
|
||||
"ExtremeHills+",
|
||||
"Forest",
|
||||
"Plains",
|
||||
"Desert",
|
||||
"ColdTaiga",
|
||||
"MushroomIsland",
|
||||
"IcePlainsSpikes",
|
||||
"SunflowerPlains",
|
||||
"IcePlains",
|
||||
"RoofedForest",
|
||||
"ExtremeHills+_snowtop",
|
||||
"MesaPlateauFM_grasstop",
|
||||
"JungleEdgeM",
|
||||
"ExtremeHillsM",
|
||||
"JungleM",
|
||||
"BirchForestM",
|
||||
"MesaPlateauF",
|
||||
"MesaPlateauFM",
|
||||
"MesaPlateauF_grasstop",
|
||||
"MesaBryce",
|
||||
"JungleEdge",
|
||||
"SavannaM",
|
||||
]]--
|
||||
"RoofedForest_ocean",
|
||||
"JungleEdgeM_ocean",
|
||||
"BirchForestM_ocean",
|
||||
"BirchForest_ocean",
|
||||
"IcePlains_deep_ocean",
|
||||
"Jungle_deep_ocean",
|
||||
"Savanna_ocean",
|
||||
"MesaPlateauF_ocean",
|
||||
"ExtremeHillsM_deep_ocean",
|
||||
"Savanna_deep_ocean",
|
||||
"SunflowerPlains_ocean",
|
||||
"Swampland_deep_ocean",
|
||||
"Swampland_ocean",
|
||||
"MegaSpruceTaiga_deep_ocean",
|
||||
"ExtremeHillsM_ocean",
|
||||
"JungleEdgeM_deep_ocean",
|
||||
"SunflowerPlains_deep_ocean",
|
||||
"BirchForest_deep_ocean",
|
||||
"IcePlainsSpikes_ocean",
|
||||
"Mesa_ocean",
|
||||
"StoneBeach_ocean",
|
||||
"Plains_deep_ocean",
|
||||
"JungleEdge_deep_ocean",
|
||||
"SavannaM_deep_ocean",
|
||||
"Desert_deep_ocean",
|
||||
"Mesa_deep_ocean",
|
||||
"ColdTaiga_deep_ocean",
|
||||
"Plains_ocean",
|
||||
"MesaPlateauFM_ocean",
|
||||
"Forest_deep_ocean",
|
||||
"JungleM_deep_ocean",
|
||||
"FlowerForest_deep_ocean",
|
||||
"MushroomIsland_ocean",
|
||||
"MegaTaiga_ocean",
|
||||
"StoneBeach_deep_ocean",
|
||||
"IcePlainsSpikes_deep_ocean",
|
||||
"ColdTaiga_ocean",
|
||||
"SavannaM_ocean",
|
||||
"MesaPlateauF_deep_ocean",
|
||||
"MesaBryce_deep_ocean",
|
||||
"ExtremeHills+_deep_ocean",
|
||||
"ExtremeHills_ocean",
|
||||
"MushroomIsland_deep_ocean",
|
||||
"Forest_ocean",
|
||||
"MegaTaiga_deep_ocean",
|
||||
"JungleEdge_ocean",
|
||||
"MesaBryce_ocean",
|
||||
"MegaSpruceTaiga_ocean",
|
||||
"ExtremeHills+_ocean",
|
||||
"Jungle_ocean",
|
||||
"RoofedForest_deep_ocean",
|
||||
"IcePlains_ocean",
|
||||
"FlowerForest_ocean",
|
||||
"ExtremeHills_deep_ocean",
|
||||
"MesaPlateauFM_deep_ocean",
|
||||
"Desert_ocean",
|
||||
"Taiga_ocean",
|
||||
"BirchForestM_deep_ocean",
|
||||
"Taiga_deep_ocean",
|
||||
"JungleM_ocean",
|
||||
|
||||
-- water or beach?
|
||||
|
||||
"MesaPlateauFM_sandlevel",
|
||||
"MesaPlateauF_sandlevel",
|
||||
"MesaBryce_sandlevel",
|
||||
"Mesa_sandlevel",
|
||||
|
||||
-- beach:
|
||||
|
||||
"FlowerForest_beach",
|
||||
"Forest_beach",
|
||||
"StoneBeach",
|
||||
"ColdTaiga_beach_water",
|
||||
"Taiga_beach",
|
||||
"Savanna_beach",
|
||||
"Plains_beach",
|
||||
"ExtremeHills_beach",
|
||||
"ColdTaiga_beach",
|
||||
"Swampland_shore",
|
||||
"MushroomIslandShore",
|
||||
"JungleM_shore",
|
||||
"Jungle_shore",
|
||||
|
||||
-- dimension biome:
|
||||
|
||||
"Nether",
|
||||
"End",
|
||||
|
||||
-- Overworld regular:
|
||||
|
||||
"Mesa",
|
||||
"FlowerForest",
|
||||
"Swampland",
|
||||
"Taiga",
|
||||
"ExtremeHills",
|
||||
"Jungle",
|
||||
"Savanna",
|
||||
"BirchForest",
|
||||
"MegaSpruceTaiga",
|
||||
"MegaTaiga",
|
||||
"ExtremeHills+",
|
||||
"Forest",
|
||||
"Plains",
|
||||
"Desert",
|
||||
"ColdTaiga",
|
||||
"MushroomIsland",
|
||||
"IcePlainsSpikes",
|
||||
"SunflowerPlains",
|
||||
"IcePlains",
|
||||
"RoofedForest",
|
||||
"ExtremeHills+_snowtop",
|
||||
"MesaPlateauFM_grasstop",
|
||||
"JungleEdgeM",
|
||||
"ExtremeHillsM",
|
||||
"JungleM",
|
||||
"BirchForestM",
|
||||
"MesaPlateauF",
|
||||
"MesaPlateauFM",
|
||||
"MesaPlateauF_grasstop",
|
||||
"MesaBryce",
|
||||
"JungleEdge",
|
||||
"SavannaM",
|
||||
}
|
||||
|
||||
-- count how many mobs are in an area
|
||||
local function count_mobs(pos)
|
||||
|
@ -216,11 +239,73 @@ WARNING: BIOME INTEGRATION NEEDED -> How to get biome through lua??
|
|||
|
||||
--this is where all of the spawning information is kept
|
||||
local spawn_dictionary = {}
|
||||
local summary_chance = 0
|
||||
|
||||
function mobs:spawn_setup(def)
|
||||
if not mobs_spawn then return end
|
||||
|
||||
if not def then
|
||||
minetest.log("warning", "Empty mob spawn setup definition")
|
||||
return
|
||||
end
|
||||
|
||||
local name = def.name
|
||||
if not name then
|
||||
minetest.log("warning", "Missing mob name")
|
||||
return
|
||||
end
|
||||
|
||||
local dimension = def.dimension or "overworld"
|
||||
local type_of_spawning = def.type_of_spawning or "ground"
|
||||
local biomes = def.biomes or list_of_all_biomes
|
||||
local min_light = def.min_light or 0
|
||||
local max_light = def.max_light or (minetest.LIGHT_MAX + 1)
|
||||
local chance = def.chance or 1000
|
||||
local aoc = def.aoc or aoc_range
|
||||
local min_height = def.min_height or mcl_mapgen.overworld.min
|
||||
local max_height = def.max_height or mcl_mapgen.overworld.max
|
||||
local day_toggle = def.day_toggle
|
||||
local on_spawn = def.on_spawn
|
||||
local check_position = def.check_position
|
||||
|
||||
-- chance/spawn number override in minetest.conf for registered mob
|
||||
local numbers = minetest.settings:get(name)
|
||||
if numbers then
|
||||
numbers = numbers:split(",")
|
||||
chance = tonumber(numbers[1]) or chance
|
||||
aoc = tonumber(numbers[2]) or aoc
|
||||
if chance == 0 then
|
||||
minetest.log("warning", string.format("[mobs] %s has spawning disabled", name))
|
||||
return
|
||||
end
|
||||
minetest.log("action", string.format("[mobs] Chance setting for %s changed to %s (total: %s)", name, chance, aoc))
|
||||
end
|
||||
|
||||
if chance < 1 then
|
||||
chance = 1
|
||||
minetest.log("warning", "Chance shouldn't be less than 1 (mob name: " .. name ..")")
|
||||
end
|
||||
|
||||
spawn_dictionary[#spawn_dictionary + 1] = {
|
||||
name = name,
|
||||
dimension = dimension,
|
||||
type_of_spawning = type_of_spawning,
|
||||
biomes = biomes,
|
||||
min_light = min_light,
|
||||
max_light = max_light,
|
||||
chance = chance,
|
||||
aoc = aoc,
|
||||
min_height = min_height,
|
||||
max_height = max_height,
|
||||
day_toggle = day_toggle,
|
||||
check_position = check_position,
|
||||
on_spawn = on_spawn,
|
||||
}
|
||||
summary_chance = summary_chance + chance
|
||||
end
|
||||
|
||||
function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_light, max_light, interval, chance, aoc, min_height, max_height, day_toggle, on_spawn)
|
||||
|
||||
--print(dump(biomes))
|
||||
|
||||
-- Do mobs spawn at all?
|
||||
if not mobs_spawn then
|
||||
return
|
||||
|
@ -239,179 +324,7 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh
|
|||
return
|
||||
end
|
||||
|
||||
minetest.log("action",
|
||||
string.format("[mobs] Chance setting for %s changed to %s (total: %s)", name, chance, aoc))
|
||||
end
|
||||
|
||||
--[[
|
||||
local function spawn_action(pos, node, active_object_count, active_object_count_wider, name)
|
||||
|
||||
local orig_pos = table.copy(pos)
|
||||
-- is mob actually registered?
|
||||
if not mobs.spawning_mobs[name]
|
||||
or not minetest.registered_entities[name] then
|
||||
minetest.log("warning", "Mob spawn of "..name.." failed, unknown entity or mob is not registered for spawning!")
|
||||
return
|
||||
end
|
||||
|
||||
-- additional custom checks for spawning mob
|
||||
if mobs:spawn_abm_check(pos, node, name) == true then
|
||||
minetest.log("info", "Mob spawn of "..name.." at "..minetest.pos_to_string(pos).." failed, ABM check rejected!")
|
||||
return
|
||||
end
|
||||
|
||||
-- count nearby mobs in same spawn class
|
||||
local entdef = minetest.registered_entities[name]
|
||||
local spawn_class = entdef and entdef.spawn_class
|
||||
if not spawn_class then
|
||||
if entdef.type == "monster" then
|
||||
spawn_class = "hostile"
|
||||
else
|
||||
spawn_class = "passive"
|
||||
end
|
||||
end
|
||||
local in_class_cap = count_mobs(pos, "!"..spawn_class) < MOB_CAP[spawn_class]
|
||||
-- do not spawn if too many of same mob in area
|
||||
if active_object_count_wider >= max_per_block -- large-range mob cap
|
||||
or (not in_class_cap) -- spawn class mob cap
|
||||
or count_mobs(pos, name) >= aoc then -- per-mob mob cap
|
||||
-- too many entities
|
||||
minetest.log("info", "Mob spawn of "..name.." at "..minetest.pos_to_string(pos).." failed, too crowded!")
|
||||
return
|
||||
end
|
||||
|
||||
-- if toggle set to nil then ignore day/night check
|
||||
if day_toggle then
|
||||
|
||||
local tod = (minetest.get_timeofday() or 0) * 24000
|
||||
|
||||
if tod > 4500 and tod < 19500 then
|
||||
-- daylight, but mob wants night
|
||||
if day_toggle == false then
|
||||
-- mob needs night
|
||||
minetest.log("info", "Mob spawn of "..name.." at "..minetest.pos_to_string(pos).." failed, mob needs light!")
|
||||
return
|
||||
end
|
||||
else
|
||||
-- night time but mob wants day
|
||||
if day_toggle == true then
|
||||
-- mob needs day
|
||||
minetest.log("info", "Mob spawn of "..name.." at "..minetest.pos_to_string(pos).." failed, mob needs daylight!")
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- spawn above node
|
||||
pos.y = pos.y + 1
|
||||
|
||||
-- only spawn away from player
|
||||
local objs = minetest.get_objects_inside_radius(pos, 24)
|
||||
|
||||
for n = 1, #objs do
|
||||
|
||||
if objs[n]:is_player() then
|
||||
-- player too close
|
||||
minetest.log("info", "Mob spawn of "..name.." at "..minetest.pos_to_string(pos).." failed, player too close!")
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- mobs cannot spawn in protected areas when enabled
|
||||
if not spawn_protected
|
||||
and minetest.is_protected(pos, "") then
|
||||
minetest.log("info", "Mob spawn of "..name.." at "..minetest.pos_to_string(pos).." failed, position is protected!")
|
||||
return
|
||||
end
|
||||
|
||||
-- are we spawning within height limits?
|
||||
if pos.y > max_height
|
||||
or pos.y < min_height then
|
||||
minetest.log("info", "Mob spawn of "..name.." at "..minetest.pos_to_string(pos).." failed, out of height limit!")
|
||||
return
|
||||
end
|
||||
|
||||
-- are light levels ok?
|
||||
local light = minetest.get_node_light(pos)
|
||||
if not light
|
||||
or light > max_light
|
||||
or light < min_light then
|
||||
minetest.log("info", "Mob spawn of "..name.." at "..minetest.pos_to_string(pos).." failed, bad light!")
|
||||
return
|
||||
end
|
||||
|
||||
-- do we have enough space to spawn mob?
|
||||
local ent = minetest.registered_entities[name]
|
||||
local width_x = max(1, math.ceil(ent.collisionbox[4] - ent.collisionbox[1]))
|
||||
local min_x, max_x
|
||||
if width_x % 2 == 0 then
|
||||
max_x = math.floor(width_x/2)
|
||||
min_x = -(max_x-1)
|
||||
else
|
||||
max_x = math.floor(width_x/2)
|
||||
min_x = -max_x
|
||||
end
|
||||
|
||||
local width_z = max(1, math.ceil(ent.collisionbox[6] - ent.collisionbox[3]))
|
||||
local min_z, max_z
|
||||
if width_z % 2 == 0 then
|
||||
max_z = math.floor(width_z/2)
|
||||
min_z = -(max_z-1)
|
||||
else
|
||||
max_z = math.floor(width_z/2)
|
||||
min_z = -max_z
|
||||
end
|
||||
|
||||
local max_y = max(0, math.ceil(ent.collisionbox[5] - ent.collisionbox[2]) - 1)
|
||||
|
||||
for y = 0, max_y do
|
||||
for x = min_x, max_x do
|
||||
for z = min_z, max_z do
|
||||
local pos2 = {x = pos.x+x, y = pos.y+y, z = pos.z+z}
|
||||
if minetest.registered_nodes[node_ok(pos2).name].walkable == true then
|
||||
-- inside block
|
||||
minetest.log("info", "Mob spawn of "..name.." at "..minetest.pos_to_string(pos).." failed, too little space!")
|
||||
if ent.spawn_small_alternative and (not minetest.registered_nodes[node_ok(pos).name].walkable) then
|
||||
minetest.log("info", "Trying to spawn smaller alternative mob: "..ent.spawn_small_alternative)
|
||||
spawn_action(orig_pos, node, active_object_count, active_object_count_wider, ent.spawn_small_alternative)
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- tweak X/Y/Z spawn pos
|
||||
if width_x % 2 == 0 then
|
||||
pos.x = pos.x + 0.5
|
||||
end
|
||||
if width_z % 2 == 0 then
|
||||
pos.z = pos.z + 0.5
|
||||
end
|
||||
pos.y = pos.y - 0.5
|
||||
|
||||
local mob = minetest.add_entity(pos, name)
|
||||
minetest.log("action", "Mob spawned: "..name.." at "..minetest.pos_to_string(pos))
|
||||
|
||||
if on_spawn then
|
||||
|
||||
local ent = mob:get_luaentity()
|
||||
|
||||
on_spawn(ent, pos)
|
||||
end
|
||||
end
|
||||
|
||||
local function spawn_abm_action(pos, node, active_object_count, active_object_count_wider)
|
||||
spawn_action(pos, node, active_object_count, active_object_count_wider, name)
|
||||
end
|
||||
]]--
|
||||
|
||||
local entdef = minetest.registered_entities[name]
|
||||
local spawn_class
|
||||
if entdef.type == "monster" then
|
||||
spawn_class = "hostile"
|
||||
else
|
||||
spawn_class = "passive"
|
||||
minetest.log("action", string.format("[mobs] Chance setting for %s changed to %s (total: %s)", name, chance, aoc))
|
||||
end
|
||||
|
||||
--load information into the spawn dictionary
|
||||
|
@ -423,107 +336,34 @@ function mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_ligh
|
|||
spawn_dictionary[key]["biomes"] = biomes
|
||||
spawn_dictionary[key]["min_light"] = min_light
|
||||
spawn_dictionary[key]["max_light"] = max_light
|
||||
spawn_dictionary[key]["interval"] = interval
|
||||
spawn_dictionary[key]["chance"] = chance
|
||||
spawn_dictionary[key]["aoc"] = aoc
|
||||
spawn_dictionary[key]["min_height"] = min_height
|
||||
spawn_dictionary[key]["max_height"] = max_height
|
||||
spawn_dictionary[key]["day_toggle"] = day_toggle
|
||||
--spawn_dictionary[key]["on_spawn"] = spawn_abm_action
|
||||
spawn_dictionary[key]["spawn_class"] = spawn_class
|
||||
|
||||
--[[
|
||||
minetest.register_abm({
|
||||
label = name .. " spawning",
|
||||
nodenames = nodes,
|
||||
neighbors = neighbors,
|
||||
interval = interval,
|
||||
chance = floor(max(1, chance * mobs_spawn_chance)),
|
||||
catch_up = false,
|
||||
action = spawn_abm_action,
|
||||
})
|
||||
]]--
|
||||
summary_chance = summary_chance + chance
|
||||
end
|
||||
|
||||
-- compatibility with older mob registration
|
||||
-- we're going to forget about this for now -j4i
|
||||
--[[
|
||||
function mobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height, day_toggle)
|
||||
|
||||
mobs:spawn_specific(name, nodes, {"air"}, min_light, max_light, 30,
|
||||
chance, active_object_count, -31000, max_height, day_toggle)
|
||||
local two_pi = 2 * math.pi
|
||||
local function get_next_mob_spawn_pos(pos)
|
||||
local distance = math_random(25, 32)
|
||||
local angle = math_random() * two_pi
|
||||
return {
|
||||
x = math_round(pos.x + distance * math_cos(angle)),
|
||||
y = pos.y,
|
||||
z = math_round(pos.z + distance * math_sin(angle))
|
||||
}
|
||||
end
|
||||
]]--
|
||||
|
||||
|
||||
--Don't disable this yet-j4i
|
||||
-- MarkBu's spawn function
|
||||
|
||||
function mobs:spawn(def)
|
||||
--does nothing for now
|
||||
--[[
|
||||
local name = def.name
|
||||
local nodes = def.nodes or {"group:soil", "group:stone"}
|
||||
local neighbors = def.neighbors or {"air"}
|
||||
local min_light = def.min_light or 0
|
||||
local max_light = def.max_light or 15
|
||||
local interval = def.interval or 30
|
||||
local chance = def.chance or 5000
|
||||
local active_object_count = def.active_object_count or 1
|
||||
local min_height = def.min_height or -31000
|
||||
local max_height = def.max_height or 31000
|
||||
local day_toggle = def.day_toggle
|
||||
local on_spawn = def.on_spawn
|
||||
|
||||
mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, interval,
|
||||
chance, active_object_count, min_height, max_height, day_toggle, on_spawn)
|
||||
]]--
|
||||
end
|
||||
|
||||
|
||||
|
||||
local axis
|
||||
--inner and outer part of square donut radius
|
||||
local inner = 15
|
||||
local outer = 64
|
||||
local int = {-1,1}
|
||||
|
||||
local function position_calculation(pos)
|
||||
|
||||
pos = vector_floor(pos)
|
||||
|
||||
--this is used to determine the axis buffer from the player
|
||||
axis = math_random(0,1)
|
||||
|
||||
--cast towards the direction
|
||||
if axis == 0 then --x
|
||||
pos.x = pos.x + math_random(inner,outer)*int[math_random(1,2)]
|
||||
pos.z = pos.z + math_random(-outer,outer)
|
||||
else --z
|
||||
pos.z = pos.z + math_random(inner,outer)*int[math_random(1,2)]
|
||||
pos.x = pos.x + math_random(-outer,outer)
|
||||
end
|
||||
return pos
|
||||
end
|
||||
|
||||
--[[
|
||||
local decypher_limits_dictionary = {
|
||||
["overworld"] = {mcl_vars.mg_overworld_min,mcl_vars.mg_overworld_max},
|
||||
["nether"] = {mcl_vars.mg_nether_min, mcl_vars.mg_nether_max},
|
||||
["end"] = {mcl_vars.mg_end_min, mcl_vars.mg_end_max}
|
||||
}
|
||||
]]--
|
||||
|
||||
local function decypher_limits(posy)
|
||||
--local min_max_table = decypher_limits_dictionary[dimension]
|
||||
--return min_max_table[1],min_max_table[2]
|
||||
posy = math_floor(posy)
|
||||
return posy - 32, posy + 32
|
||||
end
|
||||
|
||||
--a simple helper function for mob_spawn
|
||||
local function biome_check(biome_list, biome_goal)
|
||||
for _,data in ipairs(biome_list) do
|
||||
for _, data in pairs(biome_list) do
|
||||
if data == biome_goal then
|
||||
return true
|
||||
end
|
||||
|
@ -533,69 +373,27 @@ local function biome_check(biome_list, biome_goal)
|
|||
end
|
||||
|
||||
|
||||
--todo mob limiting
|
||||
--MAIN LOOP
|
||||
|
||||
if mobs_spawn then
|
||||
local timer = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
timer = timer + dtime
|
||||
if timer >= 10 then
|
||||
timer = 0
|
||||
for _,player in pairs(get_connected_players()) do
|
||||
-- after this line each "break" means "continue"
|
||||
local do_mob_spawning = true
|
||||
repeat
|
||||
--don't need to get these variables more than once
|
||||
--they happen in a single server step
|
||||
|
||||
local player_pos = player:get_pos()
|
||||
local dimension = mcl_worlds.pos_to_dimension(player_pos)
|
||||
local perlin_noise
|
||||
|
||||
if dimension == "void" or dimension == "default" then
|
||||
break -- ignore void and unloaded area
|
||||
end
|
||||
|
||||
local min, max = decypher_limits(player_pos.y)
|
||||
|
||||
for i = 1, math_random(1,4) do
|
||||
-- after this line each "break" means "continue"
|
||||
local do_mob_algorithm = true
|
||||
repeat
|
||||
|
||||
local goal_pos = position_calculation(player_pos)
|
||||
|
||||
local spawning_position_list = find_nodes_in_area_under_air(vector_new(goal_pos.x,min,goal_pos.z), vector_new(goal_pos.x,max,goal_pos.z), {"group:solid", "group:water", "group:lava"})
|
||||
|
||||
--couldn't find node
|
||||
if #spawning_position_list <= 0 then
|
||||
break
|
||||
end
|
||||
|
||||
local spawning_position = spawning_position_list[math_random(1,#spawning_position_list)]
|
||||
|
||||
--Prevent strange behavior --- this is commented out: /too close to player --fixed with inner circle
|
||||
if not spawning_position then -- or vector_distance(player_pos, spawning_position) < 15
|
||||
break
|
||||
end
|
||||
local function spawn_a_mob(pos, dimension, y_min, y_max)
|
||||
local dimension = dimension or mcl_worlds.pos_to_dimension(pos)
|
||||
local goal_pos = get_next_mob_spawn_pos(pos)
|
||||
local spawning_position_list = find_nodes_in_area_under_air(
|
||||
{x = goal_pos.x, y = y_min, z = goal_pos.z},
|
||||
{x = goal_pos.x, y = y_max, z = goal_pos.z},
|
||||
{"group:solid", "group:water", "group:lava"}
|
||||
)
|
||||
if #spawning_position_list <= 0 then return end
|
||||
local spawning_position = spawning_position_list[math_random(1, #spawning_position_list)]
|
||||
|
||||
--hard code mob limit in area to 5 for now
|
||||
if count_mobs(spawning_position) >= 5 then
|
||||
break
|
||||
end
|
||||
if count_mobs(spawning_position) >= 5 then return end
|
||||
|
||||
local gotten_node = get_node(spawning_position).name
|
||||
|
||||
if not gotten_node or gotten_node == "air" then --skip air nodes
|
||||
break
|
||||
end
|
||||
|
||||
local gotten_biome = minetest.get_biome_data(spawning_position)
|
||||
|
||||
if not gotten_biome then
|
||||
break --skip if in unloaded area
|
||||
end
|
||||
|
||||
if not gotten_node or not gotten_biome then return end
|
||||
gotten_biome = get_biome_name(gotten_biome.biome) --makes it easier to work with
|
||||
|
||||
--add this so mobs don't spawn inside nodes
|
||||
|
@ -606,8 +404,12 @@ if mobs_spawn then
|
|||
|
||||
local is_water = get_item_group(gotten_node, "water") ~= 0
|
||||
local is_lava = get_item_group(gotten_node, "lava") ~= 0
|
||||
local is_ground = not (is_water or is_lava)
|
||||
if not is_ground then
|
||||
spawning_position.y = spawning_position.y - 1
|
||||
end
|
||||
|
||||
local mob_def = nil
|
||||
local mob_def
|
||||
|
||||
--create a disconnected clone of the spawn dictionary
|
||||
--prevents memory leak
|
||||
|
@ -615,94 +417,58 @@ if mobs_spawn then
|
|||
|
||||
--grab mob that fits into the spawning location
|
||||
--randomly grab a mob, don't exclude any possibilities
|
||||
local repeat_mob_search = true
|
||||
repeat
|
||||
|
||||
--do not infinite loop
|
||||
if #mob_library_worker_table <= 0 then
|
||||
--print("breaking infinite loop")
|
||||
break
|
||||
perlin_noise = perlin_noise or minetest_get_perlin(noise_params)
|
||||
local noise = perlin_noise:get_3d(spawning_position)
|
||||
local current_summary_chance = summary_chance
|
||||
while #mob_library_worker_table > 0 do
|
||||
local mob_chance_offset = (math_round(noise * current_summary_chance + 12345) % current_summary_chance) + 1
|
||||
local mob_index = 1
|
||||
local mob_chance = mob_library_worker_table[mob_index].chance
|
||||
local step_chance = mob_chance
|
||||
while step_chance < mob_chance_offset do
|
||||
mob_index = mob_index + 1
|
||||
mob_chance = mob_library_worker_table[mob_index].chance
|
||||
step_chance = step_chance + mob_chance
|
||||
end
|
||||
|
||||
local skip = false
|
||||
|
||||
--use this for removing table elements of mobs that do not match
|
||||
local temp_index = math_random(1,#mob_library_worker_table)
|
||||
|
||||
local temp_def = mob_library_worker_table[temp_index]
|
||||
|
||||
--skip if something ridiculous happens (nil mob def)
|
||||
--something truly horrible has happened if skip gets
|
||||
--activated at this point
|
||||
if not temp_def then
|
||||
skip = true
|
||||
end
|
||||
|
||||
if not skip and (spawning_position.y < temp_def.min_height or spawning_position.y > temp_def.max_height) then
|
||||
skip = true
|
||||
end
|
||||
|
||||
--skip if not correct dimension
|
||||
if not skip and (temp_def.dimension ~= dimension) then
|
||||
skip = true
|
||||
end
|
||||
|
||||
--skip if not in correct biome
|
||||
if not skip and (not biome_check(temp_def.biomes, gotten_biome)) then
|
||||
skip = true
|
||||
end
|
||||
|
||||
--don't spawn if not in light limits
|
||||
if not skip and (gotten_light < temp_def.min_light or gotten_light > temp_def.max_light) then
|
||||
skip = true
|
||||
end
|
||||
|
||||
--skip if not in correct spawning type
|
||||
if not skip and (temp_def.type_of_spawning == "ground" and is_water) then
|
||||
skip = true
|
||||
end
|
||||
|
||||
if not skip and (temp_def.type_of_spawning == "ground" and is_lava) then
|
||||
skip = true
|
||||
end
|
||||
|
||||
--found a mob, exit out of loop
|
||||
if not skip then
|
||||
--minetest.log("warning", "found mob:"..temp_def.name)
|
||||
--print("found mob:"..temp_def.name)
|
||||
mob_def = table_copy(temp_def)
|
||||
break
|
||||
else
|
||||
--minetest.log("warning", "deleting temp index "..temp_index)
|
||||
--print("deleting temp index")
|
||||
table_remove(mob_library_worker_table, temp_index)
|
||||
end
|
||||
|
||||
until repeat_mob_search == false --this is needed to sort through mobs randomly
|
||||
|
||||
|
||||
--catch if went through all mobs and something went horribly wrong
|
||||
--could not find a valid mob to spawn that fits the environment
|
||||
if not mob_def then
|
||||
break
|
||||
end
|
||||
|
||||
--adjust the position for water and lava mobs
|
||||
if mob_def.type_of_spawning == "water" or mob_def.type_of_spawning == "lava" then
|
||||
spawning_position.y = spawning_position.y - 1
|
||||
end
|
||||
|
||||
--print("spawning: " .. mob_def.name)
|
||||
|
||||
local mob_def = mob_library_worker_table[mob_index]
|
||||
if mob_def
|
||||
and spawning_position.y >= mob_def.min_height
|
||||
and spawning_position.y <= mob_def.max_height
|
||||
and mob_def.dimension == dimension
|
||||
and biome_check(mob_def.biomes, gotten_biome)
|
||||
and gotten_light >= mob_def.min_light
|
||||
and gotten_light <= mob_def.max_light
|
||||
and (is_ground or mob_def.type_of_spawning ~= "ground")
|
||||
and (mob_def.check_position and mob_def.check_position(spawning_position) or true)
|
||||
then
|
||||
--everything is correct, spawn mob
|
||||
minetest.add_entity(spawning_position, mob_def.name)
|
||||
|
||||
break
|
||||
until do_mob_algorithm == false --this is a safety catch
|
||||
local object = minetest.add_entity(spawning_position, mob_def.name)
|
||||
if object then
|
||||
return mob_def.on_spawn and mob_def.on_spawn(object, pos)
|
||||
end
|
||||
end
|
||||
current_summary_chance = current_summary_chance - mob_chance
|
||||
table_remove(mob_library_worker_table, mob_index)
|
||||
end
|
||||
end
|
||||
|
||||
break
|
||||
until do_mob_spawning == false --this is a performance catch
|
||||
|
||||
--MAIN LOOP
|
||||
|
||||
local timer = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
timer = timer + dtime
|
||||
if timer < 10 then return end
|
||||
timer = 0
|
||||
for _, player in pairs(get_connected_players()) do
|
||||
local pos = player:get_pos()
|
||||
local dimension = mcl_worlds.pos_to_dimension(pos)
|
||||
-- ignore void and unloaded area
|
||||
if dimension ~= "void" and dimension ~= "default" then
|
||||
local y_min, y_max = decypher_limits(pos.y)
|
||||
for i = 1, math_random(1, 4) do
|
||||
spawn_a_mob(pos, dimension, y_min, y_max)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -160,6 +160,7 @@ minetest.register_entity("mcl_paintings:painting", {
|
|||
set_entity(self.object)
|
||||
end,
|
||||
get_staticdata = function(self)
|
||||
if not self then return end
|
||||
local data = {
|
||||
_facing = self._facing,
|
||||
_pos = self._pos,
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
--################### SILVERFISH
|
||||
--###################
|
||||
|
||||
local PLAYER_SCAN_RADIUS = 5
|
||||
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
mobs:register_mob("mobs_mc:silverfish", {
|
||||
|
@ -46,6 +48,20 @@ mobs:register_mob("mobs_mc:silverfish", {
|
|||
view_range = 16,
|
||||
attack_type = "punch",
|
||||
damage = 1,
|
||||
do_custom = function(self, dtime)
|
||||
self.do_custom_time = (self.do_custom_time or 0) + dtime
|
||||
if self.do_custom_time < 1.5 then return end
|
||||
self.do_custom_time = 0
|
||||
local selfpos = self.object:get_pos()
|
||||
local objects = minetest.get_objects_inside_radius(selfpos, PLAYER_SCAN_RADIUS)
|
||||
for _, obj in pairs(objects) do
|
||||
if obj:is_player() and not minetest.is_creative_enabled(obj:get_player_name()) then
|
||||
self.attacking = obj
|
||||
mobs.group_attack_initialization(self)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
mobs:register_egg("mobs_mc:silverfish", S("Silverfish"), "mobs_mc_spawn_icon_silverfish.png", 0)
|
||||
|
|
|
@ -9,6 +9,95 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
|||
--################### ZOMBIE
|
||||
--###################
|
||||
|
||||
local husk_biomes = {
|
||||
"Desert",
|
||||
"SavannaM",
|
||||
"Savanna",
|
||||
"Savanna_beach",
|
||||
}
|
||||
|
||||
local zombie_biomes = {
|
||||
"FlowerForest_underground",
|
||||
"JungleEdge_underground",
|
||||
"StoneBeach_underground",
|
||||
"MesaBryce_underground",
|
||||
"Mesa_underground",
|
||||
"RoofedForest_underground",
|
||||
"Jungle_underground",
|
||||
"Swampland_underground",
|
||||
"MushroomIsland_underground",
|
||||
"BirchForest_underground",
|
||||
"Plains_underground",
|
||||
"MesaPlateauF_underground",
|
||||
"ExtremeHills_underground",
|
||||
"MegaSpruceTaiga_underground",
|
||||
"BirchForestM_underground",
|
||||
"SavannaM_underground",
|
||||
"MesaPlateauFM_underground",
|
||||
"Desert_underground",
|
||||
"Savanna_underground",
|
||||
"Forest_underground",
|
||||
"SunflowerPlains_underground",
|
||||
"ColdTaiga_underground",
|
||||
"IcePlains_underground",
|
||||
"IcePlainsSpikes_underground",
|
||||
"MegaTaiga_underground",
|
||||
"Taiga_underground",
|
||||
"ExtremeHills+_underground",
|
||||
"JungleM_underground",
|
||||
"ExtremeHillsM_underground",
|
||||
"JungleEdgeM_underground",
|
||||
"Mesa",
|
||||
"FlowerForest",
|
||||
"Swampland",
|
||||
"Taiga",
|
||||
"ExtremeHills",
|
||||
"Jungle",
|
||||
"Savanna",
|
||||
"BirchForest",
|
||||
"MegaSpruceTaiga",
|
||||
"MegaTaiga",
|
||||
"ExtremeHills+",
|
||||
"Forest",
|
||||
"Plains",
|
||||
"Desert",
|
||||
"ColdTaiga",
|
||||
"MushroomIsland",
|
||||
"IcePlainsSpikes",
|
||||
"SunflowerPlains",
|
||||
"IcePlains",
|
||||
"RoofedForest",
|
||||
"ExtremeHills+_snowtop",
|
||||
"MesaPlateauFM_grasstop",
|
||||
"JungleEdgeM",
|
||||
"ExtremeHillsM",
|
||||
"JungleM",
|
||||
"BirchForestM",
|
||||
"MesaPlateauF",
|
||||
"MesaPlateauFM",
|
||||
"MesaPlateauF_grasstop",
|
||||
"MesaBryce",
|
||||
"JungleEdge",
|
||||
"SavannaM",
|
||||
"FlowerForest_beach",
|
||||
"Forest_beach",
|
||||
"StoneBeach",
|
||||
"ColdTaiga_beach_water",
|
||||
"Taiga_beach",
|
||||
"Savanna_beach",
|
||||
"Plains_beach",
|
||||
"ExtremeHills_beach",
|
||||
"ColdTaiga_beach",
|
||||
"Swampland_shore",
|
||||
"MushroomIslandShore",
|
||||
"JungleM_shore",
|
||||
"Jungle_shore",
|
||||
"MesaPlateauFM_sandlevel",
|
||||
"MesaPlateauF_sandlevel",
|
||||
"MesaBryce_sandlevel",
|
||||
"Mesa_sandlevel",
|
||||
}
|
||||
|
||||
local drops_common = {
|
||||
{name = mobs_mc.items.rotten_flesh,
|
||||
chance = 1,
|
||||
|
@ -115,6 +204,7 @@ local zombie = {
|
|||
attack_type = "punch",
|
||||
punch_timer_cooloff = 0.5,
|
||||
harmed_by_heal = true,
|
||||
spawn_with_armor = true,
|
||||
}
|
||||
|
||||
mobs:register_mob("mobs_mc:zombie", zombie)
|
||||
|
@ -166,230 +256,36 @@ baby_husk.child = 1
|
|||
|
||||
mobs:register_mob("mobs_mc:baby_husk", baby_husk)
|
||||
|
||||
|
||||
-- Spawning
|
||||
|
||||
mobs:spawn_specific(
|
||||
"mobs_mc:zombie",
|
||||
"overworld",
|
||||
"ground",
|
||||
{
|
||||
"FlowerForest_underground",
|
||||
"JungleEdge_underground",
|
||||
"StoneBeach_underground",
|
||||
"MesaBryce_underground",
|
||||
"Mesa_underground",
|
||||
"RoofedForest_underground",
|
||||
"Jungle_underground",
|
||||
"Swampland_underground",
|
||||
"MushroomIsland_underground",
|
||||
"BirchForest_underground",
|
||||
"Plains_underground",
|
||||
"MesaPlateauF_underground",
|
||||
"ExtremeHills_underground",
|
||||
"MegaSpruceTaiga_underground",
|
||||
"BirchForestM_underground",
|
||||
"SavannaM_underground",
|
||||
"MesaPlateauFM_underground",
|
||||
"Desert_underground",
|
||||
"Savanna_underground",
|
||||
"Forest_underground",
|
||||
"SunflowerPlains_underground",
|
||||
"ColdTaiga_underground",
|
||||
"IcePlains_underground",
|
||||
"IcePlainsSpikes_underground",
|
||||
"MegaTaiga_underground",
|
||||
"Taiga_underground",
|
||||
"ExtremeHills+_underground",
|
||||
"JungleM_underground",
|
||||
"ExtremeHillsM_underground",
|
||||
"JungleEdgeM_underground",
|
||||
"Mesa",
|
||||
"FlowerForest",
|
||||
"Swampland",
|
||||
"Taiga",
|
||||
"ExtremeHills",
|
||||
"Jungle",
|
||||
"Savanna",
|
||||
"BirchForest",
|
||||
"MegaSpruceTaiga",
|
||||
"MegaTaiga",
|
||||
"ExtremeHills+",
|
||||
"Forest",
|
||||
"Plains",
|
||||
"Desert",
|
||||
"ColdTaiga",
|
||||
"MushroomIsland",
|
||||
"IcePlainsSpikes",
|
||||
"SunflowerPlains",
|
||||
"IcePlains",
|
||||
"RoofedForest",
|
||||
"ExtremeHills+_snowtop",
|
||||
"MesaPlateauFM_grasstop",
|
||||
"JungleEdgeM",
|
||||
"ExtremeHillsM",
|
||||
"JungleM",
|
||||
"BirchForestM",
|
||||
"MesaPlateauF",
|
||||
"MesaPlateauFM",
|
||||
"MesaPlateauF_grasstop",
|
||||
"MesaBryce",
|
||||
"JungleEdge",
|
||||
"SavannaM",
|
||||
"FlowerForest_beach",
|
||||
"Forest_beach",
|
||||
"StoneBeach",
|
||||
"ColdTaiga_beach_water",
|
||||
"Taiga_beach",
|
||||
"Savanna_beach",
|
||||
"Plains_beach",
|
||||
"ExtremeHills_beach",
|
||||
"ColdTaiga_beach",
|
||||
"Swampland_shore",
|
||||
"MushroomIslandShore",
|
||||
"JungleM_shore",
|
||||
"Jungle_shore",
|
||||
"MesaPlateauFM_sandlevel",
|
||||
"MesaPlateauF_sandlevel",
|
||||
"MesaBryce_sandlevel",
|
||||
"Mesa_sandlevel",
|
||||
},
|
||||
0,
|
||||
7,
|
||||
30,
|
||||
6000,
|
||||
4,
|
||||
mobs_mc.spawn_height.overworld_min,
|
||||
mobs_mc.spawn_height.overworld_max)
|
||||
mobs:spawn_setup({
|
||||
name = "mobs_mc:zombie",
|
||||
biomes = zombie_biomes,
|
||||
max_light = 7,
|
||||
chance = 2000,
|
||||
})
|
||||
|
||||
-- Baby zombie is 20 times less likely than regular zombies
|
||||
mobs:spawn_specific(
|
||||
"mobs_mc:baby_zombie",
|
||||
"overworld",
|
||||
"ground",
|
||||
{
|
||||
"FlowerForest_underground",
|
||||
"JungleEdge_underground",
|
||||
"StoneBeach_underground",
|
||||
"MesaBryce_underground",
|
||||
"Mesa_underground",
|
||||
"RoofedForest_underground",
|
||||
"Jungle_underground",
|
||||
"Swampland_underground",
|
||||
"MushroomIsland_underground",
|
||||
"BirchForest_underground",
|
||||
"Plains_underground",
|
||||
"MesaPlateauF_underground",
|
||||
"ExtremeHills_underground",
|
||||
"MegaSpruceTaiga_underground",
|
||||
"BirchForestM_underground",
|
||||
"SavannaM_underground",
|
||||
"MesaPlateauFM_underground",
|
||||
"Desert_underground",
|
||||
"Savanna_underground",
|
||||
"Forest_underground",
|
||||
"SunflowerPlains_underground",
|
||||
"ColdTaiga_underground",
|
||||
"IcePlains_underground",
|
||||
"IcePlainsSpikes_underground",
|
||||
"MegaTaiga_underground",
|
||||
"Taiga_underground",
|
||||
"ExtremeHills+_underground",
|
||||
"JungleM_underground",
|
||||
"ExtremeHillsM_underground",
|
||||
"JungleEdgeM_underground",
|
||||
"Mesa",
|
||||
"FlowerForest",
|
||||
"Swampland",
|
||||
"Taiga",
|
||||
"ExtremeHills",
|
||||
"Jungle",
|
||||
"Savanna",
|
||||
"BirchForest",
|
||||
"MegaSpruceTaiga",
|
||||
"MegaTaiga",
|
||||
"ExtremeHills+",
|
||||
"Forest",
|
||||
"Plains",
|
||||
"Desert",
|
||||
"ColdTaiga",
|
||||
"MushroomIsland",
|
||||
"IcePlainsSpikes",
|
||||
"SunflowerPlains",
|
||||
"IcePlains",
|
||||
"RoofedForest",
|
||||
"ExtremeHills+_snowtop",
|
||||
"MesaPlateauFM_grasstop",
|
||||
"JungleEdgeM",
|
||||
"ExtremeHillsM",
|
||||
"JungleM",
|
||||
"BirchForestM",
|
||||
"MesaPlateauF",
|
||||
"MesaPlateauFM",
|
||||
"MesaPlateauF_grasstop",
|
||||
"MesaBryce",
|
||||
"JungleEdge",
|
||||
"SavannaM",
|
||||
"FlowerForest_beach",
|
||||
"Forest_beach",
|
||||
"StoneBeach",
|
||||
"ColdTaiga_beach_water",
|
||||
"Taiga_beach",
|
||||
"Savanna_beach",
|
||||
"Plains_beach",
|
||||
"ExtremeHills_beach",
|
||||
"ColdTaiga_beach",
|
||||
"Swampland_shore",
|
||||
"MushroomIslandShore",
|
||||
"JungleM_shore",
|
||||
"Jungle_shore",
|
||||
"MesaPlateauFM_sandlevel",
|
||||
"MesaPlateauF_sandlevel",
|
||||
"MesaBryce_sandlevel",
|
||||
"Mesa_sandlevel",
|
||||
},
|
||||
0,
|
||||
7,
|
||||
30,
|
||||
60000,
|
||||
4,
|
||||
mobs_mc.spawn_height.overworld_min,
|
||||
mobs_mc.spawn_height.overworld_max)
|
||||
mobs:spawn_setup({
|
||||
name = "mobs_mc:baby_zombie",
|
||||
biomes = zombie_biomes,
|
||||
max_lignt = 7,
|
||||
chance = 100,
|
||||
})
|
||||
|
||||
mobs:spawn_setup({
|
||||
name = "mobs_mc:husk",
|
||||
biomes = husk_biomes,
|
||||
max_light = 7,
|
||||
chance = 2000,
|
||||
})
|
||||
|
||||
mobs:spawn_specific(
|
||||
"mobs_mc:husk",
|
||||
"overworld",
|
||||
"ground",
|
||||
{
|
||||
"Desert",
|
||||
"SavannaM",
|
||||
"Savanna",
|
||||
"Savanna_beach",
|
||||
},
|
||||
0,
|
||||
7,
|
||||
30,
|
||||
6500,
|
||||
4,
|
||||
mobs_mc.spawn_height.overworld_min,
|
||||
mobs_mc.spawn_height.overworld_max)
|
||||
mobs:spawn_specific(
|
||||
"mobs_mc:baby_husk",
|
||||
"overworld",
|
||||
"ground",
|
||||
{
|
||||
"Desert",
|
||||
"SavannaM",
|
||||
"Savanna",
|
||||
"Savanna_beach",
|
||||
},
|
||||
0,
|
||||
7,
|
||||
30,
|
||||
65000,
|
||||
4,
|
||||
mobs_mc.spawn_height.overworld_min,
|
||||
mobs_mc.spawn_height.overworld_max)
|
||||
mobs:spawn_setup({
|
||||
name = "mobs_mc:baby_husk",
|
||||
biomes = husk_biomes,
|
||||
max_light = 7,
|
||||
chance = 100,
|
||||
})
|
||||
|
||||
-- Spawn eggs
|
||||
mobs:register_egg("mobs_mc:husk", S("Husk"), "mobs_mc_spawn_icon_husk.png", 0)
|
||||
|
|
|
@ -238,8 +238,8 @@ after(5, function(dtime)
|
|||
end)
|
||||
|
||||
minetest.register_chatcommand("lightning", {
|
||||
params = "[<X> <Y> <Z>]",
|
||||
description = S("Let lightning strike at the specified position or yourself"),
|
||||
params = "[<X> <Y> <Z> | <player name>]",
|
||||
description = S("Let lightning strike at the specified position or player. No parameter will strike yourself."),
|
||||
privs = { maphack = true },
|
||||
func = function(name, param)
|
||||
local pos = {}
|
||||
|
@ -247,21 +247,21 @@ minetest.register_chatcommand("lightning", {
|
|||
pos.x = tonumber(pos.x)
|
||||
pos.y = tonumber(pos.y)
|
||||
pos.z = tonumber(pos.z)
|
||||
local player_to_strike
|
||||
if not (pos.x and pos.y and pos.z) then
|
||||
pos = nil
|
||||
player_to_strike = minetest.get_player_by_name(param)
|
||||
if not player_to_strike and param == "" then
|
||||
player_to_strike = minetest.get_player_by_name(name)
|
||||
end
|
||||
if name == "" and pos == nil then
|
||||
end
|
||||
if not player_to_strike and pos == nil then
|
||||
return false, "No position specified and unknown player"
|
||||
end
|
||||
if pos then
|
||||
lightning.strike(pos)
|
||||
else
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
lightning.strike(player:get_pos())
|
||||
else
|
||||
return false, S("No position specified and unknown player")
|
||||
end
|
||||
elseif player_to_strike then
|
||||
lightning.strike(player_to_strike:get_pos())
|
||||
end
|
||||
return true
|
||||
end,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# textdomain: lightning
|
||||
@1 was struck by lightning.=
|
||||
Let lightning strike at the specified position or yourself=
|
||||
Let lightning strike at the specified position or player. No parameter will strike yourself.=
|
||||
No position specified and unknown player=
|
||||
|
|
|
@ -101,6 +101,18 @@ awards.register_achievement("mcl:bookcase", {
|
|||
}
|
||||
})
|
||||
|
||||
awards.register_achievement("mcl:buildIronPickaxe", {
|
||||
title = S("Isn't It Iron Pick"),
|
||||
-- TODO: This achievement should support all non-wood pickaxes
|
||||
description = S("Craft a iron pickaxe using sticks and iron."),
|
||||
icon = "default_tool_steelpick.png",
|
||||
trigger = {
|
||||
type = "craft",
|
||||
item = "mcl_tools:pick_iron",
|
||||
target = 1
|
||||
}
|
||||
})
|
||||
|
||||
-- Item pickup achievements: These are awarded when picking up a certain item.
|
||||
-- The achivements are manually given in the mod mcl_item_entity.
|
||||
awards.register_achievement("mcl:diamonds", {
|
||||
|
@ -125,6 +137,24 @@ awards.register_achievement("mcl:mineWood", {
|
|||
icon = "default_tree.png",
|
||||
})
|
||||
|
||||
awards.register_achievement("mcl:whosCuttingOnions", {
|
||||
title = S("Who is Cutting Onions?"),
|
||||
description = S("Pick up a crying obsidian from the floor."),
|
||||
icon = "default_obsidian.png^mcl_core_crying_obsidian.png",
|
||||
})
|
||||
|
||||
awards.register_achievement("mcl:hiddenInTheDepths", {
|
||||
title = S("Hidden in the Depths"),
|
||||
description = S("Pick up an Ancient Debris from the floor."),
|
||||
icon = "mcl_nether_ancient_debris_side.png",
|
||||
})
|
||||
|
||||
awards.register_achievement("mcl:notQuiteNineLives", {
|
||||
title = S('Not Quite "Nine" Lives'),
|
||||
description = S("Charge a Respawn Anchor to the maximum."),
|
||||
icon = "respawn_anchor_side4.png",
|
||||
})
|
||||
|
||||
-- Smelting achivements: These are awarded when picking up an item from a furnace
|
||||
-- output. They are given in mcl_furnaces.
|
||||
awards.register_achievement("mcl:acquireIron", {
|
||||
|
@ -163,6 +193,12 @@ awards.register_achievement("mcl:buildNetherPortal", {
|
|||
icon = "default_obsidian.png",
|
||||
})
|
||||
|
||||
awards.register_achievement("mcl:enterEndPortal", {
|
||||
title = S("The End?"),
|
||||
description = S("Or the beginning?\nHint: Enter an end portal."),
|
||||
icon = "mcl_end_end_stone.png",
|
||||
})
|
||||
|
||||
-- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.)
|
||||
|
||||
if non_pc_achievements then
|
||||
|
|
|
@ -10,7 +10,7 @@ Craft a stone pickaxe using sticks and cobblestone.=Fabriquez une pioche en pier
|
|||
Craft a wooden sword using wooden planks and sticks on a crafting table.=Fabriquez une épée en bois à l'aide de planches et de bâtons en bois sur un établi.
|
||||
DIAMONDS!=DIAMANTS!
|
||||
Delicious Fish=Délicieux Poisson
|
||||
Dispense With This=Dispenser de ça
|
||||
Dispense With This=Dispensé de ça
|
||||
Eat a cooked porkchop.=Mangez du porc cuit.
|
||||
Eat a cooked rabbit.=Mangez du lapin cuit.
|
||||
Get really desperate and eat rotten flesh.=Soyez vraiment désespéré et mangez de la chair pourrie.
|
||||
|
@ -47,3 +47,19 @@ Use a crafting table to craft a wooden hoe from wooden planks and sticks.=Utilis
|
|||
Use a crafting table to craft a wooden pickaxe from wooden planks and sticks.=Utilisez un établi pour fabriquer une pioche en bois à partir de planches et de bâtons en bois.
|
||||
Use obsidian and a fire starter to construct a Nether portal.=Utilisez de l'obsidienne et un briquet pour construire un portail du Nether.
|
||||
Use wheat to craft a bread.=Utilisez du blé pour fabriquer un pain.
|
||||
Stone Age=L'Age de Pierre
|
||||
Mine a stone with new pickaxe.=Miner de la roche avec une nouvelle pioche
|
||||
Hot Stuff=Chaud Devant !
|
||||
Put lava in a bucket.=Remplir un Seau de lave
|
||||
Ice Bucket Challenge=Le défi du seau d'eau glacée
|
||||
Obtain an obsidian block.=Obtenir un bloc d'obsidienne
|
||||
Isn't It Iron Pick=Bonne Pioche !
|
||||
Craft a iron pickaxe using sticks and iron.=Fabriquer une pioche de fer avec des batons et du fer
|
||||
Who is Cutting Onions?=Qui épluche des oignons ?
|
||||
Pick up a crying obsidian from the floor.=Ramasser une obsidienne pleureuse sur le sol.
|
||||
Hidden in the Depths=Caché dans les profondeurs
|
||||
Pick up an Ancient Debris from the floor.=Ramasser un Ancien Débris
|
||||
Not Quite "Nine" Lives=Presque "neuf" vies
|
||||
Charge a Respawn Anchor to the maximum.=Charger une Ancre de Réapparition au maximum.
|
||||
The End?=L'End ?
|
||||
Or the beginning?\nHint: Enter an end portal.=Ou le commencement ?\nAstuce : Entrer dans un portail de l'End.
|
||||
|
|
|
@ -53,3 +53,13 @@ Hot Stuff=
|
|||
Put lava in a bucket.=
|
||||
Ice Bucket Challenge=
|
||||
Obtain an obsidian block.=
|
||||
Isn't It Iron Pick=
|
||||
Craft a iron pickaxe using sticks and iron.=
|
||||
Who is Cutting Onions?=
|
||||
Pick up a crying obsidian from the floor.=
|
||||
Hidden in the Depths=
|
||||
Pick up an Ancient Debris from the floor.=
|
||||
Not Quite "Nine" Lives=
|
||||
Charge a Respawn Anchor to the maximum.=
|
||||
The End?=
|
||||
Or the beginning?\nHint: Enter an end portal.=
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
1798643961
|
||||
3raven
|
||||
AFCMS
|
||||
aldum
|
||||
Alexander Minges
|
||||
aligator
|
||||
ArTee3
|
||||
Artem Arbatsky
|
||||
basxto
|
||||
Benjamin Schötz
|
||||
Blue Blancmange
|
||||
Booglejr
|
||||
Brandon
|
||||
Bu-Gee
|
||||
bzoss
|
||||
chmodsayshello
|
||||
Code-Sploit
|
||||
cora
|
||||
Daniel Cassidy
|
||||
davedevils
|
||||
Dave Devil's
|
||||
David McMackins II
|
||||
dBeans
|
||||
debiankaios
|
||||
Dieter44
|
||||
Doloment
|
||||
Elias Åström
|
||||
Elias Fleckenstein
|
||||
Emily
|
||||
Emojigit
|
||||
epCode
|
||||
erlehmann
|
||||
FinishedFragment
|
||||
Glaucos Ginez
|
||||
Gustavo Ramos Rehermann
|
||||
Guy Liner
|
||||
GuyLiner
|
||||
HimbeerserverDE
|
||||
iliekprogrammar
|
||||
j1233
|
||||
Jared Moody
|
||||
jordan4ibanez
|
||||
kabou
|
||||
kay27
|
||||
Laurent Rocher
|
||||
Li0n
|
||||
marcin-serwin
|
||||
Marcin Serwin
|
||||
Mental-Inferno
|
||||
Midgard
|
||||
MysticTempest
|
||||
Nicholas Niro
|
||||
nickolas360
|
||||
Nicu
|
||||
nikolaus-albinger
|
||||
Nils Dagsson Moskopp
|
||||
NO11
|
||||
NO411
|
||||
Oil_boi
|
||||
pitchum
|
||||
PrairieAstronomer
|
||||
PrairieWind
|
||||
Rocher Laurent
|
||||
rootyjr
|
||||
Rootyjr
|
||||
rudzik8
|
||||
Sab Pyrope
|
||||
Saku Laesvuori
|
||||
sfan5
|
||||
SmallJoker
|
||||
superfloh247
|
||||
Sven792
|
||||
Sydney Gems
|
||||
talamh
|
||||
TechDudie
|
||||
Thinking
|
||||
Tianyang Zhang
|
||||
U.N.Owen
|
||||
Wouters Dorian
|
||||
wuniversales
|
||||
Wuzzy
|
||||
Yukitty
|
||||
yutyo
|
||||
ZedekThePD
|
||||
ZeDique la Ruleta
|
||||
ztianyang
|
|
@ -0,0 +1,9 @@
|
|||
Please run the following command to update contributor list:
|
||||
|
||||
```bash
|
||||
# git log --pretty="%an" | sort | uniq >CONTRUBUTOR_LIST.txt
|
||||
```
|
||||
|
||||
Please check that there is no error on execution, and `CONTRUBUTOR_LIST.txt` is updated.
|
||||
|
||||
There should be contributor names, line by line.
|
|
@ -1,10 +1,40 @@
|
|||
local modname = minetest.get_current_modname()
|
||||
local S = minetest.get_translator(modname)
|
||||
|
||||
local contributors_file_name = minetest.get_modpath(modname) .. "/CONTRUBUTOR_LIST.txt"
|
||||
|
||||
local file = io.open(contributors_file_name)
|
||||
local contributors = {}
|
||||
if not file then
|
||||
minetest.log("error", "[" .. modname .. "] Can't read contributors from " .. contributors_file_name)
|
||||
else
|
||||
local contributor_list = file:read("*a")
|
||||
file:close()
|
||||
for contributor in contributor_list:gmatch("[^\r\n]+") do
|
||||
table.insert(contributors, contributor)
|
||||
end
|
||||
end
|
||||
|
||||
mcl_credits = {
|
||||
players = {},
|
||||
description = S("A faithful Open Source clone of Minecraft"),
|
||||
people = dofile(minetest.get_modpath(modname) .. "/people.lua"),
|
||||
people = {
|
||||
{S("Creator of MineClone"), 0x0A9400, {
|
||||
"davedevils",
|
||||
}},
|
||||
{S("Creator of MineClone 2"), 0xFBF837, {
|
||||
"Wuzzy",
|
||||
}},
|
||||
{S("Creators of MineClone 5"), 0x52FF00,
|
||||
contributors
|
||||
},
|
||||
{S("Special thanks"), 0x00E9FF, {
|
||||
"celeron55 for creating Minetest",
|
||||
"Jordach for the jukebox music compilation from Big Freaking Dig",
|
||||
"The workaholics who spent way too much time writing for the Minecraft Wiki. It's an invaluable resource for creating this game",
|
||||
"Notch and Jeb for being the major forces behind Minecraft",
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
local function add_hud_element(def, huds, y)
|
||||
|
|
|
@ -1,145 +0,0 @@
|
|||
local modname = minetest.get_current_modname()
|
||||
local S = minetest.get_translator(modname)
|
||||
|
||||
return {
|
||||
{S("Creator of MineClone"), 0x0A9400, {
|
||||
"davedevils",
|
||||
}},
|
||||
{S("Creator of MineClone2"), 0xFBF837, {
|
||||
"Wuzzy",
|
||||
}},
|
||||
{S("Creator of MineClone5"), 0xFF51D5, {
|
||||
S("The Community"),
|
||||
}},
|
||||
{S("Developers"), 0xF84355, {
|
||||
"Fleckenstein",
|
||||
"kay27",
|
||||
"oilboi",
|
||||
"bzoss",
|
||||
"AFCMS",
|
||||
"epCode",
|
||||
"ryvnf",
|
||||
"iliekprogrammar",
|
||||
"MysticTempest",
|
||||
"Rootyjr",
|
||||
"Nicu",
|
||||
"aligator",
|
||||
"Code-Sploit",
|
||||
"NO11",
|
||||
"cora",
|
||||
}},
|
||||
{S("Contributors"), 0x52FF00, {
|
||||
"Laurent Rocher",
|
||||
"HimbeerserverDE",
|
||||
"TechDudie",
|
||||
"Alexander Minges",
|
||||
"ArTee3",
|
||||
"ZeDique la Ruleta",
|
||||
"pitchum",
|
||||
"wuniversales",
|
||||
"Bu-Gee",
|
||||
"David McMackins II",
|
||||
"Nicholas Niro",
|
||||
"Wouters Dorian",
|
||||
"Blue Blancmange",
|
||||
"Jared Moody",
|
||||
"Li0n",
|
||||
"Midgard",
|
||||
"Saku Laesvuori",
|
||||
"Yukitty",
|
||||
"ZedekThePD",
|
||||
"aldum",
|
||||
"dBeans",
|
||||
"nickolas360",
|
||||
"yutyo",
|
||||
"ztianyang",
|
||||
"j45",
|
||||
"Marcin Serwin",
|
||||
"erlehmann",
|
||||
"E",
|
||||
"Benjamin Schötz",
|
||||
"Doloment",
|
||||
"Sydney Gems",
|
||||
"talamh",
|
||||
"Emily2255",
|
||||
"Emojigit",
|
||||
"FinishedFragment",
|
||||
"sfan5",
|
||||
"Blue Blancmange",
|
||||
"Jared Moody",
|
||||
"SmallJoker",
|
||||
"Sven792",
|
||||
"aldum",
|
||||
}},
|
||||
{S("MineClone5"), 0xA60014, {
|
||||
"kay27",
|
||||
"Debiankaios",
|
||||
"epCode",
|
||||
"NO11",
|
||||
"j45",
|
||||
}},
|
||||
{S("Original Mod Authors"), 0x343434, {
|
||||
"Wuzzy",
|
||||
"Fleckenstein",
|
||||
"BlockMen",
|
||||
"TenPlus1",
|
||||
"PilzAdam",
|
||||
"ryvnf",
|
||||
"stujones11",
|
||||
"Arcelmi",
|
||||
"celeron55",
|
||||
"maikerumine",
|
||||
"GunshipPenguin",
|
||||
"Qwertymine3",
|
||||
"Rochambeau",
|
||||
"rubenwardy",
|
||||
"stu",
|
||||
"4aiman",
|
||||
"Kahrl",
|
||||
"Krock",
|
||||
"UgnilJoZ",
|
||||
"lordfingle",
|
||||
"22i",
|
||||
"bzoss",
|
||||
"kilbith",
|
||||
"xeranas",
|
||||
"kddekadenz",
|
||||
"sofar",
|
||||
"4Evergreen4",
|
||||
"jordan4ibanez",
|
||||
"paramat",
|
||||
}},
|
||||
{S("3D Models"), 0x0019FF, {
|
||||
"22i",
|
||||
"tobyplowy",
|
||||
"epCode",
|
||||
}},
|
||||
{S("Textures"), 0xFF9705, {
|
||||
"XSSheep",
|
||||
"Wuzzy",
|
||||
"kingoscargames",
|
||||
"leorockway",
|
||||
"xMrVizzy",
|
||||
"yutyo",
|
||||
"NO11",
|
||||
"kay27",
|
||||
}},
|
||||
{S("Translations"), 0x00FF60, {
|
||||
"Wuzzy",
|
||||
"Rocher Laurent",
|
||||
"wuniversales",
|
||||
"kay27",
|
||||
"pitchum",
|
||||
"todoporlalibertad",
|
||||
"Marcin Serwin",
|
||||
}},
|
||||
{S("Funders"), 0xF7FF00, {
|
||||
"40W",
|
||||
}},
|
||||
{S("Special thanks"), 0x00E9FF, {
|
||||
"celeron55 for creating Minetest",
|
||||
"Jordach for the jukebox music compilation from Big Freaking Dig",
|
||||
"The workaholics who spent way too much time writing for the Minecraft Wiki. It's an invaluable resource for creating this game",
|
||||
"Notch and Jeb for being the major forces behind Minecraft",
|
||||
}},
|
||||
}
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 277 KiB |
|
@ -5,3 +5,4 @@ Error: Too many parameters!=Erreur: Trop de paramètres!
|
|||
Error: Incorrect value of XP=Erreur: Valeur incorrecte de XP
|
||||
Error: Player not found=Erreur: Joueur introuvable
|
||||
Added @1 XP to @2, total: @3, experience level: @4=Ajout de @1 XP à @2, total: @3, niveau d'expérience: @4
|
||||
Bottle o' Enchanting=Fiole d'expérience
|
|
@ -0,0 +1,105 @@
|
|||
local refresh_interval = .63
|
||||
local huds = {}
|
||||
local default_debug = 3
|
||||
local after = minetest.after
|
||||
local get_connected_players = minetest.get_connected_players
|
||||
local get_biome_name = minetest.get_biome_name
|
||||
local get_biome_data = minetest.get_biome_data
|
||||
local format = string.format
|
||||
|
||||
local min1, min2, min3 = mcl_mapgen.overworld.min, mcl_mapgen.end_.min, mcl_mapgen.nether.min
|
||||
local max1, max2, max3 = mcl_mapgen.overworld.max, mcl_mapgen.end_.max, mcl_mapgen.nether.max + 128
|
||||
|
||||
local modname = minetest.get_current_modname()
|
||||
local modpath = minetest.get_modpath(modname)
|
||||
local S = minetest.get_translator(modname)
|
||||
local storage = minetest.get_mod_storage()
|
||||
local player_dbg = minetest.deserialize(storage:get_string("player_dbg") or "return {}") or {}
|
||||
|
||||
local function get_text(pos, bits)
|
||||
local bits = bits
|
||||
if bits == 0 then return "" end
|
||||
local y = pos.y
|
||||
if y >= min1 then
|
||||
y = y - min1
|
||||
elseif y >= min3 and y <= max3 then
|
||||
y = y - min3
|
||||
elseif y >= min2 and y <= max2 then
|
||||
y = y - min2
|
||||
end
|
||||
local biome_data = get_biome_data(pos)
|
||||
local biome_name = biome_data and get_biome_name(biome_data.biome) or "No biome"
|
||||
local text
|
||||
if bits == 1 then
|
||||
text = biome_name
|
||||
elseif bits == 2 then
|
||||
text = format("x:%.1f y:%.1f z:%.1f", pos.x, y, pos.z)
|
||||
elseif bits == 3 then
|
||||
text = format("%s x:%.1f y:%.1f z:%.1f", biome_name, pos.x, y, pos.z)
|
||||
end
|
||||
return text
|
||||
end
|
||||
|
||||
local function info()
|
||||
for _, player in pairs(get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
local pos = player:get_pos()
|
||||
local text = get_text(pos, player_dbg[name] or default_debug)
|
||||
local hud = huds[name]
|
||||
if not hud then
|
||||
local def = {
|
||||
hud_elem_type = "text",
|
||||
alignment = {x = 1, y = -1},
|
||||
scale = {x = 100, y = 100},
|
||||
position = {x = 0.0073, y = 0.989},
|
||||
text = text,
|
||||
style = 5,
|
||||
["number"] = 0xcccac0,
|
||||
z_index = 0,
|
||||
}
|
||||
local def_bg = table.copy(def)
|
||||
def_bg.offset = {x = 2, y = 1}
|
||||
def_bg["number"] = 0
|
||||
def_bg.z_index = -1
|
||||
huds[name] = {
|
||||
player:hud_add(def),
|
||||
player:hud_add(def_bg),
|
||||
text,
|
||||
}
|
||||
elseif text ~= hud[3] then
|
||||
hud[3] = text
|
||||
player:hud_change(huds[name][1], "text", text)
|
||||
player:hud_change(huds[name][2], "text", text)
|
||||
end
|
||||
end
|
||||
after(refresh_interval, info)
|
||||
end
|
||||
|
||||
minetest.register_on_authplayer(function(name, ip, is_success)
|
||||
if is_success then
|
||||
huds[name] = nil
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_chatcommand("debug",{
|
||||
description = S("Set debug bit mask: 0 = disable, 1 = biome name, 2 = coordinates, 3 = all"),
|
||||
func = function(name, params)
|
||||
local dbg = math.floor(tonumber(params) or default_debug)
|
||||
if dbg < 0 or dbg > 3 then
|
||||
minetest.chat_send_player(name, S("Error! Possible values are integer numbers from @1 to @2", 0, 3))
|
||||
return
|
||||
end
|
||||
if dbg == default_dbg then
|
||||
player_dbg[name] = nil
|
||||
else
|
||||
player_dbg[name] = dbg
|
||||
end
|
||||
minetest.chat_send_player(name, S("Debug bit mask set to @1", dbg))
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_shutdown(function()
|
||||
storage:set_string("player_dbg", minetest.serialize(player_dbg))
|
||||
end)
|
||||
|
||||
info()
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: mcl_info
|
||||
Set debug bit mask: 0 @= disable, 1 @= biome name, 2 @= coordinates, 3 @= all=Réglage du masque de débugage : 0 @= désactiver, 1 @= nom de biome, 2 @= coordonnées, 3 @= tout=
|
||||
Error! Possible values are integer numbers from @1 to @2=Erreur ! Les valeurs autorisées sont des nombres entiers de @1 à @2
|
||||
Debug bit mask set to @1=Masque de débugage réglé à @1
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: mcl_info
|
||||
Set debug bit mask: 0 @= disable, 1 @= biome name, 2 @= coordinates, 3 @= all=Установка отладочной битовой маски: 0 @= отключить, 1 @= биом, 2 @= координаты, 3 @= всё
|
||||
Error! Possible values are integer numbers from @1 to @2=Ошибка! Допустимые значения - целые числа от @1 до @2
|
||||
Debug bit mask set to @1=Отладочной битовой маске присвоено значение @1
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: mcl_info
|
||||
Set debug bit mask: 0 @= disable, 1 @= biome name, 2 @= coordinates, 3 @= all=
|
||||
Error! Possible values are integer numbers from @1 to @2=
|
||||
Debug bit mask set to @1=
|
|
@ -0,0 +1,3 @@
|
|||
name = mcl_info
|
||||
description = Prints biome name and player position
|
||||
optional_depends = mcl_mapgen
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: mcl_observers
|
||||
Bell=Cloche
|
|
@ -0,0 +1,70 @@
|
|||
local S = minetest.get_translator("mcl_target")
|
||||
|
||||
local mod_farming = minetest.get_modpath("mcl_farming")
|
||||
|
||||
mcl_target = {}
|
||||
|
||||
function mcl_target.hit(pos, time)
|
||||
minetest.set_node(pos, {name="mcl_target:target_on"})
|
||||
mesecon.receptor_on(pos, mesecon.rules.alldirs)
|
||||
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(time)
|
||||
end
|
||||
|
||||
minetest.register_node("mcl_target:target_off", {
|
||||
description = S("Target"),
|
||||
_doc_items_longdesc = S("A target is a block that provides a temporary redstone charge when hit by a projectile."),
|
||||
_doc_items_usagehelp = S("Throw a projectile on the target to activate it."),
|
||||
tiles = {"mcl_target_target_top.png", "mcl_target_target_top.png", "mcl_target_target_side.png"},
|
||||
groups = {hoey = 1},
|
||||
sounds = mcl_sounds.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.1},
|
||||
}),
|
||||
mesecons = {
|
||||
receptor = {
|
||||
state = mesecon.state.off,
|
||||
rules = mesecon.rules.alldirs,
|
||||
},
|
||||
},
|
||||
_mcl_blast_resistance = 0.5,
|
||||
_mcl_hardness = 0.5,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_target:target_on", {
|
||||
description = S("Target"),
|
||||
_doc_items_create_entry = false,
|
||||
tiles = {"mcl_target_target_top.png", "mcl_target_target_top.png", "mcl_target_target_side.png"},
|
||||
groups = {hoey = 1, not_in_creative_inventory = 1},
|
||||
drop = "mcl_target:target_off",
|
||||
sounds = mcl_sounds.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.1},
|
||||
}),
|
||||
on_timer = function(pos, elapsed)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name == "mcl_target:target_on" then --has not been dug
|
||||
minetest.set_node(pos, {name="mcl_target:target_off"})
|
||||
mesecon.receptor_off(pos, mesecon.rules.alldirs)
|
||||
end
|
||||
end,
|
||||
mesecons = {
|
||||
receptor = {
|
||||
state = mesecon.state.on,
|
||||
rules = mesecon.rules.alldirs,
|
||||
},
|
||||
},
|
||||
_mcl_blast_resistance = 0.5,
|
||||
_mcl_hardness = 0.5,
|
||||
})
|
||||
|
||||
|
||||
if mod_farming then
|
||||
minetest.register_craft({
|
||||
output = "mcl_target:target_off",
|
||||
recipe = {
|
||||
{"", "mesecons:redstone", ""},
|
||||
{"mesecons:redstone", "mcl_farming:hay_block", "mesecons:redstone"},
|
||||
{"", "mesecons:redstone", ""},
|
||||
},
|
||||
})
|
||||
end
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: mcl_target
|
||||
Target=Cible
|
||||
A target is a block that provides a temporary redstone charge when hit by a projectile.=La cible est un bloc qui se comporte comme une source d'énergie temporaire quand elle est frappée par un projectile.
|
||||
Throw a projectile on the target to activate it.=Lancer un projectile sur la cible pour l'activer.
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: mcl_target
|
||||
Target=
|
||||
A target is a block that provides a temporary redstone charge when hit by a projectile.=
|
||||
Throw a projectile on the target to activate it.=
|
|
@ -0,0 +1,3 @@
|
|||
name = mcl_target
|
||||
author = AFCMS
|
||||
depends = mesecons, mcl_sounds
|
After Width: | Height: | Size: 752 B |
After Width: | Height: | Size: 752 B |
|
@ -346,8 +346,16 @@ function mesecon.vm_abort()
|
|||
vm_cache = nil
|
||||
end
|
||||
|
||||
local function is_player_close(pos)
|
||||
for k,p in pairs(minetest.get_connected_players()) do
|
||||
local d=vector.distance(pos,p:get_pos())
|
||||
if d < 40 then return true end
|
||||
end
|
||||
end
|
||||
|
||||
-- Gets the cache entry covering a position, populating it if necessary.
|
||||
local function vm_get_or_create_entry(pos)
|
||||
if not is_player_close(pos) then return end
|
||||
local hash = hash_blockpos(pos)
|
||||
local tbl = vm_cache[hash]
|
||||
if not tbl then
|
||||
|
@ -364,6 +372,7 @@ end
|
|||
-- transaction.
|
||||
function mesecon.vm_get_node(pos)
|
||||
local tbl = vm_get_or_create_entry(pos)
|
||||
if not tbl then return end
|
||||
local index = tbl.va:indexp(pos)
|
||||
local node_value = tbl.data[index]
|
||||
if node_value == minetest.CONTENT_IGNORE then
|
||||
|
@ -380,6 +389,7 @@ end
|
|||
-- Existing param1, param2, and metadata are left alone.
|
||||
function mesecon.vm_swap_node(pos, name)
|
||||
local tbl = vm_get_or_create_entry(pos)
|
||||
if not tbl then return end
|
||||
local index = tbl.va:indexp(pos)
|
||||
tbl.data[index] = minetest.get_content_id(name)
|
||||
tbl.dirty = true
|
||||
|
@ -393,6 +403,7 @@ end
|
|||
--
|
||||
-- Inside a VM transaction, the transaction’s VM cache is used.
|
||||
function mesecon.get_node_force(pos)
|
||||
if not is_player_close(pos) then return end
|
||||
if vm_cache then
|
||||
return mesecon.vm_get_node(pos)
|
||||
else
|
||||
|
@ -424,6 +435,7 @@ function mesecon.swap_node_force(pos, name)
|
|||
-- This serves to both ensure the mapblock is loaded and also hand us
|
||||
-- the old node table so we can preserve param2.
|
||||
local node = mesecon.get_node_force(pos)
|
||||
if not node then return end
|
||||
node.name = name
|
||||
minetest.swap_node(pos, node)
|
||||
end
|
||||
|
|
|
@ -216,6 +216,18 @@ mesecon.register_button(
|
|||
S("A stone button is a redstone component made out of stone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second."),
|
||||
"mesecons_button_push")
|
||||
|
||||
mesecon.register_button(
|
||||
"polished_blackstone",
|
||||
S("Polished Blackstone Button"),
|
||||
"mcl_blackstone_polished.png",
|
||||
"mcl_blackstone:blackstone_polished",
|
||||
mcl_sounds.node_sound_stone_defaults(),
|
||||
{material_stone=1,handy=1,pickaxey=1},
|
||||
1,
|
||||
false,
|
||||
S("A polished blackstone button is a redstone component made out of polished blackstone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second."),
|
||||
"mesecons_button_push")
|
||||
|
||||
local woods = {
|
||||
{ "wood", "mcl_core:wood", "default_wood.png", S("Oak Button") },
|
||||
{ "acaciawood", "mcl_core:acaciawood", "default_acacia_wood.png", S("Acacia Button") },
|
||||
|
@ -223,6 +235,8 @@ local woods = {
|
|||
{ "darkwood", "mcl_core:darkwood", "mcl_core_planks_big_oak.png", S("Dark Oak Button") },
|
||||
{ "sprucewood", "mcl_core:sprucewood", "mcl_core_planks_spruce.png", S("Spruce Button") },
|
||||
{ "junglewood", "mcl_core:junglewood", "default_junglewood.png", S("Jungle Button") },
|
||||
{ "warped_hyphae_wood", "mcl_mushroom:warped_hyphae_wood", "warped_hyphae_wood.png", S("Warped Hyphae Button") },
|
||||
{ "crimson_hyphae_wood", "mcl_mushroom:crimson_hyphae_wood", "crimson_hyphae_wood.png", S("Crimson Hyphae Button") },
|
||||
}
|
||||
|
||||
for w=1, #woods do
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# textdomain: mesecons_button
|
||||
Use the button to push it.=Utilisez le bouton pour le pousser.
|
||||
Stone Button=Bouton de pierre
|
||||
Polished Blackstone Button=Bouton de Pierre Noire Polie
|
||||
A stone button is a redstone component made out of stone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second.=Un bouton en pierre est un composant Redstone en pierre qui peut être poussé pour fournir de la puissance Redstone. Lorsqu'il est poussé, il alimente les composants Redstone adjacents pendant 1 seconde.
|
||||
Oak Button=Bouton en Chêne
|
||||
Acacia Button=Bouton en Acacia
|
||||
|
@ -8,6 +9,8 @@ Birch Button=Bouton en Bouleau
|
|||
Dark Oak Button=Bouton en Chêne Noir
|
||||
Spruce Button=Bouton en Sapin
|
||||
Jungle Button=Bouton en Acajou
|
||||
Warped Hyphae Button=Bouton en Hyphae Tordu
|
||||
Crimson Hyphae Button=Bouton en Hyphae Ecarlate
|
||||
A wooden button is a redstone component made out of wood which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1.5 seconds. Wooden buttons may also be pushed by arrows.=Un bouton en bois est un composant de redstone en bois qui peut être poussé pour fournir une puissance de redstone. Lorsqu'il est poussé, il alimente les composants Redstone adjacents pendant 1,5 seconde. Les boutons en bois peuvent également être poussés par des flèches.
|
||||
Provides redstone power when pushed=Fournit une puissance de redstone lorsqu'il est poussé
|
||||
Push duration: @1s=Durée de poussée: @1s
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# textdomain: mesecons_button
|
||||
Use the button to push it.=
|
||||
Stone Button=
|
||||
Polished Blackstone Button=
|
||||
A stone button is a redstone component made out of stone which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1 second.=
|
||||
Oak Button=
|
||||
Acacia Button=
|
||||
|
@ -8,6 +9,8 @@ Birch Button=
|
|||
Dark Oak Button=
|
||||
Spruce Button=
|
||||
Jungle Button=
|
||||
Warped Hyphae Button=
|
||||
Crimson Hyphae Button=
|
||||
A wooden button is a redstone component made out of wood which can be pushed to provide redstone power. When pushed, it powers adjacent redstone components for 1.5 seconds. Wooden buttons may also be pushed by arrows.=
|
||||
Provides redstone power when pushed=
|
||||
Push duration: @1s=
|
||||
|
|
|
@ -4,7 +4,6 @@ local table = table
|
|||
|
||||
mesecon.mvps_stoppers = {}
|
||||
mesecon.mvps_unsticky = {}
|
||||
mesecon.mvps_droppers = {}
|
||||
mesecon.on_mvps_move = {}
|
||||
mesecon.mvps_unmov = {}
|
||||
|
||||
|
@ -17,24 +16,6 @@ function mesecon.is_mvps_unmov(objectname)
|
|||
return mesecon.mvps_unmov[objectname]
|
||||
end
|
||||
|
||||
function mesecon.is_mvps_dropper(node, pushdir, stack, stackid)
|
||||
local get_dropper = mesecon.mvps_droppers[node.name]
|
||||
if type (get_dropper) == "function" then
|
||||
get_dropper = get_dropper(node, pushdir, stack, stackid)
|
||||
end
|
||||
if not get_dropper then
|
||||
get_dropper = minetest.get_item_group(node.name, "dig_by_piston") == 1
|
||||
end
|
||||
return get_dropper
|
||||
end
|
||||
|
||||
function mesecon.register_mvps_dropper(nodename, get_dropper)
|
||||
if get_dropper == nil then
|
||||
get_dropper = true
|
||||
end
|
||||
mesecon.mvps_droppers[nodename] = get_dropper
|
||||
end
|
||||
|
||||
-- Nodes that cannot be pushed / pulled by movestones, pistons
|
||||
function mesecon.is_mvps_stopper(node)
|
||||
-- unknown nodes are always stoppers
|
||||
|
@ -220,19 +201,13 @@ end
|
|||
function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, player_name, piston_pos)
|
||||
local nodes, has_loop = mesecon.mvps_get_stack(pos, movedir, maximum, piston_pos)
|
||||
|
||||
if has_loop then
|
||||
return false
|
||||
end
|
||||
|
||||
if not nodes then return end
|
||||
if has_loop or not nodes then return end
|
||||
|
||||
local newpos={}
|
||||
-- check node availability to push/pull into, and fill newpos[i]
|
||||
for i in ipairs(nodes) do
|
||||
newpos[i] = vector.add(nodes[i].pos, movedir)
|
||||
if (newpos[i].x == piston_pos.x) and (newpos[i].y == piston_pos.y) and (newpos[i].z == piston_pos.z) then
|
||||
return
|
||||
end
|
||||
if (newpos[i].x == piston_pos.x) and (newpos[i].y == piston_pos.y) and (newpos[i].z == piston_pos.z) then return end
|
||||
if not is_available(newpos[i]) then
|
||||
local available = false
|
||||
for j in ipairs(nodes) do
|
||||
|
@ -243,23 +218,18 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, player_name,
|
|||
end
|
||||
end
|
||||
end
|
||||
if not available then
|
||||
return
|
||||
end
|
||||
if not available then return end
|
||||
end
|
||||
end
|
||||
|
||||
if are_protected(nodes, player_name) then
|
||||
return
|
||||
end
|
||||
if are_protected(nodes, player_name) then return end
|
||||
|
||||
local first_dropper = nil
|
||||
-- remove all nodes
|
||||
for id, n in ipairs(nodes) do
|
||||
n.meta = minetest.get_meta(n.pos):to_table()
|
||||
local is_dropper = mesecon.is_mvps_dropper(n.node, movedir, nodes, id)
|
||||
local is_dropper = minetest.get_item_group(n.node.name, "dig_by_piston") == 1
|
||||
if is_dropper then
|
||||
--local drops = minetest.get_node_drops(n.node.name, "")
|
||||
minetest.dig_node(n.pos)
|
||||
else
|
||||
minetest.remove_node(n.pos)
|
||||
|
|
|
@ -164,6 +164,8 @@ local woods = {
|
|||
{ "darkwood", "mcl_core:darkwood", "mcl_core_planks_big_oak.png", S("Dark Oak Pressure Plate" )},
|
||||
{ "sprucewood", "mcl_core:sprucewood", "mcl_core_planks_spruce.png", S("Spruce Pressure Plate") },
|
||||
{ "junglewood", "mcl_core:junglewood", "default_junglewood.png", S("Jungle Pressure Plate") },
|
||||
{ "warped_hyphae_wood", "mcl_mushrooom:warped_hyphae_wood", "warped_hyphae_wood.png", S("Warped Hyphae Pressure Plate")},
|
||||
{ "crimson_hyphae_wood", "mcl_mushrooom:crimson_hyphae_wood", "crimson_hyphae_wood.png", S("Crimson Hyphae Pressure Plate")},
|
||||
}
|
||||
|
||||
for w=1, #woods do
|
||||
|
@ -201,6 +203,19 @@ mesecon.register_pressure_plate(
|
|||
{ player = true, mob = true },
|
||||
S("A stone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else."))
|
||||
|
||||
mesecon.register_pressure_plate(
|
||||
"mesecons_pressureplates:pressure_plate_polished_blackstone",
|
||||
S("Polished Blackstone Pressure Plate"),
|
||||
{"mcl_blackstone_polished.png"},
|
||||
{"mcl_blackstone_polished.png"},
|
||||
"default_stone.png",
|
||||
nil,
|
||||
{{"mcl_blackstone:blackstone_polished", "mcl_blackstone:blackstone_polished"}},
|
||||
mcl_sounds.node_sound_stone_defaults(),
|
||||
{pickaxey=1, material_stone=1},
|
||||
{ player = true, mob = true },
|
||||
S("A polished blackstone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else."))
|
||||
|
||||
mesecon.register_pressure_plate(
|
||||
"mesecons_pressureplates:pressure_plate_gold",
|
||||
S("Light-Weighted Pressure Plate"),
|
||||
|
@ -211,5 +226,18 @@ mesecon.register_pressure_plate(
|
|||
{{"mcl_core:gold_ingot", "mcl_core:gold_ingot"}},
|
||||
mcl_sounds.node_sound_metal_defaults(),
|
||||
{pickaxey=1},
|
||||
{ player = true, mob = true },
|
||||
S("A light-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else."))
|
||||
nil,
|
||||
S("A light-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it."))
|
||||
|
||||
mesecon.register_pressure_plate(
|
||||
"mesecons_pressureplates:pressure_plate_iron",
|
||||
S("Heavy-Weighted Pressure Plate"),
|
||||
{"default_steel_block.png"},
|
||||
{"default_steel_block.png"},
|
||||
"default_steel_block.png",
|
||||
nil,
|
||||
{{"mcl_core:iron_ingot", "mcl_core:iron_ingot"}},
|
||||
mcl_sounds.node_sound_metal_defaults(),
|
||||
{pickaxey=1},
|
||||
nil,
|
||||
S("A heavy-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it."))
|
||||
|
|
|
@ -6,10 +6,18 @@ Birch Pressure Plate=Plaque de pression en Bouleau
|
|||
Dark Oak Pressure Plate=Plaque de pression en Chêne Noir
|
||||
Spruce Pressure Plate=Plaque de pression en Sapin
|
||||
Jungle Pressure Plate=Plaque de pression en Acajou
|
||||
Warped Hyphae Pressure Plate=Plaque de pression en Hyphae Tordue
|
||||
Crimson Hyphae Pressure Plate=Plaque de pression en Hyphae Ecarlate
|
||||
A wooden pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=Une plaque de pression en bois est un composant de redstone qui alimente ses blocs environnants en puissance de redstone tandis que tout objet mobile (y compris les objets lâchés, les joueurs et les mobs) repose dessus.
|
||||
Stone Pressure Plate=Plaque de pression en pierre
|
||||
A stone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.=Une plaque de pression en pierre est un composant de redstone qui alimente ses blocs environnants en puissance de redstone pendant qu'un joueur ou un mob se tient au-dessus. Il n'est déclenché par rien d'autre.
|
||||
Provides redstone power when pushed=Fournit une puissance de redstone lorsqu'il est poussé
|
||||
Polished Blackstone Pressure Plate=Plaque de pression en pierre noire polie
|
||||
A polished blackstone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.=Une plaque de pression en pierre noire polie est un composant de redstone qui alimente ses blocs environnants en puissance de redstone pendant qu'un joueur ou un mob se tient au-dessus. Il n'est déclenché par rien d'autre.
|
||||
Light-Weighted Pressure Plate=Plaque de pression pondérée légère
|
||||
A light-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=Une plaque de pression pondérée légère est un composant de redstone qui alimente ses blocs environnants en puissance de redstone tandis que tout objet mobile (y compris les objets lâchés, les joueurs et les mobs) repose dessus.
|
||||
Heavy-Weighted Pressure Plate=Plaque de pression pondérée lourde
|
||||
A heavy-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=Une plaque de pression pondérée lourde est un composant de redstone qui alimente ses blocs environnants en puissance de redstone tandis que tout objet mobile (y compris les objets lâchés, les joueurs et les mobs) repose dessus.
|
||||
Provides redstone power when pushed=Fournit une puissance de redstone lorsque poussé
|
||||
Pushable by players, mobs and objects=Poussable par les joueurs, les mobs et les objets
|
||||
Pushable by players and mobs=Poussable par les joueurs et les mobs
|
||||
Pushable by players=Poussable par les joueurs
|
||||
|
|
|
@ -6,9 +6,17 @@ Birch Pressure Plate=
|
|||
Dark Oak Pressure Plate=
|
||||
Spruce Pressure Plate=
|
||||
Jungle Pressure Plate=
|
||||
Warped Hyphae Pressure Plate=
|
||||
Crimson Hyphae Pressure Plate=
|
||||
A wooden pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=
|
||||
Stone Pressure Plate=
|
||||
A stone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.=
|
||||
Polished Blackstone Pressure Plate=
|
||||
A polished blackstone pressure plate is a redstone component which supplies its surrounding blocks with redstone power while a player or mob stands on top of it. It is not triggered by anything else.=
|
||||
Light-Weighted Pressure Plate=
|
||||
A light-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=
|
||||
Heavy-Weighted Pressure Plate=
|
||||
A heavy-weighted pressure plate is a redstone component which supplies its surrounding blocks with redstone power while any movable object (including dropped items, players and mobs) rests on top of it.=
|
||||
Provides redstone power when pushed=
|
||||
Pushable by players, mobs and objects=
|
||||
Pushable by players and mobs=
|
||||
|
|
|
@ -618,6 +618,7 @@ local entity_standing = {
|
|||
-- pattern: name of pattern (see list above)
|
||||
|
||||
get_staticdata = function(self)
|
||||
if not self then return end
|
||||
local out = { _base_color = self._base_color, _layers = self._layers, _name = self._name }
|
||||
return minetest.serialize(out)
|
||||
end,
|
||||
|
|
|
@ -4,9 +4,11 @@ mcl_beds.pos = {}
|
|||
mcl_beds.bed_pos = {}
|
||||
|
||||
local modpath = minetest.get_modpath("mcl_beds")
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
-- Load files
|
||||
|
||||
dofile(modpath .. "/functions.lua")
|
||||
dofile(modpath .. "/api.lua")
|
||||
dofile(modpath .. "/beds.lua")
|
||||
dofile(modpath .. "/respawn_anchor.lua")
|
|
@ -39,3 +39,4 @@ You're sleeping.=Tu dors.
|
|||
You will fall asleep when all players are in bed.=Vous vous endormirez lorsque tous les joueurs seront au lit.
|
||||
You're in bed.=Tu es au lit.
|
||||
Allows you to sleep=Vous permet de dormir
|
||||
Respawn Anchor=Ancre de Réapparition
|
|
@ -40,3 +40,4 @@ You will fall asleep when all players are in bed.=
|
|||
You will fall asleep when @1% of all players are in bed.=
|
||||
You're in bed.=
|
||||
Allows you to sleep=
|
||||
Respawn Anchor=
|
||||
|
|
|
@ -2,4 +2,4 @@ name = mcl_beds
|
|||
author = BlockMen
|
||||
description =
|
||||
depends = playerphysics
|
||||
optional_depends = mcl_sounds, mcl_worlds, mcl_wool, mcl_dye, mcl_explosions, mcl_weather, mcl_spawn, doc
|
||||
optional_depends = mcl_sounds, mcl_worlds, mcl_wool, mcl_dye, mcl_explosions, mcl_weather, mcl_spawn, doc, mcl_nether
|
|
@ -0,0 +1,177 @@
|
|||
--TODO: Add sounds for the respawn anchor
|
||||
|
||||
--Nether ends at y -29077
|
||||
--Nether roof at y -28933
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
--local mod_doc = minetest.get_modpath("doc") -> maybe add documentation ?
|
||||
|
||||
minetest.register_node("mcl_beds:respawn_anchor",{
|
||||
description=S("Respawn Anchor"),
|
||||
tiles = {
|
||||
"respawn_anchor_top_off.png",
|
||||
"respawn_anchor_bottom.png",
|
||||
"respawn_anchor_side0.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
node_box= { --Reused the composter nodebox, since it is basicly the same
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall
|
||||
{ 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall
|
||||
{-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall
|
||||
{-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.47, 0.5}, -- Bottom level, -0.47 because -0.5 is so low that you can see the texture of the block below through
|
||||
}
|
||||
},
|
||||
on_rightclick = function(pos, node, player, itemstack)
|
||||
if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then
|
||||
minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_1"})
|
||||
itemstack:take_item()
|
||||
else
|
||||
if pos.y < -29077 or pos.y > -28933 then
|
||||
mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true})
|
||||
end
|
||||
end
|
||||
end,
|
||||
groups = {pickaxey=1, material_stone=1},
|
||||
_mcl_hardness = 22.5
|
||||
})
|
||||
minetest.register_node("mcl_beds:respawn_anchor_charged_1",{
|
||||
description=S("Respawn Anchor"),
|
||||
tiles = {
|
||||
"portal.png",
|
||||
"respawn_anchor_bottom.png",
|
||||
"respawn_anchor_side1.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
node_box= { --Reused the composter nodebox, since it is basicly the same
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall
|
||||
{ 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall
|
||||
{-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall
|
||||
{-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level
|
||||
}
|
||||
},
|
||||
on_rightclick = function(pos, node, player, itemstack)
|
||||
if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then
|
||||
minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_2"})
|
||||
itemstack:take_item()
|
||||
else
|
||||
if pos.y < -29077 or pos.y > -28933 then
|
||||
mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true})
|
||||
else
|
||||
mcl_spawn.set_spawn_pos(player, pos, nil)
|
||||
end
|
||||
end
|
||||
end,
|
||||
groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1},
|
||||
_mcl_hardness = 22.5
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_beds:respawn_anchor_charged_2",{
|
||||
description=S("Respawn Anchor"),
|
||||
tiles = {
|
||||
"portal.png",
|
||||
"respawn_anchor_bottom.png",
|
||||
"respawn_anchor_side2.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
node_box= { --Reused the composter nodebox, since it is basicly the same
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall
|
||||
{ 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall
|
||||
{-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall
|
||||
{-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level
|
||||
}
|
||||
},
|
||||
on_rightclick = function(pos, node, player, itemstack)
|
||||
if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then
|
||||
minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_3"})
|
||||
itemstack:take_item()
|
||||
else
|
||||
if pos.y < -29077 or pos.y > -28933 then
|
||||
mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true})
|
||||
else
|
||||
mcl_spawn.set_spawn_pos(player, pos, nil)
|
||||
end
|
||||
end
|
||||
end,
|
||||
groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1},
|
||||
_mcl_hardness = 22.5
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_beds:respawn_anchor_charged_3",{
|
||||
description=S("Respawn Anchor"),
|
||||
tiles = {
|
||||
"portal.png",
|
||||
"respawn_anchor_bottom.png",
|
||||
"respawn_anchor_side3.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
node_box= { --Reused the composter nodebox, since it is basicly the same
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall
|
||||
{ 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall
|
||||
{-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall
|
||||
{-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level
|
||||
}
|
||||
},
|
||||
on_rightclick = function(pos, node, player, itemstack)
|
||||
if itemstack.get_name(itemstack) == "mcl_nether:glowstone" then
|
||||
minetest.set_node(pos, {name="mcl_beds:respawn_anchor_charged_4"})
|
||||
itemstack:take_item()
|
||||
else
|
||||
if pos.y < -29077 or pos.y > -28933 then
|
||||
mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true})
|
||||
else
|
||||
mcl_spawn.set_spawn_pos(player, pos, nil)
|
||||
end
|
||||
end
|
||||
end,
|
||||
groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1},
|
||||
_mcl_hardness = 22.5
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_beds:respawn_anchor_charged_4",{
|
||||
description=S("Respawn Anchor"),
|
||||
tiles = {
|
||||
"portal.png",
|
||||
"respawn_anchor_bottom.png",
|
||||
"respawn_anchor_side4.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
node_box= { --Reused the composter nodebox, since it is basicly the same
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, -0.375, 0.5, 0.5}, -- Left wall
|
||||
{ 0.375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Right wall
|
||||
{-0.375, -0.5, 0.375, 0.375, 0.5, 0.5}, -- Back wall
|
||||
{-0.375, -0.5, -0.5, 0.375, 0.5, -0.375}, -- Front wall
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Bottom level
|
||||
}
|
||||
},
|
||||
on_rightclick = function(pos, node, player, itemstack)
|
||||
if pos.y < -29077 or pos.y > -28933 then
|
||||
mcl_explosions.explode(pos, 5, {drop_chance = 0, fire = true})
|
||||
else
|
||||
mcl_spawn.set_spawn_pos(player, pos, nil)
|
||||
awards.unlock(player:get_player_name(), "mcl:notQuiteNineLives")
|
||||
end
|
||||
end,
|
||||
groups = {pickaxey=1, material_stone=1, not_in_creative_inventory=1},
|
||||
_mcl_hardness = 22.5
|
||||
})
|
||||
|
||||
minetest.register_craft({ output = "mcl_beds:respawn_anchor",
|
||||
recipe = {
|
||||
{"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"},
|
||||
{"mcl_nether:glowstone", "mcl_nether:glowstone", "mcl_nether:glowstone"},
|
||||
{"mcl_core:crying_obsidian", "mcl_core:crying_obsidian", "mcl_core:crying_obsidian"}
|
||||
}
|
||||
})
|
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 6.4 KiB |
|
@ -441,6 +441,7 @@ function ARROW_ENTITY.on_punch(self)
|
|||
end
|
||||
|
||||
function ARROW_ENTITY.get_staticdata(self)
|
||||
if not self then return end
|
||||
local out = {
|
||||
lastpos = self._lastpos,
|
||||
startpos = self._startpos,
|
||||
|
|
|
@ -38,13 +38,16 @@ local function damage_explosion(self, damagemulitplier)
|
|||
for _,obj in pairs(objects) do
|
||||
if obj:is_player() then
|
||||
mcl_util.deal_damage(obj, damagemulitplier - vector.distance(self.object:get_pos(), obj:get_pos()), {type = "explosion"})
|
||||
elseif obj:get_luaentity()._cmi_is_mob then
|
||||
else
|
||||
local entity = obj:get_luaentity()
|
||||
if entity and entity._cmi_is_mob then
|
||||
obj:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups={fleshy=damagemulitplier - vector.distance(self.object:get_pos(), obj:get_pos())},
|
||||
}, self.object:get_velocity())
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function particle_explosion(self)
|
||||
|
@ -627,6 +630,7 @@ function ARROW_ENTITY.on_punch(self)
|
|||
end
|
||||
|
||||
function ARROW_ENTITY.get_staticdata(self)
|
||||
if not self then return end
|
||||
local out = {
|
||||
lastpos = self._lastpos,
|
||||
startpos = self._startpos,
|
||||
|
|
|
@ -52,7 +52,7 @@ minetest.register_node("mcl_cake:cake", {
|
|||
fixed = full_cake
|
||||
},
|
||||
stack_max = 1,
|
||||
groups = {handy=1, cake=7, food=2,no_eat_delay=1, attached_node=1, dig_by_piston=1, comparator_signal=14},
|
||||
groups = {handy=1, cake=7, food=2, no_eat_delay=1, compostability=100, attached_node=1, dig_by_piston=1, comparator_signal=14},
|
||||
drop = "",
|
||||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
-- Cake is subject to protection
|
||||
|
@ -125,7 +125,7 @@ local register_slice = function(level, nodebox, desc)
|
|||
type = "fixed",
|
||||
fixed = nodebox,
|
||||
},
|
||||
groups = {handy=1, cake=level, food=2,no_eat_delay=1,attached_node=1,not_in_creative_inventory=1,dig_by_piston=1,comparator_signal=level*2},
|
||||
groups = {handy=1, cake=level, food=2, no_eat_delay=1, compostability=100, attached_node=1, not_in_creative_inventory=1, dig_by_piston=1, comparator_signal=level*2},
|
||||
drop = "",
|
||||
on_rightclick = on_rightclick,
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
|
|
|
@ -248,6 +248,51 @@ local function player_chest_close(player)
|
|||
open_chests[name] = nil
|
||||
end
|
||||
|
||||
local function drop_item_stack(pos, stack)
|
||||
if not stack or stack:is_empty() then return end
|
||||
local drop_offset = vector.new(math.random() - 0.5, 0, math.random() - 0.5)
|
||||
minetest.add_item(vector.add(pos, drop_offset), stack)
|
||||
end
|
||||
|
||||
local function drop_items_chest(pos, oldnode, oldmetadata, digger)
|
||||
if oldmetadata and oldmetadata.inventory then
|
||||
-- process after_dig_node callback
|
||||
local main = oldmetadata.inventory.main
|
||||
if not main then return end
|
||||
for _, stack in pairs(main) do
|
||||
drop_item_stack(pos, stack)
|
||||
end
|
||||
else
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
for i = 1, inv:get_size("main") do
|
||||
drop_item_stack(pos, inv:get_stack("main", i))
|
||||
end
|
||||
meta:from_table()
|
||||
end
|
||||
end
|
||||
|
||||
local function on_chest_blast(pos, intensity)
|
||||
local node = minetest.get_node(pos)
|
||||
drop_items_chest(pos, node)
|
||||
minetest.remove_node(pos)
|
||||
-- drop node itself with some probability depended on explosion intensity (1 for TNT):
|
||||
if math.random(1, math.floor((intensity or 1) * 2)) ~= 1 then return end
|
||||
local node_def = minetest.registered_nodes[node.name]
|
||||
if not node_def then return end
|
||||
local node_name = node_def.drop or node_def.name
|
||||
drop_item_stack(pos, ItemStack(node_name))
|
||||
end
|
||||
|
||||
local function close_forms(canonical_basename, pos)
|
||||
local players = minetest.get_connected_players()
|
||||
for p=1, #players do
|
||||
if vector.distance(players[p]:get_pos(), pos) <= 30 then
|
||||
minetest.close_formspec(players[p]:get_player_name(), "mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- This is a helper function to register both chests and trapped chests. Trapped chests will make use of the additional parameters
|
||||
local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tiles_table, hidden, mesecons, on_rightclick_addendum, on_rightclick_addendum_left, on_rightclick_addendum_right, drop, canonical_basename)
|
||||
-- START OF register_chest FUNCTION BODY
|
||||
|
@ -295,42 +340,6 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile
|
|||
end
|
||||
end
|
||||
|
||||
local function drop_item_stack(pos, stack)
|
||||
if not stack or stack:is_empty() then return end
|
||||
local drop_offset = vector.new(math.random() - 0.5, 0, math.random() - 0.5)
|
||||
minetest.add_item(vector.add(pos, drop_offset), stack)
|
||||
end
|
||||
|
||||
local function drop_items_chest(pos, oldnode, oldmetadata, digger)
|
||||
if oldmetadata and oldmetadata.inventory then
|
||||
-- process after_dig_node callback
|
||||
local main = oldmetadata.inventory.main
|
||||
if not main then return end
|
||||
for _, stack in pairs(main) do
|
||||
drop_item_stack(pos, stack)
|
||||
end
|
||||
else
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
for i = 1, inv:get_size("main") do
|
||||
drop_item_stack(pos, inv:get_stack("main", i))
|
||||
end
|
||||
meta:from_table()
|
||||
end
|
||||
end
|
||||
|
||||
local function on_chest_blast(pos, intensity)
|
||||
local node = minetest.get_node(pos)
|
||||
drop_items_chest(pos, node)
|
||||
minetest.remove_node(pos)
|
||||
-- drop node itself with some probability depended on explosion intensity (1 for TNT):
|
||||
if math.random(1, math.floor((intensity or 1) * 2)) ~= 1 then return end
|
||||
local node_def = minetest.registered_nodes[node.name]
|
||||
if not node_def then return end
|
||||
local node_name = node_def.drop or node_def.name
|
||||
drop_item_stack(pos, ItemStack(node_name))
|
||||
end
|
||||
|
||||
local function limit_put_list(stack, list)
|
||||
for _, other in ipairs(list) do
|
||||
stack = other:add_item(stack)
|
||||
|
@ -380,15 +389,6 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile
|
|||
end,
|
||||
})
|
||||
|
||||
local function close_forms(canonical_basename, pos)
|
||||
local players = minetest.get_connected_players()
|
||||
for p=1, #players do
|
||||
if vector.distance(players[p]:get_pos(), pos) <= 30 then
|
||||
minetest.close_formspec(players[p]:get_player_name(), "mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node(small_name, {
|
||||
description = desc,
|
||||
_tt_help = tt_help,
|
||||
|
@ -1476,9 +1476,11 @@ minetest.register_node("mcl_chests:barrel", {
|
|||
minetest.get_meta(pos):set_string("name", itemstack:get_meta():get_string("name"))
|
||||
end,
|
||||
after_dig_node = drop_items_chest,
|
||||
on_blast = on_blast,
|
||||
on_blast = on_chest_blast,
|
||||
on_rightclick = barrel_open,
|
||||
on_destruct = close_forms,
|
||||
on_destruct = function(pos)
|
||||
close_forms("barrel", pos)
|
||||
end,
|
||||
_mcl_blast_resistance = 2.5,
|
||||
_mcl_hardness = 2.5,
|
||||
})
|
||||
|
@ -1497,9 +1499,11 @@ minetest.register_node("mcl_chests:barrel_open", {
|
|||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
groups = {handy = 1, axey = 1, container = 2, material_wood = 1, flammable = -1, deco_block = 1, not_in_creative_inventory = 1},
|
||||
after_dig_node = drop_items_chest,
|
||||
on_blast = on_blast,
|
||||
on_blast = on_chest_blast,
|
||||
on_rightclick = barrel_open,
|
||||
on_destruct = close_forms,
|
||||
on_destruct = function(pos)
|
||||
close_forms("barrel_open", pos)
|
||||
end,
|
||||
_mcl_blast_resistance = 2.5,
|
||||
_mcl_hardness = 2.5,
|
||||
})
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
--TODO: Add advancement
|
||||
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
mcl_compass = {}
|
||||
|
@ -9,16 +11,20 @@ local compass_frames = 32
|
|||
|
||||
-- Timer for random compass spinning
|
||||
local random_timer = 0
|
||||
local random_timer_trigger = 0.5 -- random compass spinning tick in seconds. Increase if there are performance problems
|
||||
local random_timer_trigger = 0.5 -- random compass spinning tick in seconds. Incr ease if there are performance problems
|
||||
|
||||
local random_frame = math.random(0, compass_frames-1)
|
||||
|
||||
function mcl_compass.get_compass_image(pos, dir)
|
||||
function mcl_compass.get_compass_image(pos, dir, x, y, z)
|
||||
-- Compasses do not work in certain zones
|
||||
if mcl_worlds.compass_works(pos) then
|
||||
local spawn = {x=0,y=0,z=0}
|
||||
if mcl_worlds.compass_works(pos) and x ~= nil and y ~= nil and z ~= nil then
|
||||
local _, dim = mcl_worlds.y_to_layer(y)
|
||||
local _, playerdim = mcl_worlds.y_to_layer(pos.y)
|
||||
|
||||
if dim == playerdim then --Check if player and compass target are in the same dimension, above check is just if the diemension is valid for the non lodestone compass
|
||||
local spawn = {x=x,y=y,z=z}
|
||||
local ssp = minetest.setting_get_pos("static_spawnpoint")
|
||||
if ssp then
|
||||
if ssp and x == 0 and y == 0 and z == 0 then
|
||||
spawn = ssp
|
||||
if type(spawn) ~= "table" or type(spawn.x) ~= "number" or type(spawn.y) ~= "number" or type(spawn.z) ~= "number" then
|
||||
spawn = {x=0,y=0,z=0}
|
||||
|
@ -32,6 +38,32 @@ function mcl_compass.get_compass_image(pos, dir)
|
|||
else
|
||||
return random_frame
|
||||
end
|
||||
else
|
||||
if x ~= 0 and y ~= 0 and z~= 0 and x ~= nil and y ~= nil and x~= nil then
|
||||
local _, dim = mcl_worlds.y_to_layer(y)
|
||||
local _, playerdim = mcl_worlds.y_to_layer(pos.y)
|
||||
if dim == playerdim then --already explained that very same if statement above
|
||||
local spawn = {x=x,y=y,z=z}
|
||||
local ssp = minetest.setting_get_pos("static_spawnpoint")
|
||||
if ssp and x == 0 and y == 0 and z == 0 then
|
||||
spawn = ssp
|
||||
if type(spawn) ~= "table" or type(spawn.x) ~= "number" or type(spawn.y) ~= "number" or type(spawn.z) ~= "number" then
|
||||
spawn = {x=0,y=0,z=0}
|
||||
end
|
||||
end
|
||||
local angle_north = math.deg(math.atan2(spawn.x - pos.x, spawn.z - pos.z))
|
||||
if angle_north < 0 then angle_north = angle_north + 360 end
|
||||
local angle_dir = -math.deg(dir)
|
||||
local angle_relative = (angle_north - angle_dir + 180) % 360
|
||||
return math.floor((angle_relative/11.25) + 0.5) % compass_frames
|
||||
else
|
||||
return random_frame
|
||||
end
|
||||
|
||||
else
|
||||
return random_frame
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
|
@ -52,9 +84,39 @@ minetest.register_globalstep(function(dtime)
|
|||
end
|
||||
if has_compass(player) then
|
||||
local pos = player:get_pos()
|
||||
local compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal())
|
||||
|
||||
for j,stack in pairs(player:get_inventory():get_list("main")) do
|
||||
x = stack:get_meta():get_string("x") -- i know i could write the pos in meta, but i like this method more, and it is basicly the same, since else there would be one table with 3 values, and i have 3 values on their own
|
||||
y = stack:get_meta():get_string("y")
|
||||
z = stack:get_meta():get_string("z")
|
||||
|
||||
x = tonumber(x)
|
||||
y = tonumber(y)
|
||||
z = tonumber(z)
|
||||
|
||||
if x == nil or y == nil or z == nil then --checking if the compass has lodestone meta
|
||||
compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal(), 0, 0, 0) --no lodestone meta
|
||||
else
|
||||
checkblock = {x = x, y = y, z = z}
|
||||
local function get_far_node(pos) --function that tries to read node normally, and does it even if its unloaded https://dev.minetest.net/minetest.get_node
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name == "ignore" then
|
||||
minetest.get_voxel_manip():read_from_map(pos, pos)
|
||||
node = minetest.get_node(pos)
|
||||
end
|
||||
return node
|
||||
end
|
||||
|
||||
if get_far_node(checkblock).name == "mcl_compass:lodestone" then --check if lodestone still exists
|
||||
compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal(), x, y, z)
|
||||
compass_image = compass_image .. "_lodestone"
|
||||
else -- lodestone got destroyed
|
||||
compass_image = random_frame .. "_lodestone"
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
if minetest.get_item_group(stack:get_name(), "compass") ~= 0 and
|
||||
minetest.get_item_group(stack:get_name(), "compass")-1 ~= compass_image then
|
||||
local itemname = "mcl_compass:"..compass_image
|
||||
|
@ -101,6 +163,18 @@ for i,img in ipairs(images) do
|
|||
groups = {not_in_creative_inventory=inv, compass=i, tool=1, disable_repair=1 }
|
||||
})
|
||||
|
||||
minetest.register_craftitem(itemstring .. "_lodestone", {
|
||||
description = S("Lodestone Compass"),
|
||||
_tt_help = tt,
|
||||
_doc_items_create_entry = use_doc,
|
||||
_doc_items_longdesc = longdesc,
|
||||
--_doc_items_usagehelp = usagehelp,
|
||||
inventory_image = img .. "^[colorize:purple:50",
|
||||
wield_image = img .. "^[colorize:purple:50",
|
||||
stack_max = 64,
|
||||
groups = {not_in_creative_inventory=1, compass=i, tool=1, disable_repair=1 }
|
||||
})
|
||||
|
||||
-- Help aliases. Makes sure the lookup tool works correctly
|
||||
if not use_doc and doc_mod then
|
||||
doc.add_entry_alias("craftitems", "mcl_compass:"..(stereotype_frame-1), "craftitems", itemstring)
|
||||
|
@ -116,9 +190,42 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_compass:lodestone",
|
||||
recipe = {
|
||||
{"mcl_core:stonebrickcarved","mcl_core:stonebrickcarved","mcl_core:stonebrickcarved"},
|
||||
{"mcl_core:stonebrickcarved", "mcl_nether:netherite_ingot", "mcl_core:stonebrickcarved"},
|
||||
{"mcl_core:stonebrickcarved", "mcl_core:stonebrickcarved", "mcl_core:stonebrickcarved"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_alias("mcl_compass:compass", "mcl_compass:"..stereotype_frame)
|
||||
|
||||
-- Export stereotype item for other mods to use
|
||||
mcl_compass.stereotype = "mcl_compass:"..tostring(stereotype_frame)
|
||||
|
||||
|
||||
minetest.register_node("mcl_compass:lodestone",{
|
||||
description=S("Lodestone"),
|
||||
on_rightclick = function(pos, node, player, itemstack)
|
||||
if itemstack.get_name(itemstack).match(itemstack.get_name(itemstack),"mcl_compass:") then
|
||||
if itemstack.get_name(itemstack) ~= "mcl_compass:lodestone" then
|
||||
itemstack:get_meta():set_string("x", pos.x)
|
||||
itemstack:get_meta():set_string("y", pos.y)
|
||||
itemstack:get_meta():set_string("z", pos.z)
|
||||
end
|
||||
end
|
||||
end,
|
||||
tiles = {
|
||||
"lodestone_top.png",
|
||||
"lodestone_bottom.png",
|
||||
"lodestone_side1.png",
|
||||
"lodestone_side2.png",
|
||||
"lodestone_side3.png",
|
||||
"lodestone_side4.png"
|
||||
},
|
||||
groups = {pickaxey=1, material_stone=1},
|
||||
_mcl_hardness = 1.5,
|
||||
_mcl_blast_resistance = 6,
|
||||
sounds = mcl_sounds.node_sound_stone_defaults()
|
||||
})
|
|
@ -2,3 +2,5 @@
|
|||
Compasses are tools which point to the world origin (X@=0, Z@=0) or the spawn point in the Overworld.=Les boussoles sont des outils qui pointent vers l'origine du monde (X@=0,Z@=0) ou le point d'apparition dans l'Overworld.
|
||||
Compass=Boussole
|
||||
Points to the world origin=Pointe vers l'origine mondiale
|
||||
Lodestone Compass=Boussole magnétisée
|
||||
Lodestone=Magnétite
|
||||
|
|
|
@ -2,3 +2,5 @@
|
|||
Compasses are tools which point to the world origin (X@=0, Z@=0) or the spawn point in the Overworld.=
|
||||
Compass=
|
||||
Points to the world origin=
|
||||
Lodestone Compass=
|
||||
Lodestone=
|
|
@ -1,4 +1,4 @@
|
|||
name = mcl_compass
|
||||
description = A compass item which points towards the world origin.
|
||||
depends = mcl_core, mcl_worlds, mesecons
|
||||
depends = mcl_core, mcl_worlds, mesecons, mcl_nether, mcl_sounds
|
||||
optional_depends = doc
|
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.3 KiB |
|
@ -32,108 +32,6 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
local compostability = {
|
||||
["mcl_cake:cake"] = 100,
|
||||
["mcl_farming:pumpkin_pie"] = 100,
|
||||
|
||||
["mcl_farming:potato_item_baked"] = 85,
|
||||
["mcl_farming:bread"] = 85,
|
||||
["mcl_farming:cookie"] = 85,
|
||||
["mcl_farming:hay_block"] = 85,
|
||||
-- mushroom cap block have 64 variants, wtf!?
|
||||
["mcl_mushrooms:brown_mushroom_block_cap_111111"] = 85,
|
||||
["mcl_mushrooms:red_mushroom_block_cap_111111"] = 85,
|
||||
["mcl_nether:nether_wart_block"] = 85,
|
||||
["mcl_mushroom:warped_wart_block"] = 85,
|
||||
|
||||
["mcl_core:apple"] = 65,
|
||||
-- missing: azalea
|
||||
["mcl_farming:beetroot_item"] = 65,
|
||||
-- missing: big dripleaf
|
||||
["mcl_farming:carrot_item"] = 65,
|
||||
-- what's up with cocoa beans?
|
||||
["mcl_dye:brown"] = 65,
|
||||
["mcl_flowers:fern"] = 65,
|
||||
["mcl_flowers:double_fern"] = 65,
|
||||
["mcl_flowers:allium"] = 65,
|
||||
["mcl_flowers:azure_bluet"] = 65,
|
||||
["mcl_flowers:blue_orchid"] = 65,
|
||||
["mcl_flowers:dandelion"] = 65,
|
||||
["mcl_flowers:lilac"] = 65,
|
||||
["mcl_flowers:oxeye_daisy"] = 65,
|
||||
["mcl_flowers:poppy"] = 65,
|
||||
["mcl_flowers:tulip_orange"] = 65,
|
||||
["mcl_flowers:tulip_pink"] = 65,
|
||||
["mcl_flowers:tulip_red"] = 65,
|
||||
["mcl_flowers:tulip_white"] = 65,
|
||||
["mcl_flowers:peony"] = 65,
|
||||
["mcl_flowers:rose_bush"] = 65,
|
||||
["mcl_flowers:sunflower"] = 65,
|
||||
["mcl_flowers:waterlily"] = 65,
|
||||
["mcl_farming:melon"] = 65,
|
||||
["mcl_core:moss"] = 65,
|
||||
-- mushroom aliases below?
|
||||
["mcl_farming:mushroom_brown"] = 65,
|
||||
["mcl_mushrooms:mushroom_brown"] = 65,
|
||||
["mcl_farming:mushroom_red"] = 65,
|
||||
["mcl_mushrooms:mushroom_red"] = 65,
|
||||
["mcl_mushrooms:brown_mushroom_block_stem_full"] = 65,
|
||||
["mcl_mushrooms:red_mushroom_block_stem_full"] = 65,
|
||||
-- nether wart
|
||||
["mcl_farming:potato_item"] = 65,
|
||||
["mcl_farming:pumpkin"] = 65,
|
||||
["mcl_farming:pumpkin_face_light"] = 65,
|
||||
["mcl_ocean:sea_pickle_"] = 65,
|
||||
["mcl_mushroom:shroomlight"] = 65,
|
||||
-- missing: spore blossom
|
||||
["mcl_farming:wheat_item"] = 65,
|
||||
["mcl_mushroom:crimson_fungus"] = 65,
|
||||
["mcl_mushroom:warped_fungus"] = 65,
|
||||
["mcl_mushroom:crimson_roots"] = 65,
|
||||
["mcl_mushroom:warped_roots"] = 65,
|
||||
|
||||
["mcl_core:cactus"] = 50,
|
||||
["mcl_ocean:dried_kelp_block"] = 50,
|
||||
-- missing: flowering azalea leaves
|
||||
-- missing: glow lichen
|
||||
["mcl_farming:melon_item"] = 50,
|
||||
["mcl_mushroom:nether_sprouts"] = 50,
|
||||
["mcl_core:reeds"] = 50,
|
||||
["mcl_flowers:double_grass"] = 50,
|
||||
["mcl_core:vine"] = 50,
|
||||
-- missing: weeping vines
|
||||
["mcl_mushroom:twisting_vines"] = 50,
|
||||
|
||||
["mcl_flowers:tallgrass"] = 30,
|
||||
["mcl_farming:beetroot_seeds"] = 30,
|
||||
["mcl_core:dirt_with_grass"] = 30,
|
||||
["mcl_core:tallgrass"] = 30,
|
||||
["mcl_ocean:dried_kelp"] = 30,
|
||||
["mcl_ocean:kelp"] = 30,
|
||||
["mcl_core:leaves"] = 30,
|
||||
["mcl_core:acacialeaves"] = 30,
|
||||
["mcl_core:birchleaves"] = 30,
|
||||
["mcl_core:darkleaves"] = 30,
|
||||
["mcl_core:jungleleaves"] = 30,
|
||||
["mcl_core:spruceleaves"] = 30,
|
||||
--
|
||||
["mcl_farming:melon_seeds"] = 30,
|
||||
["mcl_core:moss_carpet"] = 30,
|
||||
["mcl_farming:pumpkin_seeds"] = 30,
|
||||
["mcl_core:sapling"] = 30,
|
||||
["mcl_core:acaciasapling"] = 30,
|
||||
["mcl_core:birchsapling"] = 30,
|
||||
["mcl_core:darksapling"] = 30,
|
||||
["mcl_core:junglesapling"] = 30,
|
||||
["mcl_core:sprucesapling"] = 30,
|
||||
["mcl_ocean:seagrass"] = 30,
|
||||
-- missing: small dripleaf
|
||||
["mcl_sweet_berry:sweet_berry"] = 30,
|
||||
["mcl_farming:sweet_berry"] = 30,
|
||||
["mcl_farming:wheat_seeds"] = 30,
|
||||
|
||||
}
|
||||
|
||||
local function composter_add_item(pos, node, player, itemstack, pointed_thing)
|
||||
--
|
||||
-- handler for filling the composter when rightclicked
|
||||
|
@ -147,8 +45,9 @@ local function composter_add_item(pos, node, player, itemstack, pointed_thing)
|
|||
return itemstack
|
||||
end
|
||||
local itemname = itemstack:get_name()
|
||||
local chance = compostability[itemname]
|
||||
if chance then
|
||||
local chance = minetest.get_item_group(itemname, "compostability")
|
||||
|
||||
if chance > 0 then
|
||||
if not minetest.is_creative_enabled(player:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
|
|
|
@ -21,6 +21,14 @@ MIT License.
|
|||
The textures are taken from the Minecraft resource pack “Faithful 1.11” by Vattic and
|
||||
xMrVizzy and contributers.
|
||||
|
||||
|
||||
CC BY-SA 4.0
|
||||
|
||||
mcl_core_lava_spark.png is based on the Pixel Perfection resource pack for Minecraft 1.11,
|
||||
authored by XSSheep.
|
||||
Source: <https://www.planetminecraft.com/texture_pack/131pixel-perfection/>
|
||||
License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)
|
||||
|
||||
Sounds
|
||||
======
|
||||
All sounds included in this mod are under the MIT License.
|
||||
|
|
|
@ -139,7 +139,7 @@ minetest.register_craftitem("mcl_core:apple", {
|
|||
stack_max = 64,
|
||||
on_place = minetest.item_eat(4),
|
||||
on_secondary_use = minetest.item_eat(4),
|
||||
groups = { food = 2, eatable = 4 },
|
||||
groups = { food = 2, eatable = 4, compostability=65 },
|
||||
_mcl_saturation = 2.4,
|
||||
})
|
||||
|
||||
|
|
|
@ -54,6 +54,137 @@ minetest.register_abm({
|
|||
end,
|
||||
})
|
||||
|
||||
|
||||
--
|
||||
-- Production of sparks from lava
|
||||
--
|
||||
|
||||
local LAVA_SPARK_ABM_INTERVAL = 5
|
||||
local lava_spark_limit = minetest.settings:get("mcl_core_lava_spark_limit")
|
||||
if lava_spark_limit == nil then
|
||||
lava_spark_limit = 10
|
||||
else
|
||||
lava_spark_limit = tonumber(lava_spark_limit)
|
||||
end
|
||||
local lava_spark_chance = 0
|
||||
local lava_spark_abm_census = 0
|
||||
local lava_spark_census = 0
|
||||
|
||||
function mcl_core.lava_spark_set_chance()
|
||||
lava_spark_chance = lava_spark_limit / lava_spark_abm_census
|
||||
minetest.after(LAVA_SPARK_ABM_INTERVAL, mcl_core.lava_spark_set_chance)
|
||||
lava_spark_abm_census = 0
|
||||
lava_spark_census = 0
|
||||
end
|
||||
|
||||
if lava_spark_limit > 0 then
|
||||
mcl_core.lava_spark_set_chance()
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Lava produce sparks",
|
||||
nodenames = {"group:lava"},
|
||||
neighbors = {"air"},
|
||||
interval = LAVA_SPARK_ABM_INTERVAL,
|
||||
chance = 18,
|
||||
action = function(pos, node)
|
||||
local above = minetest.get_node(vector.new(pos.x, pos.y + 1, pos.z))
|
||||
if above.name ~= "air" then return end
|
||||
|
||||
lava_spark_abm_census = lava_spark_abm_census + 1
|
||||
|
||||
if lava_spark_census >= lava_spark_limit then return end
|
||||
if math.random() > lava_spark_chance then return end
|
||||
|
||||
lava_spark_census = lava_spark_census + 1
|
||||
minetest.after(math.random() * LAVA_SPARK_ABM_INTERVAL, mcl_core.lava_spark_add, pos)
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
function mcl_core.lava_spark_add(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if minetest.get_node_group(node.name, "lava") == 0 then return end
|
||||
|
||||
local above = minetest.get_node(vector.new(pos.x, pos.y + 1, pos.z))
|
||||
if above.name ~= "air" then return end
|
||||
|
||||
local pos_addend = vector.new(
|
||||
(math.random() - 0.5) * 0.8,
|
||||
(math.random() - 0.5) * 0.8,
|
||||
(math.random() - 0.5) * 0.8
|
||||
)
|
||||
local spark_pos = vector.add(pos, pos_addend)
|
||||
local spark = minetest.add_entity(spark_pos, "mcl_core:lava_spark")
|
||||
if not spark then return end
|
||||
|
||||
local velocity = vector.new(
|
||||
(math.random() - 0.5) * 3,
|
||||
(math.random() + 2) * 2,
|
||||
(math.random() - 0.5) * 3
|
||||
)
|
||||
spark:set_velocity(velocity)
|
||||
|
||||
spark:set_acceleration(vector.new(0, -9, 0))
|
||||
|
||||
-- Set a random size
|
||||
local size = 0.2 + math.random() * 0.2
|
||||
local props = spark:get_properties()
|
||||
if not props then return end
|
||||
props.visual_size = vector.new(size, size, size)
|
||||
spark:set_properties(props)
|
||||
|
||||
local luaentity = spark:get_luaentity()
|
||||
if not luaentity then return end
|
||||
luaentity._life_timer = 0.4 + math.random()
|
||||
end
|
||||
|
||||
minetest.register_entity("mcl_core:lava_spark", {
|
||||
physical = true,
|
||||
visual = "sprite",
|
||||
collide_with_objects = true,
|
||||
textures = {"mcl_core_lava_spark.png"},
|
||||
glow = 10,
|
||||
static_save = false,
|
||||
_smoke_timer = 0.1,
|
||||
_life_timer = 1,
|
||||
on_step = function(self, dtime)
|
||||
if not self or not self.object then return end
|
||||
|
||||
self._life_timer = self._life_timer - dtime
|
||||
if self._life_timer <= 0 then
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
self._smoke_timer = self._smoke_timer - dtime
|
||||
if self._smoke_timer > 0 then return end
|
||||
self._smoke_timer = 0.2 + math.random() * 0.3
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
-- Add smoke
|
||||
minetest.add_particlespawner({
|
||||
amount = 3,
|
||||
time = 0.001,
|
||||
minpos = pos,
|
||||
maxpos = pos,
|
||||
minvel = vector.new(-0.1, 1, -0.1),
|
||||
maxvel = vector.new(0.1, 1.5, 0.1),
|
||||
minexptime = 0.1,
|
||||
maxexptime = 0.6,
|
||||
minsize = 0.5,
|
||||
maxsize = 1.5,
|
||||
texture = "mcl_particles_smoke_anim.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 8,
|
||||
aspect_h = 8,
|
||||
}
|
||||
})
|
||||
end
|
||||
})
|
||||
|
||||
--
|
||||
-- Papyrus and cactus growing
|
||||
--
|
||||
|
|
|
@ -92,6 +92,7 @@ Diorite=Diorite
|
|||
Diorite is an igneous rock.=La diorite est une roche volcanique.
|
||||
Dirt=Terre
|
||||
Dirt acts as a soil for a few plants. When in light, this block may grow a grass or mycelium cover if such blocks are nearby.=La terre agit comme un sol pour quelques plantes. Lorsqu'il est à la lumière, ce bloc peut faire pousser une couverture d'herbe ou de mycélium si ces blocs sont à proximité.
|
||||
Enchanted Golden Apple=Pomme Dorée Enchantée
|
||||
Emerald=Emeraude
|
||||
Emerald Ore=Minerai d'Emeraude
|
||||
Emerald ore is the ore of emeralds. It is very rare and can be found alone, not in clusters.=Le minerai d'émeraude produit des émeraudes. Il est très rare et ne peut être trouvé que seul, pas en filons.
|
||||
|
@ -154,6 +155,8 @@ Oak Wood Planks=Planches de Chêne
|
|||
Oak leaves are grown from oak trees.=Les feuilles de chêne sont cultivées à partir de chênes.
|
||||
Obsidian=Obsidienne
|
||||
Obsidian is an extremely hard mineral with an enourmous blast-resistance. Obsidian is formed when water meets lava.=L'obsidienne est un minéral extrêmement dur avec une énorme résistance à l'explosion. L'obsidienne se forme lorsque l'eau rencontre la lave.
|
||||
Crying Obsidian=Obsidienne Pleureuse
|
||||
Crying obsidian is a luminous obsidian that can generate as part of ruined portals.=L'obsidienne pleureuse est de l'obsidienne lumineuse générée comme composant des portails en ruines.
|
||||
One of the most common blocks in the world, almost the entire underground consists of stone. It sometimes contains ores. Stone may be created when water meets lava.=L'un des blocs les plus courants au monde, presque tout le sous-sol est en pierre. Il contient parfois des minerais. La pierre peut être créée lorsque l'eau rencontre la lave.
|
||||
Orange Stained Glass=Verre Orange
|
||||
Packed Ice=Glace Compactée
|
||||
|
@ -202,20 +205,45 @@ Stained glass is a decorative and mostly transparent block which comes in variou
|
|||
Stick=Bâton
|
||||
Sticks are a very versatile crafting material; used in countless crafting recipes.=Les bâtons sont un matériau d'artisanat très polyvalent; utilisé dans d'innombrables recettes d'artisanat.
|
||||
Stone=Roche
|
||||
Stripped Acacia Log=Bois d'Acacia
|
||||
Stripped Acacia Wood=Bois Ecorché d'Acacia
|
||||
Stripped Birch Log=Bois de Bouleau
|
||||
Stripped Birch Wood=Bois Ecorché de Bouleau
|
||||
Stripped Dark Oak Log=Bois de Chêne Noir
|
||||
Stripped Dark Oak Wood=Bois Ecorché de Chêne Noir
|
||||
Stripped Jungle Log=Bois d'Acajou
|
||||
Stripped Jungle Wood=Bois Ecorché d'Acajou
|
||||
Stripped Oak Log=Bois de Chêne
|
||||
Stripped Oak Wood=Bois Ecorché de Chêne
|
||||
Stripped Spruce Log=Bois de Sapin
|
||||
Stripped Spruce Wood=Bois Ecorché de Sapin
|
||||
Stone Bricks=Pierre Taillée
|
||||
Sugar=Sucre
|
||||
Sugar Canes=Canne à Sucre
|
||||
Sugar canes are a plant which has some uses in crafting. Sugar canes will slowly grow up to 3 blocks when they are next to water and are placed on a grass block, dirt, sand, red sand, podzol or coarse dirt. When a sugar cane is broken, all sugar canes connected above will break as well.=Les cannes à sucre sont une plante qui a certaines utilisations dans l'artisanat. Les cannes à sucre poussent lentement jusqu'à 3 blocs lorsqu'elles sont à côté de l'eau et sont placées sur un bloc d'herbe, de terre, de sable, de sable rouge, de podzol ou de terre stérile. Lorsqu'une canne à sucre est cassée, toutes les cannes à sucre connectées au-dessus se brisent également.
|
||||
Sugar canes can only be placed top of other sugar canes and on top of blocks on which they would grow.=Les cannes à sucre ne peuvent être placées que sur d'autres cannes à sucre et sur des blocs sur lesquels elles poussent.
|
||||
Sugar comes from sugar canes and is used to make sweet foods.=Le sucre provient des cannes à sucre et est utilisé pour fabriquer des aliments sucrés.
|
||||
The stripped trunk of an acacia tree.=Le tronc écorché d'un acacia.
|
||||
The stripped trunk of a birch tree.=Le tronc écorché d'un bouleau.
|
||||
The stripped trunk of a dark oak tree.=Le tronc écorché d'un chêne noir.
|
||||
The stripped trunk of a jungle tree.=Le tronc écorché d'un acajou.
|
||||
The stripped trunk of an oak tree.=Le tronc écorché d'un chêne.
|
||||
The stripped trunk of a spruce tree.=Le tronc écorché d'un sapin.
|
||||
The trunk of a birch tree.=Le tronc d'un bouleau.
|
||||
The trunk of a dark oak tree.=Le tronc d'un chêne noir.
|
||||
The trunk of a jungle tree.=Le tronc d'un acajou.
|
||||
The trunk of a spruce tree.=Le tronc d'un sapin.
|
||||
The trunk of an acacia.=Le tronc d'un acacia
|
||||
The trunk of an oak tree.=Le tronc d'un chêne.
|
||||
The stripped wood of an acacia tree.=Les planches écorchée d'un acacia.
|
||||
The stripped wood of a birch tree.=Les planches écorchée d'un bouleau.
|
||||
The stripped wood of a dark oak tree.=Les planches écorchée d'un chêne noir.
|
||||
The stripped wood of a jungle tree.=Les planches écorchée d'un acajou.
|
||||
The stripped wood of an oak tree.=Les planches écorchée d'un chêne.
|
||||
The stripped wood of a spruce tree.=Les planches écorchée d'un sapin.
|
||||
This block consists of a couple of loose stones and can't support itself.=Ce bloc se compose de quelques pierres lâches et ne peut pas se soutenir.
|
||||
This is a decorative block surrounded by the bark of a tree trunk.=Il s'agit d'un bloc décoratif entouré par l'écorce d'un tronc d'arbre.
|
||||
This is a decorative block.=Il s'agit d'un bloc décoratif.
|
||||
This is a full block of snow. Snow of this thickness is usually found in areas of extreme cold.=Ceci est un bloc de neige complet. La neige de cette épaisseur se trouve généralement dans les zones de froid extrême.
|
||||
This is a piece of cactus commonly found in dry areas, especially deserts. Over time, cacti will grow up to 3 blocks high on sand or red sand. A cactus hurts living beings touching it with a damage of 1 HP every half second. When a cactus block is broken, all cactus blocks connected above it will break as well.=Il s'agit d'un morceau de cactus que l'on trouve couramment dans les zones sèches, en particulier dans les déserts. Au fil du temps, les cactus pousseront jusqu'à 3 blocs de haut sur le sable ou le sable rouge. Un cactus blesse les êtres vivants qui le touchent avec des dégâts de 1 HP toutes les demi-secondes. Lorsqu'un bloc de cactus est brisé, tous les blocs de cactus connectés au-dessus se brisent également.
|
||||
This stone contains pure gold, a rare metal.=Cette pierre contient de l'or pur, un métal rare.
|
||||
|
@ -256,3 +284,7 @@ Slows down movement=Ralentit le mouvement
|
|||
2×2 saplings @= large tree=2×2 pousses @= grand arbre
|
||||
Grows on sand or dirt next to water=Pousse sur le sable ou la terre près de l'eau
|
||||
Stackable=Empilable
|
||||
Moss=Mousse
|
||||
Moss Carpet=Tapis de Mousse
|
||||
A moss block is a natural block that can be spread to some other blocks by using bone meal.=Un bloc de mousse est un bloc naturel qui peut se propager à d'autres blocs en utilisant de la farine d'os.
|
||||
Moss Carpets are a thin decorative variant of the moss block.=Les tapis de mousse sont une fine variante décorative du bloc de mousse.
|
|
@ -284,3 +284,7 @@ Slows down movement=
|
|||
2×2 saplings @= large tree=
|
||||
Grows on sand or dirt next to water=
|
||||
Stackable=
|
||||
Moss=
|
||||
Moss Carpet=
|
||||
A moss block is a natural block that can be spread to some other blocks by using bone meal.=
|
||||
Moss Carpets are a thin decorative variant of the moss block.=
|
|
@ -369,7 +369,7 @@ minetest.register_node("mcl_core:dirt_with_grass", {
|
|||
color = "#8EB971",
|
||||
is_ground_content = true,
|
||||
stack_max = 64,
|
||||
groups = {handy=1,shovely=1,dirt=2,grass_block=1, grass_block_no_snow=1, soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, spreading_dirt_type=1, enderman_takable=1, building_block=1},
|
||||
groups = {handy=1,shovely=1,dirt=2,grass_block=1, grass_block_no_snow=1, soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, spreading_dirt_type=1, enderman_takable=1, building_block=1, compostability=30},
|
||||
drop = "mcl_core:dirt",
|
||||
sounds = mcl_sounds.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.1},
|
||||
|
@ -473,7 +473,7 @@ minetest.register_node("mcl_core:moss", {
|
|||
tiles = {"mcl_core_moss_block.png"},
|
||||
is_ground_content = true,
|
||||
stack_max = 64,
|
||||
groups = {handy=1, hoey=1},
|
||||
groups = {handy=1, hoey=1, compostability=65},
|
||||
--sounds = TODO: add sound
|
||||
_mcl_blast_resistance = 0.1,
|
||||
_mcl_hardness = 0.1,
|
||||
|
@ -1096,7 +1096,7 @@ minetest.register_node("mcl_core:moss", {
|
|||
tiles = {"mcl_core_moss_block.png"},
|
||||
is_ground_content = true,
|
||||
stack_max = 64,
|
||||
groups = {handy=1, hoey=1},
|
||||
groups = {handy=1, hoey=1, compostability=65},
|
||||
--sounds = TODO: add sound
|
||||
_mcl_blast_resistance = 0.1,
|
||||
_mcl_hardness = 0.1,
|
||||
|
@ -1153,7 +1153,7 @@ minetest.register_node("mcl_core:moss_carpet", {
|
|||
{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
|
||||
},
|
||||
},
|
||||
groups = {handy=1, hoey=1},
|
||||
groups = {handy=1, hoey=1, compostability=30},
|
||||
--sounds = TODO: add sound
|
||||
_mcl_blast_resistance = 0.1,
|
||||
_mcl_hardness = 0.1,
|
||||
|
|
|
@ -12,7 +12,7 @@ minetest.register_node("mcl_core:cactus", {
|
|||
tiles = {"mcl_core_cactus_top.png", "mcl_core_cactus_bottom.png", "mcl_core_cactus_side.png"},
|
||||
is_ground_content = true,
|
||||
stack_max = 64,
|
||||
groups = {handy=1, attached_node=1, plant=1, deco_block=1, dig_by_piston=1, enderman_takable=1},
|
||||
groups = {handy=1, attached_node=1, plant=1, deco_block=1, dig_by_piston=1, enderman_takable=1, compostability=50},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
|
@ -79,7 +79,7 @@ minetest.register_node("mcl_core:reeds", {
|
|||
},
|
||||
},
|
||||
stack_max = 64,
|
||||
groups = {dig_immediate=3, craftitem=1, deco_block=1, plant=1, non_mycelium_plant=1, dig_by_piston=1},
|
||||
groups = {dig_immediate=3, craftitem=1, deco_block=1, plant=1, non_mycelium_plant=1, dig_by_piston=1, compostability=50},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
node_placement_prediction = "",
|
||||
drop = "mcl_core:reeds", -- to prevent color inheritation
|
||||
|
|
|
@ -104,7 +104,7 @@ minetest.register_node("mcl_core:vine", {
|
|||
type = "wallmounted",
|
||||
},
|
||||
stack_max = 64,
|
||||
groups = {handy=1,axey=1,shearsy=1,swordy=1, flammable=2,deco_block=1,destroy_by_lava_flow=1,dig_by_piston=1, fire_encouragement=15, fire_flammability=100},
|
||||
groups = {handy=1,axey=1,shearsy=1,swordy=1, flammable=2,deco_block=1,destroy_by_lava_flow=1,dig_by_piston=1, fire_encouragement=15, fire_flammability=100, compostability=50},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
drop = "",
|
||||
_mcl_shears_drop = true,
|
||||
|
|
|
@ -10,32 +10,53 @@ local WATER_VISC = 1
|
|||
local LAVA_VISC = 7
|
||||
local LIGHT_LAVA = minetest.LIGHT_MAX
|
||||
local USE_TEXTURE_ALPHA = true
|
||||
local BUBBLE_COLUMN_SPEED = 1
|
||||
local BUBBLE_ABM_INTERVAL = 2
|
||||
local BUBBLE_AMOUNT = math.floor(BUBBLE_ABM_INTERVAL / math.abs(BUBBLE_COLUMN_SPEED) + 0.5)
|
||||
|
||||
if minetest.features.use_texture_alpha_string_modes then
|
||||
USE_TEXTURE_ALPHA = "blend"
|
||||
end
|
||||
|
||||
minetest.register_node("mcl_core:water_flowing", {
|
||||
description = S("Flowing Water"),
|
||||
function mcl_core.register_liquid(def)
|
||||
local base_name = def.base_name
|
||||
local description_flowing = def.description_flowing
|
||||
local description_source = def.description_source
|
||||
local _doc_items_entry_name = def._doc_items_entry_name
|
||||
local _doc_items_longdesc = def._doc_items_longdesc
|
||||
local wield_image = def.wield_image
|
||||
local tiles_flowing = def.tiles_flowing
|
||||
local tiles_source = def.tiles_source
|
||||
local special_tiles_flowing = def.special_tiles_flowing
|
||||
local special_tiles_source = def.special_tiles_source
|
||||
local sounds = def.sounds
|
||||
local use_texture_alpha = def.use_texture_alpha
|
||||
local drowning = def.drowning
|
||||
local liquid_viscosity = def.liquid_viscosity
|
||||
local liquid_range = def.liquid_range
|
||||
local post_effect_color = def.post_effect_color
|
||||
local groups = def.groups
|
||||
|
||||
local source_node_name = string.format("mcl_core:%s_source", base_name)
|
||||
local flowing_node_name = string.format("mcl_core:%s_flowing", base_name)
|
||||
local mandatory_liquid_groups = {liquid=3, not_in_creative_inventory=1, dig_by_piston=1}
|
||||
for group_id, group_level in pairs(mandatory_liquid_groups) do
|
||||
if not groups[group_id] then
|
||||
groups[group_id] = group_level
|
||||
elseif groups[group_id] == false then
|
||||
groups[group_id] = nil
|
||||
end
|
||||
end
|
||||
minetest.register_node(flowing_node_name, {
|
||||
description = description_flowing,
|
||||
_doc_items_create_entry = false,
|
||||
wield_image = "default_water_flowing_animated.png^[verticalframe:64:0",
|
||||
wield_image = wield_image,
|
||||
drawtype = "flowingliquid",
|
||||
tiles = {"default_water_flowing_animated.png^[verticalframe:64:0"},
|
||||
special_tiles = {
|
||||
{
|
||||
image="default_water_flowing_animated.png",
|
||||
backface_culling=false,
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
|
||||
},
|
||||
{
|
||||
image="default_water_flowing_animated.png",
|
||||
backface_culling=false,
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
|
||||
},
|
||||
},
|
||||
sounds = mcl_sounds.node_sound_water_defaults(),
|
||||
tiles = tiles_flowing,
|
||||
special_tiles = special_tiles_flowing,
|
||||
sounds = sounds,
|
||||
is_ground_content = false,
|
||||
use_texture_alpha = USE_TEXTURE_ALPHA,
|
||||
use_texture_alpha = use_texture_alpha,
|
||||
paramtype = "light",
|
||||
paramtype2 = "flowingliquid",
|
||||
walkable = false,
|
||||
|
@ -43,34 +64,79 @@ minetest.register_node("mcl_core:water_flowing", {
|
|||
diggable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
drowning = 4,
|
||||
drowning = drowning,
|
||||
liquidtype = "flowing",
|
||||
liquid_alternative_flowing = "mcl_core:water_flowing",
|
||||
liquid_alternative_source = "mcl_core:water_source",
|
||||
liquid_viscosity = WATER_VISC,
|
||||
liquid_range = 7,
|
||||
post_effect_color = {a=209, r=0x03, g=0x3C, b=0x5C},
|
||||
groups = { water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1, freezes=1, melt_around=1, dig_by_piston=1},
|
||||
liquid_alternative_flowing = flowing_node_name,
|
||||
liquid_alternative_source = source_node_name,
|
||||
liquid_viscosity = liquid_viscosity,
|
||||
liquid_range = liquid_range,
|
||||
post_effect_color = post_effect_color,
|
||||
groups = groups,
|
||||
_mcl_blast_resistance = 100,
|
||||
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
|
||||
_mcl_hardness = -1,
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:water_source", {
|
||||
description = S("Water Source"),
|
||||
_doc_items_entry_name = S("Water"),
|
||||
_doc_items_longdesc =
|
||||
S("Water is abundant in oceans and also appears in a few springs in the ground. You can swim easily in water, but you need to catch your breath from time to time.").."\n\n"..
|
||||
S("Water interacts with lava in various ways:").."\n"..
|
||||
S("• When water is directly above or horizontally next to a lava source, the lava turns into obsidian.").."\n"..
|
||||
S("• When flowing water touches flowing lava either from above or horizontally, the lava turns into cobblestone.").."\n"..
|
||||
S("• When water is directly below lava, the water turns into stone."),
|
||||
minetest.register_node(source_node_name, {
|
||||
description = description_source,
|
||||
_doc_items_entry_name = _doc_items_entry_name,
|
||||
_doc_items_longdesc = _doc_items_longdesc,
|
||||
_doc_items_hidden = false,
|
||||
drawtype = "liquid",
|
||||
tiles = {
|
||||
{name="default_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0}}
|
||||
tiles = tiles_source,
|
||||
special_tiles = special_tiles_source,
|
||||
sounds = sounds,
|
||||
is_ground_content = false,
|
||||
use_texture_alpha = use_texture_alpha,
|
||||
paramtype = "light",
|
||||
paramtype2 = "flowingliquid",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
drowning = drowning,
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = flowing_node_name,
|
||||
liquid_alternative_source = source_node_name,
|
||||
liquid_viscosity = liquid_viscosity,
|
||||
liquid_range = liquid_range,
|
||||
post_effect_color = post_effect_color,
|
||||
stack_max = 64,
|
||||
groups = groups,
|
||||
_mcl_blast_resistance = 100,
|
||||
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
|
||||
_mcl_hardness = -1,
|
||||
})
|
||||
end
|
||||
|
||||
mcl_core.register_liquid({
|
||||
base_name = "water",
|
||||
description_flowing = S("Flowing Water"),
|
||||
description_source = S("Water Source"),
|
||||
_doc_items_entry_name = S("Water"),
|
||||
_doc_items_longdesc =
|
||||
S("Water is abundant in oceans and also appears in a few springs in the ground. You can swim easily in water, but you need to catch your breath from time to time.").."\n\n"..
|
||||
S("Water interacts with lava in various ways:").."\n"..
|
||||
S("• When water is directly above or horizontally next to a lava source, the lava turns into obsidian.").."\n"..
|
||||
S("• When flowing water touches flowing lava either from above or horizontally, the lava turns into cobblestone.").."\n"..
|
||||
S("• When water is directly below lava, the water turns into stone."),
|
||||
wield_image = "default_water_flowing_animated.png^[verticalframe:64:0",
|
||||
tiles_flowing = {"default_water_flowing_animated.png^[verticalframe:64:0"},
|
||||
tiles_source = {{name="default_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0}}},
|
||||
special_tiles_flowing = {
|
||||
{
|
||||
image="default_water_flowing_animated.png",
|
||||
backface_culling=false,
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
|
||||
},
|
||||
special_tiles = {
|
||||
{
|
||||
image="default_water_flowing_animated.png",
|
||||
backface_culling=false,
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
|
||||
},
|
||||
},
|
||||
special_tiles_source = {
|
||||
-- New-style water source material (mostly unused)
|
||||
{
|
||||
name="default_water_source_animated.png",
|
||||
|
@ -79,28 +145,93 @@ S("• When water is directly below lava, the water turns into stone."),
|
|||
}
|
||||
},
|
||||
sounds = mcl_sounds.node_sound_water_defaults(),
|
||||
is_ground_content = false,
|
||||
use_texture_alpha = USE_TEXTURE_ALPHA,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
drowning = 4,
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = "mcl_core:water_flowing",
|
||||
liquid_alternative_source = "mcl_core:water_source",
|
||||
liquid_viscosity = WATER_VISC,
|
||||
liquid_range = 7,
|
||||
post_effect_color = {a=209, r=0x03, g=0x3C, b=0x5C},
|
||||
stack_max = 64,
|
||||
groups = { water=3, liquid=3, puts_out_fire=1, freezes=1, not_in_creative_inventory=1, dig_by_piston=1},
|
||||
_mcl_blast_resistance = 100,
|
||||
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
|
||||
_mcl_hardness = -1,
|
||||
groups = {water=3, puts_out_fire=1, freezes=1, melt_around=1},
|
||||
})
|
||||
|
||||
mcl_core.register_liquid({
|
||||
base_name = "whirlpool",
|
||||
description_flowing = S("Flowing Water"),
|
||||
description_source = S("Whirlpool"),
|
||||
_doc_items_entry_name = S("Water"),
|
||||
_doc_items_longdesc =
|
||||
S("A whirlpool, or downward bubble column, is originating from magma at the bottom of underwater canyons.").."\n"..
|
||||
S("They drag entities downward."),
|
||||
wield_image = "default_water_flowing_animated.png^[verticalframe:64:0",
|
||||
tiles_flowing = {"default_water_flowing_animated.png^[verticalframe:64:0"},
|
||||
tiles_source = {{name="default_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0}}},
|
||||
special_tiles_flowing = {
|
||||
{
|
||||
image="default_water_flowing_animated.png",
|
||||
backface_culling=false,
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
|
||||
},
|
||||
{
|
||||
image="default_water_flowing_animated.png",
|
||||
backface_culling=false,
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
|
||||
},
|
||||
},
|
||||
special_tiles_source = {
|
||||
{
|
||||
name="default_water_source_animated.png",
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0},
|
||||
backface_culling = false,
|
||||
}
|
||||
},
|
||||
sounds = mcl_sounds.node_sound_water_defaults(),
|
||||
use_texture_alpha = USE_TEXTURE_ALPHA,
|
||||
drowning = 0,
|
||||
liquid_viscosity = WATER_VISC,
|
||||
liquid_range = 7,
|
||||
post_effect_color = {a=209, r=0x03, g=0x3C, b=0x5C},
|
||||
groups = {puts_out_fire=1, freezes=1, melt_around=1},
|
||||
})
|
||||
|
||||
mcl_core.register_liquid({
|
||||
base_name = "bubble_column",
|
||||
description_flowing = S("Flowing Water"),
|
||||
description_source = S("Bubble Column"),
|
||||
_doc_items_entry_name = S("Water"),
|
||||
_doc_items_longdesc =
|
||||
S("A bubble column is generated above soul sand.").."\n"..
|
||||
S("It accelerates entities upward."),
|
||||
wield_image = "default_water_flowing_animated.png^[verticalframe:64:0",
|
||||
tiles_flowing = {"default_water_flowing_animated.png^[verticalframe:64:0"},
|
||||
tiles_source = {{name="default_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0}}},
|
||||
special_tiles_flowing = {
|
||||
{
|
||||
image="default_water_flowing_animated.png",
|
||||
backface_culling=false,
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
|
||||
},
|
||||
{
|
||||
image="default_water_flowing_animated.png",
|
||||
backface_culling=false,
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
|
||||
},
|
||||
},
|
||||
special_tiles_source = {
|
||||
{
|
||||
name="default_water_source_animated.png",
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0},
|
||||
backface_culling = false,
|
||||
}
|
||||
},
|
||||
sounds = mcl_sounds.node_sound_water_defaults(),
|
||||
use_texture_alpha = USE_TEXTURE_ALPHA,
|
||||
drowning = 0,
|
||||
liquid_viscosity = WATER_VISC,
|
||||
liquid_range = 7,
|
||||
post_effect_color = {a=209, r=0x03, g=0x3C, b=0x5C},
|
||||
groups = {puts_out_fire=1, freezes=1, melt_around=1},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("mcl_core:lava_flowing", {
|
||||
description = S("Flowing Lava"),
|
||||
_doc_items_create_entry = false,
|
||||
|
@ -243,3 +374,64 @@ if minetest.settings:get("mcl_node_particles") == "full" then
|
|||
end,
|
||||
})
|
||||
end
|
||||
|
||||
--if minetest.settings:get("mcl_node_particles") ~= "none" then
|
||||
local nether_node_to_check = {
|
||||
["mcl_core:whirlpool_source"] = "mcl_nether:magma",
|
||||
["mcl_core:bubble_column_source"] = "mcl_nether:soul_sand",
|
||||
}
|
||||
local nether_node_offset_y = {
|
||||
["mcl_core:whirlpool_source"] = 0.5,
|
||||
["mcl_core:bubble_column_source"] = -0.5,
|
||||
}
|
||||
local nether_node_speed_y = {
|
||||
["mcl_core:whirlpool_source"] = -BUBBLE_COLUMN_SPEED,
|
||||
["mcl_core:bubble_column_source"] = BUBBLE_COLUMN_SPEED,
|
||||
}
|
||||
local bubble_source_fast_switch_from_to = {
|
||||
["mcl_nether:soul_sand"] = "mcl_core:bubble_column_source",
|
||||
["mcl_core:bubble_column_source"] = "mcl_core:bubble_column_source",
|
||||
["mcl_nether:magma"] = "mcl_core:whirlpool_source",
|
||||
["mcl_core:whirlpool_source"] = "mcl_core:whirlpool_source",
|
||||
}
|
||||
minetest.register_abm({
|
||||
label = "Process bubble columns and whirlpools",
|
||||
nodenames = {"mcl_core:whirlpool_source", "mcl_core:bubble_column_source"},
|
||||
interval = BUBBLE_ABM_INTERVAL,
|
||||
chance = 1,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
local x, y, z, name = pos.x, pos.y, pos.z, node.name
|
||||
local check = nether_node_to_check[name]
|
||||
local below = minetest.get_node({x = x, y = y - 1, z = z}).name
|
||||
if below ~= name and below ~= check then
|
||||
minetest.swap_node(pos, {name = bubble_source_fast_switch_from_to[below] or "mcl_core:water_source"})
|
||||
return
|
||||
end
|
||||
local upper_pos = {x = x, y = y + 1, z = z}
|
||||
local upper = minetest.get_node(upper_pos).name
|
||||
if upper == "mcl_core:water_source" then
|
||||
minetest.swap_node(upper_pos, {name = name})
|
||||
end
|
||||
local offset_y, speed_y = nether_node_offset_y[name], nether_node_speed_y[name]
|
||||
for _, obj in pairs(minetest.get_objects_inside_radius(pos, 12)) do
|
||||
if obj:is_player() then
|
||||
minetest.add_particlespawner({
|
||||
amount = BUBBLE_AMOUNT,
|
||||
minpos = {x = x - 0.2, y = y + offset_y, z = z - 0.2},
|
||||
maxpos = {x = x + 0.2, y = y + offset_y, z = z + 0.2},
|
||||
minvel = {x = 0 , y = speed_y, z = 0 },
|
||||
maxvel = {x = 0 , y = speed_y, z = 0 },
|
||||
minexptime = 0.95 / BUBBLE_COLUMN_SPEED,
|
||||
maxexptime = 1.05 / BUBBLE_COLUMN_SPEED,
|
||||
minsize = 0.6,
|
||||
maxsize = 1.9,
|
||||
collisiondetection = false,
|
||||
texture = "mcl_core_bubble.png",
|
||||
playername = obj:get_player_name(),
|
||||
})
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
--end
|
||||
|
|
|
@ -162,7 +162,8 @@ local function register_leaves(subname, description, longdesc, tiles, sapling, d
|
|||
deco_block=1,
|
||||
dig_by_piston=1,
|
||||
fire_encouragement=30,
|
||||
fire_flammability=60
|
||||
fire_flammability=60,
|
||||
compostability=30
|
||||
},
|
||||
drop = get_drops(0),
|
||||
_mcl_shears_drop = true,
|
||||
|
@ -194,7 +195,7 @@ local function register_sapling(subname, description, longdesc, tt_help, texture
|
|||
fixed = selbox
|
||||
},
|
||||
stack_max = 64,
|
||||
groups = {dig_immediate=3, plant=1,sapling=1,non_mycelium_plant=1,attached_node=1,dig_by_water=1,dig_by_piston=1,destroy_by_lava_flow=1,deco_block=1},
|
||||
groups = {dig_immediate=3, plant=1,sapling=1,non_mycelium_plant=1,attached_node=1,dig_by_water=1,dig_by_piston=1,destroy_by_lava_flow=1,deco_block=1, compostability=30},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
|