Integrate newer mesecons (bluestone). Part 1, WIP

master
MoNTE48 2019-05-19 21:26:46 +02:00
parent 3d4de82b4f
commit c1acb73c80
63 changed files with 1645 additions and 716 deletions

View File

@ -0,0 +1,532 @@
The LGPLv3 applies to all code in this project.
The CC-BY-SA-3.0 license applies to textures and any other content in this project which is not source code.
=================================================================
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
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
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,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
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.
=================================================================
Creative Commons Legal Code
Attribution-ShareAlike 3.0 Unported
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
DAMAGES RESULTING FROM ITS USE.
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
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.
1. Definitions
a. "Adaptation" means a work based upon the Work, or upon the Work and
other pre-existing works, such as a translation, adaptation,
derivative work, arrangement of music or other alterations of a
literary or artistic work, or phonogram or performance and includes
cinematographic adaptations or any other form in which the Work may be
recast, transformed, or adapted including in any form recognizably
derived from the original, except that a work that constitutes a
Collection will not be considered an Adaptation for the purpose of
this License. For the avoidance of doubt, where the Work is a musical
work, performance or phonogram, the synchronization of the Work in
timed-relation with a moving image ("synching") will be considered an
Adaptation for the purpose of this License.
b. "Collection" means a collection of literary or artistic works, such as
encyclopedias and anthologies, or performances, phonograms or
broadcasts, or other works or subject matter other than works listed
in Section 1(f) below, which, by reason of the selection and
arrangement of their contents, constitute intellectual creations, in
which the Work is included in its entirety in unmodified form along
with one or more other contributions, each constituting separate and
independent works in themselves, which together are assembled into a
collective whole. A work that constitutes a Collection will not be
considered an Adaptation (as defined below) for the purposes of this
License.
c. "Creative Commons Compatible License" means a license that is listed
at http://creativecommons.org/compatiblelicenses that has been
approved by Creative Commons as being essentially equivalent to this
License, including, at a minimum, because that license: (i) contains
terms that have the same purpose, meaning and effect as the License
Elements of this License; and, (ii) explicitly permits the relicensing
of adaptations of works made available under that license under this
License or a Creative Commons jurisdiction license with the same
License Elements as this License.
d. "Distribute" means to make available to the public the original and
copies of the Work or Adaptation, as appropriate, through sale or
other transfer of ownership.
e. "License Elements" means the following high-level license attributes
as selected by Licensor and indicated in the title of this License:
Attribution, ShareAlike.
f. "Licensor" means the individual, individuals, entity or entities that
offer(s) the Work under the terms of this License.
g. "Original Author" means, in the case of a literary or artistic work,
the individual, individuals, entity or entities who created the Work
or if no individual or entity can be identified, the publisher; and in
addition (i) in the case of a performance the actors, singers,
musicians, dancers, and other persons who act, sing, deliver, declaim,
play in, interpret or otherwise perform literary or artistic works or
expressions of folklore; (ii) in the case of a phonogram the producer
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.
h. "Work" means the literary and/or artistic work offered under the terms
of this License including without limitation any production in the
literary, scientific and artistic domain, whatever may be the mode or
form of its expression including digital form, such as a book,
pamphlet and other writing; a lecture, address, sermon or other work
of the same nature; a dramatic or dramatico-musical work; a
choreographic work or entertainment in dumb show; a musical
composition with or without words; a cinematographic work to which are
assimilated works expressed by a process analogous to cinematography;
a work of drawing, painting, architecture, sculpture, engraving or
lithography; a photographic work to which are assimilated works
expressed by a process analogous to photography; a work of applied
art; an illustration, map, plan, sketch or three-dimensional work
relative to geography, topography, architecture or science; a
performance; a broadcast; a phonogram; a compilation of data to the
extent it is protected as a copyrightable work; or a work performed by
a variety or circus performer to the extent it is not otherwise
considered a literary or artistic work.
i. "You" means an individual or entity exercising rights under this
License who has not previously violated the terms of this License with
respect to the Work, or who has received express permission from the
Licensor to exercise rights under this License despite a previous
violation.
j. "Publicly Perform" means to perform public recitations of the Work and
to communicate to the public those public recitations, by any means or
process, including by wire or wireless means or public digital
performances; to make available to the public Works in such a way that
members of the public may access these Works from a place and at a
place individually chosen by them; to perform the Work to the public
by any means or process and the communication to the public of the
performances of the Work, including by public digital performance; to
broadcast and rebroadcast the Work by any means including signs,
sounds or images.
k. "Reproduce" means to make copies of the Work by any means including
without limitation by sound or visual recordings and the right of
fixation and reproducing fixations of the Work, including storage of a
protected performance or phonogram in digital form or other electronic
medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce,
limit, or restrict any uses free from copyright or rights arising from
limitations or exceptions that are provided for in connection with the
copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License,
Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
perpetual (for the duration of the applicable copyright) license to
exercise the rights in the Work as stated below:
a. to Reproduce the Work, to incorporate the Work into one or more
Collections, and to Reproduce the Work as incorporated in the
Collections;
b. to create and Reproduce Adaptations provided that any such Adaptation,
including any translation in any medium, takes reasonable steps to
clearly label, demarcate or otherwise identify that changes were made
to the original Work. For example, a translation could be marked "The
original work was translated from English to Spanish," or a
modification could indicate "The original work has been modified.";
c. to Distribute and Publicly Perform the Work including as incorporated
in Collections; and,
d. to Distribute and Publicly Perform Adaptations.
e. For the avoidance of doubt:
i. Non-waivable Compulsory License Schemes. In those jurisdictions in
which the right to collect royalties through any statutory or
compulsory licensing scheme cannot be waived, the Licensor
reserves the exclusive right to collect such royalties for any
exercise by You of the rights granted under this License;
ii. Waivable Compulsory License Schemes. In those jurisdictions in
which the right to collect royalties through any statutory or
compulsory licensing scheme can be waived, the Licensor waives the
exclusive right to collect such royalties for any exercise by You
of the rights granted under this License; and,
iii. Voluntary License Schemes. The Licensor waives the right to
collect royalties, whether individually or, in the event that the
Licensor is a member of a collecting society that administers
voluntary licensing schemes, via that society, from any exercise
by You of the rights granted under this License.
The above rights may be exercised in all media and formats whether now
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
granted by Licensor are hereby reserved.
4. Restrictions. The license granted in Section 3 above is expressly made
subject to and limited by the following restrictions:
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
Identifier (URI) for, this License with every copy of the Work You
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
the recipient of the Work to exercise the rights granted to that
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
to the disclaimer of warranties with every copy of the Work You
Distribute or Publicly Perform. When You Distribute or Publicly
Perform the Work, You may not impose any effective technological
measures on the Work that restrict the ability of a recipient of the
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
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
License. If You create a Collection, upon notice from any Licensor You
must, to the extent practicable, remove from the Collection any credit
as required by Section 4(c), as requested. If You create an
Adaptation, upon notice from any Licensor You must, to the extent
practicable, remove from the Adaptation any credit as required by
Section 4(c), as requested.
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
the same License Elements as this License; (iii) a Creative Commons
jurisdiction license (either this or a later license version) that
contains the same License Elements as this License (e.g.,
Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible
License. If you license the Adaptation under one of the licenses
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
mentioned in (i), (ii) or (iii) (the "Applicable License"), you must
comply with the terms of the Applicable License generally and the
following provisions: (I) You must include a copy of, or the URI for,
the Applicable License with every copy of each Adaptation You
Distribute or Publicly Perform; (II) You may not offer or impose any
terms on the Adaptation that restrict the terms of the Applicable
License or the ability of the recipient of the Adaptation to exercise
the rights granted to that recipient under the terms of the Applicable
License; (III) You must keep intact all notices that refer to the
Applicable License and to the disclaimer of warranties with every copy
of the Work as included in the Adaptation You Distribute or Publicly
Perform; (IV) when You Distribute or Publicly Perform the Adaptation,
You may not impose any effective technological measures on the
Adaptation that restrict the ability of a recipient of the Adaptation
from You to exercise the rights granted to that recipient under the
terms of the Applicable License. This Section 4(b) applies to the
Adaptation as incorporated in a Collection, but this does not require
the Collection apart from the Adaptation itself to be made subject to
the terms of the Applicable License.
c. If You Distribute, or Publicly Perform the Work or any Adaptations or
Collections, You must, unless a request has been made pursuant to
Section 4(a), keep intact all copyright notices for the Work and
provide, reasonable to the medium or means You are utilizing: (i) the
name of the Original Author (or pseudonym, if applicable) if supplied,
and/or if the Original Author and/or Licensor designate another party
or parties (e.g., a sponsor institute, publishing entity, journal) for
attribution ("Attribution Parties") in Licensor's copyright notice,
terms of service or by other reasonable means, the name of such party
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
refer to the copyright notice or licensing information for the Work;
and (iv) , consistent with Ssection 3(b), in the case of an
Adaptation, a credit identifying the use of the Work in the Adaptation
(e.g., "French translation of the Work by Original Author," or
"Screenplay based on original Work by Original Author"). The credit
required by this Section 4(c) may be implemented in any reasonable
manner; provided, however, that in the case of a Adaptation or
Collection, at a minimum such credit will appear, if a credit for all
contributing authors of the Adaptation or Collection appears, then as
part of these credits and in a manner at least as prominent as the
credits for the other contributing authors. For the avoidance of
doubt, You may only use the credit required by this Section for the
purpose of attribution in the manner set out above and, by exercising
Your rights under this License, You may not implicitly or explicitly
assert or imply any connection with, sponsorship or endorsement by the
Original Author, Licensor and/or Attribution Parties, as appropriate,
of You or Your use of the Work, without the separate, express prior
written permission of the Original Author, Licensor and/or Attribution
Parties.
d. Except as otherwise agreed in writing by the Licensor or as may be
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
take other derogatory action in relation to the Work which would be
prejudicial to the Original Author's honor or reputation. Licensor
agrees that in those jurisdictions (e.g. Japan), in which any exercise
of the right granted in Section 3(b) of this License (the right to
make Adaptations) would be deemed to be a distortion, mutilation,
modification or other derogatory action prejudicial to the Original
Author's honor and reputation, the Licensor will waive or not assert,
as appropriate, this Section, to the fullest extent permitted by the
applicable national law, to enable You to reasonably exercise Your
right under Section 3(b) of this License (right to make Adaptations)
but not otherwise.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
a. This License and the rights granted hereunder will terminate
automatically upon any breach by You of the terms of this License.
Individuals or entities who have received Adaptations or Collections
from You under this License, however, will not have their licenses
terminated provided such individuals or entities remain in full
compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
survive any termination of this License.
b. Subject to the above terms and conditions, the license granted here is
perpetual (for the duration of the applicable copyright in the Work).
Notwithstanding the above, Licensor reserves the right to release the
Work under different license terms or to stop distributing the Work at
any time; provided, however that any such election will not serve to
withdraw this License (or any other license that has been, or is
required to be, granted under the terms of this License), and this
License will continue in full force and effect unless terminated as
stated above.
8. Miscellaneous
a. Each time You Distribute or Publicly Perform the Work or a Collection,
the Licensor offers to the recipient a license to the Work on the same
terms and conditions as the license granted to You under this License.
b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
offers to the recipient a license to the original Work on the same
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
the remainder of the terms of this License, and without further action
by the parties to this agreement, such provision shall be reformed to
the minimum extent necessary to make such provision valid and
enforceable.
d. No term or provision of this License shall be deemed waived and no
breach consented to unless such waiver or consent shall be in writing
and signed by the party to be charged with such waiver or consent.
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
here. Licensor shall not be bound by any additional provisions that
may appear in any communication from You. This License may not be
modified without the mutual written agreement of the Licensor and You.
f. The rights granted under, and the subject matter referenced, in this
License were drafted utilizing the terminology of the Berne Convention
for the Protection of Literary and Artistic Works (as amended on
September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
and the Universal Copyright Convention (as revised on July 24, 1971).
These rights and subject matter take effect in the relevant
jurisdiction in which the License terms are sought to be enforced
according to the corresponding provisions of the implementation of
those treaty provisions in the applicable national law. If the
standard suite of rights granted under applicable copyright law
includes additional rights not granted under this License, such
additional rights are deemed to be included in the License; this
License is not intended to restrict the license of any rights under
applicable law.
Creative Commons Notice
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,
incidental or consequential damages arising in connection to this
license. Notwithstanding the foregoing two (2) sentences, if Creative
Commons has expressly identified itself as the Licensor hereunder, it
shall have all rights and obligations of Licensor.
Except for the limited purpose of indicating to the public that the
Work is licensed under the CCPL, Creative Commons does not authorize
the use by either party of the trademark "Creative Commons" or any
related trademark or logo of Creative Commons without the prior
written consent of Creative Commons. Any permitted use will be in
compliance with Creative Commons' then-current trademark usage
guidelines, as may be published on its website or otherwise made
available upon request from time to time. For the avoidance of doubt,
this trademark restriction does not form part of the License.
Creative Commons may be contacted at http://creativecommons.org/.

View File

@ -0,0 +1,76 @@
########################################################################
## __ __ _____ _____ _____ _____ _____ _ _ _____ ##
## | \ / | | ___| | ___| | ___| | ___| | _ | | \ | | | ___| ##
## | \/ | | |___ | |___ | |___ | | | | | | | \| | | |___ ##
## | |\__/| | | ___| |___ | | ___| | | | | | | | | |___ | ##
## | | | | | |___ ___| | | |___ | |___ | |_| | | |\ | ___| | ##
## |_| |_| |_____| |_____| |_____| |_____| |_____| |_| \_| |_____| ##
## ##
########################################################################
MESECONS by Jeija and contributors
Mezzee-what?
------------
[Mesecons](http://mesecons.net/)! They're yellow, they're conductive, and they'll add a whole new dimension to Minetest's gameplay.
Mesecons is a mod for [Minetest](http://minetest.net/) that implements a ton of items related to digital circuitry, such as wires, buttons, lights, and even programmable controllers. Among other things, there are also pistons, solar panels, pressure plates, and note blocks.
OK, I want in.
--------------
Go get it!
[DOWNLOADS PAGE](http://mesecons.net/downloads.php)
Now go ahead and install it like any other Minetest mod. Don't know how? Check out [the wonderful page about it](http://wiki.minetest.com/wiki/Mods) over at the Minetest Wiki. For your convenience, here's a quick summary:
1. If Mesecons is still in a ZIP file, extract the folder inside to somewhere on the computer.
2. Make sure that when you open the folder, you can directly find `README.md` in the listing. If you just see another folder, move that folder up one level and delete the old one.
3. Open up the Minetest mods folder - usually `/mods/`. If you see the `minetest` or folder inside of that, that is your mod folder instead.
4. Copy the Mesecons folder into the mods folder.
Don't like some parts of Mesecons? Open up the Mesecons folder and delete the subfolder containing the mod you don't want. If you didn't want movestones, for example, all you have to do is delete the `mesecons_movestones` folder and they will no longer be available.
There are no dependencies - it will work right after installing!
How do I use this thing?
------------------------
How about a [quick overview video](https://www.youtube.com/watch?v=6kmeQj6iW5k)?
Or maybe a [comprehensive reference](http://mesecons.net/items.php) is your style?
An overview for the very newest of new beginners? How does [this one](http://uberi.mesecons.net/projects/MeseconsBasics/index.html) look?
Want to get more into building? Why not check out the [Mesecons Laboratory](http://uberi.mesecons.net/), a website dedicated to advanced Mesecons builders?
Want to contribute to Mesecons itself? Check out the [source code](https://github.com/Jeija/minetest-mod-mesecons)!
Who wrote it anyways?
---------------------
These awesome people made Mesecons possible!
| Contributor | Contribution |
| --------------- | -------------------------------- |
| Jat15 | Various tweaks. |
| Jeija | **Main developer! Everything.** |
| Jordach | Noteblock sounds. |
| khonkhortistan | Code, recipes, textures. |
| Kotolegokot | Nodeboxes for items. |
| minerd247 | Textures. |
| Nore/Novatux | Code. |
| RealBadAngel | Fixes, improvements. |
| sfan5 | Code, recipes, textures. |
| suzenako | Piston sounds. |
| Uberi/Temperest | Code, textures, documentation. |
| VanessaE | Code, recipes, textures, design. |
| Whiskers75 | Logic gates implementation. |
There are also a whole bunch of other people helping with everything from code to testing and feedback. Mesecons would also not be possible without their help!
Alright, how can I use it?
--------------------------
All textures in this project are licensed under the CC-BY-SA 3.0 (Creative Commons Attribution-ShareAlike 3.0 Generic). That means you can distribute and remix them as much as you want to, under the condition that you give credit to the authors and the project, and that if you remix and release them, they must be under the same or similar license to this one.
All code in this project is licensed under the LGPL version 3 or later. That means you have unlimited freedom to distribute and modify the work however you see fit, provided that if you decide to distribute it or any modified versions of it, you must also use the same license. The LGPL also grants the additional freedom to write extensions for the software and distribute them without the extensions being subject to the terms of the LGPL, although the software itself retains its license.
No warranty is provided, express or implied, for any part of the project.

View File

@ -1 +1 @@
default
default

View File

@ -1,5 +1,3 @@
-- |\ /| ____ ____ ____ _____ ____ _____
-- | \ / | | | | | | | |\ | |
-- | \/ | |___ ____ |___ | | | | \ | |____
@ -51,6 +49,31 @@ mesecon.receptors={} -- saves all information about receptors | DEPRECATED
mesecon.effectors={} -- saves all information about effectors | DEPRECATED
mesecon.conductors={} -- saves all information about conductors | DEPRECATED
local wpath = minetest.get_worldpath()
local function read_file(fn)
local f = io.open(fn, "r")
if f==nil then return {} end
local t = f:read("*all")
f:close()
if t=="" or t==nil then return {} end
return minetest.deserialize(t)
end
local function write_file(fn, tbl)
local f = io.open(fn, "w")
f:write(minetest.serialize(tbl))
f:close()
end
mesecon.to_update = read_file(wpath.."/mesecon_to_update")
mesecon.r_to_update = read_file(wpath.."/mesecon_r_to_update")
minetest.register_on_shutdown(function()
write_file(wpath.."/mesecon_to_update",mesecon.to_update)
write_file(wpath.."/mesecon_r_to_update",mesecon.r_to_update)
end)
-- Settings
dofile(minetest.get_modpath("mesecons").."/settings.lua")
@ -73,10 +96,10 @@ dofile(minetest.get_modpath("mesecons").."/internal.lua");
-- API
-- these are the only functions you need to remember
function mesecon:receptor_on(pos, rules)
function mesecon:receptor_on_i(pos, rules)
rules = rules or mesecon.rules.default
for _, rule in ipairs(rules) do
for _, rule in ipairs(mesecon:flattenrules(rules)) do
local np = mesecon:addPosRule(pos, rule)
local link, rulename = mesecon:rules_link(pos, np, rules)
if link then
@ -85,19 +108,37 @@ function mesecon:receptor_on(pos, rules)
end
end
function mesecon:receptor_off(pos, rules)
function mesecon:receptor_on(pos, rules)
if MESECONS_GLOBALSTEP then
rules = rules or mesecon.rules.default
mesecon.r_to_update[#mesecon.r_to_update+1]={pos=pos, rules=rules, action="on"}
else
mesecon:receptor_on_i(pos, rules)
end
end
function mesecon:receptor_off_i(pos, rules)
rules = rules or mesecon.rules.default
for _, rule in ipairs(rules) do
for _, rule in ipairs(mesecon:flattenrules(rules)) do
local np = mesecon:addPosRule(pos, rule)
local link, rulename = mesecon:rules_link(pos, np, rules)
if link then
if not mesecon:connected_to_receptor(np) then
if not mesecon:connected_to_receptor(np, mesecon:invertRule(rule)) then
mesecon:turnoff(np, rulename)
else
mesecon:changesignal(np, minetest.env:get_node(np), rulename, mesecon.state.off)
mesecon:changesignal(np, minetest.get_node(np), rulename, mesecon.state.off)
end
end
end
end
function mesecon:receptor_off(pos, rules)
if MESECONS_GLOBALSTEP then
rules = rules or mesecon.rules.default
mesecon.r_to_update[#mesecon.r_to_update+1]={pos=pos, rules=rules, action="off"}
else
mesecon:receptor_off_i(pos, rules)
end
end

View File

@ -180,25 +180,116 @@ end
--Signals
function mesecon:activate(pos, node, rulename)
if MESECONS_GLOBALSTEP then
if rulename == nil then
for _,rule in ipairs(mesecon:effector_get_rules(node)) do
mesecon:activate(pos, node, rule)
end
return
end
add_action(pos, "on", rulename)
else
local effector = mesecon:get_effector(node.name)
if effector and effector.action_on then
effector.action_on (pos, node, rulename)
end
end
end
function mesecon:deactivate(pos, node, rulename)
if MESECONS_GLOBALSTEP then
if rulename == nil then
for _,rule in ipairs(mesecon:effector_get_rules(node)) do
mesecon:deactivate(pos, node, rule)
end
return
end
add_action(pos, "off", rulename)
else
local effector = mesecon:get_effector(node.name)
if effector and effector.action_off then
effector.action_off (pos, node, rulename)
end
end
end
function mesecon:changesignal(pos, node, rulename, newstate)
newstate = newstate or "on"
--rulename = rulename or mesecon.rules.default
if MESECONS_GLOBALSTEP then
if rulename == nil then
for _,rule in ipairs(mesecon:effector_get_rules(node)) do
mesecon:changesignal(pos, node, rule, newstate)
end
return
end
add_action(pos, "c"..newstate, rulename)
else
local effector = mesecon:get_effector(node.name)
if effector and effector.action_change then
effector.action_change (pos, node, rulename, newstate)
end
end
end
function execute_actions(dtime)
local nactions = mesecon.to_update
mesecon.to_update = {}
for _,i in ipairs(nactions) do
node = minetest.get_node(i.pos)
if node.name=="ignore" then
add_action(i.pos, i.action, i.rname)
else
effector = mesecon:get_effector(node.name)
if i.action == "on" then
if effector and effector.action_on then
effector.action_on(i.pos, node, i.rname)
end
elseif i.action == "off" then
if effector and effector.action_off then
effector.action_off(i.pos, node, i.rname)
end
elseif i.action == "con" then
if effector and effector.action_change then
effector.action_change(i.pos, node, i.rname, "on")
end
elseif i.action == "coff" then
if effector and effector.action_change then
effector.action_change(i.pos, node, i.rname, "off")
end
end
end
end
local nactions = mesecon.r_to_update
mesecon.r_to_update = {}
for _,i in ipairs(nactions) do
if i.action == "on" then
mesecon:receptor_on_i(i.pos, i.rules)
else
mesecon:receptor_off_i(i.pos,i.rules)
end
end
end
minetest.register_globalstep(execute_actions)
function add_action(pos, action, rname)
for _,i in ipairs(mesecon.to_update) do
if i.pos.x == pos.x and i.pos.y == pos.y and i.pos.z == pos.z and i.rname.x == rname.x and i.rname.y == rname.y and i.rname.z == rname.z then
if (i.action == "on" and action == "on") or (i.action == "off" and action == "off") then
--nothing
elseif i.action == "coff" and action == "on" then i.action = "on"
elseif i.action == "con" and action == "off" then i.action = "off"
else
if action == "on" or action == "con" then i.action = "con" end
if action == "off" or action == "coff" then i.action = "coff" end
end
break
end
end
mesecon.to_update[#mesecon.to_update+1] = {pos = pos, action = action, rname = rname}
end
--Rules
@ -212,18 +303,38 @@ end
-- Conductors
function mesecon:is_conductor_on(nodename)
function mesecon:is_conductor_on(nodename, rulename)
local conductor = mesecon:get_conductor(nodename)
if conductor and conductor.state == mesecon.state.on then
return true
if conductor then
if conductor.state then
return conductor.state == mesecon.state.on
end
if conductor.states then
if not rulename then
return mesecon:getstate(nodename, conductor.states) ~= 1
end
local bit = mesecon:rule2bit(rulename, mesecon:conductor_get_rules(minetest.registered_nodes[nodename]))
local binstate = mesecon:getbinstate(nodename, conductor.states)
return mesecon:get_bit(binstate, bit)
end
end
return false
end
function mesecon:is_conductor_off(nodename)
function mesecon:is_conductor_off(nodename, rulename)
local conductor = mesecon:get_conductor(nodename)
if conductor and conductor.state == mesecon.state.off then
return true
if conductor then
if conductor.state then
return conductor.state == mesecon.state.off
end
if conductor.states then
if not rulename then
return mesecon:getstate(nodename, conductor.states) == 1
end
local bit = mesecon:rule2bit(rulename, mesecon:conductor_get_rules(minetest.registered_nodes[nodename]))
local binstate = mesecon:getbinstate(nodename, conductor.states)
return not mesecon:get_bit(binstate, bit)
end
end
return false
end
@ -236,20 +347,36 @@ function mesecon:is_conductor(nodename)
return false
end
function mesecon:get_conductor_on(offstate)
function mesecon:get_conductor_on(offstate, rulename)
local conductor = mesecon:get_conductor(offstate)
if conductor then
if conductor.onstate then
return conductor.onstate
end
return false
if conductor.states then
local bit = mesecon:rule2bit(rulename, mesecon:conductor_get_rules(minetest.registered_nodes[offstate]))
local binstate = mesecon:getbinstate(offstate, conductor.states)
binstate = mesecon:set_bit(binstate, bit, "1")
return conductor.states[tonumber(binstate,2)+1]
end
end
return offstate
end
function mesecon:get_conductor_off(onstate)
function mesecon:get_conductor_off(onstate, rulename)
local conductor = mesecon:get_conductor(onstate)
if conductor then
if conductor.offstate then
return conductor.offstate
end
return false
if conductor.states then
local bit = mesecon:rule2bit(rulename, mesecon:conductor_get_rules(minetest.registered_nodes[onstate]))
local binstate = mesecon:getbinstate(onstate, conductor.states)
binstate = mesecon:set_bit(binstate, bit, "0")
return conductor.states[tonumber(binstate,2)+1]
end
end
return onstate
end
function mesecon:conductor_get_rules(node)
@ -267,17 +394,17 @@ end
-- some more general high-level stuff
function mesecon:is_power_on(pos)
function mesecon:is_power_on(pos, rulename)
local node = minetest.get_node(pos)
if mesecon:is_conductor_on(node.name) or mesecon:is_receptor_on(node.name) then
if mesecon:is_conductor_on(node.name, rulename) or mesecon:is_receptor_on(node.name) then
return true
end
return false
end
function mesecon:is_power_off(pos)
function mesecon:is_power_off(pos, rulename)
local node = minetest.get_node(pos)
if mesecon:is_conductor_off(node.name) or mesecon:is_receptor_off(node.name) then
if mesecon:is_conductor_off(node.name, rulename) or mesecon:is_receptor_off(node.name) then
return true
end
return false
@ -286,11 +413,21 @@ end
function mesecon:turnon(pos, rulename)
local node = minetest.get_node(pos)
if mesecon:is_conductor_off(node.name) then
if mesecon:is_conductor_off(node.name, rulename) then
local rules = mesecon:conductor_get_rules(node)
minetest.add_node(pos, {name = mesecon:get_conductor_on(node.name), param2 = node.param2})
for _, rule in ipairs(rules) do
if not rulename then
for _, rule in ipairs(mesecon:flattenrules(rules)) do
if mesecon:connected_to_receptor(pos, rule) then
mesecon:turnon(pos, rule)
end
end
return
end
minetest.add_node(pos, {name = mesecon:get_conductor_on(node.name, rulename), param2 = node.param2})
for _, rule in ipairs(mesecon:rule2meta(rulename, rules)) do
local np = mesecon:addPosRule(pos, rule)
local link, rulename = mesecon:rules_link(pos, np)
@ -309,11 +446,21 @@ end
function mesecon:turnoff(pos, rulename)
local node = minetest.get_node(pos)
if mesecon:is_conductor_on(node.name) then
if mesecon:is_conductor_on(node.name, rulename) then
local rules = mesecon:conductor_get_rules(node)
minetest.add_node(pos, {name = mesecon:get_conductor_off(node.name), param2 = node.param2})
--[[
if not rulename then
for _, rule in ipairs(mesecon:flattenrules(rules)) do
if mesecon:is_powered(pos, rule) then
mesecon:turnoff(pos, rule)
end
end
return
end
--]]
minetest.add_node(pos, {name = mesecon:get_conductor_off(node.name, rulename), param2 = node.param2})
for _, rule in ipairs(rules) do
for _, rule in ipairs(mesecon:rule2meta(rulename, rules)) do
local np = mesecon:addPosRule(pos, rule)
local link, rulename = mesecon:rules_link(pos, np)
@ -331,17 +478,17 @@ function mesecon:turnoff(pos, rulename)
end
function mesecon:connected_to_receptor(pos)
function mesecon:connected_to_receptor(pos, rulename)
local node = minetest.get_node(pos)
-- Check if conductors around are connected
local rules = mesecon:get_any_inputrules(node)
if not rules then return false end
for _, rule in ipairs(rules) do
for _, rule in ipairs(mesecon:rule2meta(rulename, rules)) do
local np = mesecon:addPosRule(pos, rule)
if mesecon:rules_link(np, pos) then
if mesecon:find_receptor_on(np, {}) then
if mesecon:find_receptor_on(np, {}, mesecon:invertRule(rule)) then
return true
end
end
@ -350,7 +497,7 @@ function mesecon:connected_to_receptor(pos)
return false
end
function mesecon:find_receptor_on(pos, checked)
function mesecon:find_receptor_on(pos, checked, rulename)
-- find out if node has already been checked (to prevent from endless loop)
for _, cp in ipairs(checked) do
if mesecon:cmpPos(cp, pos) then
@ -368,10 +515,10 @@ function mesecon:find_receptor_on(pos, checked)
if mesecon:is_conductor(node.name) then
local rules = mesecon:conductor_get_rules(node)
for _, rule in ipairs(rules) do
for _, rule in ipairs(mesecon:rule2meta(rulename, rules)) do
local np = mesecon:addPosRule(pos, rule)
if mesecon:rules_link(np, pos) then
if mesecon:find_receptor_on(np, checked) then
if mesecon:find_receptor_on(np, checked, mesecon:invertRule(rule)) then
return true
end
end
@ -390,13 +537,13 @@ function mesecon:rules_link(output, input, dug_outputrules) --output/input are p
return
end
for _, outputrule in ipairs(outputrules) do
for _, outputrule in ipairs(mesecon:flattenrules(outputrules)) do
-- Check if output sends to input
if mesecon:cmpPos(mesecon:addPosRule(output, outputrule), input) then
for _, inputrule in ipairs(inputrules) do
for _, inputrule in ipairs(mesecon:flattenrules(inputrules)) do
-- Check if input accepts from output
if mesecon:cmpPos(mesecon:addPosRule(input, inputrule), output) then
return true, inputrule.name
return true, inputrule
end
end
end
@ -408,16 +555,26 @@ function mesecon:rules_link_anydir(pos1, pos2)
return mesecon:rules_link(pos1, pos2) or mesecon:rules_link(pos2, pos1)
end
function mesecon:is_powered(pos)
function mesecon:is_powered(pos, rule)
local node = minetest.get_node(pos)
local rules = mesecon:get_any_inputrules(node)
if not rules then return false end
for _, rule in ipairs(rules) do
if not rule then
for _, rule in ipairs(mesecon:flattenrules(rules)) do
local np = mesecon:addPosRule(pos, rule)
local nn = minetest.get_node(np)
if (mesecon:is_conductor_on (nn.name, mesecon:invertRule(rule)) or mesecon:is_receptor_on (nn.name))
and mesecon:rules_link(np, pos) then
return true
end
end
else
local np = mesecon:addPosRule(pos, rule)
local nn = minetest.get_node(np)
if (mesecon:is_conductor_on (nn.name) or mesecon:is_receptor_on (nn.name))
if (mesecon:is_conductor_on (nn.name, mesecon:invertRule(rule)) or mesecon:is_receptor_on (nn.name))
and mesecon:rules_link(np, pos) then
return true
end

View File

@ -4,13 +4,13 @@ mesecon.on_placenode = function (pos, node)
elseif mesecon:is_powered(pos) then
if mesecon:is_conductor(node.name) then
mesecon:turnon (pos)
mesecon:receptor_on (pos, mesecon:conductor_get_rules(node))
--mesecon:receptor_on (pos, mesecon:conductor_get_rules(node))
else
mesecon:changesignal(pos, node)
mesecon:changesignal(pos, node, mesecon:effector_get_rules(node), "on")
mesecon:activate(pos, node)
end
elseif mesecon:is_conductor_on(node.name) then
mesecon:swap_node(pos, mesecon:get_conductor_off(node.name))
minetest.swap_node(pos, {name = mesecon:get_conductor_off(node.name)})
elseif mesecon:is_effector_on (node.name) then
mesecon:deactivate(pos, node)
end
@ -24,5 +24,15 @@ mesecon.on_dignode = function (pos, node)
end
end
minetest.register_abm({
nodenames = {"group:overheat"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local meta = minetest.get_meta(pos)
meta:set_int("heat",0)
end,
})
minetest.register_on_placenode(mesecon.on_placenode)
minetest.register_on_dignode(mesecon.on_dignode)

View File

@ -1,7 +1,9 @@
-- SETTINGS
BLINKY_PLANT_INTERVAL = 3
NEW_STYLE_WIRES = true -- true = new nodebox wires, false = old raillike wires
PRESSURE_PLATE_INTERVAL = 0.04
PRESSURE_PLATE_INTERVAL = 0.1
OBJECT_DETECTOR_RADIUS = 6
PISTON_MAXIMUM_PUSH = 11 -- +1
MOVESTONE_MAXIMUM_PUSH = 0
PISTON_MAXIMUM_PUSH = 15
MOVESTONE_MAXIMUM_PUSH = 100
MESECONS_GLOBALSTEP = true -- true = receptors/effectors won't be updated
-- until next globalstep, decreases server load

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 B

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 289 B

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 B

After

Width:  |  Height:  |  Size: 289 B

View File

@ -1,11 +1,3 @@
function mesecon:swap_node(pos, name)
local node = minetest.get_node(pos)
local data = minetest.get_meta(pos):to_table()
node.name = name
minetest.add_node(pos, node)
minetest.get_meta(pos):from_table(data)
end
function mesecon:move_node(pos, newpos)
local node = minetest.get_node(pos)
local meta = minetest.get_meta(pos):to_table()
@ -14,6 +6,143 @@ function mesecon:move_node(pos, newpos)
minetest.get_meta(pos):from_table(meta)
end
--[[ new functions:
mesecon:flattenrules(allrules)
mesecon:rule2bit(findrule, allrules)
mesecon:rule2meta(findrule, allrules)
dec2bin(n)
mesecon:getstate(nodename, states)
mesecon:getbinstate(nodename, states)
mesecon:get_bit(binary, bit)
mesecon:set_bit(binary, bit, value)
mesecon:invertRule(r)
--]]
function mesecon:flattenrules(allrules)
--[[
{
{
{xyz},
{xyz},
},
{
{xyz},
{xyz},
},
}
--]]
if allrules[1] and
allrules[1].x then
return allrules
end
local shallowrules = {}
for _, metarule in ipairs( allrules) do
for _, rule in ipairs(metarule ) do
table.insert(shallowrules, rule)
end
end
return shallowrules
--[[
{
{xyz},
{xyz},
{xyz},
{xyz},
}
--]]
end
function mesecon:rule2bit(findrule, allrules)
--get the bit of the metarule the rule is in, or bit 1
if (allrules[1] and
allrules[1].x) or
not findrule then
return 1
end
for m,metarule in ipairs( allrules) do
for _, rule in ipairs(metarule ) do
if mesecon:cmpPos(findrule, rule) then
return m
end
end
end
end
function mesecon:rule2meta(findrule, allrules)
--get the metarule the rule is in, or allrules
if allrules[1].x then
return allrules
end
if not(findrule) then
return mesecon:flattenrules(allrules)
end
for m, metarule in ipairs( allrules) do
for _, rule in ipairs(metarule ) do
if mesecon:cmpPos(findrule, rule) then
return metarule
end
end
end
end
if convert_base then
print(
"base2dec is tonumber(num,base1)\n"..
"commonlib needs dec2base(num,base2)\n"..
"and it needs base2base(num,base1,base2),\n"..
"which is dec2base(tonumber(num,base1),base2)"
)
else
function dec2bin(n)
local x, y = math.floor(n / 2), n % 2
if (n > 1) then
return dec2bin(x)..y
else
return ""..y
end
end
end
function mesecon:getstate(nodename, states)
for state, name in ipairs(states) do
if name == nodename then
return state
end
end
error(nodename.." doesn't mention itself in "..dump(states))
end
function mesecon:getbinstate(nodename, states)
return dec2bin(mesecon:getstate(nodename, states)-1)
end
function mesecon:get_bit(binary,bit)
bit = bit or 1
local c = binary:len()-(bit-1)
return binary:sub(c,c) == "1"
end
function mesecon:set_bit(binary,bit,value)
if value == "1" then
if not mesecon:get_bit(binary,bit) then
return dec2bin(tonumber(binary,2)+math.pow(2,bit-1))
end
elseif value == "0" then
if mesecon:get_bit(binary,bit) then
return dec2bin(tonumber(binary,2)-math.pow(2,bit-1))
end
end
return binary
end
function mesecon:invertRule(r)
return {x = -r.x, y = -r.y, z = -r.z}
end
function mesecon:addPosRule(p, r)
return {x = p.x + r.x, y = p.y + r.y, z = p.z + r.z}
@ -22,3 +151,17 @@ end
function mesecon:cmpPos(p1, p2)
return (p1.x == p2.x and p1.y == p2.y and p1.z == p2.z)
end
function mesecon:tablecopy(table) -- deep table copy
local newtable = {}
for idx, item in pairs(table) do
if type(item) == "table" then
newtable[idx] = mesecon:tablecopy(item)
else
newtable[idx] = item
end
end
return newtable
end

View File

@ -34,10 +34,10 @@ for zmy=0, 1 do
tostring(xpy)..tostring(zpy)..tostring(xmy)..tostring(zmy)
if nodeid == "00000000" then
groups = {dig_immediate = 3, mesecon_conductor_craftable = 1, attach_node = 1, mese = 1}
groups = {dig_immediate = 3, mesecon_conductor_craftable=1}
wiredesc = "Mesecon"
else
groups = {dig_immediate = 3, not_in_creative_inventory = 1, attach_node = 1}
groups = {dig_immediate = 3, not_in_creative_inventory = 1}
wiredesc = "Mesecons Wire (ID: "..nodeid..")"
end
@ -118,7 +118,7 @@ for zmy=0, 1 do
mesecons = {conductor={
state = mesecon.state.off,
onstate = "mesecons:wire_"..nodeid.."_on"
}},
}}
})
minetest.register_node("mesecons:wire_"..nodeid.."_on", {
@ -144,7 +144,7 @@ for zmy=0, 1 do
mesecons = {conductor={
state = mesecon.state.on,
offstate = "mesecons:wire_"..nodeid.."_off"
}},
}}
})
end
end

View File

@ -1,3 +1 @@
mesecons
default

View File

@ -1,5 +1,3 @@
-- This file registers aliases for the /give /giveme commands.
minetest.register_alias("mesecons:removestone", "mesecons_random:removestone")

View File

@ -1,2 +1 @@
mesecons
default

View File

@ -1,18 +1,16 @@
-- WALL BUTTON
-- A button that when pressed emits power for 1 second
-- and then turns off again
mesecon.button_turnoff = function (pos)
local node = minetest.env:get_node(pos)
local node = minetest.get_node(pos)
if node.name=="mesecons_button:button_stone_on" then --has not been dug
mesecon:swap_node(pos, "mesecons_button:button_stone_off")
minetest.swap_node(pos, {name = "mesecons_button:button_stone_off", param2=node.param2})
minetest.sound_play("mesecons_button_pop", {pos=pos})
local rules = mesecon.rules.buttonlike_get(node)
mesecon:receptor_off(pos, rules)
elseif node.name=="mesecons_button:button_wood_on" then --has not been dug
mesecon:swap_node(pos, "mesecons_button:button_wood_off")
minetest.swap_node(pos, {name = "mesecons_button:button_wood_off", param2=node.param2})
minetest.sound_play("mesecons_button_pop", {pos=pos})
local rules = mesecon.rules.buttonlike_get(node)
mesecon:receptor_off(pos, rules)
@ -38,10 +36,10 @@ minetest.register_node("mesecons_button:button_stone_off", {
type = "fixed",
fixed = boxes_off -- the button itself
},
groups = {dig_immediate=2, attached_node=1, mese = 1},
groups = {dig_immediate=2, attached_node=1},
description = "Stone Button",
on_punch = function (pos, node)
mesecon:swap_node(pos, "mesecons_button:button_stone_on")
minetest.swap_node(pos, {name = "mesecons_button:button_stone_on", param2=node.param2})
mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node))
minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.after(1, mesecon.button_turnoff, pos)
@ -69,14 +67,14 @@ minetest.register_node("mesecons_button:button_stone_on", {
type = "fixed",
fixed = boxes_on -- the button itself
},
groups = {dig_immediate=2, not_in_creative_inventory=1, attached_node=1},
groups = {dig_immediate=2, not_in_creative_inventory=1},
drop = 'mesecons_button:button_stone_off',
description = "Stone Button",
sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.on,
rules = mesecon.rules.buttonlike_get
}}
sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.on,
rules = mesecon.rules.buttonlike_get
}}
})
minetest.register_node("mesecons_button:button_wood_off", {
@ -95,10 +93,10 @@ minetest.register_node("mesecons_button:button_wood_off", {
type = "fixed",
fixed = boxes_off -- the button itself
},
groups = {dig_immediate=2, attached_node=1, mese = 1},
groups = {dig_immediate=2},
description = "Wood Button",
on_punch = function (pos, node)
mesecon:swap_node(pos, "mesecons_button:button_wood_on")
minetest.swap_node(pos, {name = "mesecons_button:button_wood_on", param2=node.param2})
mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node))
minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.after(1, mesecon.button_turnoff, pos)
@ -126,7 +124,7 @@ minetest.register_node("mesecons_button:button_wood_on", {
type = "fixed",
fixed = boxes_on -- the button itself
},
groups = {dig_immediate=2, not_in_creative_inventory=1, attached_node=1},
groups = {dig_immediate=2, not_in_creative_inventory=1},
drop = 'mesecons_button:button_wood_off',
description = "Wood Button",
sounds = default.node_sound_stone_defaults(),
@ -137,15 +135,15 @@ minetest.register_node("mesecons_button:button_wood_on", {
})
minetest.register_craft({
output = 'mesecons_button:button_stone_off',
output = "mesecons_button:button_stone_off 2",
recipe = {
{'default:stone'},
{"default:cobble"},
}
})
minetest.register_craft({
output = 'mesecons_button:button_wood_off',
output = "mesecons_button:button_wood_off 2",
recipe = {
{'group:wood'},
{"group:wood"},
}
})

View File

@ -1,4 +1,2 @@
mesecons
doors
default

View File

@ -1,5 +1,3 @@
doors = {}
-- Registers a door - REDEFINITION ONLY | DOORS MOD MUST HAVE BEEN LOADED BEFORE
@ -152,7 +150,7 @@ end
doors:register_door("doors:door_wood", {
description = "Wooden Door",
inventory_image = "door_wood.png",
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,door=1, mese = 1},
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,door=1},
tiles_bottom = {"door_wood_b.png", "door_brown.png"},
tiles_top = {"door_wood_a.png", "door_brown.png"},
sounds = default.node_sound_wood_defaults(),
@ -161,7 +159,7 @@ doors:register_door("doors:door_wood", {
doors:register_door("doors:door_steel", {
description = "Steel Door",
inventory_image = "door_steel.png",
groups = {snappy = 1,bendy=2,cracky=1,melty=2,level=2,door=1, mese = 1},
groups = {snappy = 1,bendy=2,cracky=1,melty=2,level=2,door=1},
tiles_bottom = {"door_steel_b.png", "door_grey.png"},
tiles_top = {"door_steel_a.png", "door_grey.png"},
only_placer_can_open = true,

View File

@ -1,3 +1 @@
mesecons
default

View File

@ -1,5 +1,3 @@
-- Function that get the input/output rules of the delayer
local delayer_get_output_rules = function(node)
local rules = {{x = 0, y = 0, z = 1}}
@ -32,24 +30,23 @@ end
local delayer_activate = function(pos, node)
local def = minetest.registered_nodes[node.name]
local time = def.delayer_time
mesecon:swap_node(pos, def.delayer_onstate)
minetest.swap_node(pos, {name = def.delayer_onstate, param2=node.param2})
minetest.after(time, delayer_turnon , {pos = pos, node = node})
end
local delayer_deactivate = function(pos, node)
local def = minetest.registered_nodes[node.name]
local time = def.delayer_time
mesecon:swap_node(pos, def.delayer_offstate)
minetest.swap_node(pos, {name = def.delayer_offstate, param2=node.param2})
minetest.after(time, delayer_turnoff, {pos = pos, node = node})
end
-- Register the 2 (states) x 4 (delay times) delayers
local done = false
for i = 1, 4 do
local groups = {}
if i == 1 and not done then
groups = {bendy=2,snappy = 1,dig_immediate=2, mese = 1}
done = true
if i == 1 then
groups = {bendy=2,snappy=1,dig_immediate=2}
else
groups = {bendy=2,snappy = 1,dig_immediate=2, not_in_creative_inventory=1}
end
@ -58,8 +55,7 @@ local delaytime
if i == 1 then delaytime = 0.1
elseif i == 2 then delaytime = 0.3
elseif i == 3 then delaytime = 0.5
elseif i == 4 then delaytime = 1.0
end
elseif i == 4 then delaytime = 1.0 end
local boxes
if i == 1 then
@ -113,16 +109,17 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
is_ground_content = true,
drop = 'mesecons_delayer:delayer_off_1',
on_punch = function (pos, node)
if node.name=="mesecons_delayer:delayer_off_1" then
mesecon:swap_node(pos,"mesecons_delayer:delayer_off_2")
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_off_2", param2=node.param2})
elseif node.name=="mesecons_delayer:delayer_off_2" then
mesecon:swap_node(pos,"mesecons_delayer:delayer_off_3")
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_off_3", param2=node.param2})
elseif node.name=="mesecons_delayer:delayer_off_3" then
mesecon:swap_node(pos,"mesecons_delayer:delayer_off_4")
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_off_4", param2=node.param2})
elseif node.name=="mesecons_delayer:delayer_off_4" then
mesecon:swap_node(pos,"mesecons_delayer:delayer_off_1")
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_off_1", param2=node.param2})
end
end,
delayer_time = delaytime,
@ -167,16 +164,17 @@ minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), {
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
is_ground_content = true,
drop = 'mesecons_delayer:delayer_off_1',
on_punch = function (pos, node)
if node.name=="mesecons_delayer:delayer_on_1" then
mesecon:swap_node(pos,"mesecons_delayer:delayer_on_2")
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_on_2", param2=node.param2})
elseif node.name=="mesecons_delayer:delayer_on_2" then
mesecon:swap_node(pos,"mesecons_delayer:delayer_on_3")
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_on_3", param2=node.param2})
elseif node.name=="mesecons_delayer:delayer_on_3" then
mesecon:swap_node(pos,"mesecons_delayer:delayer_on_4")
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_on_4", param2=node.param2})
elseif node.name=="mesecons_delayer:delayer_on_4" then
mesecon:swap_node(pos,"mesecons_delayer:delayer_on_1")
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_on_1", param2=node.param2})
end
end,
delayer_time = delaytime,
@ -200,6 +198,6 @@ minetest.register_craft({
output = "mesecons_delayer:delayer_off_1",
recipe = {
{"mesecons_torch:mesecon_torch_on", "", "mesecons_torch:mesecon_torch_on"},
{"default:stone","default:stone", "default:stone"},
{"default:cobble","default:cobble", "default:cobble"},
}
})

View File

@ -1,3 +1 @@
mesecons
default

View File

@ -2,33 +2,33 @@
minetest.register_node("mesecons_lightstone:lightstone_off", {
tiles = {"jeija_lightstone_gray_off.png"},
groups = {cracky=2, mesecon_effector_off = 1, mesecon = 2, mese = 1},
groups = {cracky=2, mesecon_effector_off = 1, mesecon = 2},
description= "Bluestone Lamp",
sounds = default.node_sound_glass_defaults(),
mesecons = {effector = {
action_on = function (pos, node)
mesecon:swap_node(pos, "mesecons_lightstone:lightstone_on")
end
minetest.swap_node(pos, {name = "mesecons_lightstone:lightstone_on", param2 = node.param2})
end,
}}
})
minetest.register_node("mesecons_lightstone:lightstone_on", {
tiles = {"jeija_lightstone_gray_on.png"},
groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2},
drop = "node mesecons_lightstone:lightstone_off",
light_source = default.LIGHT_MAX,
drop = "mesecons_lightstone:lightstone_off",
light_source = default.LIGHT_MAX-2,
sounds = default.node_sound_glass_defaults(),
mesecons = {effector = {
action_off = function (pos, node)
mesecon:swap_node(pos, "mesecons_lightstone:lightstone_off")
end
minetest.swap_node(pos, {name = "mesecons_lightstone:lightstone_off", param2 = node.param2})
end,
}}
})
minetest.register_craft({
output = "node mesecons_lightstone:lightstone_off",
output = "mesecons_lightstone:lightstone_off",
recipe = {
{'',"default:bluestone_dust",''},
{"","default:bluestone_dust",""},
{"default:bluestone_dust",'default:glowstone',"default:bluestone_dust"},
{'','default:bluestone_dust',''},
}

View File

@ -1,3 +1 @@
mesecons
default

View File

@ -1,15 +1,12 @@
--GLUE
minetest.register_craftitem("mesecons_materials:glue", {
image = "jeija_glue.png",
on_place_on_ground = minetest.craftitem_place_item,
description="Glue",
groups = {misc = 1},
})
minetest.register_craft({
output = '"mesecons_materials:glue" 2',
output = "mesecons_materials:glue 2",
type = "cooking",
recipe = "default:sapling",
cooktime = 2

View File

@ -1,2 +1 @@
mesecons
default

View File

@ -1,8 +1,7 @@
--register stoppers for movestones/pistons
mesecon.mvps_stoppers={}
mesecon.mvps_unmov = {}
function mesecon:is_mvps_stopper(node, pushdir, stack, stackid)
local get_stopper = mesecon.mvps_stoppers[node.name]
@ -19,6 +18,15 @@ function mesecon:register_mvps_stopper(nodename, get_stopper)
mesecon.mvps_stoppers[nodename] = get_stopper
end
-- Objects that cannot be moved (e.g. movestones)
function mesecon:register_mvps_unmov(objectname)
mesecon.mvps_unmov[objectname] = true;
end
function mesecon:is_mvps_unmov(objectname)
return mesecon.mvps_unmov[objectname]
end
function mesecon:mvps_process_stack(stack)
-- update mesecons for placed nodes ( has to be done after all nodes have been added )
for _, n in ipairs(stack) do
@ -28,20 +36,20 @@ function mesecon:mvps_process_stack(stack)
end
end
function mesecon:mvps_push(pos, dir, maximum) -- pos: pos of mvps; dir: direction of push; maximum: maximum nodes to be pushed
local np = {x = pos.x, y = pos.y, z = pos.z}
function mesecon:mvps_get_stack(pos, dir, maximum)
-- determine the number of nodes to be pushed
local np = {x = pos.x, y = pos.y, z = pos.z}
local nodes = {}
while true do
local nn = minetest.get_node_or_nil(np)
if not nn or #nodes > maximum then
-- don't push at all, something is in the way (unloaded map or too many nodes)
return
return nil
end
if nn.name == "air"
or minetest.registered_nodes[nn.name].liquidtype ~= "none" then --is liquid
or (minetest.registered_nodes[nn.name]
and minetest.registered_nodes[nn.name].liquidtype ~= "none") then --is liquid
break
end
@ -49,7 +57,13 @@ function mesecon:mvps_push(pos, dir, maximum) -- pos: pos of mvps; dir: directio
np = mesecon:addPosRule(np, dir)
end
return nodes
end
function mesecon:mvps_push(pos, dir, maximum) -- pos: pos of mvps; dir: direction of push; maximum: maximum nodes to be pushed
local nodes = mesecon:mvps_get_stack(pos, dir, maximum)
if not nodes then return end
-- determine if one of the nodes blocks the push
for id, n in ipairs(nodes) do
if mesecon:is_mvps_stopper(n.node, dir, nodes, id) then
@ -76,19 +90,26 @@ function mesecon:mvps_push(pos, dir, maximum) -- pos: pos of mvps; dir: directio
minetest.get_meta(np):from_table(n.meta)
end
local oldstack = mesecon:tablecopy(nodes)
for i in ipairs(nodes) do
nodes[i].pos = mesecon:addPosRule(nodes[i].pos, dir)
end
return true, nodes
for _, n in ipairs(nodes) do
mesecon.on_placenode(n.pos, n.node)
mesecon:update_autoconnect(n.pos)
end
return true, nodes, oldstack
end
function mesecon:mvps_pull_single(pos, dir) -- pos: pos of mvps; direction: direction of pull (matches push direction for sticky pistons)
local np = mesecon:addPosRule(pos, dir)
local nn = minetest.get_node(np)
np = mesecon:addPosRule(pos, dir)
nn = minetest.get_node(np)
if minetest.registered_nodes[nn.name].liquidtype == "none"
and not mesecon:is_mvps_stopper(nn, {x = -dir.x, y = -dir.y, z = -dir.z}, {{pos = np, node = nn}}, 1) then
if ((not minetest.registered_nodes[nn.name]) --unregistered node
or minetest.registered_nodes[nn.name].liquidtype == "none") --non-liquid node
and not mesecon:is_mvps_stopper(nn, {x = -dir.x, y = -dir.y, z = -dir.z}, {{pos = np, node = nn}}, 1) then --non-stopper node
local meta = minetest.get_meta(np):to_table()
minetest.remove_node(np)
minetest.add_node(pos, nn)
@ -98,6 +119,8 @@ function mesecon:mvps_pull_single(pos, dir) -- pos: pos of mvps; direction: dire
nodeupdate(pos)
mesecon.on_dignode(np, nn)
mesecon:update_autoconnect(np)
mesecon:update_autoconnect(pos)
mesecon.on_placenode(pos, nn)
end
return {{pos = np, node = {param2 = 0, name = "air"}}, {pos = pos, node = nn}}
end
@ -108,8 +131,21 @@ function mesecon:mvps_pull_all(pos, direction) -- pos: pos of mvps; direction: d
local lpos2 = {x=pos.x-direction.x*2, y=pos.y-direction.y*2, z=pos.z-direction.z*2} -- 2 away
local lnode2 = minetest.get_node(lpos2)
if lnode.name ~= "ignore" and lnode.name ~= "air" and minetest.registered_nodes[lnode.name].liquidtype == "none" then return end
if lnode2.name == "ignore" or lnode2.name == "air" or not(minetest.registered_nodes[lnode2.name].liquidtype == "none") then return end
--avoid pulling solid nodes
if lnode.name ~= "ignore"
and lnode.name ~= "air"
and ((not minetest.registered_nodes[lnode.name])
or minetest.registered_nodes[lnode.name].liquidtype == "none") then
return
end
--avoid pulling empty or liquid nodes
if lnode2.name == "ignore"
or lnode2.name == "air"
or (minetest.registered_nodes[lnode2.name]
and minetest.registered_nodes[lnode2.name].liquidtype ~= "none") then
return
end
local oldpos = {x=lpos2.x+direction.x, y=lpos2.y+direction.y, z=lpos2.z+direction.z}
repeat
@ -121,9 +157,54 @@ function mesecon:mvps_pull_all(pos, direction) -- pos: pos of mvps; direction: d
lpos2.y = lpos2.y-direction.y
lpos2.z = lpos2.z-direction.z
lnode = minetest.get_node(lpos2)
until lnode.name=="air" or lnode.name=="ignore" or not(minetest.registered_nodes[lnode2.name].liquidtype == "none")
until lnode.name == "air"
or lnode.name == "ignore"
or (minetest.registered_nodes[lnode2.name]
and minetest.registered_nodes[lnode2.name].liquidtype ~= "none")
minetest.remove_node(oldpos)
end
function mesecon:mvps_move_objects(pos, dir, nodestack)
local objects_to_move = {}
-- Move object at tip of stack
local pushpos = mesecon:addPosRule(pos, -- get pos at tip of stack
{x = dir.x * #nodestack,
y = dir.y * #nodestack,
z = dir.z * #nodestack})
local objects = minetest.get_objects_inside_radius(pushpos, 1)
for _, obj in ipairs(objects) do
table.insert(objects_to_move, obj)
end
-- Move objects lying/standing on the stack (before it was pushed - oldstack)
if tonumber(minetest.setting_get("movement_gravity")) > 0 and dir.y == 0 then
-- If gravity positive and dir horizontal, push players standing on the stack
for _, n in ipairs(nodestack) do
local p_above = mesecon:addPosRule(n.pos, {x=0, y=1, z=0})
local objects = minetest.get_objects_inside_radius(p_above, 1)
for _, obj in ipairs(objects) do
table.insert(objects_to_move, obj)
end
end
end
for _, obj in ipairs(objects_to_move) do
local entity = obj:get_luaentity()
if not entity or not mesecon:is_mvps_unmov(entity.name) then
local np = mesecon:addPosRule(obj:getpos(), dir)
--move only if destination is not solid
local nn = minetest.get_node(np)
if not ((not minetest.registered_nodes[nn.name])
or minetest.registered_nodes[nn.name].walkable) then
obj:setpos(np)
end
end
end
end
mesecon:register_mvps_stopper("default:chest_locked")
mesecon:register_mvps_stopper("default:furnace")

View File

@ -1,3 +1 @@
mesecons
default

View File

@ -1,9 +1,7 @@
minetest.register_node("mesecons_noteblock:noteblock", {
description = "Noteblock",
tiles = {"mesecons_noteblock.png"},
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, mese = 1},
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2},
drawtype = "allfaces_optional",
visual_scale = 1.3,
paramtype="light",
@ -25,7 +23,7 @@ minetest.register_node("mesecons_noteblock:noteblock", {
})
minetest.register_craft({
output = '"mesecons_noteblock:noteblock" 1',
output = "mesecons_noteblock:noteblock 1",
recipe = {
{"group:wood", "group:wood", "group:wood"},
{"default:steel_ingot", "default:bluestone_dust", "default:steel_ingot"},

View File

@ -1,3 +1,2 @@
mesecons
mesecons_mvps
default

View File

@ -1,5 +1,3 @@
-- Get mesecon rules of pistons
piston_rules =
{{x=0, y=0, z=1}, --everything apart from z- (pusher side)
@ -57,28 +55,40 @@ piston_get_direction = function (dir, node)
end
local piston_remove_pusher = function (pos, node)
local pistonspec = minetest.registered_nodes[node.name].mesecons_piston
pistonspec = minetest.registered_nodes[node.name].mesecons_piston
if pushername == pistonspec.pusher then --make sure there actually is a pusher (for compatibility reasons mainly)
return
end
local dir = piston_get_direction(pistonspec.dir, node)
dir = piston_get_direction(pistonspec.dir, node)
local pusherpos = mesecon:addPosRule(pos, dir)
local pushername = minetest.get_node(pusherpos).name
if pushername == pistonspec.pusher then --make sure there actually is a pusher (for compatibility reasons mainly)
minetest.remove_node(pusherpos)
minetest.sound_play("piston_retract", {
pos = pos,
max_hear_distance = 20,
gain = 0.3,
})
nodeupdate(pusherpos)
end
end
local piston_on = function (pos, node)
local pistonspec = minetest.registered_nodes[node.name].mesecons_piston
local dir = piston_get_direction(pistonspec.dir, node)
local np = mesecon:addPosRule(pos, dir)
local success, stack = mesecon:mvps_push(np, dir, PISTON_MAXIMUM_PUSH)
local success, stack, oldstack = mesecon:mvps_push(np, dir, PISTON_MAXIMUM_PUSH)
if success then
minetest.add_node(pos, {param2 = node.param2, name = pistonspec.onname})
minetest.add_node(np, {param2 = node.param2, name = pistonspec.pusher})
minetest.sound_play("piston_extend", {
pos = pos,
max_hear_distance = 20,
gain = 0.3,
})
mesecon:mvps_process_stack(stack)
mesecon:mvps_move_objects (np, dir, oldstack)
end
end
@ -88,10 +98,10 @@ local piston_off = function (pos, node)
piston_remove_pusher (pos, node)
if pistonspec.sticky then
local dir = piston_get_direction(pistonspec.dir, node)
local pullpos = mesecon:addPosRule(pos, dir)
local stack = mesecon:mvps_pull_single(pullpos, dir)
mesecon:mvps_process_stack(stack)
dir = piston_get_direction(pistonspec.dir, node)
pullpos = mesecon:addPosRule(pos, dir)
stack = mesecon:mvps_pull_single(pullpos, dir)
mesecon:mvps_process_stack(pos, dir, stack)
end
end
@ -152,9 +162,9 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
"mesecons_piston_left.png",
"mesecons_piston_right.png",
"mesecons_piston_back.png",
"mesecons_piston_pusher.png"
"mesecons_piston_pusher_front.png"
},
groups = {cracky = 3, mese = 1},
groups = {cracky = 3},
paramtype2 = "facedir",
after_place_node = piston_orientate,
mesecons_piston = pistonspec_normal,
@ -197,12 +207,12 @@ minetest.register_node("mesecons_pistons:piston_normal_on", {
minetest.register_node("mesecons_pistons:piston_pusher_normal", {
drawtype = "nodebox",
tiles = {
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png"
"mesecons_piston_top.png",
"mesecons_piston_bottom.png",
"mesecons_piston_left.png",
"mesecons_piston_right.png",
"mesecons_piston_back.png",
"mesecons_piston_pusher_front.png"
},
paramtype = "light",
paramtype2 = "facedir",
@ -235,7 +245,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
"mesecons_piston_back.png",
"mesecons_piston_pusher_front_sticky.png"
},
groups = {cracky = 3, mese = 1},
groups = {cracky = 3},
paramtype2 = "facedir",
after_place_node = piston_orientate,
mesecons_piston = pistonspec_sticky,
@ -278,11 +288,11 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", {
minetest.register_node("mesecons_pistons:piston_pusher_sticky", {
drawtype = "nodebox",
tiles = {
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png",
"mesecons_piston_top.png",
"mesecons_piston_bottom.png",
"mesecons_piston_left.png",
"mesecons_piston_right.png",
"mesecons_piston_back.png",
"mesecons_piston_pusher_front_sticky.png"
},
paramtype = "light",
@ -326,7 +336,7 @@ local pistonspec_normal_up = {
-- offstate
minetest.register_node("mesecons_pistons:piston_up_normal_off", {
tiles = {
"mesecons_piston_pusher.png",
"mesecons_piston_pusher_front.png",
"mesecons_piston_back.png",
"mesecons_piston_left.png^[transformR270",
"mesecons_piston_right.png^[transformR90",
@ -377,12 +387,12 @@ minetest.register_node("mesecons_pistons:piston_up_normal_on", {
minetest.register_node("mesecons_pistons:piston_up_pusher_normal", {
drawtype = "nodebox",
tiles = {
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png^[transformR270",
"mesecons_piston_pusher.png^[transformR90",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png^[transformR180",
"mesecons_piston_pusher_front.png",
"mesecons_piston_back.png",
"mesecons_piston_left.png^[transformR270",
"mesecons_piston_right.png^[transformR90",
"mesecons_piston_bottom.png",
"mesecons_piston_top.png^[transformR180",
},
paramtype = "light",
paramtype2 = "facedir",
@ -462,11 +472,11 @@ minetest.register_node("mesecons_pistons:piston_up_pusher_sticky", {
drawtype = "nodebox",
tiles = {
"mesecons_piston_pusher_front_sticky.png",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png^[transformR270",
"mesecons_piston_pusher.png^[transformR90",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png^[transformR180",
"mesecons_piston_back.png",
"mesecons_piston_left.png^[transformR270",
"mesecons_piston_right.png^[transformR90",
"mesecons_piston_bottom.png",
"mesecons_piston_top.png^[transformR180",
},
paramtype = "light",
paramtype2 = "facedir",
@ -512,7 +522,7 @@ local pistonspec_normal_down = {
minetest.register_node("mesecons_pistons:piston_down_normal_off", {
tiles = {
"mesecons_piston_back.png",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher_front.png",
"mesecons_piston_left.png^[transformR90",
"mesecons_piston_right.png^[transformR270",
"mesecons_piston_bottom.png^[transformR180",
@ -563,12 +573,12 @@ minetest.register_node("mesecons_pistons:piston_down_normal_on", {
minetest.register_node("mesecons_pistons:piston_down_pusher_normal", {
drawtype = "nodebox",
tiles = {
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png",
"mesecons_piston_pusher.png^[transformR90",
"mesecons_piston_pusher.png^[transformR270",
"mesecons_piston_pusher.png^[transformR180",
"mesecons_piston_pusher.png",
"mesecons_piston_back.png",
"mesecons_piston_pusher_front.png",
"mesecons_piston_left.png^[transformR90",
"mesecons_piston_right.png^[transformR270",
"mesecons_piston_bottom.png^[transformR180",
"mesecons_piston_top.png",
},
paramtype = "light",
paramtype2 = "facedir",
@ -643,12 +653,12 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_on", {
minetest.register_node("mesecons_pistons:piston_down_pusher_sticky", {
drawtype = "nodebox",
tiles = {
"mesecons_piston_pusher.png",
"mesecons_piston_back.png",
"mesecons_piston_pusher_front_sticky.png",
"mesecons_piston_pusher.png^[transformR90",
"mesecons_piston_pusher.png^[transformR270",
"mesecons_piston_pusher.png^[transformR180",
"mesecons_piston_pusher.png",
"mesecons_piston_left.png^[transformR90",
"mesecons_piston_right.png^[transformR270",
"mesecons_piston_bottom.png^[transformR180",
"mesecons_piston_top.png",
},
paramtype = "light",
paramtype2 = "facedir",
@ -731,7 +741,7 @@ mesecon:register_mvps_stopper("mesecons_pistons:piston_down_sticky_on", piston_u
--craft recipes
minetest.register_craft({
output = 'mesecons_pistons:piston_normal_off',
output = "mesecons_pistons:piston_normal_off 2",
recipe = {
{"group:wood", "group:wood", "group:wood"},
{"default:cobble", "default:steel_ingot", "default:cobble"},

View File

@ -1,2 +1 @@
mesecons
default

View File

@ -1,5 +1,3 @@
local pp_box_off = {
type = "fixed",
fixed = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 },
@ -10,7 +8,7 @@ local pp_box_on = {
fixed = { -7/16, -8/16, -7/16, 7/16, -7.5/16, 7/16 },
}
pp_on_timer = function (pos, elapsed)
local function pp_on_timer(pos, elapsed)
local node = minetest.get_node(pos)
local ppspec = minetest.registered_nodes[node.name].pressureplate
@ -59,12 +57,12 @@ function mesecon:register_pressure_plate(offstate, onstate, description, texture
minetest.register_node(offstate, {
drawtype = "nodebox",
tiles = {texture_off},
tiles = texture_off,
wield_image = texture_off,
paramtype = "light",
selection_box = pp_box_off,
node_box = pp_box_off,
groups = {snappy = 2, oddly_breakable_by_hand = 3, mese = 1},
groups = {snappy = 2, oddly_breakable_by_hand = 3},
description = description,
pressureplate = ppspec,
on_timer = pp_on_timer,
@ -78,7 +76,7 @@ function mesecon:register_pressure_plate(offstate, onstate, description, texture
minetest.register_node(onstate, {
drawtype = "nodebox",
tiles = {texture_on},
tiles = texture_on,
paramtype = "light",
selection_box = pp_box_on,
node_box = pp_box_on,
@ -111,14 +109,14 @@ mesecon:register_pressure_plate(
"mesecons_pressureplates:pressure_plate_wood_off",
"mesecons_pressureplates:pressure_plate_wood_on",
"Wooden Pressure Plate",
"default_wood.png",
"default_wood.png",
{"default_wood.png"},
{"default_wood.png"},
{{"default:wood", "default:wood"}})
mesecon:register_pressure_plate(
"mesecons_pressureplates:pressure_plate_stone_off",
"mesecons_pressureplates:pressure_plate_stone_on",
"Stone Pressure Plate",
"default_stone.png",
"default_stone.png",
{"default_stone.png"},
{"default_stone.png"},
{{"default:cobble", "default:cobble"}})

View File

@ -1,3 +1,2 @@
default
mesecons
mesecons_materials
mesecons_materials

View File

@ -1,22 +1,24 @@
local boxes = { -8/16, -8/16, -8/16, 8/16, -2/16, 8/16 } -- Solar Pannel
-- Solar Panel
minetest.register_node("mesecons_solarpanel:solar_panel_on", {
drawtype = "nodebox",
tiles = { "jeija_solar_panel.png","jeija_solar_panel.png","jeija_solar_panel_side.png",
"jeija_solar_panel_side.png","jeija_solar_panel_side.png","jeija_solar_panel_side.png", },
tiles = { "jeija_solar_panel.png", },
inventory_image = "jeija_solar_panel.png",
wield_image = "jeija_solar_panel.png",
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
selection_box = {
type = "fixed",
fixed = boxes
},
is_ground_content = true,
node_box = {
type = "fixed",
fixed = boxes
type = "wallmounted",
wall_bottom = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 },
wall_top = { -7/16, 7/16, -7/16, 7/16, 8/16, 7/16 },
wall_side = { -8/16, -7/16, -7/16, -7/16, 7/16, 7/16 },
},
selection_box = {
type = "wallmounted",
wall_bottom = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 },
wall_top = { -7/16, 7/16, -7/16, 7/16, 8/16, 7/16 },
wall_side = { -8/16, -7/16, -7/16, -7/16, 7/16, 7/16 },
},
drop = "mesecons_solarpanel:solar_panel_off",
groups = {dig_immediate=3, not_in_creative_inventory = 1},
@ -29,20 +31,26 @@ minetest.register_node("mesecons_solarpanel:solar_panel_on", {
-- Solar Panel
minetest.register_node("mesecons_solarpanel:solar_panel_off", {
drawtype = "nodebox",
tiles = { "jeija_solar_panel.png","jeija_solar_panel.png","jeija_solar_panel_side.png",
"jeija_solar_panel_side.png","jeija_solar_panel_side.png","jeija_solar_panel_side.png", },
tiles = { "jeija_solar_panel.png", },
inventory_image = "jeija_solar_panel.png",
wield_image = "jeija_solar_panel.png",
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
selection_box = {
type = "fixed",
fixed = boxes
},
is_ground_content = true,
node_box = {
type = "fixed",
fixed = boxes
type = "wallmounted",
wall_bottom = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 },
wall_top = { -7/16, 7/16, -7/16, 7/16, 8/16, 7/16 },
wall_side = { -8/16, -7/16, -7/16, -7/16, 7/16, 7/16 },
},
selection_box = {
type = "wallmounted",
wall_bottom = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 },
wall_top = { -7/16, 7/16, -7/16, 7/16, 8/16, 7/16 },
wall_side = { -8/16, -7/16, -7/16, -7/16, 7/16, 7/16 },
},
groups = {dig_immediate=3, mese = 1},
groups = {dig_immediate=3},
description="Solar Panel",
sounds = default.node_sound_glass_defaults(),
mesecons = {receptor = {
@ -51,7 +59,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_off", {
})
minetest.register_craft({
output = '"mesecons_solarpanel:solar_panel_off" 1',
output = "mesecons_solarpanel:solar_panel_off 1",
recipe = {
{'default:glass', 'default:glass', 'default:glass'},
{'default:glass', 'default:glass', 'default:glass'},
@ -66,7 +74,7 @@ minetest.register_abm(
action = function(pos, node, active_object_count, active_object_count_wider)
local light = minetest.get_node_light(pos, nil)
if light >= 12 and minetest.get_timeofday() > 0.2 and minetest.get_timeofday() < 0.8 then
if light >= 12 then
minetest.set_node(pos, {name="mesecons_solarpanel:solar_panel_on", param2=node.param2})
mesecon:receptor_on(pos)
end
@ -87,90 +95,6 @@ minetest.register_abm(
end,
})
--- Solar panel inversed
-- Solar Panel
minetest.register_node("mesecons_solarpanel:solar_panel_inverted_on", {
drawtype = "nodebox",
tiles = { "jeija_solar_panel_inverted.png","jeija_solar_panel_inverted.png","jeija_solar_panel_side.png",
"jeija_solar_panel_side.png","jeija_solar_panel_side.png","jeija_solar_panel_side.png", },
wield_image = "jeija_solar_panel_inverted.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = boxes
},
node_box = {
type = "fixed",
fixed = boxes
},
drop = "mesecons_solarpanel:solar_panel_inverted_off",
groups = {dig_immediate=3, not_in_creative_inventory = 1},
sounds = default.node_sound_glass_defaults(),
mesecons = {receptor = {
state = mesecon.state.on
}}
})
-- Solar Panel
minetest.register_node("mesecons_solarpanel:solar_panel_inverted_off", {
drawtype = "nodebox",
tiles = { "jeija_solar_panel_inverted.png","jeija_solar_panel_inverted.png","jeija_solar_panel_side.png",
"jeija_solar_panel_side.png","jeija_solar_panel_side.png","jeija_solar_panel_side.png", },
wield_image = "jeija_solar_panel_inverted.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = boxes
},
node_box = {
type = "fixed",
fixed = boxes
},
groups = {dig_immediate=3, mese =1},
description="Solar Panel Inverted",
sounds = default.node_sound_glass_defaults(),
mesecons = {receptor = {
state = mesecon.state.off
}}
})
minetest.register_craft({
output = '"mesecons_solarpanel:solar_panel_inverted_off" 1',
recipe = {
{'default:restone_dust', 'default:restone_dust', 'default:restone_dust'},
{'default:glass', 'default:glass', 'default:glass'},
{'default:glass', 'default:glass', 'default:glass'},
}
})
minetest.register_abm(
{nodenames = {"mesecons_solarpanel:solar_panel_inverted_off"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local light = minetest.get_node_light(pos, nil)
if light < 12 then
minetest.set_node(pos, {name="mesecons_solarpanel:solar_panel_inverted_on", param2=node.param2})
mesecon:receptor_on(pos)
end
end,
})
minetest.register_abm(
{nodenames = {"mesecons_solarpanel:solar_panel_inverted_on"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local light = minetest.get_node_light(pos, nil)
if light >= 12 and minetest.get_timeofday() > 0.8 and minetest.get_timeofday() < 0.2 then
minetest.set_node(pos, {name="mesecons_solarpanel:solar_panel_inverted_off", param2=node.param2})
mesecon:receptor_off(pos)
end
end,
})
-- Solar panel
minetest.register_alias("mesecons_solarpanel:solar_panel_inverted_on", "mesecons_solarpanel:solar_panel_on")
minetest.register_alias("mesecons_solarpanel:solar_panel_inverted_off", "mesecons_solarpanel:solar_panel_off")

View File

@ -1,2 +1 @@
mesecons
default

View File

@ -1,5 +1,3 @@
--MESECON TORCHES
local rotate_torch_rules = function (rules, param2)
@ -77,8 +75,8 @@ minetest.register_node("mesecons_torch:mesecon_torch_on", {
walkable = false,
paramtype2 = "wallmounted",
selection_box = torch_selectionbox,
groups = {dig_immediate=3, mese = 1},
light_source = default.LIGHT_MAX-10,
groups = {dig_immediate=3},
light_source = default.LIGHT_MAX-5,
description="Bluestone Torch",
mesecons = {receptor = {
state = mesecon.state.on,
@ -89,7 +87,7 @@ minetest.register_node("mesecons_torch:mesecon_torch_on", {
minetest.register_node("mesecons_torch:bluestoneblock", {
description = "Bluestone Block",
tiles = {"default_bluestone_block.png"},
groups = {cracky=1, mese = 1},
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.on,
@ -128,11 +126,11 @@ minetest.register_abm({
if is_powered then
if node.name == "mesecons_torch:mesecon_torch_on" then
mesecon:swap_node(pos, "mesecons_torch:mesecon_torch_off")
minetest.swap_node(pos, {name = "mesecons_torch:mesecon_torch_off", param2 = node.param2})
mesecon:receptor_off(pos, torch_get_output_rules(node))
end
elseif node.name == "mesecons_torch:mesecon_torch_off" then
mesecon:swap_node(pos, "mesecons_torch:mesecon_torch_on")
minetest.swap_node(pos, {name = "mesecons_torch:mesecon_torch_on", param2 = node.param2})
mesecon:receptor_on(pos, torch_get_output_rules(node))
end
end

View File

@ -1,5 +1,3 @@
-- WALL LEVER
-- Basically a switch that can be attached to a wall
-- Powers the block 2 nodes behind (using a receiver)
@ -29,10 +27,10 @@ minetest.register_node("mesecons_walllever:wall_lever_off", {
fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base
{ -1/16, -8/16, 7/16, 1/16, 0/16, 5/16 }} -- the lever itself.
},
groups = {dig_immediate=2, mese = 1},
groups = {dig_immediate=2},
description="Lever",
on_punch = function (pos, node)
mesecon:swap_node(pos, "mesecons_walllever:wall_lever_on")
minetest.swap_node(pos, {name = "mesecons_walllever:wall_lever_on", param2 = node.param2})
mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node))
minetest.sound_play("mesecons_lever", {pos=pos})
end,
@ -68,10 +66,10 @@ minetest.register_node("mesecons_walllever:wall_lever_on", {
{ -1/16, 0/16, 7/16, 1/16, 8/16, 5/16 }} -- the lever itself.
},
groups = {dig_immediate = 2, not_in_creative_inventory = 1},
drop = '"mesecons_walllever:wall_lever_off" 1',
drop = "mesecons_walllever:wall_lever_off 1",
description="Lever",
on_punch = function (pos, node)
mesecon:swap_node(pos, "mesecons_walllever:wall_lever_off")
minetest.swap_node(pos, {name = "mesecons_walllever:wall_lever_off", param2 = node.param2})
mesecon:receptor_off(pos, mesecon.rules.buttonlike_get(node))
minetest.sound_play("mesecons_lever", {pos=pos})
end,
@ -83,9 +81,9 @@ minetest.register_node("mesecons_walllever:wall_lever_on", {
})
minetest.register_craft({
output = 'mesecons_walllever:wall_lever_off',
output = "mesecons_walllever:wall_lever_off 2",
recipe = {
{'default:stick'},
{'default:stone'},
{"default:cobble"},
{"default:stick"},
}
})

View File

@ -14,7 +14,7 @@ function boost_cart:on_rail_step(entity, pos, distance)
entity.sound_counter = entity.sound_counter - distance
if HAVE_MESECONS_ENABLED then
boost_cart:signal_detector_rail(pos)
--boost_cart:signal_detector_rail(pos)
end
end

View File

@ -16,7 +16,7 @@ if creative_mode_cache then
-- increased such that nodes of differing levels have an insignificant
-- effect on digtime.
local digtime = 128
local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 256}
local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 192}
minetest.register_item(":", {
type = "none",

View File

@ -296,7 +296,7 @@ doors:register_door("doors:door_wood", {
description = "Wooden Door",
inventory_image = "door_wood.png",
stack_max = 16,
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,door=1, mese = 1},
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door = 1},
tiles_bottom = {"door_wood_b.png", "door_brown.png"},
tiles_top = {"door_wood_a.png", "door_brown.png"},
})
@ -315,7 +315,7 @@ doors:register_door("doors:door_acacia", {
description = "Wooden Acacia Door",
inventory_image = "door_acacia.png",
stack_max = 16,
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,door=1, mese=1},
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door=1},
tiles_bottom = {"door_acacia_b.png", "door_brown.png"},
tiles_top = {"door_acacia_a.png", "door_brown.png"},
})
@ -334,7 +334,7 @@ doors:register_door("doors:door_birch", {
description = "Wooden Birch Door",
stack_max = 16,
inventory_image = "door_birch.png",
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,door=1, mese = 1},
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,door=1},
tiles_bottom = {"door_birch_b.png", "door_brown.png"},
tiles_top = {"door_birch_a.png", "door_brown.png"},
})
@ -344,7 +344,7 @@ doors:register_door("doors:door_dark_oak", {
description = "Wooden Dark Oak Door",
inventory_image = "door_dark_oak.png",
stack_max = 16,
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,door=1, mese=1},
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door=1},
tiles_bottom = {"door_dark_oak_b.png", "door_brown.png"},
tiles_top = {"door_dark_oak_a.png", "door_brown.png"},
})
@ -354,7 +354,7 @@ doors:register_door("doors:door_jungle", {
description = "Wooden Jungle Door",
stack_max = 16,
inventory_image = "door_jungle.png",
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,door=1, mese=1},
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door=1},
tiles_bottom = {"door_jungle_b.png", "door_brown.png"},
tiles_top = {"door_jungle_a.png", "door_brown.png"},
})
@ -374,7 +374,7 @@ doors:register_door("doors:door_steel", {
description = "Steel Door",
stack_max = 16,
inventory_image = "door_steel.png",
groups = {snappy = 1,bendy=2,cracky=1,melty=2,level=2,door=1,mesecon_effector_on=1, mese=1},
groups = {snappy = 1,bendy=2,cracky=1,melty=2,level=2,door=1, mesecon_effector_on=1},
tiles_bottom = {"door_steel_b.png", "door_grey.png"},
tiles_top = {"door_steel_a.png", "door_grey.png"},
only_placer_can_open = true,
@ -412,7 +412,7 @@ local function punch(pos)
me = minetest.get_node(pos)
local tmp_node
local tmp_node2
oben = {x=pos.x, y=pos.y+1, z=pos.z}
-- oben = {x=pos.x, y=pos.y+1, z=pos.z}
if state == 1 then
state = 0
minetest.sound_play("doors_door_close", {pos = pos, gain = 0.3, max_hear_distance = 10})
@ -434,7 +434,7 @@ minetest.register_node("doors:trapdoor", {
paramtype = "light",
stack_max = 16,
paramtype2 = "facedir",
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2,mesecon_effector_on=1, flammable = 2,door=1,mese=1},
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2,mesecon_effector_on=1, flammable = 2, door=1},
sounds = default.node_sound_wood_defaults(),
drop = "doors:trapdoor",
node_box = {
@ -529,7 +529,7 @@ local function punch(pos)
me = minetest.get_node(pos)
local tmp_node
local tmp_node2
oben = {x=pos.x, y=pos.y+1, z=pos.z}
-- oben = {x=pos.x, y=pos.y+1, z=pos.z}
if state == 1 then
state = 0
minetest.sound_play("doors_door_close", {pos = pos, gain = 0.3, max_hear_distance = 10})
@ -551,7 +551,7 @@ minetest.register_node("doors:iron_trapdoor", {
paramtype = "light",
stack_max = 16,
paramtype2 = "facedir",
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2,mesecon_effector_on=1, flammable = 0,door=1, mese=1},
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2,mesecon_effector_on=1, flammable = 0, door=1},
sounds = default.node_sound_wood_defaults(),
drop = "doors:iron_trapdoor",
node_box = {

View File

@ -1,6 +1,6 @@
local age = 1 --How old an item has to be before collecting
local age = 0.5 --How old an item has to be before collecting
local radius_magnet = 2 --Radius of item magnet
local player_collect_height = 1.3 --Added to their pos y value
local player_collect_height = 1.3 --Added to their pos y value
local function collect_items(player)
local pos = player:get_pos()

View File

@ -641,7 +641,7 @@ minetest.register_node("fences:fencegate", {
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = true,
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, mesecon_effector_on=1, fences=1, mese = 1},
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, mesecon_effector_on = 1, fences = 1},
drop = 'fences:fencegate',
drawtype = "nodebox",
node_box = {

View File

@ -1,95 +1,95 @@
mobs:register_mob("mobs_animal:bear", {
type = "npc",
visual = "mesh",
mesh = "mobs_bear.b3d",
rotate = 0,
collisionbox = {-0.5, -0.01, -0.5, 0.5, 1.49, 0.5},
animation = {
speed_normal = 15, speed_run = 30,
stand_start = 0, stand_end = 30,
walk_start = 35, walk_end = 65,
run_start = 105, run_end = 135,
punch_start = 70, punch_end = 100,
},
textures = {
{"mobs_bear.png"},
},
sounds = {
random = "mobs_bear",
attack = "mobs_bear_angry",
},
fear_height = 4,
runaway = false,
jump = false,
jump_height = 4,
fly = false,
walk_chance = 75,
run_velocity = 3,
view_range = 14,
follow = {
"farming:blueberries", "farming:raspberries"
},
attack_type = "dogfight",
damage = 4,
reach = 3,
attacks_monsters = true,
pathfinding = true,
hp_min = 10,
hp_max = 15,
armor = 100,
knock_back = 1,
water_damage = 0,
lava_damage = 10,
fall_damage = 5,
makes_footstep_sound = true,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
{name = "mobs:meat_raw", chance = 2, min = 1, max = 1},
{name = "mobs:meat_raw", chance = 2, min = 1, max = 1},
{name = "mobs:leather", chance = 1, min = 1, max = 1},
{name = "mobs:leather", chance = 2, min = 1, max = 1}
},
replace_what = {
"farming:blueberry_4", "farming:raspberry_4"
},
replace_with = "air",
replace_rate = 20,
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 10, true, true) then
return
end
if clicker:get_wielded_item():is_empty() and clicker:get_player_name() == self.owner then
if clicker:get_player_control().sneak then
self.order = ""
self.state = "walk"
self.walk_velocity = 1
else
if self.order == "follow" then
self.order = "stand"
self.state = "stand"
self.walk_velocity = 1
else
self.order = "follow"
self.state = "walk"
self.walk_velocity = 3
end
end
return
end
mobs:capture_mob(self, clicker, 0, 0, 80, false, nil)
end,
after_activate = function(self, staticdata, def, dtime)
-- replace bear using the old directx model
if self.mesh == "mobs_bear.x" then
local pos = self.object:get_pos()
if pos then
minetest.add_entity(pos, self.name)
self.object:remove()
end
mobs:register_mob("mobs_animal:bear", {
type = "npc",
visual = "mesh",
mesh = "mobs_bear.b3d",
rotate = 0,
collisionbox = {-0.5, -0.01, -0.5, 0.5, 1.49, 0.5},
animation = {
speed_normal = 15, speed_run = 30,
stand_start = 0, stand_end = 30,
walk_start = 35, walk_end = 65,
run_start = 105, run_end = 135,
punch_start = 70, punch_end = 100,
},
textures = {
{"mobs_bear.png"},
},
sounds = {
random = "mobs_bear",
attack = "mobs_bear_angry",
},
fear_height = 4,
runaway = false,
jump = false,
jump_height = 4,
fly = false,
walk_chance = 75,
run_velocity = 3,
view_range = 14,
follow = {
"farming:blueberries", "farming:raspberries"
},
attack_type = "dogfight",
damage = 4,
reach = 3,
attacks_monsters = true,
pathfinding = true,
hp_min = 10,
hp_max = 15,
armor = 100,
knock_back = 1,
water_damage = 0,
lava_damage = 10,
fall_damage = 5,
makes_footstep_sound = true,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
{name = "mobs:meat_raw", chance = 2, min = 1, max = 1},
{name = "mobs:meat_raw", chance = 2, min = 1, max = 1},
{name = "mobs:leather", chance = 1, min = 1, max = 1},
{name = "mobs:leather", chance = 2, min = 1, max = 1}
},
replace_what = {
"farming:blueberry_4", "farming:raspberry_4"
},
replace_with = "air",
replace_rate = 20,
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 10, true, true) then
return
end
if clicker:get_wielded_item():is_empty() and clicker:get_player_name() == self.owner then
if clicker:get_player_control().sneak then
self.order = ""
self.state = "walk"
self.walk_velocity = 1
else
if self.order == "follow" then
self.order = "stand"
self.state = "stand"
self.walk_velocity = 1
else
self.order = "follow"
self.state = "walk"
self.walk_velocity = 3
end
end
return
end
mobs:capture_mob(self, clicker, 0, 0, 80, false, nil)
end,
})
after_activate = function(self, staticdata, def, dtime)
-- replace bear using the old directx model
if self.mesh == "mobs_bear.x" then
local pos = self.object:get_pos()
if pos then
minetest.add_entity(pos, self.name)
self.object:remove()
end
end
end,
})
mobs:spawn({
name = "mobs_animal:bear",
@ -105,4 +105,4 @@ mobs:spawn({
mobs:register_egg("mobs_animal:bear", "Bear", "wool_brown.png", 1)
-- compatibility
mobs:alias_mob("mobs:bear", "mobs_animal:bear")
mobs:alias_mob("mobs:bear", "mobs_animal:bear")

View File

@ -1,5 +1,4 @@
-- Bunny by ExeterDad
mobs:register_mob("mobs_animal:bunny", {
stepheight = 0.6,
type = "animal",
@ -24,7 +23,7 @@ mobs:register_mob("mobs_animal:bunny", {
runaway = true,
runaway_from = {"mobs_animal:pumba", "player"},
jump = true,
jump_height = 6,
jump_height = 4,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
},

View File

@ -1,5 +1,4 @@
-- Chicken by JK Murray
mobs:register_mob("mobs_animal:chicken", {
type = "animal",
passive = true,
@ -19,7 +18,7 @@ mobs:register_mob("mobs_animal:chicken", {
run_velocity = 3,
runaway = true,
drops = {
{name = "mobs:chicken_raw", chance = 1, min = 1, max = 1},
{name = "mobs:chicken_raw", chance = 1, min = 1, max = 1}
},
water_damage = 0,
lava_damage = 5,

View File

@ -22,14 +22,14 @@ mobs:register_mob("mobs_animal:cow", {
walk_velocity = 1,
run_velocity = 2,
jump = true,
jump_height = 6,
jump_height = 4,
pushable = true,
drops = {
{name = "mobs:meat_raw", chance = 1},
{name = "mobs:meat_raw", chance = 2},
{name = "mobs:meat_raw", chance = 2},
{name = "mobs:leather", chance = 2},
{name = "mobs:leather", chance = 2}
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
{name = "mobs:meat_raw", chance = 2, min = 1, max = 1},
{name = "mobs:meat_raw", chance = 2, min = 1, max = 1},
{name = "mobs:leather", chance = 2, min = 1, max = 1},
{name = "mobs:leather", chance = 2, min = 1, max = 1}
},
water_damage = 0,
lava_damage = 5,
@ -115,7 +115,7 @@ mobs:register_mob("mobs_animal:cow", {
self.gotten = false
end
end,
after_activate = function(self, staticdata, def, dtime)
-- replace cow using the old directx model
if self.mesh == "mobs_cow.x" then

View File

@ -1,62 +1,62 @@
mobs:register_mob("mobs_animal:wolf", {
type = "animal",
visual = "mesh",
mesh = "mobs_wolf.x",
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
animation = {
speed_normal = 20, speed_run = 30,
stand_start = 10, stand_end = 20,
walk_start = 75, walk_end = 100,
run_start = 100, run_end = 130,
punch_start = 135, punch_end = 155,
},
textures = {
{"mobs_wolf.png"},
},
fear_height = 4,
runaway = false,
jump = false,
jump_height = 4,
fly = false,
walk_chance = 75,
walk_velocity = 2,
run_velocity = 3,
view_range = 7,
follow = "mobs:meat_raw",
passive = false,
attack_type = "dogfight",
damage = 2,
reach = 2,
attacks_monsters = false,
pathfinding = true,
group_attack = true,
hp_min = 8,
hp_max = 10,
armor = 100,
knock_back = 2,
water_damage = 0,
lava_damage = 5,
fall_damage = 4,
makes_footstep_sound = true,
sounds = {
war_cry = "mobs_wolf_attack",
death = "mobs_wolf_attack"
},
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 2, false, true) then
if self.food == 0 then
local mob = minetest.add_entity(self.object:getpos(), "mobs_animal:dog")
local ent = mob:get_luaentity()
ent.owner = clicker:get_player_name()
ent.following = clicker
ent.order = "follow"
self.object:remove()
end
return
end
mobs:capture_mob(self, clicker, 0, 0, 80, true, nil)
mobs:register_mob("mobs_animal:wolf", {
type = "animal",
visual = "mesh",
mesh = "mobs_wolf.x",
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
animation = {
speed_normal = 20, speed_run = 30,
stand_start = 10, stand_end = 20,
walk_start = 75, walk_end = 100,
run_start = 100, run_end = 130,
punch_start = 135, punch_end = 155,
},
textures = {
{"mobs_wolf.png"},
},
fear_height = 4,
runaway = false,
jump = false,
jump_height = 4,
fly = false,
walk_chance = 75,
walk_velocity = 2,
run_velocity = 3,
view_range = 7,
follow = "mobs:meat_raw",
passive = false,
attack_type = "dogfight",
damage = 2,
reach = 2,
attacks_monsters = false,
pathfinding = true,
group_attack = true,
hp_min = 8,
hp_max = 10,
armor = 100,
knock_back = 2,
water_damage = 0,
lava_damage = 5,
fall_damage = 4,
makes_footstep_sound = true,
sounds = {
war_cry = "mobs_wolf_attack",
death = "mobs_wolf_attack"
},
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 2, false, true) then
if self.food == 0 then
local mob = minetest.add_entity(self.object:getpos(), "mobs_animal:dog")
local ent = mob:get_luaentity()
ent.owner = clicker:get_player_name()
ent.following = clicker
ent.order = "follow"
self.object:remove()
end
})
return
end
mobs:capture_mob(self, clicker, 0, 0, 80, true, nil)
end
})
mobs:spawn({
name = "mobs_animal:wolf",
@ -72,81 +72,81 @@ mobs:spawn({
mobs:register_egg("mobs_animal:wolf", "Wolf", "wool_grey.png", 1)
-- Dog
mobs:register_mob("mobs_animal:dog", {
type = "npc",
visual = "mesh",
mesh = "mobs_wolf.x",
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
animation = {
speed_normal = 20, speed_run = 30,
stand_start = 10, stand_end = 20,
walk_start = 75, walk_end = 100,
run_start = 100, run_end = 130,
punch_start = 135, punch_end = 155,
},
textures = {
{"mobs_dog.png"}
},
fear_height = 4,
runaway = false,
jump = false,
jump_height = 4,
fly = false,
walk_chance = 75,
walk_velocity = 2,
run_velocity = 4,
view_range = 15,
follow = "mobs:meat_raw",
passive = false,
attack_type = "dogfight",
damage = 4,
reach = 2,
attacks_monsters = true,
pathfinding = true,
group_attack = true,
hp_min = 15,
hp_max = 25,
armor = 100,
knock_back = 2,
water_damage = 0,
lava_damage = 5,
fall_damage = 5,
makes_footstep_sound = true,
sounds = {
war_cry = "mobs_wolf_attack",
death = "mobs_wolf_attack"
},
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 6, true, true) then
return
end
if clicker:get_wielded_item():is_empty() and clicker:get_player_name() == self.owner then
if clicker:get_player_control().sneak then
self.order = ""
self.state = "walk"
self.walk_velocity = 2
self.stepheight = 0.6
else
if self.order == "follow" then
self.order = "stand"
self.state = "stand"
self.walk_velocity = 2
self.stepheight = 0.6
else
self.order = "follow"
self.state = "walk"
self.walk_velocity = 3
self.stepheight = 1.1
end
end
return
end
mobs:capture_mob(self, clicker, 0, 0, 80, false, nil)
mobs:register_mob("mobs_animal:dog", {
type = "npc",
visual = "mesh",
mesh = "mobs_wolf.x",
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
animation = {
speed_normal = 20, speed_run = 30,
stand_start = 10, stand_end = 20,
walk_start = 75, walk_end = 100,
run_start = 100, run_end = 130,
punch_start = 135, punch_end = 155,
},
textures = {
{"mobs_dog.png"}
},
fear_height = 4,
runaway = false,
jump = false,
jump_height = 4,
fly = false,
walk_chance = 75,
walk_velocity = 2,
run_velocity = 4,
view_range = 15,
follow = "mobs:meat_raw",
passive = false,
attack_type = "dogfight",
damage = 4,
reach = 2,
attacks_monsters = true,
pathfinding = true,
group_attack = true,
hp_min = 15,
hp_max = 25,
armor = 100,
knock_back = 2,
water_damage = 0,
lava_damage = 5,
fall_damage = 5,
makes_footstep_sound = true,
sounds = {
war_cry = "mobs_wolf_attack",
death = "mobs_wolf_attack"
},
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 6, true, true) then
return
end
if clicker:get_wielded_item():is_empty() and clicker:get_player_name() == self.owner then
if clicker:get_player_control().sneak then
self.order = ""
self.state = "walk"
self.walk_velocity = 2
self.stepheight = 0.6
else
if self.order == "follow" then
self.order = "stand"
self.state = "stand"
self.walk_velocity = 2
self.stepheight = 0.6
else
self.order = "follow"
self.state = "walk"
self.walk_velocity = 3
self.stepheight = 1.1
end
})
end
return
end
mobs:capture_mob(self, clicker, 0, 0, 80, false, nil)
end
})
mobs:register_egg("mobs_animal:dog", "Dog", "wool_brown.png", 1)
-- compatibility
mobs:alias_mob("mobs:wolf", "mobs_animal:wolf")
mobs:alias_mob("mobs:dog", "mobs_animal:dog")
mobs:alias_mob("mobs:dog", "mobs_animal:dog")

View File

@ -1,5 +1,4 @@
-- Kitten by Jordach / BFD
mobs:register_mob("mobs_animal:kitten", {
stepheight = 0.6,
type = "animal",
@ -27,7 +26,7 @@ mobs:register_mob("mobs_animal:kitten", {
runaway = true,
jump = false,
drops = {
{name = "farming:string", chance = 1, min = 1, max = 1},
{name = "farming:string", chance = 1, min = 1, max = 1}
},
water_damage = 1,
lava_damage = 5,

View File

@ -1,6 +1,5 @@
-- Warthog(Boar) by KrupnoPavel (MIT)
-- Changed to Boar and tweaked by Kaadmy (WTFPL) and MoNTE48 (LGPLv3)
mobs:register_mob("mobs_animal:pig", {
type = "animal",
passive = false,
@ -28,12 +27,9 @@ mobs:register_mob("mobs_animal:pig", {
follow = {"default:apple", "farming:potato"},
view_range = 5,
drops = {
{name = "mobs:pork_raw",
chance = 1, min = 1, max = 1},
{name = "mobs:pork_raw",
chance = 2, min = 1, max = 1},
{name = "mobs:pork_raw",
chance = 2, min = 1, max = 1}
{name = "mobs:pork_raw", chance = 1, min = 1, max = 1},
{name = "mobs:pork_raw", chance = 2, min = 1, max = 1},
{name = "mobs:pork_raw", chance = 2, min = 1, max = 1}
},
water_damage = 0,
lava_damage = 5,
@ -68,4 +64,4 @@ mobs:spawn({
mobs:register_egg("mobs_animal:pig", "Pig", "wool_pink.png", 1)
-- compatibility
mobs:alias_mob("mobs:pig", "mobs_animal:pig")
mobs:alias_mob("mobs:pig", "mobs_animal:pig")

View File

@ -1,4 +1,4 @@
-- Sheep by PilzAdam
local all_colours = {
{"black", "Black" },
{"blue", "Blue" },
@ -17,13 +17,11 @@ local all_colours = {
{"yellow", "Yellow" },
}
-- Sheep by PilzAdam
for _, col in ipairs(all_colours) do
mobs:register_mob("mobs_animal:sheep_"..col[1], {
stay_near = {"farming:straw", 10},
stepheight = 0.6,
stepheight = 1.1,
type = "animal",
passive = true,
hp_min = 6,
@ -46,7 +44,7 @@ for _, col in ipairs(all_colours) do
run_velocity = 2,
runaway = true,
jump = true,
jump_height = 6,
jump_height = 4,
pushable = true,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
@ -225,7 +223,7 @@ mobs:spawn({
max_height = 31000,
day_toggle = true,
})
mobs:spawn({
name = "mobs_animal:sheep_dark_grey",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"},
@ -235,7 +233,7 @@ mobs:spawn({
max_height = 31000,
day_toggle = true,
})
mobs:spawn({
name = "mobs_animal:sheep_black",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"},
@ -246,7 +244,7 @@ mobs:spawn({
max_height = 31000,
day_toggle = true,
})
mobs:spawn({
name = "mobs_animal:sheep_brown",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"},

View File

@ -1,55 +1,55 @@
mobs:register_mob("mobs_monster:skeleton", {
type = "monster",
visual = "mesh",
mesh = "mobs_zombie.b3d",
textures = {
{"mobs_skeleton.png"},
},
collisionbox = {-0.25, -1, -0.3, 0.25, 0.75, 0.3},
animation = {
speed_normal = 10, speed_run = 15,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 188,
run_start = 168, run_end = 188
},
makes_footstep_sound = true,
sounds = {
random = "mobs_skeleton",
war_cry = "mobs_zombie.3",
attack = "mobs_zombie.2",
damage = "mobs_zombie_hit",
death = "mobs_zombie_death",
},
hp_min = 10,
hp_max = 15,
armor = 100,
knock_back = 1,
light_damage = 1,
lava_damage = 10,
damage = 1,
reach = 2,
attack_type = "dogfight",
group_attack = true,
view_range = 15,
walk_chance = 75,
walk_velocity = 0.5,
run_velocity = 0.5,
jump = false,
drops = {
{name = "default:bone", chance = 2, min = 1, max = 1},
{name = "default:bone", chance = 2, min = 1, max = 1}
},
after_activate = function(self, staticdata, def, dtime)
-- replace skeleton using the old directx model
if self.mesh == "mobs_zombie.x" then
local pos = self.object:get_pos()
if pos then
minetest.add_entity(pos, self.name)
self.object:remove()
end
end
end,
})
type = "monster",
visual = "mesh",
mesh = "mobs_zombie.b3d",
textures = {
{"mobs_skeleton.png"},
},
collisionbox = {-0.25, -1, -0.3, 0.25, 0.75, 0.3},
animation = {
speed_normal = 10, speed_run = 15,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 188,
run_start = 168, run_end = 188
},
makes_footstep_sound = true,
sounds = {
random = "mobs_skeleton",
war_cry = "mobs_zombie.3",
attack = "mobs_zombie.2",
damage = "mobs_zombie_hit",
death = "mobs_zombie_death",
},
hp_min = 10,
hp_max = 15,
armor = 100,
knock_back = 1,
light_damage = 1,
lava_damage = 10,
damage = 1,
reach = 2,
attack_type = "dogfight",
group_attack = true,
view_range = 15,
walk_chance = 75,
walk_velocity = 0.5,
run_velocity = 0.5,
jump = false,
drops = {
{name = "default:bone", chance = 2, min = 1, max = 1},
{name = "default:bone", chance = 2, min = 1, max = 1}
},
after_activate = function(self, staticdata, def, dtime)
-- replace skeleton using the old directx model
if self.mesh == "mobs_zombie.x" then
local pos = self.object:get_pos()
if pos then
minetest.add_entity(pos, self.name)
self.object:remove()
end
end
end,
})
mobs:spawn({
name = "mobs_monster:skeleton",

View File

@ -1,6 +1,4 @@
-- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture)
mobs:register_mob("mobs_monster:spider", {
docile_by_day = true,
group_attack = true,
@ -29,8 +27,9 @@ mobs:register_mob("mobs_monster:spider", {
view_range = 15,
floats = 0,
drops = {
{name = "farming:string",
chance = 1, min = 1, max = 2}, },
{name = "farming:string", chance = 1, min = 1, max = 1},
{name = "farming:string", chance = 2, min = 1, max = 1}
},
water_damage = 5,
lava_damage = 5,
light_damage = 0,
@ -104,8 +103,8 @@ mobs:register_mob("mobs_monster:small_spider", {
view_range = 10,
floats = 0,
drops = {
{name = "farming:string",
chance = 1, min = 1, max = 1}, },
{name = "farming:string", chance = 1, min = 1, max = 1}
},
water_damage = 5,
lava_damage = 5,
light_damage = 0,

View File

@ -1,56 +1,55 @@
mobs:register_mob("mobs_monster:zombie", {
type = "monster",
visual = "mesh",
mesh = "mobs_zombie.b3d",
textures = {
{"mobs_zombie.png"},
},
collisionbox = {-0.25, -1, -0.3, 0.25, 0.75, 0.3},
animation = {
speed_normal = 10, speed_run = 15,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 188,
run_start = 168, run_end = 188
},
makes_footstep_sound = true,
sounds = {
random = "mobs_zombie.1",
war_cry = "mobs_zombie.3",
attack = "mobs_zombie.2",
damage = "mobs_zombie_hit",
death = "mobs_zombie_death",
},
hp_min = 15,
hp_max = 25,
armor = 100,
knock_back = 1,
light_damage = 1,
lava_damage = 10,
damage = 2,
reach = 2,
attack_type = "dogfight",
group_attack = true,
view_range = 15,
walk_chance = 75,
walk_velocity = 0.5,
run_velocity = 0.5,
jump = false,
drops = {
{name = "mobs_monster:rotten_flesh", chance = 1, min = 1, max = 1},
{name = "mobs_monster:rotten_flesh", chance = 2, min = 1, max = 1},
{name = "mobs_monster:rotten_flesh", chance = 2, min = 1, max = 1}
},
after_activate = function(self, staticdata, def, dtime)
-- replace zombies using the old directx model
if self.mesh == "mobs_zombie.x" then
local pos = self.object:get_pos()
if pos then
minetest.add_entity(pos, self.name)
self.object:remove()
end
type = "monster",
visual = "mesh",
mesh = "mobs_zombie.b3d",
textures = {
{"mobs_zombie.png"},
},
collisionbox = {-0.25, -1, -0.3, 0.25, 0.75, 0.3},
animation = {
speed_normal = 10, speed_run = 15,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 188,
run_start = 168, run_end = 188
},
makes_footstep_sound = true,
sounds = {
random = "mobs_zombie.1",
war_cry = "mobs_zombie.3",
attack = "mobs_zombie.2",
damage = "mobs_zombie_hit",
death = "mobs_zombie_death",
},
hp_min = 15,
hp_max = 25,
armor = 100,
knock_back = 1,
light_damage = 1,
lava_damage = 10,
damage = 2,
reach = 2,
attack_type = "dogfight",
group_attack = true,
view_range = 15,
walk_chance = 75,
walk_velocity = 0.5,
run_velocity = 0.5,
jump = false,
drops = {
{name = "mobs_monster:rotten_flesh", chance = 1, min = 1, max = 1},
{name = "mobs_monster:rotten_flesh", chance = 2, min = 1, max = 1},
{name = "mobs_monster:rotten_flesh", chance = 2, min = 1, max = 1}
},
after_activate = function(self, staticdata, def, dtime)
-- replace zombies using the old directx model
if self.mesh == "mobs_zombie.x" then
local pos = self.object:get_pos()
if pos then
minetest.add_entity(pos, self.name)
self.object:remove()
end
end,
})
end
end, })
mobs:spawn({
name = "mobs_monster:zombie",
@ -73,4 +72,4 @@ minetest.register_craftitem("mobs_monster:rotten_flesh", {
description = "Rotten Flesh",
inventory_image = "mobs_rotten_flesh.png",
on_use = minetest.item_eat(1),
})
})

View File

@ -64,7 +64,7 @@ end
local aoc_range = tonumber(minetest.settings:get("active_block_range")) * 16
-- pathfinding settings
local enable_pathfinding = true
local enable_pathfinding = false -- for server!
local stuck_timeout = 3 -- how long before mob gets stuck in place and starts searching
local stuck_path_timeout = 10 -- how long will mob follow path before giving up

View File

@ -27,6 +27,7 @@ local throwing_shoot_arrow = function(itemstack, player)
return false
end
local wear
minetest.register_tool("throwing:bow", {
description = "Bow",
inventory_image = "throwing_bow.png",