1
0
mirror of https://github.com/mt-mods/moretrees.git synced 2025-06-30 07:01:12 +02:00

1 Commits

Author SHA1 Message Date
817b410cc4 Version MFF. 2018-09-08 13:18:30 +02:00
116 changed files with 588 additions and 2554 deletions

0
.gitignore vendored Normal file → Executable file
View File

View File

@ -1,17 +0,0 @@
unused_args = false
allow_defined_top = true
read_globals = {
"DIR_DELIM",
"minetest", "core",
"dump",
"vector", "nodeupdate",
"VoxelManip", "VoxelArea",
"PseudoRandom", "ItemStack",
"intllib",
"default",
table = { fields = { "copy", "getn" } },
"biome_lib",
"stairs", "stairsplus",
}

960
LICENSE Normal file → Executable file
View File

@ -3,618 +3,390 @@ Minetest mod moretrees
All source code: All source code:
© 2013, Vanessa Ezekowitz <vanessaezekowitz@gmail.com> © 2013, Vanessa Ezekowitz <vanessaezekowitz@gmail.com>
Date & cocos palm code (date_palm.lua, cocos_palm.lua) Published under the terms and conditions of the WTFPL.
© 2016, Rogier <rogier777@gmail.com> All sapling textures (textures/*_sapling.png):
All date & date palm textures, date-based food, cocos flower & green coconuts,
and all poplar textures:
© 2016, Rogier <rogier777@gmail.com>
- Three of the date palm textures are modifications of existing moretrees textures
- The green coconuts are a modification of the brown coconut
- The date cake batter is a modification of the acorn muffin batter
All other sapling textures (textures/*_sapling.png):
© 2013, Tim Huppertz <mitroman@naturalnet.de> © 2013, Tim Huppertz <mitroman@naturalnet.de>
Published under the terms and conditions of CC-BY-SA-3.0 Unported.
All other textures: All other textures:
© 2013, Vanessa Ezekowitz <vanessaezekowitz@gmail.com> © 2013, Vanessa Ezekowitz <vanessaezekowitz@gmail.com>
Published under the terms and conditions of CC-BY-SA-3.0 Unported.
############################################################################### -------------------------------------------------------------------------------
License for all code: LGPL 3.0 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
License for all media and all other assets: CC-by-SA 4.0 Version 2, December 2004
############################################################################### Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
GNU LESSER GENERAL PUBLIC LICENSE Everyone is permitted to copy and distribute verbatim or modified
Version 3, 29 June 2007 copies of this license document, and changing it is allowed as long
as the name is changed.
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Everyone is permitted to copy and distribute verbatim copies TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
of this license document, but changing it is not allowed.
0. You just DO WHAT THE FUCK YOU WANT TO.
This version of the GNU Lesser General Public License incorporates This license is commonly known as "WTFPL".
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions. -------------------------------------------------------------------------------
As used herein, "this License" refers to version 3 of the GNU Lesser Creative Commons Legal Code
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License, Attribution-ShareAlike 3.0 Unported
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
by the Library, but which is not otherwise based on the Library. LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
Defining a subclass of a class defined by the Library is deemed a mode ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
of using an interface provided by the Library. INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
DAMAGES RESULTING FROM ITS USE.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
###############################################################################
Attribution-ShareAlike 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-ShareAlike 4.0 International Public
License License
By exercising the Licensed Rights (defined below), You accept and agree THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
to be bound by the terms and conditions of this Creative Commons COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
Attribution-ShareAlike 4.0 International Public License ("Public COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
License"). To the extent this Public License may be interpreted as a AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
CONDITIONS.
Section 1 -- Definitions. 1. Definitions
a. Adapted Material means material subject to Copyright and Similar a. "Adaptation" means a work based upon the Work, or upon the Work and
Rights that is derived from or based upon the Licensed Material other pre-existing works, such as a translation, adaptation,
and in which the Licensed Material is translated, altered, derivative work, arrangement of music or other alterations of a
arranged, transformed, or otherwise modified in a manner requiring literary or artistic work, or phonogram or performance and includes
permission under the Copyright and Similar Rights held by the cinematographic adaptations or any other form in which the Work may be
Licensor. For purposes of this Public License, where the Licensed recast, transformed, or adapted including in any form recognizably
Material is a musical work, performance, or sound recording, derived from the original, except that a work that constitutes a
Adapted Material is always produced where the Licensed Material is Collection will not be considered an Adaptation for the purpose of
synched in timed relation with a moving image. this License. For the avoidance of doubt, where the Work is a musical
work, performance or phonogram, the synchronization of the Work in
b. Adapter's License means the license You apply to Your Copyright timed-relation with a moving image ("synching") will be considered an
and Similar Rights in Your contributions to Adapted Material in Adaptation for the purpose of this License.
accordance with the terms and conditions of this Public License. b. "Collection" means a collection of literary or artistic works, such as
encyclopedias and anthologies, or performances, phonograms or
c. BY-SA Compatible License means a license listed at broadcasts, or other works or subject matter other than works listed
creativecommons.org/compatiblelicenses, approved by Creative in Section 1(f) below, which, by reason of the selection and
Commons as essentially the equivalent of this Public License. arrangement of their contents, constitute intellectual creations, in
which the Work is included in its entirety in unmodified form along
d. Copyright and Similar Rights means copyright and/or similar rights with one or more other contributions, each constituting separate and
closely related to copyright including, without limitation, independent works in themselves, which together are assembled into a
performance, broadcast, sound recording, and Sui Generis Database collective whole. A work that constitutes a Collection will not be
Rights, without regard to how the rights are labeled or considered an Adaptation (as defined below) for the purposes of this
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License. License.
c. "Creative Commons Compatible License" means a license that is listed
i. Licensed Rights means the rights granted to You subject to the at http://creativecommons.org/compatiblelicenses that has been
terms and conditions of this Public License, which are limited to approved by Creative Commons as being essentially equivalent to this
all Copyright and Similar Rights that apply to Your use of the License, including, at a minimum, because that license: (i) contains
Licensed Material and that the Licensor has authority to license. terms that have the same purpose, meaning and effect as the License
Elements of this License; and, (ii) explicitly permits the relicensing
j. Licensor means the individual(s) or entity(ies) granting rights of adaptations of works made available under that license under this
under this Public License. License or a Creative Commons jurisdiction license with the same
License Elements as this License.
k. Share means to provide material to the public by any means or d. "Distribute" means to make available to the public the original and
process that requires permission under the Licensed Rights, such copies of the Work or Adaptation, as appropriate, through sale or
as reproduction, public display, public performance, distribution, other transfer of ownership.
dissemination, communication, or importation, and to make material e. "License Elements" means the following high-level license attributes
available to the public including in ways that members of the as selected by Licensor and indicated in the title of this License:
public may access the material from a place and at a time Attribution, ShareAlike.
individually chosen by them. f. "Licensor" means the individual, individuals, entity or entities that
offer(s) the Work under the terms of this License.
l. Sui Generis Database Rights means rights other than copyright g. "Original Author" means, in the case of a literary or artistic work,
resulting from Directive 96/9/EC of the European Parliament and of the individual, individuals, entity or entities who created the Work
the Council of 11 March 1996 on the legal protection of databases, or if no individual or entity can be identified, the publisher; and in
as amended and/or succeeded, as well as other essentially addition (i) in the case of a performance the actors, singers,
equivalent rights anywhere in the world. musicians, dancers, and other persons who act, sing, deliver, declaim,
play in, interpret or otherwise perform literary or artistic works or
m. You means the individual or entity exercising the Licensed Rights expressions of folklore; (ii) in the case of a phonogram the producer
under this Public License. Your has a corresponding meaning. being the person or legal entity who first fixes the sounds of a
performance or other sounds; and, (iii) in the case of broadcasts, the
organization that transmits the broadcast.
Section 2 -- Scope. h. "Work" means the literary and/or artistic work offered under the terms
of this License including without limitation any production in the
a. License grant. literary, scientific and artistic domain, whatever may be the mode or
form of its expression including digital form, such as a book,
1. Subject to the terms and conditions of this Public License, pamphlet and other writing; a lecture, address, sermon or other work
the Licensor hereby grants You a worldwide, royalty-free, of the same nature; a dramatic or dramatico-musical work; a
non-sublicensable, non-exclusive, irrevocable license to choreographic work or entertainment in dumb show; a musical
exercise the Licensed Rights in the Licensed Material to: composition with or without words; a cinematographic work to which are
assimilated works expressed by a process analogous to cinematography;
a. reproduce and Share the Licensed Material, in whole or a work of drawing, painting, architecture, sculpture, engraving or
in part; and lithography; a photographic work to which are assimilated works
expressed by a process analogous to photography; a work of applied
b. produce, reproduce, and Share Adapted Material. art; an illustration, map, plan, sketch or three-dimensional work
relative to geography, topography, architecture or science; a
2. Exceptions and Limitations. For the avoidance of doubt, where performance; a broadcast; a phonogram; a compilation of data to the
Exceptions and Limitations apply to Your use, this Public extent it is protected as a copyrightable work; or a work performed by
License does not apply, and You do not need to comply with a variety or circus performer to the extent it is not otherwise
its terms and conditions. considered a literary or artistic work.
i. "You" means an individual or entity exercising rights under this
3. Term. The term of this Public License is specified in Section License who has not previously violated the terms of this License with
6(a). respect to the Work, or who has received express permission from the
Licensor to exercise rights under this License despite a previous
4. Media and formats; technical modifications allowed. The violation.
Licensor authorizes You to exercise the Licensed Rights in j. "Publicly Perform" means to perform public recitations of the Work and
all media and formats whether now known or hereafter created, to communicate to the public those public recitations, by any means or
and to make technical modifications necessary to do so. The process, including by wire or wireless means or public digital
Licensor waives and/or agrees not to assert any right or performances; to make available to the public Works in such a way that
authority to forbid You from making technical modifications members of the public may access these Works from a place and at a
necessary to exercise the Licensed Rights, including place individually chosen by them; to perform the Work to the public
technical modifications necessary to circumvent Effective by any means or process and the communication to the public of the
Technological Measures. For purposes of this Public License, performances of the Work, including by public digital performance; to
simply making modifications authorized by this Section 2(a) broadcast and rebroadcast the Work by any means including signs,
(4) never produces Adapted Material. sounds or images.
k. "Reproduce" means to make copies of the Work by any means including
5. Downstream recipients. without limitation by sound or visual recordings and the right of
fixation and reproducing fixations of the Work, including storage of a
a. Offer from the Licensor -- Licensed Material. Every protected performance or phonogram in digital form or other electronic
recipient of the Licensed Material automatically medium.
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this 2. Fair Dealing Rights. Nothing in this License is intended to reduce,
Public License. limit, or restrict any uses free from copyright or rights arising from
limitations or exceptions that are provided for in connection with the
b. Additional offer from the Licensor -- Adapted Material. copyright protection under copyright law or other applicable laws.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to 3. License Grant. Subject to the terms and conditions of this License,
exercise the Licensed Rights in the Adapted Material Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
under the conditions of the Adapter's License You apply. perpetual (for the duration of the applicable copyright) license to
exercise the rights in the Work as stated below:
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or a. to Reproduce the Work, to incorporate the Work into one or more
apply any Effective Technological Measures to, the Collections, and to Reproduce the Work as incorporated in the
Licensed Material if doing so restricts exercise of the Collections;
Licensed Rights by any recipient of the Licensed b. to create and Reproduce Adaptations provided that any such Adaptation,
Material. including any translation in any medium, takes reasonable steps to
clearly label, demarcate or otherwise identify that changes were made
6. No endorsement. Nothing in this Public License constitutes or to the original Work. For example, a translation could be marked "The
may be construed as permission to assert or imply that You original work was translated from English to Spanish," or a
are, or that Your use of the Licensed Material is, connected modification could indicate "The original work has been modified.";
with, or sponsored, endorsed, or granted official status by, c. to Distribute and Publicly Perform the Work including as incorporated
the Licensor or others designated to receive attribution as in Collections; and,
provided in Section 3(a)(1)(A)(i). d. to Distribute and Publicly Perform Adaptations.
e. For the avoidance of doubt:
b. Other rights.
i. Non-waivable Compulsory License Schemes. In those jurisdictions in
1. Moral rights, such as the right of integrity, are not which the right to collect royalties through any statutory or
licensed under this Public License, nor are publicity, compulsory licensing scheme cannot be waived, the Licensor
privacy, and/or other similar personality rights; however, to reserves the exclusive right to collect such royalties for any
the extent possible, the Licensor waives and/or agrees not to exercise by You of the rights granted under this License;
assert any such rights held by the Licensor to the limited ii. Waivable Compulsory License Schemes. In those jurisdictions in
extent necessary to allow You to exercise the Licensed which the right to collect royalties through any statutory or
Rights, but not otherwise. compulsory licensing scheme can be waived, the Licensor waives the
exclusive right to collect such royalties for any exercise by You
2. Patent and trademark rights are not licensed under this of the rights granted under this License; and,
Public License. iii. Voluntary License Schemes. The Licensor waives the right to
collect royalties, whether individually or, in the event that the
3. To the extent possible, the Licensor waives any right to Licensor is a member of a collecting society that administers
collect royalties from You for the exercise of the Licensed voluntary licensing schemes, via that society, from any exercise
Rights, whether directly or through a collecting society by You of the rights granted under this License.
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly The above rights may be exercised in all media and formats whether now
reserves any right to collect such royalties. known or hereafter devised. The above rights include the right to make
such modifications as are technically necessary to exercise the rights in
other media and formats. Subject to Section 8(f), all rights not expressly
Section 3 -- License Conditions. granted by Licensor are hereby reserved.
Your exercise of the Licensed Rights is expressly made subject to the 4. Restrictions. The license granted in Section 3 above is expressly made
following conditions. subject to and limited by the following restrictions:
a. Attribution. a. You may Distribute or Publicly Perform the Work only under the terms
of this License. You must include a copy of, or the Uniform Resource
1. If You Share the Licensed Material (including in modified Identifier (URI) for, this License with every copy of the Work You
form), You must: Distribute or Publicly Perform. You may not offer or impose any terms
on the Work that restrict the terms of this License or the ability of
a. retain the following if it is supplied by the Licensor the recipient of the Work to exercise the rights granted to that
with the Licensed Material: recipient under the terms of the License. You may not sublicense the
Work. You must keep intact all notices that refer to this License and
i. identification of the creator(s) of the Licensed to the disclaimer of warranties with every copy of the Work You
Material and any others designated to receive Distribute or Publicly Perform. When You Distribute or Publicly
attribution, in any reasonable manner requested by Perform the Work, You may not impose any effective technological
the Licensor (including by pseudonym if measures on the Work that restrict the ability of a recipient of the
designated); Work from You to exercise the rights granted to that recipient under
the terms of the License. This Section 4(a) applies to the Work as
ii. a copyright notice; incorporated in a Collection, but this does not require the Collection
apart from the Work itself to be made subject to the terms of this
iii. a notice that refers to this Public License; License. If You create a Collection, upon notice from any Licensor You
must, to the extent practicable, remove from the Collection any credit
iv. a notice that refers to the disclaimer of as required by Section 4(c), as requested. If You create an
warranties; Adaptation, upon notice from any Licensor You must, to the extent
practicable, remove from the Adaptation any credit as required by
v. a URI or hyperlink to the Licensed Material to the Section 4(c), as requested.
extent reasonably practicable; b. You may Distribute or Publicly Perform an Adaptation only under the
terms of: (i) this License; (ii) a later version of this License with
b. indicate if You modified the Licensed Material and the same License Elements as this License; (iii) a Creative Commons
retain an indication of any previous modifications; and jurisdiction license (either this or a later license version) that
contains the same License Elements as this License (e.g.,
c. indicate the Licensed Material is licensed under this Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible
Public License, and include the text of, or the URI or License. If you license the Adaptation under one of the licenses
hyperlink to, this Public License. mentioned in (iv), you must comply with the terms of that license. If
you license the Adaptation under the terms of any of the licenses
2. You may satisfy the conditions in Section 3(a)(1) in any mentioned in (i), (ii) or (iii) (the "Applicable License"), you must
reasonable manner based on the medium, means, and context in comply with the terms of the Applicable License generally and the
which You Share the Licensed Material. For example, it may be following provisions: (I) You must include a copy of, or the URI for,
reasonable to satisfy the conditions by providing a URI or the Applicable License with every copy of each Adaptation You
hyperlink to a resource that includes the required Distribute or Publicly Perform; (II) You may not offer or impose any
information. terms on the Adaptation that restrict the terms of the Applicable
License or the ability of the recipient of the Adaptation to exercise
3. If requested by the Licensor, You must remove any of the the rights granted to that recipient under the terms of the Applicable
information required by Section 3(a)(1)(A) to the extent License; (III) You must keep intact all notices that refer to the
reasonably practicable. Applicable License and to the disclaimer of warranties with every copy
of the Work as included in the Adaptation You Distribute or Publicly
b. ShareAlike. Perform; (IV) when You Distribute or Publicly Perform the Adaptation,
You may not impose any effective technological measures on the
In addition to the conditions in Section 3(a), if You Share Adaptation that restrict the ability of a recipient of the Adaptation
Adapted Material You produce, the following conditions also apply. from You to exercise the rights granted to that recipient under the
terms of the Applicable License. This Section 4(b) applies to the
1. The Adapter's License You apply must be a Creative Commons Adaptation as incorporated in a Collection, but this does not require
license with the same License Elements, this version or the Collection apart from the Adaptation itself to be made subject to
later, or a BY-SA Compatible License. the terms of the Applicable License.
c. If You Distribute, or Publicly Perform the Work or any Adaptations or
2. You must include the text of, or the URI or hyperlink to, the Collections, You must, unless a request has been made pursuant to
Adapter's License You apply. You may satisfy this condition Section 4(a), keep intact all copyright notices for the Work and
in any reasonable manner based on the medium, means, and provide, reasonable to the medium or means You are utilizing: (i) the
context in which You Share Adapted Material. name of the Original Author (or pseudonym, if applicable) if supplied,
and/or if the Original Author and/or Licensor designate another party
3. You may not offer or impose any additional or different terms or parties (e.g., a sponsor institute, publishing entity, journal) for
or conditions on, or apply any Effective Technological attribution ("Attribution Parties") in Licensor's copyright notice,
Measures to, Adapted Material that restrict exercise of the terms of service or by other reasonable means, the name of such party
rights granted under the Adapter's License You apply. or parties; (ii) the title of the Work if supplied; (iii) to the
extent reasonably practicable, the URI, if any, that Licensor
specifies to be associated with the Work, unless such URI does not
Section 4 -- Sui Generis Database Rights. refer to the copyright notice or licensing information for the Work;
and (iv) , consistent with Ssection 3(b), in the case of an
Where the Licensed Rights include Sui Generis Database Rights that Adaptation, a credit identifying the use of the Work in the Adaptation
apply to Your use of the Licensed Material: (e.g., "French translation of the Work by Original Author," or
"Screenplay based on original Work by Original Author"). The credit
a. for the avoidance of doubt, Section 2(a)(1) grants You the right required by this Section 4(c) may be implemented in any reasonable
to extract, reuse, reproduce, and Share all or a substantial manner; provided, however, that in the case of a Adaptation or
portion of the contents of the database; Collection, at a minimum such credit will appear, if a credit for all
contributing authors of the Adaptation or Collection appears, then as
b. if You include all or a substantial portion of the database part of these credits and in a manner at least as prominent as the
contents in a database in which You have Sui Generis Database credits for the other contributing authors. For the avoidance of
Rights, then the database in which You have Sui Generis Database doubt, You may only use the credit required by this Section for the
Rights (but not its individual contents) is Adapted Material, purpose of attribution in the manner set out above and, by exercising
Your rights under this License, You may not implicitly or explicitly
including for purposes of Section 3(b); and assert or imply any connection with, sponsorship or endorsement by the
c. You must comply with the conditions in Section 3(a) if You Share Original Author, Licensor and/or Attribution Parties, as appropriate,
all or a substantial portion of the contents of the database. of You or Your use of the Work, without the separate, express prior
written permission of the Original Author, Licensor and/or Attribution
For the avoidance of doubt, this Section 4 supplements and does not Parties.
replace Your obligations under this Public License where the Licensed d. Except as otherwise agreed in writing by the Licensor or as may be
Rights include other Copyright and Similar Rights. otherwise permitted by applicable law, if You Reproduce, Distribute or
Publicly Perform the Work either by itself or as part of any
Adaptations or Collections, You must not distort, mutilate, modify or
Section 5 -- Disclaimer of Warranties and Limitation of Liability. take other derogatory action in relation to the Work which would be
prejudicial to the Original Author's honor or reputation. Licensor
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE agrees that in those jurisdictions (e.g. Japan), in which any exercise
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS of the right granted in Section 3(b) of this License (the right to
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF make Adaptations) would be deemed to be a distortion, mutilation,
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, modification or other derogatory action prejudicial to the Original
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, Author's honor and reputation, the Licensor will waive or not assert,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR as appropriate, this Section, to the fullest extent permitted by the
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, applicable national law, to enable You to reasonably exercise Your
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT right under Section 3(b) of this License (right to make Adaptations)
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT but not otherwise.
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
5. Representations, Warranties and Disclaimer
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
above shall be interpreted in a manner that, to the extent LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
possible, most closely approximates an absolute disclaimer and ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
waiver of all liability. ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Section 6 -- Term and Termination. 7. Termination
a. This Public License applies for the term of the Copyright and a. This License and the rights granted hereunder will terminate
Similar Rights licensed here. However, if You fail to comply with automatically upon any breach by You of the terms of this License.
this Public License, then Your rights under this Public License Individuals or entities who have received Adaptations or Collections
terminate automatically. from You under this License, however, will not have their licenses
terminated provided such individuals or entities remain in full
b. Where Your right to use the Licensed Material has terminated under compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
Section 6(a), it reinstates: survive any termination of this License.
b. Subject to the above terms and conditions, the license granted here is
1. automatically as of the date the violation is cured, provided perpetual (for the duration of the applicable copyright in the Work).
it is cured within 30 days of Your discovery of the Notwithstanding the above, Licensor reserves the right to release the
violation; or Work under different license terms or to stop distributing the Work at
any time; provided, however that any such election will not serve to
2. upon express reinstatement by the Licensor. withdraw this License (or any other license that has been, or is
required to be, granted under the terms of this License), and this
For the avoidance of doubt, this Section 6(b) does not affect any License will continue in full force and effect unless terminated as
right the Licensor may have to seek remedies for Your violations stated above.
of this Public License.
8. Miscellaneous
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop a. Each time You Distribute or Publicly Perform the Work or a Collection,
distributing the Licensed Material at any time; however, doing so the Licensor offers to the recipient a license to the Work on the same
will not terminate this Public License. terms and conditions as the license granted to You under this License.
b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public offers to the recipient a license to the original Work on the same
License. terms and conditions as the license granted to You under this License.
c. If any provision of this License is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of
Section 7 -- Other Terms and Conditions. the remainder of the terms of this License, and without further action
by the parties to this agreement, such provision shall be reformed to
a. The Licensor shall not be bound by any additional or different the minimum extent necessary to make such provision valid and
terms or conditions communicated by You unless expressly agreed. enforceable.
d. No term or provision of this License shall be deemed waived and no
b. Any arrangements, understandings, or agreements regarding the breach consented to unless such waiver or consent shall be in writing
Licensed Material not stated herein are separate from and and signed by the party to be charged with such waiver or consent.
independent of the terms and conditions of this Public License. e. This License constitutes the entire agreement between the parties with
respect to the Work licensed here. There are no understandings,
agreements or representations with respect to the Work not specified
Section 8 -- Interpretation. here. Licensor shall not be bound by any additional provisions that
may appear in any communication from You. This License may not be
a. For the avoidance of doubt, this Public License does not, and modified without the mutual written agreement of the Licensor and You.
shall not be interpreted to, reduce, limit, restrict, or impose f. The rights granted under, and the subject matter referenced, in this
conditions on any use of the Licensed Material that could lawfully License were drafted utilizing the terminology of the Berne Convention
be made without permission under this Public License. for the Protection of Literary and Artistic Works (as amended on
September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
b. To the extent possible, if any provision of this Public License is Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
deemed unenforceable, it shall be automatically reformed to the and the Universal Copyright Convention (as revised on July 24, 1971).
minimum extent necessary to make it enforceable. If the provision These rights and subject matter take effect in the relevant
cannot be reformed, it shall be severed from this Public License jurisdiction in which the License terms are sought to be enforced
without affecting the enforceability of the remaining terms and according to the corresponding provisions of the implementation of
conditions. those treaty provisions in the applicable national law. If the
standard suite of rights granted under applicable copyright law
c. No term or condition of this Public License will be waived and no includes additional rights not granted under this License, such
failure to comply consented to unless expressly agreed to by the additional rights are deemed to be included in the License; this
Licensor. License is not intended to restrict the license of any rights under
applicable law.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal Creative Commons Notice
processes of any jurisdiction or authority.
Creative Commons is not a party to this License, and makes no warranty
whatsoever in connection with the Work. Creative Commons will not be
======================================================================= liable to You or any party on any legal theory for any damages
whatsoever, including without limitation any general, special,
Creative Commons is not a party to its public incidental or consequential damages arising in connection to this
licenses. Notwithstanding, Creative Commons may elect to apply one of license. Notwithstanding the foregoing two (2) sentences, if Creative
its public licenses to material it publishes and in those instances Commons has expressly identified itself as the Licensor hereunder, it
will be considered the “Licensor.” The text of the Creative Commons shall have all rights and obligations of Licensor.
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that Except for the limited purpose of indicating to the public that the
material is shared under a Creative Commons public license or as Work is licensed under the CCPL, Creative Commons does not authorize
otherwise permitted by the Creative Commons policies published at the use by either party of the trademark "Creative Commons" or any
creativecommons.org/policies, Creative Commons does not authorize the related trademark or logo of Creative Commons without the prior
use of the trademark "Creative Commons" or any other trademark or logo written consent of Creative Commons. Any permitted use will be in
of Creative Commons without its prior written consent including, compliance with Creative Commons' then-current trademark usage
without limitation, in connection with any unauthorized modifications guidelines, as may be published on its website or otherwise made
to any of its public licenses or any other arrangements, available upon request from time to time. For the avoidance of doubt,
understandings, or agreements concerning use of licensed material. For this trademark restriction does not form part of the License.
the avoidance of doubt, this paragraph does not form part of the
public licenses. Creative Commons may be contacted at http://creativecommons.org/.
Creative Commons may be contacted at creativecommons.org.

0
README.md Normal file → Executable file
View File

137
biome_defs.lua Normal file → Executable file
View File

@ -24,40 +24,6 @@ moretrees.palm_biome = {
max_count = 10, max_count = 10,
} }
moretrees.date_palm_biome = {
surface = "default:desert_sand",
avoid_nodes = moretrees.avoidnodes,
avoid_radius = 10,
seed_diff = 339,
min_elevation = -1,
max_elevation = 10,
near_nodes = {"default:water_source"},
near_nodes_size = 20,
near_nodes_count = 100,
near_nodes_vertical = 20,
temp_min = -0.20,
humidity_max = 0.20,
rarity = 10,
max_count = 30,
}
moretrees.date_palm_biome_2 = {
surface = "default:desert_sand",
avoid_nodes = moretrees.avoidnodes,
avoid_radius = 10,
seed_diff = 340,
min_elevation = 11,
max_elevation = 30,
near_nodes = {"default:water_source"},
near_nodes_size = 1,
near_nodes_count = 1,
near_nodes_vertical = 30,
temp_min = -0.20,
humidity_max = 0.20,
rarity = 10,
max_count = 30,
}
moretrees.apple_tree_biome = { moretrees.apple_tree_biome = {
surface = "default:dirt_with_grass", surface = "default:dirt_with_grass",
avoid_nodes = moretrees.avoidnodes, avoid_nodes = moretrees.avoidnodes,
@ -124,6 +90,18 @@ moretrees.willow_biome = {
max_count = 5, max_count = 5,
} }
moretrees.acacia_biome = {
surface = { "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:desert_sand" },
avoid_nodes = moretrees.avoidnodes,
avoid_radius = 15,
seed_diff = 1,
rarity = 50,
max_count = 15,
plantlife_limit = -1,
humidity_min = 0.3,
humidity_max = 0,
}
moretrees.rubber_tree_biome = { moretrees.rubber_tree_biome = {
surface = "default:dirt_with_grass", surface = "default:dirt_with_grass",
avoid_nodes = moretrees.avoidnodes, avoid_nodes = moretrees.avoidnodes,
@ -184,97 +162,6 @@ moretrees.cedar_biome = {
max_count = 10, max_count = 10,
} }
-- Poplar requires a lot of water.
moretrees.poplar_biome = {
surface = "default:dirt_with_grass",
avoid_nodes = moretrees.avoidnodes,
avoid_radius = 6,
seed_diff = 341,
min_elevation = 0,
max_elevation = 50,
near_nodes = {"default:water_source"},
near_nodes_size = 15,
near_nodes_vertical = 5,
near_nodes_count = 1,
humidity_min = -0.7,
humidity_max = -1,
rarity = 50,
max_count = 15,
}
-- The humidity requirement it quite restrictive (apparently).
-- Spawn an occasional poplar elsewhere.
moretrees.poplar_biome_2 = {
surface = "default:dirt_with_grass",
avoid_nodes = moretrees.avoidnodes,
avoid_radius = 6,
seed_diff = 341,
min_elevation = 0,
max_elevation = 50,
near_nodes = {"default:water_source"},
near_nodes_size = 15,
near_nodes_vertical = 4,
near_nodes_count = 10,
humidity_min = 0.1,
humidity_max = -0.6,
rarity = 50,
max_count = 1,
}
-- Subterranean lakes provide enough water for poplars to grow
moretrees.poplar_biome_3 = {
surface = "default:dirt_with_grass",
avoid_nodes = moretrees.avoidnodes,
avoid_radius = 6,
seed_diff = 342,
min_elevation = 0,
max_elevation = 50,
near_nodes = {"default:water_source"},
near_nodes_size = 1,
near_nodes_vertical = 25,
near_nodes_count = 1,
humidity_min = -0.5,
humidity_max = -1,
rarity = 0,
max_count = 30,
}
moretrees.poplar_small_biome = {
surface = "default:dirt_with_grass",
avoid_nodes = moretrees.avoidnodes,
avoid_radius = 4,
seed_diff = 343,
min_elevation = 0,
max_elevation = 50,
near_nodes = {"default:water_source"},
near_nodes_size = 10,
near_nodes_vertical = 5,
near_nodes_count = 1,
humidity_min = -0.7,
humidity_max = -1,
rarity = 50,
max_count = 10,
}
moretrees.poplar_small_biome_2 = {
surface = "default:dirt_with_grass",
avoid_nodes = moretrees.avoidnodes,
avoid_radius = 4,
seed_diff = 343,
min_elevation = 0,
max_elevation = 50,
near_nodes = {"default:water_source"},
near_nodes_size = 10,
near_nodes_vertical = 4,
near_nodes_count = 5,
humidity_min = 0.1,
humidity_max = -0.6,
rarity = 50,
max_count = 3,
}
moretrees.fir_biome = { moretrees.fir_biome = {
surface = "default:dirt_with_grass", surface = "default:dirt_with_grass",
avoid_nodes = moretrees.avoidnodes, avoid_nodes = moretrees.avoidnodes,

View File

@ -1,283 +0,0 @@
local S = moretrees.intllib
-- © 2016, Rogier <rogier777@gmail.com>
-- Some constants
local coconut_drop_ichance = 8
-- Make the cocos palm fruit trunk a real trunk (it is generated as a fruit)
local trunk = minetest.registered_nodes["moretrees:palm_trunk"]
local ftrunk = {}
local gftrunk = {}
for k,v in pairs(trunk) do
ftrunk[k] = v
gftrunk[k] = v
end
ftrunk.tiles = {}
gftrunk.tiles = {}
for k,v in pairs(trunk.tiles) do
ftrunk.tiles[k] = v
gftrunk.tiles[k] = v
end
ftrunk.drop = "moretrees:palm_trunk"
gftrunk.drop = "moretrees:palm_trunk"
ftrunk.after_destruct = function(pos, oldnode)
local coconuts = minetest.find_nodes_in_area({x=pos.x-1, y=pos.y, z=pos.z-1}, {x=pos.x+1, y=pos.y, z=pos.z+1}, {"group:moretrees_coconut"})
for _,coconutpos in pairs(coconuts) do
-- minetest.dig_node(coconutpos) does not cause nearby coconuts to be dropped :-( ...
--minetest.dig_node(coconutpos)
local items = minetest.get_node_drops(minetest.get_node(coconutpos).name)
minetest.swap_node(coconutpos, biome_lib.air)
for _, itemname in pairs(items) do
minetest.add_item(coconutpos, itemname)
end
end
end
-- Make the different trunk types distinguishable (but barely)
ftrunk.tiles[1] = "moretrees_palm_trunk_top.png^[transformR90"
gftrunk.tiles[1] = "moretrees_palm_trunk_top.png^[transformR180"
gftrunk.description = gftrunk.description.." (gen)"
minetest.register_node("moretrees:palm_fruit_trunk", ftrunk)
minetest.register_node("moretrees:palm_fruit_trunk_gen", gftrunk)
local coconut_regrow_abm_spec = {
nodenames = { "moretrees:palm_fruit_trunk" },
interval = moretrees.coconut_flower_interval,
chance = moretrees.coconut_flower_chance,
action = function(pos, node, active_object_count, active_object_count_wider)
local coconuts = minetest.find_nodes_in_area({x=pos.x-1, y=pos.y, z=pos.z-1}, {x=pos.x+1, y=pos.y, z=pos.z+1}, "group:moretrees_coconut")
-- Expected growth interval increases exponentially with number of coconuts already hanging.
-- Also: if more coconuts are hanging, the chance of picking an empty spot decreases as well...
if math.random(2^#coconuts) <= 2 then
-- Grow in area of 3x3 round trunk
local dx=math.floor(math.random(3)-2)
local dz=math.floor(math.random(3)-2)
local coconutpos = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local coconutnode = minetest.get_node(coconutpos)
if coconutnode.name == "air" then
minetest.swap_node(coconutpos, {name="moretrees:coconut_0"})
end
end
end
}
if moretrees.coconuts_regrow then
minetest.register_abm(coconut_regrow_abm_spec)
end
-- Spawn initial coconuts
-- Spawn initial coconuts
-- (Instead of coconuts, a generated-palm fruit trunk is generated with the tree. This
-- ABM converts the trunk to a regular fruit trunk, and spawns some coconuts)
minetest.register_abm({
nodenames = { "moretrees:palm_fruit_trunk_gen" },
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
minetest.swap_node(pos, {name="moretrees:palm_fruit_trunk"})
local poslist = minetest.find_nodes_in_area({x=pos.x-1, y=pos.y, z=pos.z-1}, {x=pos.x+1, y=pos.y, z=pos.z+1}, "air")
local genlist = {}
for k,v in pairs(poslist) do
genlist[k] = {x = math.random(100), pos = v}
end
table.sort(genlist, function(a, b) return a.x < b.x; end)
local gen
local count = 0
for _,gen in pairs(genlist) do
minetest.swap_node(gen.pos, {name = "moretrees:coconut_3"})
count = count + 1
if count == 4 then
break
end
end
end,
})
-- Register coconuts, and make them regrow
local coconut_growfn = function(pos, elapsed)
local node = minetest.get_node(pos)
local delay = moretrees.coconut_grow_interval
if not node then
return
elseif not moretrees.coconuts_regrow then
-- Regrowing has been turned off. Make coconust grow instantly
minetest.swap_node(pos, {name="moretrees:coconut_3"})
return
elseif node.name == "moretrees:coconut_3" then
-- Drop coconuts (i.e. remove them), so that new coconuts can grow.
-- Coconuts will drop as items with a small chance
if math.random(coconut_drop_ichance) == 1 then
if moretrees.coconut_item_drop_ichance > 0 and math.random(moretrees.coconut_item_drop_ichance) == 1 then
local items = minetest.get_node_drops(minetest.get_node(pos).name)
for _, itemname in pairs(items) do
minetest.add_item(pos, itemname)
end
end
minetest.swap_node(pos, biome_lib.air)
end
else
-- Grow coconuts to the next stage
local offset = string.len("moretrees:coconut_x")
local n = string.sub(node.name, offset)
minetest.swap_node(pos, {name=string.sub(node.name, 1, offset-1)..n+1})
end
-- Don't catch up when elapsed time is large. Regular visits are needed for growth...
local timer = minetest.get_node_timer(pos)
timer:start(delay + math.random(moretrees.coconut_grow_interval))
end
local coconut_starttimer = function(pos, elapsed)
local timer = minetest.get_node_timer(pos)
local base_interval = moretrees.coconut_grow_interval * 2 / 3
timer:set(base_interval + math.random(base_interval), elapsed or 0)
end
for _,suffix in ipairs({"_0", "_1", "_2", "_3", ""}) do
local name
if suffix == "_0" then
name = S("Coconut Flower")
else
name = S("Coconut")
end
local drop = ""
local coco_group = 1
local tile = "moretrees_coconut"..suffix..".png"
local timerfn = coconut_growfn
local constructfn = coconut_starttimer
if suffix == "_3" then
drop = "moretrees:coconut"
tile = "moretrees_coconut.png"
elseif suffix == "" then
drop = nil
coco_group = nil
timerfn = nil
constructfn = nil
end
local coconutdef = {
description = name,
tiles = {tile},
drawtype = "plantlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = { fleshy=3, dig_immediate=3, flammable=2, moretrees_coconut=coco_group },
inventory_image = tile.."^[transformR180",
wield_image = tile.."^[transformR180",
sounds = default.node_sound_defaults(),
drop = drop,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3}
},
on_timer = timerfn,
on_construct = constructfn,
}
minetest.register_node("moretrees:coconut"..suffix, coconutdef)
end
-- convert exisiting cocos palms. This is a bit tricky...
-- Try to make sure that this is indeed a generated tree, and not manually-placed trunks and/or coconuts
if moretrees.coconuts_convert_existing_palms then
local spec = {
name = "moretrees:convert_existing_cocos_palms_to_regrow_coconuts",
nodenames = "moretrees:coconut",
action = function(pos, node, active_object_count, active_object_count_wider)
local trunks
local cvtrunks
local leaves
local coconuts
-- One regular trunk must be adjacent to the coconut
trunks = minetest.find_nodes_in_area({x=pos.x-1, y=pos.y, z=pos.z-1}, {x=pos.x+1, y=pos.y, z=pos.z+1}, "moretrees:palm_trunk")
if #trunks ~= 1 then
return
end
local tpos = trunks[1]
-- 1 or 2 other trunks must be one level below to the trunk being converted.
trunks = minetest.find_nodes_in_area({x=tpos.x-1, y=tpos.y-1, z=tpos.z-1}, {x=tpos.x+1, y=tpos.y-1, z=tpos.z+1}, "moretrees:palm_trunk")
if #trunks < 1 or #trunks > 2 then
return
end
-- 1 or 2 other trunks must be two levels below to the trunk being converted.
trunks = minetest.find_nodes_in_area({x=tpos.x-1, y=tpos.y-2, z=tpos.z-1}, {x=tpos.x+1, y=tpos.y-2, z=tpos.z+1}, "moretrees:palm_trunk")
if #trunks < 1 or #trunks > 2 then
return
end
-- 1 or 2 trunks must at the level of the trunk being converted.
cvtrunks = minetest.find_nodes_in_area({x=tpos.x-1, y=tpos.y, z=tpos.z-1}, {x=tpos.x+1, y=tpos.y, z=tpos.z+1}, "moretrees:palm_trunk")
if #cvtrunks < 1 or #cvtrunks > 2 then
return
end
-- No trunks may be one level above the trunk being converted.
trunks = minetest.find_nodes_in_area({x=tpos.x-1, y=tpos.y+1, z=tpos.z-1}, {x=tpos.x+1, y=tpos.y+1, z=tpos.z+1}, "moretrees:palm_trunk")
if #trunks ~= 0 then
return
end
-- Leaves must be one level above the trunk being converted.
leaves = minetest.find_nodes_in_area({x=tpos.x-1, y=tpos.y+1, z=tpos.z-1}, {x=tpos.x+1, y=tpos.y+1, z=tpos.z+1}, "moretrees:palm_leaves")
if #leaves == 0 then
return
end
-- Leaves must be two levels above the trunk being converted.
leaves = minetest.find_nodes_in_area({x=tpos.x-1, y=tpos.y+2, z=tpos.z-1}, {x=tpos.x+1, y=tpos.y+2, z=tpos.z+1}, "moretrees:palm_leaves")
if #leaves == 0 then
return
end
-- No cocos fruit trunk may already be adjacent to the coconut
trunks = minetest.find_nodes_in_area({x=pos.x-1, y=pos.y, z=pos.z-1}, {x=pos.x+1, y=pos.y, z=pos.z+1}, "moretrees:palm_fruit_trunk")
if #trunks ~= 0 then
return
end
-- No cocos fruit trunk may be adjacent to or below the trunk being converted.
trunks = minetest.find_nodes_in_area({x=tpos.x-1, y=tpos.y-2, z=tpos.z-1}, {x=tpos.x+1, y=tpos.y, z=tpos.z+1}, "moretrees:palm_fruit_trunk")
if #trunks ~= 0 then
return
end
-- Convert trunk and all coconuts nearby. Maybe convert 2 trunks, just in case...
for _, tpos in pairs(cvtrunks) do
minetest.swap_node(tpos, {name = "moretrees:palm_fruit_trunk"})
coconuts = minetest.find_nodes_in_area({x=tpos.x-1, y=tpos.y, z=tpos.z-1}, {x=tpos.x+1, y=tpos.y, z=tpos.z+1}, "moretrees:coconut")
for _, coconutpos in pairs(coconuts) do
minetest.swap_node(coconutpos, {name = "moretrees:coconut_3"})
end
end
end,
}
if minetest.register_lbm then
minetest.register_lbm(spec)
else
spec.interval = 3691
spec.chance = 10
minetest.register_abm(spec)
end
end
-- If regrowing was previously disabled, but is enabled now, make sure timers are started for existing coconuts
if moretrees.coconuts_regrow then
local spec = {
name = "moretrees:restart_coconut_regrow_timer",
nodenames = "group:moretrees_coconut",
action = function(pos, node, active_object_count, active_object_count_wider)
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
coconut_starttimer(pos)
else
local timeout = timer:get_timeout()
local elapsed = timer:get_elapsed()
if timeout - elapsed > moretrees.coconut_grow_interval * 4/3 then
coconut_starttimer(pos, math.random(moretrees.coconut_grow_interval * 4/3))
end
end
end,
}
if minetest.register_lbm then
minetest.register_lbm(spec)
else
spec.interval = 3659
spec.chance = 10
minetest.register_abm(spec)
end
end

102
crafts.lua Normal file → Executable file
View File

@ -3,6 +3,25 @@ local S = moretrees.intllib
for i in ipairs(moretrees.treelist) do for i in ipairs(moretrees.treelist) do
local treename = moretrees.treelist[i][1] local treename = moretrees.treelist[i][1]
-- MODIFICATION MADE FOR MFF //MFF(Mg|08/12/15)
if minetest.registered_items["moretrees:" .. treename .. "_trunk_sideways"] then
minetest.register_craft({
output = "moretrees:"..treename.."_trunk 2",
recipe = {
{"moretrees:"..treename.."_trunk_sideways"},
{"moretrees:"..treename.."_trunk_sideways"}
}
})
minetest.register_craft({
type = "shapeless",
output = "moretrees:"..treename.."_planks 4",
recipe = {
"moretrees:"..treename.."_trunk_sideways"
}
})
end
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = "moretrees:"..treename.."_planks 4", output = "moretrees:"..treename.."_planks 4",
@ -47,35 +66,6 @@ minetest.register_craftitem("moretrees:raw_coconut", {
on_use = minetest.item_eat(4), on_use = minetest.item_eat(4),
}) })
minetest.register_craftitem("moretrees:date", {
description = S("Date"),
inventory_image = "moretrees_date.png",
on_use = minetest.item_eat(1),
})
minetest.register_craftitem("moretrees:date_nut_snack", {
description = S("Date & nut snack"),
inventory_image = "moretrees_date_nut_snack.png",
on_use = minetest.item_eat(4),
})
minetest.register_craftitem("moretrees:date_nut_batter", {
description = S("Date-nut cake batter"),
inventory_image = "moretrees_date_nut_batter.png",
})
minetest.register_craftitem("moretrees:date_nut_cake", {
description = S("Date-nut cake"),
inventory_image = "moretrees_date_nut_cake.png",
on_use = minetest.item_eat(32),
})
minetest.register_craftitem("moretrees:date_nut_bar", {
description = S("Date-nut energy bar"),
inventory_image = "moretrees_date_nut_bar.png",
on_use = minetest.item_eat(4),
})
minetest.register_craftitem("moretrees:acorn_muffin_batter", { minetest.register_craftitem("moretrees:acorn_muffin_batter", {
description = S("Acorn Muffin batter"), description = S("Acorn Muffin batter"),
inventory_image = "moretrees_acorn_muffin_batter.png", inventory_image = "moretrees_acorn_muffin_batter.png",
@ -122,60 +112,6 @@ for i in ipairs(moretrees.cutting_tools) do
}) })
end end
minetest.register_craft({
type = "shapeless",
output = "moretrees:date_nut_snack",
recipe = {
"moretrees:date",
"moretrees:date",
"moretrees:date",
"moretrees:spruce_nuts",
"moretrees:cedar_nuts",
"moretrees:fir_nuts",
}
})
-- The date-nut cake is an exceptional food item due to its highly
-- concentrated nature (32 food units). Because of that, it requires
-- many different ingredients, and, starting from the base ingredients
-- found or harvested in nature, it requires many steps to prepare.
local flour
if minetest.registered_nodes["farming:flour"] then
flour = "farming:flour"
else
flour = "moretrees:acorn_muffin_batter"
end
minetest.register_craft({
type = "shapeless",
output = "moretrees:date_nut_batter",
recipe = {
"moretrees:date_nut_snack",
"moretrees:date_nut_snack",
"moretrees:date_nut_snack",
"moretrees:coconut_milk",
"moretrees:date_nut_snack",
"moretrees:raw_coconut",
"moretrees:coconut_milk",
flour,
"moretrees:raw_coconut",
},
replacements = {
{ "moretrees:coconut_milk", "vessels:drinking_glass 2" }
}
})
minetest.register_craft({
type = "cooking",
output = "moretrees:date_nut_cake",
recipe = "moretrees:date_nut_batter",
})
minetest.register_craft({
type = "shapeless",
output = "moretrees:date_nut_bar 8",
recipe = {"moretrees:date_nut_cake"},
})
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = "moretrees:acorn_muffin_batter", output = "moretrees:acorn_muffin_batter",

View File

@ -1,750 +0,0 @@
-- Date palms.
--
-- Date palms grow in hot and dry desert, but they require water. This makes them
-- a bit harder to find. If found in the middle of the desert, their presence
-- indicates a water source below the surface.
--
-- As an additional feature (which can be disabled), dates automatically regrow after
-- harvesting (provided a male tree is sufficiently nearby).
-- If regrowing is enabled, then ripe dates will not hang forever. Most will disappear
-- (e.g. eaten by birds, ...), and a small fraction will drop as items.
-- © 2016, Rogier <rogier777@gmail.com>
local S = moretrees.intllib
-- Some constants
local dates_drop_ichance = 4
local stems_drop_ichance = 4
local flowers_wither_ichance = 3
-- implementation
local dates_regrow_prob
if moretrees.dates_regrow_unpollinated_percent <= 0 then
dates_regrow_prob = 0
elseif moretrees.dates_regrow_unpollinated_percent >= 100 then
dates_regrow_prob = 1
else
dates_regrow_prob = 1 - math.pow(moretrees.dates_regrow_unpollinated_percent/100, 1/flowers_wither_ichance)
end
-- Make the date palm fruit trunk a real trunk (it is generated as a fruit)
local trunk = minetest.registered_nodes["moretrees:date_palm_trunk"]
local ftrunk = {}
local fftrunk = {}
local mftrunk = {}
for k,v in pairs(trunk) do
ftrunk[k] = v
end
ftrunk.tiles = {}
for k,v in pairs(trunk.tiles) do
ftrunk.tiles[k] = v
end
ftrunk.drop = "moretrees:date_palm_trunk"
ftrunk.after_destruct = function(pos, oldnode)
local dates = minetest.find_nodes_in_area({x=pos.x-2, y=pos.y, z=pos.z-2}, {x=pos.x+2, y=pos.y, z=pos.z+2}, {"group:moretrees_dates"})
for _,datespos in pairs(dates) do
-- minetest.dig_node(datespos) does not cause nearby dates to be dropped :-( ...
local items = minetest.get_node_drops(minetest.get_node(datespos).name)
minetest.swap_node(datespos, biome_lib.air)
for _, itemname in pairs(items) do
minetest.add_item(datespos, itemname)
end
end
end
for k,v in pairs(ftrunk) do
mftrunk[k] = v
fftrunk[k] = v
end
fftrunk.tiles = {}
mftrunk.tiles = {}
for k,v in pairs(trunk.tiles) do
fftrunk.tiles[k] = v
mftrunk.tiles[k] = v
end
-- Make the different types of trunk distinguishable (but not too easily)
ftrunk.tiles[1] = "moretrees_date_palm_trunk_top.png^[transformR180"
ftrunk.description = ftrunk.description.." (gen)"
fftrunk.tiles[1] = "moretrees_date_palm_trunk_top.png^[transformR90"
mftrunk.tiles[1] = "moretrees_date_palm_trunk_top.png^[transformR-90"
minetest.register_node("moretrees:date_palm_fruit_trunk", ftrunk)
minetest.register_node("moretrees:date_palm_ffruit_trunk", fftrunk)
minetest.register_node("moretrees:date_palm_mfruit_trunk", mftrunk)
-- ABM to grow new date blossoms
local date_regrow_abm_spec = {
nodenames = { "moretrees:date_palm_ffruit_trunk", "moretrees:date_palm_mfruit_trunk" },
interval = moretrees.dates_flower_interval,
chance = moretrees.dates_flower_chance,
action = function(pos, node, active_object_count, active_object_count_wider)
local dates = minetest.find_nodes_in_area({x=pos.x-2, y=pos.y, z=pos.z-2}, {x=pos.x+2, y=pos.y, z=pos.z+2}, "group:moretrees_dates")
-- New blossom interval increases exponentially with number of dates already hanging
-- In addition: if more dates are hanging, the chance of picking an empty spot decreases as well...
if math.random(2^#dates) <= 2 then
-- Grow in area of 5x5 round trunk; higher probability in 3x3 area close to trunk
local dx=math.floor((math.random(50)-18)/16)
local dz=math.floor((math.random(50)-18)/16)
local datepos = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local datenode = minetest.get_node(datepos)
if datenode.name == "air" then
if node.name == "moretrees:date_palm_ffruit_trunk" then
minetest.swap_node(datepos, {name="moretrees:dates_f0"})
else
minetest.swap_node(datepos, {name="moretrees:dates_m0"})
end
end
end
end
}
if moretrees.dates_regrow_pollinated or moretrees.dates_regrow_unpollinated_percent > 0 then
minetest.register_abm(date_regrow_abm_spec)
end
-- Choose male or female palm, and spawn initial dates
-- (Instead of dates, a dates fruit trunk is generated with the tree. This
-- ABM converts the trunk to a female or male fruit trunk, and spawns some
-- hanging dates)
minetest.register_abm({
nodenames = { "moretrees:date_palm_fruit_trunk" },
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local type
if math.random(100) <= moretrees.dates_female_percent then
type = "f"
minetest.swap_node(pos, {name="moretrees:date_palm_ffruit_trunk"})
else
type = "m"
minetest.swap_node(pos, {name="moretrees:date_palm_mfruit_trunk"})
end
local dates1 = minetest.find_nodes_in_area({x=pos.x-1, y=pos.y, z=pos.z-1}, {x=pos.x+1, y=pos.y, z=pos.z+1}, "air")
local genpos
for _,genpos in pairs(dates1) do
if math.random(100) <= 20 then
if type == "m" then
minetest.swap_node(genpos, {name = "moretrees:dates_n"})
else
minetest.swap_node(genpos, {name = "moretrees:dates_f4"})
end
end
end
local dates2 = minetest.find_nodes_in_area({x=pos.x-2, y=pos.y, z=pos.z-2}, {x=pos.x+2, y=pos.y, z=pos.z+2}, "air")
for _,genpos in pairs(dates2) do
if math.random(100) <= 5 then
if type == "m" then
minetest.swap_node(genpos, {name = "moretrees:dates_n"})
else
minetest.swap_node(genpos, {name = "moretrees:dates_f4"})
end
end
end
end,
})
-- Dates growing functions.
-- This is a bit complex, as the purpose is to find male flowers at horizontal distances of over
-- 100 nodes. As searching such a large area is time consuming, this is optimized in four ways:
-- - The search result (the locations of male trees) is cached, so that it can be used again
-- - Only 1/9th of the desired area is searched at a time. A new search is only performed if no male
-- flowers are found in the previously searched parts.
-- - Search results are shared with other female palms nearby.
-- - If previous searches for male palms have consumed too much CPU time, the search is skipped
-- (This means no male palms will be found, and the pollination of the flowers affected will be
-- delayed. If this happens repeatedly, eventually, the female flowers will wither...)
-- A caching method was selected that is suited for the case where most date trees are long-lived,
-- and where the number of trees nearby is limited:
-- - Locations of male palms are stored as metadata for every female palm. This means that a player
-- visiting a remote area with some date palms will not cause extensive searches for male palms as
-- long overdue blossoming ABMs are triggered for every date palm.
-- - Even when male palms *are* cut down, a cache refill will only be performed if the cached results do not
-- contain a male palm with blossoms.
-- The method will probably perform suboptimally:
-- - If female palms are frequently chopped down and replanted.
-- Freshly grown palms will need to search for male palms again
-- (this is mitigated by the long blossoming interval, which increases the chance that search
-- results have already been shared)
-- - If an area contains a large number of male and female palms.
-- In this area, every female palm will have an almost identical list of male palm locations
-- as metadata.
-- - If all male palms within range of a number of female palms have been chopped down (with possibly
-- new ones planted). Although an attempt was made to share search results in this case as well,
-- a number of similar searches will unavoidably be performed by the different female palms.
-- - If no male palms are in range of a female palm. In that case, there will be frequent searches
-- for newly-grown male palms.
-- Search statistics - used to limit the search load.
local sect_search_stats = {} -- Search statistics - server-wide
local function reset_sect_search_stats()
sect_search_stats.count = 0 -- # of searches
sect_search_stats.skip = 0 -- # of times skipped
sect_search_stats.sum = 0 -- total time spent
sect_search_stats.min = 999999999 -- min time spent
sect_search_stats.max = 0 -- max time spent
end
reset_sect_search_stats()
sect_search_stats.last_us = 0 -- last time a search was done (microseconds, max: 2^32)
sect_search_stats.last_s = 0 -- last time a search was done (system time in seconds)
-- Find male trunks in one section (=1/9 th) of the searchable area.
-- sect is -4 to 4, where 0 is the center section
local function find_fruit_trunks_near(ftpos, sect)
local r = moretrees.dates_pollination_distance + 2 * math.sqrt(2)
local sect_hr = math.floor(r / 3 + 0.9999)
local sect_vr = math.floor(r / 2 + 0.9999)
local t0us = core.get_us_time()
local t0s = os.time()
-- Compute elapsed time since last search.
-- Unfortunately, the time value wraps after about 71 minutes (2^32 microseconds),
-- so it must be corrected to obtain the actual elapsed time.
if t0us < sect_search_stats.last_us then
-- Correct a simple wraparound.
-- This is not sufficient, as the time value may have wrapped more than once...
sect_search_stats.last_us = sect_search_stats.last_us - 2^32
end
if t0s - sect_search_stats.last_s > 2^32/1000000 then
-- One additional correction is enough for our purposes.
-- For exact results, more corrections may be needed though...
-- (and even not applying this correction at all would still only yield
-- a minimal risk of a non-serious miscalculation...)
sect_search_stats.last_us = sect_search_stats.last_us - 2^32
end
-- Skip the search if it is consuming too much CPU time
if sect_search_stats.count > 0 and moretrees.dates_blossom_search_iload > 0
and sect_search_stats.sum / sect_search_stats.count > moretrees.dates_blossom_search_time_treshold
and t0us - sect_search_stats.last_us < moretrees.dates_blossom_search_iload * (sect_search_stats.sum / sect_search_stats.count) then
sect_search_stats.skip = sect_search_stats.skip + 1
return nil
end
local basevec = { x = ftpos.x + 2 * sect.x * sect_hr,
y = ftpos.y,
z = ftpos.z + 2 * sect.z * sect_hr}
-- find_nodes_in_area is limited to 82^3, make sure to not overrun it
local sizevec = { x = sect_hr, y = sect_vr, z = sect_hr }
if sect_hr * sect_hr * sect_vr > 41^3 then
sizevec = vector.apply(sizevec, function(a) return math.min(a, 41) end)
end
local all_palms = minetest.find_nodes_in_area(
vector.subtract(basevec, sizevec),
vector.add(basevec, sizevec),
{"moretrees:date_palm_mfruit_trunk", "moretrees:date_palm_ffruit_trunk"})
-- Collect different palms in separate lists.
local female_palms = {}
local male_palms = {}
local all_male_palms = {}
for _, pos in pairs(all_palms) do
if pos.x ~= ftpos.x or pos.y ~= ftpos.y or pos.z ~= ftpos.z then
local node = minetest.get_node(pos)
if node and node.name == "moretrees:date_palm_ffruit_trunk" then
table.insert(female_palms,pos)
elseif node then
table.insert(all_male_palms,pos)
-- In sector 0, all palms are of interest.
-- In other sectors, forget about palms that are too far away.
if sect == 0 then
table.insert(male_palms,pos)
else
local ssq = 0
for _, c in pairs({"x", "z"}) do
local dc = pos[c] - ftpos[c]
ssq = ssq + dc * dc
end
if math.sqrt(ssq) <= r then
table.insert(male_palms,pos)
end
end
end
end
end
-- Update search statistics
local t1us = core.get_us_time()
if t1us < t0us then
-- Wraparound. Assume the search lasted less than 2^32 microseconds (~71 min)
-- (so no need to apply another correction)
t0us = t0us - 2^32
end
sect_search_stats.last_us = t0us
sect_search_stats.last_s = t0s
sect_search_stats.count = sect_search_stats.count + 1
sect_search_stats.sum = sect_search_stats.sum + t1us-t0us
if t1us - t0us < sect_search_stats.min then
sect_search_stats.min = t1us - t0us
end
if t1us - t0us > sect_search_stats.max then
sect_search_stats.max = t1us - t0us
end
return male_palms, female_palms, all_male_palms
end
local function dates_print_search_stats(log)
local stats
if sect_search_stats.count > 0 then
stats = string.format("Male date tree searching stats: searches: %d/%d: average: %d µs (%d..%d)",
sect_search_stats.count, sect_search_stats.count + sect_search_stats.skip,
sect_search_stats.sum/sect_search_stats.count, sect_search_stats.min, sect_search_stats.max)
else
stats = string.format("Male date tree searching stats: searches: 0/0: average: (no searches yet)")
end
if log then
minetest.log("action", "[moretrees] " .. stats)
end
return true, stats
end
minetest.register_chatcommand("dates_stats", {
description = "Print male date palm search statistics",
params = "|chat|log|reset",
privs = { server = true },
func = function(name, param)
param = string.lower(string.trim(param))
if param == "" or param == "chat" then
return dates_print_search_stats(false)
elseif param == "log" then
return dates_print_search_stats(true)
elseif param == "reset" then
reset_sect_search_stats()
return true
else
return false, "Invalid subcommand; expected: '' or 'chat' or 'log' or 'reset'"
end
end,
})
-- Find the female trunk near the female flowers to be pollinated
local function find_female_trunk(fbpos)
local trunks = minetest.find_nodes_in_area({x=fbpos.x-2, y=fbpos.y, z=fbpos.z-2},
{x=fbpos.x+2, y=fbpos.y, z=fbpos.z+2},
"moretrees:date_palm_ffruit_trunk")
local ftpos
local d = 99
for x, pos in pairs(trunks) do
local ssq = 0
for _, c in pairs({"x", "z"}) do
local dc = pos[c] - fbpos[c]
ssq = ssq + dc * dc
end
if math.sqrt(ssq) < d then
ftpos = pos
d = math.sqrt(ssq)
end
end
return ftpos
end
-- Find male blossom near a male trunk,
-- the male blossom must be in range of a specific female blossom as well
local function find_male_blossom_near_trunk(fbpos, mtpos)
local r = moretrees.dates_pollination_distance
local blossoms = minetest.find_nodes_in_area({x=mtpos.x-2, y=mtpos.y, z=mtpos.z-2},
{x=mtpos.x+2, y=mtpos.y, z=mtpos.z+2},
"moretrees:dates_m0")
for x, mbpos in pairs(blossoms) do
local ssq = 0
for _, c in pairs({"x", "z"}) do
local dc = mbpos[c] - fbpos[c]
ssq = ssq + dc * dc
end
if math.sqrt(ssq) <= r then
return mbpos
end
end
end
-- Find a male blossom in range of a specific female blossom,
-- using a nested list of male blossom positions
local function find_male_blossom_in_mpalms(ftpos, fbpos, mpalms)
-- Process the elements of mpalms.sect (index -4 .. 4) in random order
-- First, compute the order in which the sectors will be searched
local sect_index = {}
local sect_rnd = {}
for i = -4,4 do
local n = math.random(1023)
sect_index[n] = i
table.insert(sect_rnd, n)
end
table.sort(sect_rnd)
-- Search the sectors
local sect_old = 0
local sect_time = minetest.get_gametime()
for _, n in pairs(sect_rnd) do
-- Record the oldest sector, so that it can be searched if no male
-- blossoms were found
if not mpalms.sect_time[sect_index[n]] then
sect_old = sect_index[n]
sect_time = 0
elseif mpalms.sect_time[sect_index[n]] < sect_time then
sect_old = sect_index[n]
sect_time = mpalms.sect_time[sect_index[n]]
end
if mpalms.sect[sect_index[n]] and #mpalms.sect[sect_index[n]] then
for px, mtpos in pairs(mpalms.sect[sect_index[n]]) do
local node = minetest.get_node(mtpos)
if node and node.name == "moretrees:date_palm_mfruit_trunk" then
local mbpos = find_male_blossom_near_trunk(fbpos, mtpos)
if mbpos then
return mbpos
end
elseif node and node.name ~= "ignore" then
-- no more male trunk here.
mpalms.sect[sect_index[n]][px] = nil
end
end
end
end
return nil, sect_old
end
-- Find a male blossom in range of a specific female blossom,
-- using the cache associated with the given female trunk
-- If necessary, recompute part of the cache
local last_search_result = {}
local function find_male_blossom_with_ftrunk(fbpos,ftpos)
local meta = minetest.get_meta(ftpos)
local mpalms
local cache_changed = true
-- Load cache. If distance has changed, start with empty cache instead.
local mpalms_dist = meta:get_int("male_palms_dist")
if mpalms_dist and mpalms_dist == moretrees.dates_pollination_distance then
mpalms = meta:get_string("male_palms")
if mpalms and mpalms ~= "" then
mpalms = minetest.deserialize(mpalms)
cache_changed = false
end
end
if not mpalms or not mpalms.sect then
mpalms = {}
mpalms.sect = {}
mpalms.sect_time = {}
meta:set_int("male_palms_dist", moretrees.dates_pollination_distance)
cache_changed = true
end
local fpalms_list
local all_mpalms_list
local sector0_searched = false
-- Always make sure that sector 0 is cached
if not mpalms.sect[0] then
mpalms.sect[0], fpalms_list, all_mpalms_list = find_fruit_trunks_near(ftpos, {x = 0, z = 0})
mpalms.sect_time[0] = minetest.get_gametime()
sector0_searched = true
cache_changed = true
last_search_result.female = fpalms_list
last_search_result.male = all_mpalms_list
end
-- Find male palms
local mbpos, sect_old = find_male_blossom_in_mpalms(ftpos, fbpos, mpalms)
-- If not found, (re)generate the cache for an additional sector. But don't search it yet (for performance reasons)
-- (Use the globally cached results if possible)
if not mbpos and not sector0_searched then
if not mpalms.sect_time[0] or mpalms.sect_time[0] == 0 or math.random(3) == 1 then
-- Higher probability of re-searching the center sector
sect_old = 0
end
-- Use globally cached result if possible
mpalms.sect[sect_old] = nil
if sect_old == 0 and mpalms.sect_time[0] and mpalms.sect_time[0] > 0
and last_search_result.male and #last_search_result.male then
for _, pos in pairs(last_search_result.female) do
if pos.x == ftpos.x and pos.y == ftpos.y and pos.z == ftpos.z then
mpalms.sect[sect_old] = last_search_result.male
-- Next time, don't use the cached result
mpalms.sect_time[sect_old] = nil
cache_changed = true
end
end
end
-- Else do a new search
if not mpalms.sect[sect_old] then
mpalms.sect[sect_old], fpalms_list, all_mpalms_list = find_fruit_trunks_near(ftpos, {x = (sect_old + 4) % 3 - 1, z = (sect_old + 4) / 3 - 1})
cache_changed = true
if sect_old == 0 then
-- Save the results if it is sector 0
-- (chance of reusing results from another sector are smaller)
last_search_result.female = fpalms_list
last_search_result.male = all_mpalms_list
end
if mpalms.sect[sect_old] then
mpalms.sect_time[sect_old] = minetest.get_gametime()
else
mpalms.sect_time[sect_old] = nil
end
end
end
-- Share search results with other female trunks in the same area
-- Note that the list of female trunks doesn't (shouldn't :-) contain the current female trunk.
if fpalms_list and #fpalms_list and #all_mpalms_list then
local all_mpalms = {}
all_mpalms.sect = {}
all_mpalms.sect_time = {}
all_mpalms.sect[0] = all_mpalms_list
-- Don't set sect_time[0], so that the cached sector will be re-searched soon (if necessary)
local all_mpalms_serialized = minetest.serialize(all_mpalms)
for _, pos in pairs(fpalms_list) do
local fmeta = minetest.get_meta(pos)
local fdist = fmeta:get_int("male_palms_dist")
if not fdist or fdist ~= moretrees.dates_pollination_distance then
fmeta:set_string("male_palms", all_mpalms_serialized)
fmeta:set_int("male_palms_dist", moretrees.dates_pollination_distance)
end
end
end
-- Save cache.
if cache_changed then
meta:set_string("male_palms", minetest.serialize(mpalms))
end
return mbpos
end
-- Find a male blossom in range of a specific female blossom
local function find_male_blossom(fbpos)
local ftpos = find_female_trunk(fbpos)
if ftpos then
return find_male_blossom_with_ftrunk(fbpos, ftpos)
end
return nil
end
-- Growing function for dates
local dates_growfn = function(pos, elapsed)
local node = minetest.get_node(pos)
local delay = moretrees.dates_grow_interval
local r = moretrees.dates_pollination_distance
local action
if not node then
return
elseif not moretrees.dates_regrow_pollinated and dates_regrow_prob == 0 then
-- Regrowing of dates is disabled.
if string.find(node.name, "moretrees:dates_f") then
minetest.swap_node(pos, {name="moretrees:dates_f4"})
elseif string.find(node.name, "moretrees:dates_m") then
minetest.swap_node(pos, {name="moretrees:dates_n"})
else
minetest.swap_node(pos, biome_lib.air)
end
return
elseif node.name == "moretrees:dates_f0" and math.random(100) <= 100 * dates_regrow_prob then
-- Dates grow unpollinated
minetest.swap_node(pos, {name="moretrees:dates_f1"})
action = "nopollinate"
elseif node.name == "moretrees:dates_f0" and moretrees.dates_regrow_pollinated and find_male_blossom(pos) then
-- Pollinate flowers
minetest.swap_node(pos, {name="moretrees:dates_f1"})
action = "pollinate"
elseif string.match(node.name, "0$") then
-- Make female unpollinated and male flowers last a bit longer
if math.random(flowers_wither_ichance) == 1 then
if node.name == "moretrees:dates_f0" then
minetest.swap_node(pos, {name="moretrees:dates_fn"})
else
minetest.swap_node(pos, {name="moretrees:dates_n"})
end
action = "wither"
else
action = "nowither"
end
elseif node.name == "moretrees:dates_f4" then
-- Remove dates, and optionally drop them as items
if math.random(dates_drop_ichance) == 1 then
if moretrees.dates_item_drop_ichance > 0 and math.random(moretrees.dates_item_drop_ichance) == 1 then
local items = minetest.get_node_drops(minetest.get_node(pos).name)
for _, itemname in pairs(items) do
minetest.add_item(pos, itemname)
end
end
minetest.swap_node(pos, {name="moretrees:dates_n"})
action = "drop"
else
action = "nodrop"
end
elseif string.match(node.name, "n$") then
-- Remove stems.
if math.random(stems_drop_ichance) == 1 then
minetest.swap_node(pos, biome_lib.air)
return "stemdrop"
end
action = "nostemdrop"
else
-- Grow dates
local offset = 18
local n = string.sub(node.name, offset)
minetest.swap_node(pos, {name=string.sub(node.name, 1, offset-1)..n+1})
action = "grow"
end
-- Don't catch up when elapsed time is large. Regular visits are needed for growth...
local timer = minetest.get_node_timer(pos)
timer:start(delay + math.random(moretrees.dates_grow_interval))
return action
end
-- Alternate growth function for dates.
-- It calls the primary growth function, but also measures CPU time consumed.
-- Use this function to analyze date growing performance.
local stat = {}
stat.count = 0
local dates_growfn_profiling = function(pos, elapsed)
local t0 = core.get_us_time()
local action = dates_growfn(pos, elapsed)
local t1 = core.get_us_time()
if t1 < t0 then
t1 = t1 + 2^32
end
stat.count = stat.count + 1
if not stat[action] then
stat[action] = {}
stat[action].count = 0
stat[action].sum = 0
stat[action].min = 9999999999
stat[action].max = 0
end
stat[action].count = stat[action].count + 1
stat[action].sum = stat[action].sum + t1-t0
if t1-t0 < stat[action].min then
stat[action].min = t1-t0
end
if t1-t0 > stat[action].max then
stat[action].max = t1-t0
end
if stat.count % 10 == 0 then
io.write(".")
io.flush()
end
if stat.count % 100 == 0 then
print(string.format("Date grow statistics %5d:", stat.count))
local sum = 0
local count = 0
if sect_search_stats.count > 0 and stat.pollinate and stat.pollinate.count > 0 then
print(string.format("\t%-12s: %6d (%4.1f%%): %6dus (%d..%d)",
"search", sect_search_stats.count,
100*sect_search_stats.count/stat.pollinate.count,
sect_search_stats.sum/sect_search_stats.count,
sect_search_stats.min, sect_search_stats.max))
else
print(string.format("\t%-12s: %6d (%4.1f%%): %6dus (%d..%d)",
"search", sect_search_stats.count,
0, 0, 0, 0))
end
for action,data in pairs(stat) do
if action ~= "count" then
count = count + data.count
sum = sum + data.sum
print(string.format("\t%-12s: %6d (%4.1f%%): %6dus (%d..%d)",
action, data.count,
100*data.count/stat.count, data.sum/data.count,
data.min, data.max))
end
end
print(string.format("\t%-12s: %6d ( 100%%): %6dus",
"TOTAL", count, sum/count))
end
end
-- Register dates
local dates_starttimer = function(pos, elapsed)
local timer = minetest.get_node_timer(pos)
local base_interval = moretrees.dates_grow_interval * 2 / 3
timer:set(base_interval + math.random(base_interval), elapsed or 0)
end
local dates_drop = {
items = {
{items = { "moretrees:date" }},
{items = { "moretrees:date" }},
{items = { "moretrees:date" }},
{items = { "moretrees:date" }},
{items = { "moretrees:date" }, rarity = 2 },
{items = { "moretrees:date" }, rarity = 2 },
{items = { "moretrees:date" }, rarity = 2 },
{items = { "moretrees:date" }, rarity = 2 },
{items = { "moretrees:date" }, rarity = 5 },
{items = { "moretrees:date" }, rarity = 5 },
{items = { "moretrees:date" }, rarity = 5 },
{items = { "moretrees:date" }, rarity = 5 },
{items = { "moretrees:date" }, rarity = 20 },
{items = { "moretrees:date" }, rarity = 20 },
{items = { "moretrees:date" }, rarity = 20 },
{items = { "moretrees:date" }, rarity = 20 },
}
}
for _,suffix in ipairs({"f0", "f1", "f2", "f3", "f4", "m0", "fn", "n"}) do
local name
if suffix == "f0" or suffix == "m0" then
name = S("Date Flowers")
elseif suffix == "n" or suffix == "fn" then
name = S("Date Stem")
else
name = S("Dates")
end
local dropfn = suffix == "f4" and dates_drop or ""
local datedef = {
description = name,
tiles = {"moretrees_dates_"..suffix..".png"},
visual_scale = 2,
drawtype = "plantlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = { fleshy=3, dig_immediate=3, flammable=2, moretrees_dates=1 },
inventory_image = "moretrees_dates_"..suffix..".png^[transformR0",
wield_image = "moretrees_dates_"..suffix..".png^[transformR90",
sounds = default.node_sound_defaults(),
drop = dropfn,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.3, -0.3, 0.3, 3.5, 0.3}
},
on_timer = dates_growfn,
on_construct = (moretrees.dates_regrow_pollinated or moretrees.dates_regrow_unpollinated_percent > 0)
and dates_starttimer,
}
minetest.register_node("moretrees:dates_"..suffix, datedef)
end
-- If regrowing was previously disabled, but is enabled now, make sure timers are started for existing dates
if moretrees.dates_regrow_pollinated or moretrees.dates_regrow_unpollinated_percent > 0 then
local spec = {
name = "moretrees:restart_dates_regrow_timer",
nodenames = "group:moretrees_dates",
action = function(pos, node, active_object_count, active_object_count_wider)
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
dates_starttimer(pos)
else
local timeout = timer:get_timeout()
local elapsed = timer:get_elapsed()
if timeout - elapsed > moretrees.dates_grow_interval * 4/3 then
dates_starttimer(pos, math.random(moretrees.dates_grow_interval * 4/3))
end
end
end,
}
if minetest.register_lbm then
minetest.register_lbm(spec)
else
spec.interval = 3557
spec.chance = 10
minetest.register_abm(spec)
end
end

69
default_settings.txt Normal file → Executable file
View File

@ -6,23 +6,21 @@ moretrees.enable_apple_tree = true
moretrees.enable_oak = true moretrees.enable_oak = true
moretrees.enable_sequoia = true moretrees.enable_sequoia = true
moretrees.enable_palm = true moretrees.enable_palm = true
moretrees.enable_date_palm = true
moretrees.enable_cedar = true moretrees.enable_cedar = true
moretrees.enable_rubber_tree = true moretrees.enable_rubber_tree = true
moretrees.enable_willow = true moretrees.enable_willow = true
moretrees.enable_acacia = true
moretrees.enable_birch = true moretrees.enable_birch = true
moretrees.enable_spruce = true moretrees.enable_spruce = true
moretrees.enable_jungle_tree = true moretrees.enable_jungle_tree = true
moretrees.enable_fir = true moretrees.enable_fir = true
moretrees.enable_poplar = true
moretrees.enable_beech = false moretrees.enable_beech = false
-- set this to true to make moretrees spawn saplings at mapgen time instead -- set this to true to make moretrees spawn saplings at mapgen time instead
-- of fully-grown trees, which will grow into full trees after a very short -- of fully-grown trees, which will grow into full trees after a very short
-- delay. This reduces mapgen lag in some situations, and fixes situations -- delay. This reduces mapgen lag in some situations.
-- where the mapgen conflicts with the tree generator.
moretrees.spawn_saplings = true moretrees.spawn_saplings = false
-- Set this to true to allow defining stairs/slabs/etc. If Moreblocks is -- Set this to true to allow defining stairs/slabs/etc. If Moreblocks is
-- installed, this will use that mod's Stairs Plus component. Otherwise, it -- installed, this will use that mod's Stairs Plus component. Otherwise, it
@ -59,67 +57,6 @@ moretrees.firs_remove_default_trees = false
moretrees.firs_remove_interval = 2 moretrees.firs_remove_interval = 2
moretrees.firs_remove_chance = 150 moretrees.firs_remove_chance = 150
-- Cocos palm settings
moretrees.coconuts_regrow = true
moretrees.coconuts_convert_existing_palms = true -- Converting existing palm trees will make coconuts regrow on them as well
-- Else, they will only regrow on newly-spawned palms
-- However, conversion is not an exact science, and although an attempt is
-- made to detect whether a trunk belongs to an actual palm, some coconut trunks
-- and some coconuts may be incorrectly converted.
moretrees.coconut_flower_interval = 59
moretrees.coconut_flower_chance = 67
moretrees.coconut_grow_interval = 2 * moretrees.coconut_flower_interval * moretrees.coconut_flower_chance
-- Actual interval will randomly vary between 67% and 133% of this value
-- 2 * 59 * 67 ~ 2 hours. So flowers become coconuts in about 6 hours
moretrees.coconut_item_drop_ichance = 10 -- inverse probability of ripe coconuts dropping as items (instead of disappearing)
-- Date palm settings
-- Suggested configuration alternatives:
-- - Dates grow only when pollinated:
-- - Set dates_regrow_pollinated to true
-- - Set dates_regrow_unpollinated_percent to 0
-- - Dates grow without pollination. Pollination disabled:
-- - Set dates_regrow_pollinated to false
-- - Set dates_regrow_unpollinated_percent to some larger positive value, e.g. 95
-- - Dates grow, but more and faster if male flowers are nearby
-- - Set dates_regrow_pollinated to true
-- - Set dates_regrow_unpollinated_percent to some small positive value, e.g. 33
-- - Optional but recommended: Reduce the pollination distance, e.g. to 30
-- Note that it should not be necessary to disable pollination for performance
-- reasons. A lot of effort has gone into ensuring that date growing will not cause lag.
--
-- If lag is suspected, use the chat command '/dates_stats' to obtain the male dates
-- search time, as well as the counts of total number of searches requested and the
-- number of searches actually performed.
moretrees.dates_regrow_pollinated = true -- Enable pollination. If enabled, male trees are required for dates to grow.
-- If disabled, dates_regrow_unpollinated_percent must be non-zero for dates to regrow.
moretrees.dates_regrow_unpollinated_percent = 0 -- Percentage of female dates becoming dates without being pollinated.
-- If 0, dates_regrow_pollinated must be enabled for dates to grow.
moretrees.dates_female_percent = 57 -- Ratio of female to male trees - tune this to improve # of generated trees that actually bear fruit
-- ~57% gives near optimal results for groups of 3 random trees, while it is only slightly suboptimal
-- for groups of 2 and 4 random trees (~2% less fruit than optimal).
-- Optimal values per group size: 2: 50%, 3: 57.78%, 4: 63%, 5: 66.9%, 6: 69.9%, [...], 12: 79.8%
-- So 57% is optimal for small groups of trees. As larger groups have more female palms anyway, a
-- less than optimal proportion of female to male trees is not a problem.
moretrees.dates_pollination_distance = 120
moretrees.dates_blossom_search_time_treshold = 1000 -- If average male blossom search time (in microseconds) exceeds this, start limiting the search load.
moretrees.dates_blossom_search_iload = 10 -- Inverse fraction of CPU time that male blossom searching search may consume.
-- As searching a large area (radius: dates_pollination_distance/3 per attempt) can cause lag,
-- this limits the search frequency server-wide so that the impact on server lag is minimised
-- For personal servers, this can be set lower, or even to 1 or 0 (0 disables load limiting).
-- Obtain the current average search time using /dates_stats
moretrees.dates_flower_interval = 59
moretrees.dates_flower_chance = 181
moretrees.dates_grow_interval = 2 * moretrees.dates_flower_interval * moretrees.dates_flower_chance
-- As date palms have a high yield, don't grow dates too fast
-- The actual interval will vary randomly between 67% and 133% of this value.
-- 2 * 59 * 181 ~ 6 hours. So by default flowers become dates in about one (human) day.
moretrees.dates_item_drop_ichance = 10 -- inverse probability of ripe dates dropping as items (instead of disappearing)
-- Sapling settings -- Sapling settings
moretrees.sapling_interval = 500 moretrees.sapling_interval = 500

2
depends.txt Normal file → Executable file
View File

@ -1,8 +1,6 @@
default default
biome_lib biome_lib
vessels
stairs? stairs?
moreblocks? moreblocks?
intllib? intllib?
farming?

63
init.lua Normal file → Executable file
View File

@ -8,10 +8,12 @@
-- Brought together into one mod and made L-systems compatible by Vanessa -- Brought together into one mod and made L-systems compatible by Vanessa
-- Ezekowitz. -- Ezekowitz.
-- --
-- Firs and Jungle tree axioms/rules by Vanessa Dannenberg, with the -- Firs and Jungle tree axioms/rules by Vanessa Ezekowitz, with the
-- latter having been tweaked by RealBadAngel, most other axioms/rules written -- latter having been tweaked by RealBadAngel, most other axioms/rules written
-- by RealBadAngel. -- by RealBadAngel.
-- --
-- License: WTFPL for all parts (code and textures, including those copied
-- from the the old jungletree and conifers mods).
moretrees = {} moretrees = {}
@ -49,8 +51,7 @@ end
-- infinite stacks checking -- infinite stacks checking
if minetest.get_modpath("unified_inventory") or not if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then
minetest.settings:get_bool("creative_mode") then
moretrees.expect_infinite_stacks = false moretrees.expect_infinite_stacks = false
else else
moretrees.expect_infinite_stacks = true moretrees.expect_infinite_stacks = true
@ -63,17 +64,16 @@ moretrees.cutting_tools = {
"default:axe_diamond", "default:axe_diamond",
"default:axe_mese", "default:axe_mese",
"default:axe_steel", "default:axe_steel",
"glooptest:axe_alatro", -- "glooptest:axe_alatro",
"glooptest:axe_arol", -- "glooptest:axe_arol",
"moreores:axe_mithril", "default:axe_mithril",
"moreores:axe_silver", "default:axe_silver",
"titanium:axe", -- "titanium:axe",
} }
-- Cutting tools disabled. They are unknown //MFF(Mg|08/09/15)
dofile(modpath.."/tree_models.lua") dofile(modpath.."/tree_models.lua")
dofile(modpath.."/node_defs.lua") dofile(modpath.."/node_defs.lua")
dofile(modpath.."/date_palm.lua")
dofile(modpath.."/cocos_palm.lua")
dofile(modpath.."/biome_defs.lua") dofile(modpath.."/biome_defs.lua")
dofile(modpath.."/saplings.lua") dofile(modpath.."/saplings.lua")
dofile(modpath.."/crafts.lua") dofile(modpath.."/crafts.lua")
@ -86,34 +86,30 @@ if moretrees.spawn_saplings then
moretrees.spawn_oak_object = "moretrees:oak_sapling_ongen" moretrees.spawn_oak_object = "moretrees:oak_sapling_ongen"
moretrees.spawn_sequoia_object = "moretrees:sequoia_sapling_ongen" moretrees.spawn_sequoia_object = "moretrees:sequoia_sapling_ongen"
moretrees.spawn_palm_object = "moretrees:palm_sapling_ongen" moretrees.spawn_palm_object = "moretrees:palm_sapling_ongen"
moretrees.spawn_date_palm_object = "moretrees:date_palm_sapling_ongen"
moretrees.spawn_cedar_object = "moretrees:cedar_sapling_ongen" moretrees.spawn_cedar_object = "moretrees:cedar_sapling_ongen"
moretrees.spawn_rubber_tree_object = "moretrees:rubber_tree_sapling_ongen" moretrees.spawn_rubber_tree_object = "moretrees:rubber_tree_sapling_ongen"
moretrees.spawn_willow_object = "moretrees:willow_sapling_ongen" moretrees.spawn_willow_object = "moretrees:willow_sapling_ongen"
moretrees.spawn_acacia_object = "moretrees:acacia_sapling_ongen"
moretrees.spawn_birch_object = "moretrees:birch_sapling_ongen" moretrees.spawn_birch_object = "moretrees:birch_sapling_ongen"
moretrees.spawn_spruce_object = "moretrees:spruce_sapling_ongen" moretrees.spawn_spruce_object = "moretrees:spruce_sapling_ongen"
moretrees.spawn_jungletree_object = "moretrees:jungletree_sapling_ongen" moretrees.spawn_jungletree_object = "moretrees:jungletree_sapling_ongen"
moretrees.spawn_fir_object = "moretrees:fir_sapling_ongen" moretrees.spawn_fir_object = "moretrees:fir_sapling_ongen"
moretrees.spawn_fir_snow_object = "snow:sapling_pine" moretrees.spawn_fir_snow_object = "snow:sapling_pine"
moretrees.spawn_poplar_object = "moretrees:poplar_sapling_ongen"
moretrees.spawn_poplar_small_object = "moretrees:poplar_small_sapling_ongen"
else else
moretrees.spawn_beech_object = moretrees.beech_model moretrees.spawn_beech_object = moretrees.beech_model
moretrees.spawn_apple_tree_object = moretrees.apple_tree_model moretrees.spawn_apple_tree_object = moretrees.apple_tree_model
moretrees.spawn_oak_object = moretrees.oak_model moretrees.spawn_oak_object = moretrees.oak_model
moretrees.spawn_sequoia_object = moretrees.sequoia_model moretrees.spawn_sequoia_object = moretrees.sequoia_model
moretrees.spawn_palm_object = moretrees.palm_model moretrees.spawn_palm_object = moretrees.palm_model
moretrees.spawn_date_palm_object = moretrees.date_palm_model
moretrees.spawn_cedar_object = moretrees.cedar_model moretrees.spawn_cedar_object = moretrees.cedar_model
moretrees.spawn_rubber_tree_object = moretrees.rubber_tree_model moretrees.spawn_rubber_tree_object = moretrees.rubber_tree_model
moretrees.spawn_willow_object = moretrees.willow_model moretrees.spawn_willow_object = moretrees.willow_model
moretrees.spawn_acacia_object = moretrees.acacia_model
moretrees.spawn_birch_object = "moretrees.grow_birch" moretrees.spawn_birch_object = "moretrees.grow_birch"
moretrees.spawn_spruce_object = "moretrees.grow_spruce" moretrees.spawn_spruce_object = "moretrees.grow_spruce"
moretrees.spawn_jungletree_object = "moretrees.grow_jungletree" moretrees.spawn_jungletree_object = "moretrees.grow_jungletree"
moretrees.spawn_fir_object = "moretrees.grow_fir" moretrees.spawn_fir_object = "moretrees.grow_fir"
moretrees.spawn_fir_snow_object = "moretrees.grow_fir_snow" moretrees.spawn_fir_snow_object = "moretrees.grow_fir_snow"
moretrees.spawn_poplar_object = moretrees.poplar_model
moretrees.spawn_poplar_small_object = moretrees.poplar_small_model
end end
if moretrees.enable_beech then if moretrees.enable_beech then
@ -136,11 +132,6 @@ if moretrees.enable_palm then
biome_lib:register_generate_plant(moretrees.palm_biome, moretrees.spawn_palm_object) biome_lib:register_generate_plant(moretrees.palm_biome, moretrees.spawn_palm_object)
end end
if moretrees.enable_date_palm then
biome_lib:register_generate_plant(moretrees.date_palm_biome, moretrees.spawn_date_palm_object)
biome_lib:register_generate_plant(moretrees.date_palm_biome_2, moretrees.spawn_date_palm_object)
end
if moretrees.enable_cedar then if moretrees.enable_cedar then
biome_lib:register_generate_plant(moretrees.cedar_biome, moretrees.spawn_cedar_object) biome_lib:register_generate_plant(moretrees.cedar_biome, moretrees.spawn_cedar_object)
end end
@ -153,6 +144,10 @@ if moretrees.enable_willow then
biome_lib:register_generate_plant(moretrees.willow_biome, moretrees.spawn_willow_object) biome_lib:register_generate_plant(moretrees.willow_biome, moretrees.spawn_willow_object)
end end
if moretrees.enable_acacia then
biome_lib:register_generate_plant(moretrees.acacia_biome, moretrees.spawn_acacia_object)
end
if moretrees.enable_birch then if moretrees.enable_birch then
biome_lib:register_generate_plant(moretrees.birch_biome, moretrees.spawn_birch_object) biome_lib:register_generate_plant(moretrees.birch_biome, moretrees.spawn_birch_object)
end end
@ -172,18 +167,10 @@ if moretrees.enable_fir then
end end
end end
if moretrees.enable_poplar then
biome_lib:register_generate_plant(moretrees.poplar_biome, moretrees.spawn_poplar_object)
biome_lib:register_generate_plant(moretrees.poplar_biome_2, moretrees.spawn_poplar_object)
biome_lib:register_generate_plant(moretrees.poplar_biome_3, moretrees.spawn_poplar_object)
biome_lib:register_generate_plant(moretrees.poplar_small_biome, moretrees.spawn_poplar_small_object)
biome_lib:register_generate_plant(moretrees.poplar_small_biome_2, moretrees.spawn_poplar_small_object)
end
-- Code to spawn a birch tree -- Code to spawn a birch tree
function moretrees.grow_birch(pos) function moretrees.grow_birch(pos)
minetest.swap_node(pos, biome_lib.air) minetest.remove_node(pos)
if math.random(1,2) == 1 then if math.random(1,2) == 1 then
minetest.spawn_tree(pos, moretrees.birch_model1) minetest.spawn_tree(pos, moretrees.birch_model1)
else else
@ -194,7 +181,7 @@ end
-- Code to spawn a spruce tree -- Code to spawn a spruce tree
function moretrees.grow_spruce(pos) function moretrees.grow_spruce(pos)
minetest.swap_node(pos, biome_lib.air) minetest.remove_node(pos)
if math.random(1,2) == 1 then if math.random(1,2) == 1 then
minetest.spawn_tree(pos, moretrees.spruce_model1) minetest.spawn_tree(pos, moretrees.spruce_model1)
else else
@ -248,10 +235,10 @@ function moretrees.grow_jungletree(pos)
moretrees.jungletree_model.rules_b = moretrees.jt_rules_b2 moretrees.jungletree_model.rules_b = moretrees.jt_rules_b2
end end
minetest.swap_node(pos, biome_lib.air) minetest.remove_node(pos)
local leaves = minetest.find_nodes_in_area({x = pos.x-1, y = pos.y, z = pos.z-1}, {x = pos.x+1, y = pos.y+10, z = pos.z+1}, "default:leaves") local leaves = minetest.find_nodes_in_area({x = pos.x-1, y = pos.y, z = pos.z-1}, {x = pos.x+1, y = pos.y+10, z = pos.z+1}, "default:leaves")
for leaf in ipairs(leaves) do for leaf in ipairs(leaves) do
minetest.swap_node(leaves[leaf], biome_lib.air) minetest.remove_node(leaves[leaf])
end end
minetest.spawn_tree(pos, moretrees.jungletree_model) minetest.spawn_tree(pos, moretrees.jungletree_model)
end end
@ -275,10 +262,10 @@ function moretrees.grow_fir(pos)
moretrees.fir_model.iterations = 7 moretrees.fir_model.iterations = 7
moretrees.fir_model.random_level = 5 moretrees.fir_model.random_level = 5
minetest.swap_node(pos, biome_lib.air) minetest.remove_node(pos)
local leaves = minetest.find_nodes_in_area({x = pos.x, y = pos.y, z = pos.z}, {x = pos.x, y = pos.y+5, z = pos.z}, "default:leaves") local leaves = minetest.find_nodes_in_area({x = pos.x, y = pos.y, z = pos.z}, {x = pos.x, y = pos.y+5, z = pos.z}, "default:leaves")
for leaf in ipairs(leaves) do for leaf in ipairs(leaves) do
minetest.swap_node(leaves[leaf], biome_lib.air) minetest.remove_node(leaves[leaf])
end end
minetest.spawn_tree(pos,moretrees.fir_model) minetest.spawn_tree(pos,moretrees.fir_model)
end end
@ -302,12 +289,12 @@ function moretrees.grow_fir_snow(pos)
moretrees.fir_model.iterations = 2 moretrees.fir_model.iterations = 2
moretrees.fir_model.random_level = 2 moretrees.fir_model.random_level = 2
minetest.swap_node(pos, biome_lib.air) minetest.remove_node(pos)
local leaves = minetest.find_nodes_in_area({x = pos.x, y = pos.y, z = pos.z}, {x = pos.x, y = pos.y+5, z = pos.z}, "default:leaves") local leaves = minetest.find_nodes_in_area({x = pos.x, y = pos.y, z = pos.z}, {x = pos.x, y = pos.y+5, z = pos.z}, "default:leaves")
for leaf in ipairs(leaves) do for leaf in ipairs(leaves) do
minetest.swap_node(leaves[leaf], biome_lib.air) minetest.remove_node(leaves[leaf])
end end
minetest.spawn_tree(pos,moretrees.fir_model) minetest.spawn_tree(pos,moretrees.fir_model)
end end
print(S("[Moretrees] Loaded (2013-02-11)")) minetest.log("action", S("[Moretrees] Loaded (2013-02-11)"))

0
locale/de.txt Normal file → Executable file
View File

View File

@ -1,100 +0,0 @@
# Traducido por Carlos Barraza
### crafts.lua ###
Coconut Milk = Leche de Coco
Raw Coconut = Coco crudo
Acorn Muffin batter = Masa de Mollete de Bellota
Acorn Muffin = Mollete de Bellota
Roasted Spruce Cone Nuts = Cono de Picea Tostado
Roasted Pine Cone Nuts = Cono de Pino Tostado
Roasted Fir Cone Nuts = Cono de Abeto Tostado
Roasted Cedar Cone Nuts = Coco de Alamo Tostado
Date = Datilera
Date & nut snack = Datilera y Nueces
Date-nut cake batter = Pasta de torta de Datilera
Date-nut cake = Pastel de Datilera
Date-nut energy bar = Barra energetica de Datilera
### date_palm.lua ###
Dates = Datilera
Date Stem = Tallo de Datilera
Date Flowers = Flores de Datilera
### node_defs.lua ###
Beech Tree Trunk = Tronco de Arbol de Haya
Apple Tree Trunk = Tronco de Arbol de Manzana
Oak Tree Trunk = Tronco de Arbol de Roble
Giant Sequoia Trunk = Tronco de Sequoia Gigante
Birch Tree Trunk = Tronco de Arbol de Abedul
Palm Tree Trunk = Tronco de Palmera
Spruce Tree Trunk = Tronco de Arbol de Abeto
Willow Tree Trunk = Tronco de Arbol de Sauce
Rubber Tree Trunk = Tronco de Arbol de Arbol de Goma
Jungle Tree = Tronco de Arbol de Arbol de la Selva
Douglas Fir Trunk = Tronco de Arbol de Abeto de Douglas
Cedar Tree Trunk = Tronco de Arbol de Cedro
Date Palm Tree Trunk = Tronco de Palmera Datilera
Acacia Tree Trunk = Tronco de Arbol de Acacia
Poplar Tree Trunk = Tronco de Arbol de Alamo
Beech Tree Planks = Madera de Arbol de Haya
Apple Tree Planks = Madera de Arbol de Manzana
Oak Tree Planks = Madera de Arbol de Roble
Giant Sequoia Planks = Madera de Sequoia Gigante
Birch Tree Planks = Madera de Arbol de Abedul
Palm Tree Planks = Madera de Palmera
Spruce Tree Planks = Madera de Arbol de Abeto
Willow Tree Planks = Madera de Arbol de Sauce
Rubber Tree Planks = Madera de Arbol de Arbol de Goma
Jungle Planks = Madera de Arbol de Arbol de la Selva
Douglas Fir Planks = Madera de Arbol de Abeto de Douglas
Cedar Tree Planks = Madera de Arbol de Cedro
Date Palm Tree Planks = Madera de Palmera Datilera
Acacia Tree Planks = Madera de Arbol de Acacia
Poplar Tree Planks = Madera de Arbol de Alamo
Beech Tree Sapling = Retoño de Arbol de Haya
Apple Tree Sapling = Retoño de Arbol de Manzana
Oak Tree Sapling = Retoño de Arbol de Roble
Giant Sequoia Sapling = Retoño de Arbol de Sequoia Gigante
Birch Tree Sapling = Retoño de Arbol de Abedul
Palm Tree Sapling = Retoño de Palmera
Spruce Tree Sapling = Retoño de Arbol de Abeto
Willow Tree Sapling = Retoño de Arbol de Sauce
Rubber Tree Sapling = Retoño de Arbol de Arbol de Goma
Jungle Sapling = Retoño de Arbol de Arbol de la Selva
Douglas Fir Sapling = Retoño de Arbol de Abeto de Douglas
Cedar Tree Sapling = Retoño de Arbol de Cedro
Date Palm Tree Tree Sapling = Retoño de Palmera Datilera
Acacia Tree Sapling = Retoño de Arbol de Acacia
Poplar Tree Sapling = Retoño de Arbol de Alamo
Beech Tree Leaves = Hojas de Arbol de Haya
Apple Tree Leaves = Hojas de Arbol de Manzana
Oak Tree Leaves = Hojas de Arbol de Roble
Giant Sequoia Leaves = Hojas de Sequoia Gigante
Birch Tree Leaves = Hojas de Arbol de Abedul
Palm Tree Leaves = Hojas de Palmera
Spruce Tree Leaves = Hojas de Arbol de Abeto
Willow Tree Leaves = Hojas de Arbol de Sauce
Rubber Tree Leaves = Hojas de Arbol de Arbol de Goma
Jungle Leaves = Hojas de Arbol de Arbol de la Selva
Douglas Fir Leaves = Hojas de Arbol de Abeto de Douglas
Cedar Tree Leaves = Hojas de Arbol de Cedro
Date Palm Tree Tree Leaves = Hojas de Palmera Datilera
Acacia Tree Leaves = Hojas de Arbol de Acacia
Poplar Tree Leaves = Hojas de Arbol de Alamo
Acorn = Bellota
Coconut = Coco
Spruce Cone = Coco de Picea
Pine Cone = Coco de Pino
Fir Cone = Coco de Abeto
Cedar Cone = Coco de Alamo
Jungle Sapling = Retoño de Arbol de la Selva
Jungle Tree Leaves (Yellow) = Hojas de Arbol de la Selva (Amarilla)
Jungle Tree Leaves (Red) = Hojas de Arbol de la Selva (Roja)
Douglas Fir Leaves (Bright) = Hojas de Arbol de Abeto de Douglas (Brillante)
Rubber Tree Trunk (Empty) = Tronco de Arbol de Goma (Vacio)
[Moretrees] Loaded (2013-02-11) = [Masarboles] Cargado

View File

@ -1,74 +0,0 @@
# Traduction par Yoan31
#
### crafts.lua ###
Coconut Milk = Lait de Coco
Raw Coconut = Noix de Coco Crue
Acorn Muffin batter = Pate à Muffins au Gland
Acorn Muffin = Muffins au Gland
Roasted Spruce Cone Nuts = Noix de Cône de Sapin Roties
Roasted Pine Cone Nuts = Noix de Pomme de pin Roties
Roasted Fir Cone Nuts = Noix de Cône de Sapin Roties
### node_defs.lua ###
Beech Tree Trunk = Tronc d'Arbre de Hêtre
Apple Tree Trunk = Tronc d'Arbre de Pommier
Oak Tree Trunk = Tronc d'Arbre de chêne
Giant Sequoia Trunk = Tronc d'Arbre de Séquoia Géant
Birch Tree Trunk = Tronc d'Arbre de bouleau
Palm Tree Trunk = Tronc d'Arbre de Palmier
Spruce Tree Trunk = Tronc d'Arbre d'Epicéa
Pine Tree Trunk = Tronc d'Arbre de Pin
Willow Tree Trunk = Tronc d'Arbre de Saule
Rubber Tree Trunk = Tronc d'Arbre a Caoutchouc
Jungle Tree Trunk = Tronc d'Arbre de la Jungle
Douglas Fir Trunk = Tronc de Sapin de Douglas
Beech Tree Planks = Planches de Hêtre
Apple Tree Planks = Planches de Pommier
Oak Tree Planks = Planches de Chêne
Giant Sequoia Planks = Planches de d'Arbre de Séquoia Géant
Birch Tree Planks = Planches d'Arbre de bouleau
Palm Tree Planks = Planches d'Arbre de Palmier
Spruce Tree Planks = Planches d'Arbre d'Epicéa
Pine Tree Planks = Planches d'Arbre de Pin
Willow Tree Planks = Planches d'Arbre de Saule
Rubber Tree Planks = Planches d'Arbre a Caoutchouc
Jungle Tree Planks = Planches d'Arbre de la Jungle
Douglas Fir Planks = Planches de Sapin de Douglas
Beech Tree Sapling = Pousse d'Arbre de Hêtre
Apple Tree Sapling = Pousse d'Arbre de Pommier
Oak Tree Sapling = Pousse d'Arbre de chêne
Giant Sequoia Sapling = Pousse d'Arbre de Séquoia Géant
Birch Tree Sapling = Pousse d'Arbre de bouleau
Palm Tree Sapling = Pousse d'Arbre de Palmier
Spruce Tree Sapling = Pousse d'Arbre d'Epicéa
Pine Tree Sapling = Pousse d'Arbre de Pin
Willow Tree Sapling = Pousse d'Arbre de Saule
Rubber Tree Sapling = Pousse d'Arbre a Caoutchouc
Jungle Tree Sapling = Pousse d'Arbre de la Jungle
Douglas Fir Sapling = Pousse de Sapin de Douglas
Beech Tree Leaves = Feuilles d'Arbre de Hêtre
Apple Tree Leaves = Feuilles d'Arbre de Pommier
Oak Tree Leaves = Feuilles d'Arbre de chêne
Giant Sequoia Leaves = Feuilles d'Arbre de Séquoia Géant
Birch Tree Leaves = Feuilles d'Arbre de bouleau
Palm Tree Leaves = Feuilles d'Arbre de Palmier
Spruce Tree Leaves = Feuilles d'Arbre d'Epicéa
Pine Tree Leaves = Feuilles d'Arbre de Pin
Willow Tree Leaves = Feuilles d'Arbre de Saule
Rubber Tree Leaves = Feuilles d'Arbre a Caoutchouc
Jungle Tree Leaves = Feuilles d'Arbre de la Jungle
Douglas Fir Leaves = Feuilles de Sapin de Douglas
Acorn = Gland
Coconut = Noix de Coco
Spruce Cone = Cône de Sapin
Pine Cone = Pomme de Pin
Fir Cone = Pomme de Sapin
Jungle Sapling = Pousse d'Arbre de la Jungle
Jungle Tree Leaves (Yellow) = Feuille d'Arbre de la Jungle (Jaune)
Jungle Tree Leaves (Red) = Feuille d'Arbre de la Jungle (Rouge)
Douglas Fir Leaves (Bright) = Feuille de Sapin de Douglas (Brillant)
Rubber Tree Trunk (Empty) = Tronc d'Arbre en Caoutchouc (Vide)
[Moretrees] Loaded (2013-02-11) =

0
locale/template.txt Normal file → Executable file
View File

163
node_defs.lua Normal file → Executable file
View File

@ -8,16 +8,15 @@ moretrees.treelist = {
{"oak", "Oak Tree", "acorn", "Acorn", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, {"oak", "Oak Tree", "acorn", "Acorn", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
{"sequoia", "Giant Sequoia"}, {"sequoia", "Giant Sequoia"},
{"birch", "Birch Tree"}, {"birch", "Birch Tree"},
{"palm", "Palm Tree", "palm_fruit_trunk_gen", "Palm Tree", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 1.0 }, {"palm", "Palm Tree", "coconut", "Coconut", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 1.0 },
{"date_palm", "Date Palm Tree", "date_palm_fruit_trunk", "Date Palm Tree", {0, 0, 0, 0, 0, 0}, 0.0 },
{"spruce", "Spruce Tree", "spruce_cone", "Spruce Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, {"spruce", "Spruce Tree", "spruce_cone", "Spruce Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
{"cedar", "Cedar Tree", "cedar_cone", "Cedar Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, {"cedar", "Cedar Tree", "cedar_cone", "Cedar Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
{"poplar", "Poplar Tree"},
{"poplar_small", "Poplar Tree"},
{"willow", "Willow Tree"}, {"willow", "Willow Tree"},
{"rubber_tree", "Rubber Tree"}, {"rubber_tree", "Rubber Tree"},
{"fir", "Douglas Fir", "fir_cone", "Fir Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 }, {"fir", "Douglas Fir", "fir_cone", "Fir Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
{"jungletree", "Jungle Tree", nil, nil, nil, nil, "default_junglesapling.png" }, {"jungletree", "Jungle Tree", nil, nil, nil, nil, "default_junglesapling.png" },
{"acacia", "Acacia Tree", nil, nil, nil, nil, "default_acacia_sapling.png" },
} }
local dirs1 = { 21, 20, 23, 22, 21 } local dirs1 = { 21, 20, 23, 22, 21 }
@ -29,7 +28,7 @@ local moretrees_plantlike_leaves_visual_scale = 1
if moretrees.plantlike_leaves then if moretrees.plantlike_leaves then
moretrees_new_leaves_drawtype = "plantlike" moretrees_new_leaves_drawtype = "plantlike"
moretrees_plantlike_leaves_visual_scale = math.sqrt(2) moretrees_plantlike_leaves_visual_scale = 1.189
end end
-- redefine default leaves to handle plantlike and/or leaf decay options -- redefine default leaves to handle plantlike and/or leaf decay options
@ -38,7 +37,11 @@ if moretrees.plantlike_leaves then
minetest.override_item("default:leaves", { minetest.override_item("default:leaves", {
inventory_image = minetest.inventorycube("default_leaves.png"), inventory_image = minetest.inventorycube("default_leaves.png"),
drawtype = "plantlike", drawtype = "plantlike",
visual_scale = math.sqrt(2) visual_scale = 1.189
})
else
minetest.override_item("default:leaves", {
waving = 1
}) })
end end
@ -48,7 +51,11 @@ if moretrees.plantlike_leaves then
minetest.override_item("default:jungleleaves", { minetest.override_item("default:jungleleaves", {
inventory_image = minetest.inventorycube("default_jungleleaves.png"), inventory_image = minetest.inventorycube("default_jungleleaves.png"),
drawtype = "plantlike", drawtype = "plantlike",
visual_scale = math.sqrt(2) visual_scale = 1.189
})
else
minetest.override_item("default:jungleleaves", {
waving = 1
}) })
end end
@ -62,22 +69,8 @@ for i in ipairs(moretrees.treelist) do
local saptex = moretrees.treelist[i][7] local saptex = moretrees.treelist[i][7]
-- player will get a sapling with 1/100 chance if treename ~= "jungletree" -- the default game provides jungle tree, acacia, and pine trunk/planks nodes.
-- player will get leaves only if he/she gets no saplings, and treename ~= "acacia"
-- this is because max_items is 1
local droprarity = 100
local decay = moretrees.leafdecay_radius
if treename == "palm" then
droprarity = 20
decay = moretrees.palm_leafdecay_radius
elseif treename == "date_palm" then
decay = moretrees.palm_leafdecay_radius
end
if treename ~= "jungletree" -- the default game provides jungle tree and pine trunk/planks nodes.
and treename ~= "poplar_small"
and treename ~= "pine" then and treename ~= "pine" then
saptex = "moretrees_"..treename.."_sapling.png" saptex = "moretrees_"..treename.."_sapling.png"
@ -90,7 +83,7 @@ for i in ipairs(moretrees.treelist) do
"moretrees_"..treename.."_trunk.png" "moretrees_"..treename.."_trunk.png"
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
is_ground_content = false, is_ground_content = true,
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node, on_place = minetest.rotate_node,
@ -99,7 +92,7 @@ for i in ipairs(moretrees.treelist) do
minetest.register_node("moretrees:"..treename.."_planks", { minetest.register_node("moretrees:"..treename.."_planks", {
description = S(treedesc.." Planks"), description = S(treedesc.." Planks"),
tiles = {"moretrees_"..treename.."_wood.png"}, tiles = {"moretrees_"..treename.."_wood.png"},
is_ground_content = false, is_ground_content = true,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
@ -112,7 +105,6 @@ for i in ipairs(moretrees.treelist) do
paramtype = "light", paramtype = "light",
paramtype2 = "waving", paramtype2 = "waving",
walkable = false, walkable = false,
is_ground_content = true,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
@ -121,6 +113,18 @@ for i in ipairs(moretrees.treelist) do
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
}) })
-- player will get a sapling with 1/100 chance
-- player will get leaves only if he/she gets no saplings,
-- this is because max_items is 1
local droprarity = 100
local decay = moretrees.leafdecay_radius
if treename == "palm" then
droprarity = 20
decay = moretrees.palm_leafdecay_radius
end
local moretrees_leaves_inventory_image = nil local moretrees_leaves_inventory_image = nil
local moretrees_new_leaves_waving = nil local moretrees_new_leaves_waving = nil
@ -138,8 +142,7 @@ for i in ipairs(moretrees.treelist) do
tiles = { "moretrees_"..treename.."_leaves.png" }, tiles = { "moretrees_"..treename.."_leaves.png" },
inventory_image = moretrees_leaves_inventory_image, inventory_image = moretrees_leaves_inventory_image,
paramtype = "light", paramtype = "light",
is_ground_content = false, groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = decay},
groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = 1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = { drop = {
@ -212,14 +215,13 @@ for i in ipairs(moretrees.treelist) do
end end
minetest.register_node("moretrees:"..treename.."_sapling_ongen", { minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
description = S(treedesc.." Sapling (on-generated)"), description = S(treedesc.." Sapling"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = {saptex}, tiles = {saptex},
inventory_image = saptex, inventory_image = saptex,
paramtype = "light", paramtype = "light",
paramtype2 = "waving", paramtype2 = "waving",
walkable = false, walkable = false,
is_ground_content = true,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
@ -229,10 +231,8 @@ for i in ipairs(moretrees.treelist) do
drop = "moretrees:"..treename.."_sapling" drop = "moretrees:"..treename.."_sapling"
}) })
local fruitname = nil
if fruit then if fruit then
fruitname = "moretrees:"..fruit minetest.register_node("moretrees:"..fruit, {
minetest.register_node(fruitname, {
description = S(fruitdesc), description = S(fruitdesc),
drawtype = "plantlike", drawtype = "plantlike",
tiles = { "moretrees_"..fruit..".png" }, tiles = { "moretrees_"..fruit..".png" },
@ -241,34 +241,23 @@ for i in ipairs(moretrees.treelist) do
visual_scale = vscale, visual_scale = vscale,
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
is_ground_content = false,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = selbox fixed = selbox
}, },
groups = {fleshy=3,dig_immediate=3,flammable=2, attached_node=1, leafdecay = 1, leafdecay_drop = 1}, groups = {fleshy=3,dig_immediate=3,flammable=2, attached_node=1},
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
}) })
end end
if treename ~= "jungletree"
and treename ~= "poplar_small"
and treename ~= "pine" then
default.register_leafdecay({
trunks = { "moretrees:"..treename.."_trunk" },
leaves = { "moretrees:"..treename.."_leaves", fruitname },
radius = decay,
})
end
minetest.register_abm({ minetest.register_abm({
nodenames = { "moretrees:"..treename.."_trunk_sideways" }, nodenames = { "moretrees:"..treename.."_trunk_sideways" },
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
local fdir = node.param2 or 0 local fdir = node.param2 or 0
nfdir = dirs2[fdir+1] local nfdir = dirs2[fdir+1]
minetest.add_node(pos, {name = "moretrees:"..treename.."_trunk", param2 = nfdir}) minetest.add_node(pos, {name = "moretrees:"..treename.."_trunk", param2 = nfdir})
end, end,
}) })
@ -281,45 +270,6 @@ for i in ipairs(moretrees.treelist) do
end end
end end
-- Add small poplar saplings
local poplar_sapling = minetest.registered_nodes["moretrees:poplar_sapling"]
local poplar_sapling_ongen = minetest.registered_nodes["moretrees:poplar_sapling_ongen"]
local poplar_small_sapling = {}
local poplar_small_sapling_ongen = {}
for k,v in pairs(poplar_sapling) do
poplar_small_sapling[k] = v
end
for k,v in pairs(poplar_sapling_ongen) do
poplar_small_sapling_ongen[k] = v
end
poplar_small_sapling.tiles = {"moretrees_poplar_small_sapling.png"}
poplar_small_sapling.inventory_image = "moretrees_poplar_small_sapling.png"
poplar_small_sapling.is_ground_content = true
poplar_small_sapling_ongen.tiles_ongen = {"moretrees_poplar_small_sapling.png"}
poplar_small_sapling_ongen.inventory_image_ongen = "moretrees_poplar_small_sapling.png"
poplar_small_sapling_ongen.drop = "moretrees:poplar_small_sapling"
poplar_small_sapling_ongen.is_ground_content = true
minetest.register_node("moretrees:poplar_small_sapling", poplar_small_sapling)
minetest.register_node("moretrees:poplar_small_sapling_ongen", poplar_small_sapling_ongen)
if moretrees.spawn_saplings then
table.insert(moretrees.avoidnodes, "moretrees:poplar_sapling")
table.insert(moretrees.avoidnodes, "moretrees:poplar_small_sapling_ongen")
end
local poplar_leaves_drop = minetest.registered_nodes["moretrees:poplar_leaves"].drop
minetest.override_item("moretrees:poplar_leaves", {
drop = {
max_items = poplar_leaves_drop.maxitems,
items = {
{items = {"moretrees:poplar_sapling"}, rarity = 1.33 * poplar_leaves_drop.items[1].rarity },
{items = {"moretrees:poplar_small_sapling"}, rarity = 1.33 * poplar_leaves_drop.items[1].rarity },
{items = {"moretrees:poplar_leaves"} }
}
}
})
-- Extra nodes for jungle trees: -- Extra nodes for jungle trees:
local jungleleaves = {"yellow","red"} local jungleleaves = {"yellow","red"}
@ -343,8 +293,7 @@ for color = 1, #jungleleaves do
tiles = {"moretrees_jungletree_leaves_"..jungleleaves[color]..".png"}, tiles = {"moretrees_jungletree_leaves_"..jungleleaves[color]..".png"},
inventory_image = moretrees_leaves_inventory_image, inventory_image = moretrees_leaves_inventory_image,
paramtype = "light", paramtype = "light",
is_ground_content = false, groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = moretrees.leafdecay_radius },
groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = 3 },
drop = { drop = {
max_items = 1, max_items = 1,
items = { items = {
@ -356,18 +305,6 @@ for color = 1, #jungleleaves do
}) })
end end
-- To get Moretrees to generate its own jungle trees among the default mapgen
-- we need our own copy of that node, which moretrees will match against.
local jungle_tree = table.copy(minetest.registered_nodes["default:jungletree"])
minetest.register_node("moretrees:jungletree_trunk", jungle_tree)
default.register_leafdecay({
trunks = { "default:jungletree", "moretrees:jungletree_trunk" },
leaves = { "default:jungleleaves", "moretrees:jungletree_leaves_yellow", "moretrees:jungletree_leaves_red" },
radius = moretrees.leafdecay_radius,
})
-- Extra needles for firs -- Extra needles for firs
local moretrees_leaves_inventory_image = nil local moretrees_leaves_inventory_image = nil
@ -384,8 +321,7 @@ minetest.register_node("moretrees:fir_leaves_bright", {
tiles = { "moretrees_fir_leaves_bright.png" }, tiles = { "moretrees_fir_leaves_bright.png" },
inventory_image = moretrees_leaves_inventory_image, inventory_image = moretrees_leaves_inventory_image,
paramtype = "light", paramtype = "light",
is_ground_content = false, groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = moretrees.leafdecay_radius },
groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = 3 },
drop = { drop = {
max_items = 1, max_items = 1,
items = { items = {
@ -396,13 +332,6 @@ minetest.register_node("moretrees:fir_leaves_bright", {
sounds = default.node_sound_leaves_defaults() sounds = default.node_sound_leaves_defaults()
}) })
default.register_leafdecay({
trunks = { "moretrees:fir_trunk" },
leaves = { "moretrees:fir_leaves", "moretrees:fir_leaves_bright" },
radius = moretrees.leafdecay_radius,
})
if moretrees.enable_redefine_apple then if moretrees.enable_redefine_apple then
local appledef = moretrees.clone_node("default:apple") local appledef = moretrees.clone_node("default:apple")
appledef.groups.attached_node = 1 appledef.groups.attached_node = 1
@ -419,6 +348,7 @@ if moretrees.spawn_saplings then
table.insert(moretrees.avoidnodes, "snow:sapling_pine") table.insert(moretrees.avoidnodes, "snow:sapling_pine")
table.insert(moretrees.avoidnodes, "default:junglesapling") table.insert(moretrees.avoidnodes, "default:junglesapling")
table.insert(moretrees.avoidnodes, "default:pine_sapling") table.insert(moretrees.avoidnodes, "default:pine_sapling")
table.insert(moretrees.avoidnodes, "default:acacia_sapling")
end end
-- "empty" (tapped) rubber tree nodes -- "empty" (tapped) rubber tree nodes
@ -434,7 +364,6 @@ minetest.register_node("moretrees:rubber_tree_trunk_empty", {
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
paramtype2 = "facedir", paramtype2 = "facedir",
is_ground_content = false,
on_place = minetest.rotate_node, on_place = minetest.rotate_node,
}) })
@ -449,6 +378,14 @@ minetest.register_abm({
end, end,
}) })
-- To get Moretrees to generate its own jungle trees among the default mapgen
-- we need our own copy of that node, which moretrees will match against.
local jungle_tree = moretrees.clone_node("default:jungletree")
jungle_tree.drop = jungle_tree.drop or { items = {} }
table.insert(jungle_tree.drop.items, { items = {"default:jungletree"}})
minetest.register_node("moretrees:jungletree_trunk", jungle_tree)
-- For compatibility with old nodes, recently-changed nodes, and default nodes -- For compatibility with old nodes, recently-changed nodes, and default nodes
minetest.register_alias("technic:rubber_tree_full", "moretrees:rubber_tree_trunk") minetest.register_alias("technic:rubber_tree_full", "moretrees:rubber_tree_trunk")
@ -480,6 +417,10 @@ minetest.register_alias("moretrees:jungletree_trunk_sideways", "moreblocks:horiz
minetest.register_alias("moretrees:jungletree_planks", "default:junglewood") minetest.register_alias("moretrees:jungletree_planks", "default:junglewood")
minetest.register_alias("moretrees:jungletree_leaves_green", "default:jungleleaves") minetest.register_alias("moretrees:jungletree_leaves_green", "default:jungleleaves")
minetest.register_alias("jungletree:leaves_green", "default:jungleleaves")
minetest.register_alias("jungletree:leaves_red", "moretrees:jungletree_leaves_red")
minetest.register_alias("jungletree:leaves_yellow", "moretrees:jungletree_leaves_yellow")
minetest.register_alias("moretrees:acacia_trunk", "default:acacia_tree") minetest.register_alias("moretrees:acacia_trunk", "default:acacia_tree")
minetest.register_alias("moretrees:acacia_planks", "default:acacia_wood") minetest.register_alias("moretrees:acacia_planks", "default:acacia_wood")
minetest.register_alias("moretrees:acacia_sapling", "default:acacia_sapling") minetest.register_alias("moretrees:acacia_sapling", "default:acacia_sapling")
@ -491,6 +432,6 @@ minetest.register_alias("moretrees:pine_sapling", "moretrees:cedar_sapling")
minetest.register_alias("moretrees:pine_leaves", "moretrees:cedar_leaves") minetest.register_alias("moretrees:pine_leaves", "moretrees:cedar_leaves")
minetest.register_alias("moretrees:pine_cone", "moretrees:cedar_cone") minetest.register_alias("moretrees:pine_cone", "moretrees:cedar_cone")
minetest.register_alias("moretrees:pine_nuts", "moretrees:cedar_nuts") minetest.register_alias("moretrees:pine_nuts", "moretrees:cedar_nuts")
minetest.register_alias("moretrees:pine_sapling_ongen", "moretrees:cedar_sapling_ongen")
minetest.register_alias("moretrees:dates", "moretrees:dates_f4") -- Overriding moretrees' palm leaves:
minetest.override_item("moretrees:palm_leaves",{walkable = false})

55
saplings.lua Normal file → Executable file
View File

@ -16,7 +16,6 @@ for i in ipairs(moretrees.treelist) do
grow_function = moretrees[tree_model], grow_function = moretrees[tree_model],
}) })
if moretrees.spawn_saplings then
biome_lib:grow_plants({ biome_lib:grow_plants({
grow_delay = 2, grow_delay = 2,
grow_chance = 30, grow_chance = 30,
@ -24,7 +23,6 @@ for i in ipairs(moretrees.treelist) do
grow_nodes = moretrees[tree_biome].surface, grow_nodes = moretrees[tree_biome].surface,
grow_function = moretrees[tree_model], grow_function = moretrees[tree_model],
}) })
end
end end
end end
@ -37,6 +35,13 @@ biome_lib:grow_plants({
grow_function = "moretrees.grow_birch" grow_function = "moretrees.grow_birch"
}) })
biome_lib:grow_plants({
grow_delay = 2,
grow_chance = 30,
grow_plant = "moretrees:birch_sapling_ongen",
grow_nodes = moretrees.birch_biome.surface,
grow_function = "moretrees.grow_birch"
})
biome_lib:grow_plants({ biome_lib:grow_plants({
grow_delay = moretrees.sapling_interval, grow_delay = moretrees.sapling_interval,
@ -46,6 +51,14 @@ biome_lib:grow_plants({
grow_function = "moretrees.grow_spruce" grow_function = "moretrees.grow_spruce"
}) })
biome_lib:grow_plants({
grow_delay = 2,
grow_chance = 30,
grow_plant = "moretrees:spruce_sapling_ongen",
grow_nodes = moretrees.spruce_biome.surface,
grow_function = "moretrees.grow_spruce"
})
biome_lib:grow_plants({ biome_lib:grow_plants({
grow_delay = moretrees.sapling_interval, grow_delay = moretrees.sapling_interval,
grow_chance = moretrees.sapling_chance, grow_chance = moretrees.sapling_chance,
@ -54,6 +67,14 @@ biome_lib:grow_plants({
grow_function = "moretrees.grow_fir" grow_function = "moretrees.grow_fir"
}) })
biome_lib:grow_plants({
grow_delay = 2,
grow_chance = 30,
grow_plant = "moretrees:fir_sapling_ongen",
grow_nodes = moretrees.fir_biome.surface,
grow_function = "moretrees.grow_fir"
})
biome_lib:grow_plants({ biome_lib:grow_plants({
grow_delay = moretrees.sapling_interval, grow_delay = moretrees.sapling_interval,
grow_chance = moretrees.sapling_chance, grow_chance = moretrees.sapling_chance,
@ -62,37 +83,11 @@ biome_lib:grow_plants({
grow_function = "moretrees.grow_jungletree" grow_function = "moretrees.grow_jungletree"
}) })
if moretrees.spawn_saplings then biome_lib:grow_plants({
biome_lib:grow_plants({
grow_delay = 2, grow_delay = 2,
grow_chance = 30, grow_chance = 30,
grow_plant = "moretrees:jungletree_sapling_ongen", grow_plant = "moretrees:jungletree_sapling_ongen",
grow_nodes = moretrees.jungletree_biome.surface, grow_nodes = moretrees.jungletree_biome.surface,
grow_function = "moretrees.grow_jungletree" grow_function = "moretrees.grow_jungletree"
}) })
biome_lib:grow_plants({
grow_delay = 2,
grow_chance = 30,
grow_plant = "moretrees:fir_sapling_ongen",
grow_nodes = moretrees.fir_biome.surface,
grow_function = "moretrees.grow_fir"
})
biome_lib:grow_plants({
grow_delay = 2,
grow_chance = 30,
grow_plant = "moretrees:spruce_sapling_ongen",
grow_nodes = moretrees.spruce_biome.surface,
grow_function = "moretrees.grow_spruce"
})
biome_lib:grow_plants({
grow_delay = 2,
grow_chance = 30,
grow_plant = "moretrees:birch_sapling_ongen",
grow_nodes = moretrees.birch_biome.surface,
grow_function = "moretrees.grow_birch"
})
end

View File

@ -1,168 +0,0 @@
-- Usage:
-- - Create a new world
-- - Set world mapgen: v6
-- - Set world seed: 2625051331357512570
-- - Enable the moretrees mod
-- - Edit the moretrees source
-- - Disable all trees in default_settings.lua
-- - Recommended: make saplings grow fast in default_settings.lua:
-- sapling_interval = 5
-- sapling_chance = 1
-- - Apply the patch below to moretrees
-- (so that jungle trees are always large, and differently-colored):
-- use 'git apply --ignore-space-change'
-- - Make sure this file (you are reading) will be loaded when minetest starts !
-- (e.g. add 'dofile(modpath.."/screenshot.lua")' to init.lua)
-- - Start minetest
-- - Goto 700,y,-280 (approximately)
-- - Make sure the world is loaded between x = 650 .. 780 and z = -350 .. -180
-- - Give the chat command '/make-scene'
-- - Wait & walk/fly around until all trees have grown
-- - goto the platform at 780, 30, -277
-- - Set the viewing range to 300, with fog enabled
-- - Take a screenshot.
-- Patch to apply to moretrees
--[[
diff --git a/init.lua b/init.lua
index 8189ffd..afd4644 100644
--- a/init.lua
+++ b/init.lua
@@ -225,9 +225,12 @@ moretrees.ct_rules_b1 = "[-FBf][+FBf]"
moretrees.ct_rules_a2 = "FF[FF][&&-FBF][&&+FBF][&&---FBF][&&+++FBF]F/A"
moretrees.ct_rules_b2 = "[-fB][+fB]"
+local jleaves = 1
function moretrees.grow_jungletree(pos)
local r1 = math.random(2)
local r2 = math.random(3)
+ r1 = jleaves
+ jleaves = jleaves % 2 + 1
if r1 == 1 then
moretrees.jungletree_model.leaves2 = "moretrees:jungletree_leaves_red"
else
@@ -235,6 +238,7 @@ function moretrees.grow_jungletree(pos)
end
moretrees.jungletree_model.leaves2_chance = math.random(25, 75)
+ r2=3
if r2 == 1 then
moretrees.jungletree_model.trunk_type = "single"
moretrees.jungletree_model.iterations = 2
]]
minetest.register_chatcommand("make-scene", {
func = function()
minetest.place_node({x=780, y=30, z=-277}, {name="default:obsidian"})
minetest.place_node({x=780, y=30, z=-278}, {name="default:obsidian"})
minetest.place_node({x=781, y=30, z=-277}, {name="default:obsidian"})
minetest.place_node({x=781, y=30, z=-278}, {name="default:obsidian"})
minetest.place_node({x=781, y=30, z=-276}, {name="default:obsidian"})
minetest.place_node({x=780, y=30, z=-276}, {name="default:obsidian"})
for z = -360, -300 do
dy=2
for x = 630 + (-z - 360)/3, 660 + (-z - 300)/3 do
for y = 5, 22 do
minetest.place_node({x=x, y=y, z=z}, {name="default:desert_stone"})
end
for y = 23, 25 + dy do
minetest.place_node({x=x, y=y, z=z}, {name="default:desert_sand"})
end
dy = 0
end
end
minetest.place_node({x=717, y=2, z=-298}, {name = "moretrees:palm_sapling"})
minetest.place_node({x=713, y=2, z=-302}, {name = "moretrees:palm_sapling"})
minetest.place_node({x=713, y=2, z=-307}, {name = "moretrees:palm_sapling"})
minetest.place_node({x=717, y=2, z=-318}, {name = "moretrees:palm_sapling"})
minetest.place_node({x=723, y=2, z=-320}, {name = "moretrees:palm_sapling"})
minetest.place_node({x=645, y=26, z=-314}, {name="moretrees:date_palm_sapling"})
minetest.place_node({x=653, y=26, z=-322}, {name="moretrees:date_palm_sapling"})
minetest.place_node({x=649, y=26, z=-334}, {name="moretrees:date_palm_sapling"})
minetest.place_node({x=662, y=26, z=-342}, {name="moretrees:date_palm_sapling"})
minetest.place_node({x=672, y=5, z=-305}, {name="moretrees:oak_sapling"})
minetest.place_node({x=690, y=6, z=-322}, {name="moretrees:oak_sapling"})
minetest.place_node({x=695, y=7, z=-335}, {name="moretrees:oak_sapling"})
minetest.place_node({x=699, y=4, z=-301}, {name="moretrees:oak_sapling"})
minetest.place_node({x=751, y=5, z=-254}, {name="moretrees:apple_tree_sapling"})
minetest.place_node({x=729, y=3, z=-275}, {name="moretrees:apple_tree_sapling"})
minetest.place_node({x=747, y=4, z=-270}, {name="moretrees:apple_tree_sapling"})
minetest.place_node({x=671, y=5, z=-283}, {name="default:junglesapling"})
minetest.place_node({x=680, y=4, z=-287}, {name="default:junglesapling"})
minetest.place_node({x=702, y=4, z=-288}, {name="default:junglesapling"})
minetest.place_node({x=646, y=12, z=-199}, {name="moretrees:spruce_sapling"})
minetest.place_node({x=644, y=14, z=-177}, {name="moretrees:spruce_sapling"})
minetest.place_node({x=678, y=9, z=-211}, {name="moretrees:spruce_sapling"})
minetest.place_node({x=663, y=10, z=-215}, {name="moretrees:spruce_sapling"})
minetest.place_node({x=637, y=3, z=-263}, {name="moretrees:sequoia_sapling"})
minetest.place_node({x=625, y=3, z=-250}, {name="moretrees:sequoia_sapling"})
minetest.place_node({x=616, y=3, z=-233}, {name="moretrees:sequoia_sapling"})
minetest.place_node({x=635, y=3, z=-276}, {name="moretrees:sequoia_sapling"})
minetest.place_node({x=681, y=11, z=-260}, {name="moretrees:sequoia_sapling"})
minetest.place_node({x=682, y=10, z=-247}, {name="moretrees:sequoia_sapling"})
minetest.place_node({x=737, y=7, z=-195}, {name="moretrees:cedar_sapling"})
minetest.place_node({x=720, y=8, z=-189}, {name="moretrees:cedar_sapling"})
minetest.place_node({x=704, y=7, z=-187}, {name="moretrees:cedar_sapling"})
minetest.place_node({x=731, y=2, z=-227}, {name="moretrees:poplar_sapling"})
minetest.place_node({x=721, y=2, z=-233}, {name="moretrees:poplar_sapling"})
minetest.place_node({x=712, y=1, z=-237}, {name="moretrees:poplar_sapling"})
minetest.place_node({x=743, y=3, z=-228}, {name="moretrees:poplar_small_sapling"})
minetest.place_node({x=750, y=3, z=-230}, {name="moretrees:poplar_small_sapling"})
minetest.place_node({x=731, y=5, z=-233}, {name="moretrees:poplar_small_sapling"})
minetest.place_node({x=702, y=2, z=-274}, {name="moretrees:birch_sapling"})
minetest.place_node({x=697, y=2, z=-271}, {name="moretrees:birch_sapling"})
minetest.place_node({x=696, y=2, z=-264}, {name="moretrees:birch_sapling"})
minetest.place_node({x=710, y=2, z=-265}, {name="moretrees:birch_sapling"})
minetest.place_node({x=707, y=8, z=-247}, {name="moretrees:fir_sapling"})
minetest.place_node({x=699, y=10, z=-254}, {name="moretrees:fir_sapling"})
minetest.place_node({x=729, y=5, z=-261}, {name="moretrees:fir_sapling"})
minetest.place_node({x=732, y=5, z=-252}, {name="moretrees:fir_sapling"})
minetest.place_node({x=741, y=4, z=-262}, {name="moretrees:fir_sapling"})
minetest.place_node({x=751, y=2, z=-286}, {name="moretrees:willow_sapling"})
minetest.place_node({x=760, y=5, z=-223}, {name="moretrees:rubber_tree_sapling"})
minetest.place_node({x=762, y=5, z=-230}, {name="moretrees:rubber_tree_sapling"})
minetest.place_node({x=766, y=5, z=-243}, {name="moretrees:rubber_tree_sapling"})
minetest.place_node({x=764, y=6, z=-252}, {name="moretrees:rubber_tree_sapling"})
end
})
--[[
The following is a search/replace command suitable for vi (/vim) or sed, to convert minetest log
messages to equivalent lua commands:
s/.*\(\(moretrees\|default\)[^ ]*\) at (\([-0-9]\+\),\([-0-9]\+\),\([-0-9]\+\)).*/\t\tminetest.place_node({x=\3, y=\4, z=\5}, {name="\1"})/
E.g. a minetest log line of the following kind:
2016-07-03 11:30:50: ACTION[Server]: singleplayer places node moretrees:rubber_tree_sapling at (760,5,-223)
Becomes:
minetest.place_node({x=760, y=5, z=-223}, {name="moretrees:rubber_tree_sapling"})
(Except that the example log line above has an extra space added, so it won't be converted)
vi/vim users: Add the minetest log lines to this file, then enter the following command, with
<expression> replaced with the search/replace expression above.
:%<expression>
sed users: Add the minetest log lines to this file, then execute the following command at the shell
prompt with <expression> replaced by the search/replace expression above. Don't forget the
single-quotes.
sed '<expression>' < screenshot.lua > screenshot-new.lua
Windows users: You're probably out of luck. And the effort of doing such a thing is probably
larger anyway than the effort of copying an existing line and typing things manually.
]]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

BIN
textures/moretrees_acorn.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 B

After

Width:  |  Height:  |  Size: 398 B

BIN
textures/moretrees_acorn_muffin.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 782 B

After

Width:  |  Height:  |  Size: 765 B

BIN
textures/moretrees_acorn_muffin_batter.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 619 B

After

Width:  |  Height:  |  Size: 602 B

0
textures/moretrees_apple_tree_leaves.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 351 B

BIN
textures/moretrees_apple_tree_sapling.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

After

Width:  |  Height:  |  Size: 178 B

0
textures/moretrees_apple_tree_trunk.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

0
textures/moretrees_apple_tree_trunk_top.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 503 B

After

Width:  |  Height:  |  Size: 503 B

0
textures/moretrees_apple_tree_wood.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 464 B

After

Width:  |  Height:  |  Size: 464 B

0
textures/moretrees_beech_leaves.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

0
textures/moretrees_beech_sapling.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 177 B

After

Width:  |  Height:  |  Size: 177 B

BIN
textures/moretrees_beech_trunk.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 980 B

After

Width:  |  Height:  |  Size: 964 B

0
textures/moretrees_beech_trunk_top.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 926 B

After

Width:  |  Height:  |  Size: 926 B

BIN
textures/moretrees_beech_wood.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 170 B

0
textures/moretrees_birch_leaves.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 459 B

After

Width:  |  Height:  |  Size: 459 B

BIN
textures/moretrees_birch_sapling.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 204 B

BIN
textures/moretrees_birch_trunk.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 975 B

After

Width:  |  Height:  |  Size: 959 B

0
textures/moretrees_birch_trunk_top.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 811 B

After

Width:  |  Height:  |  Size: 811 B

0
textures/moretrees_birch_wood.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

0
textures/moretrees_coconut.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 963 B

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 877 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

BIN
textures/moretrees_coconut_milk.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 211 B

0
textures/moretrees_coconut_milk_inv.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

BIN
textures/moretrees_fir_cone.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 227 B

0
textures/moretrees_fir_leaves.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 205 B

After

Width:  |  Height:  |  Size: 205 B

0
textures/moretrees_fir_leaves_bright.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 205 B

After

Width:  |  Height:  |  Size: 205 B

0
textures/moretrees_fir_nuts.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 361 B

After

Width:  |  Height:  |  Size: 361 B

BIN
textures/moretrees_fir_sapling.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 161 B

0
textures/moretrees_fir_trunk.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 753 B

After

Width:  |  Height:  |  Size: 753 B

0
textures/moretrees_fir_trunk_top.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 924 B

After

Width:  |  Height:  |  Size: 924 B

BIN
textures/moretrees_fir_wood.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

0
textures/moretrees_jungletree_leaves_green.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

0
textures/moretrees_jungletree_leaves_red.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

0
textures/moretrees_jungletree_leaves_yellow.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

0
textures/moretrees_oak_leaves.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 730 B

After

Width:  |  Height:  |  Size: 730 B

0
textures/moretrees_oak_sapling.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 172 B

After

Width:  |  Height:  |  Size: 172 B

BIN
textures/moretrees_oak_trunk.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 998 B

After

Width:  |  Height:  |  Size: 982 B

0
textures/moretrees_oak_trunk_top.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 519 B

After

Width:  |  Height:  |  Size: 519 B

BIN
textures/moretrees_oak_wood.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

After

Width:  |  Height:  |  Size: 599 B

BIN
textures/moretrees_palm_leaves.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 918 B

After

Width:  |  Height:  |  Size: 902 B

0
textures/moretrees_palm_sapling.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 122 B

0
textures/moretrees_palm_trunk.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 295 B

0
textures/moretrees_palm_trunk_top.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 400 B

After

Width:  |  Height:  |  Size: 400 B

BIN
textures/moretrees_palm_wood.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 726 B

0
textures/moretrees_raw_coconut.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 466 B

After

Width:  |  Height:  |  Size: 466 B

0
textures/moretrees_rubber_tree_leaves.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

0
textures/moretrees_rubber_tree_sapling.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 151 B

0
textures/moretrees_rubber_tree_trunk.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 693 B

After

Width:  |  Height:  |  Size: 693 B

BIN
textures/moretrees_rubber_tree_trunk_empty.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
textures/moretrees_rubber_tree_trunk_top.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 534 B

After

Width:  |  Height:  |  Size: 534 B

0
textures/moretrees_rubber_tree_wood.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 435 B

After

Width:  |  Height:  |  Size: 435 B

0
textures/moretrees_sequoia_leaves.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 205 B

After

Width:  |  Height:  |  Size: 205 B

BIN
textures/moretrees_sequoia_sapling.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 199 B

BIN
textures/moretrees_sequoia_trunk.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

After

Width:  |  Height:  |  Size: 620 B

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