63 Commits

Author SHA1 Message Date
DS
f9f436fd7e fix a crash (#190) 2017-07-20 01:42:34 -04:00
769dd7fe7b Adjust rate control code to work better
now it'll run at full speed if there's enough time
else it'll throttle back to 1/3.
(at that point, the movement imprecision caused by this
will become hidden behind lag-induced imprecision)
2017-07-03 18:43:03 -04:00
3c20e91029 prevent crash if node being taken from has no inv 2017-06-23 14:11:19 -04:00
1273d82917 only return true from receive_fields() when actually needed 2017-06-19 22:59:37 -04:00
078161c51d Pipeworks uses LGPL code from minetest_game, changed license accordingly. 2017-06-18 19:32:05 -04:00
11d57cc02b Change compat-chests.lua to block top-mounted tube connections when chest is open 2017-06-17 19:52:55 -05:00
018accd1ae Change compat-chests.lua to handle modern chests and be clean. (Addresses https://github.com/minetest-mods/pipeworks/issues/177) 2017-06-17 13:32:10 -05:00
2eff6e36ea Change scope of local variable 'nodecolor': (#185)
Fixes warning about undefined global.
2017-06-08 01:54:09 -04:00
69d994a2a2 Replace deprecated methods: (#179)
- 'setting_get' with 'settings:get'
- 'setting_getbool' with 'settings:get_bool'
2017-05-18 05:33:56 -04:00
DS
7d70d79cda improve node breaker textures (#173) 2017-05-18 05:32:01 -04:00
DS
d82227942d Nice settings (#171)
* improve style

* do something

* make settingtypes nicer

* fix settingtypes new lines

* fix it and so make it work 🐈
2017-04-13 21:13:30 -04:00
3679943620 also check for group "tubedevice" (fixes injecting into one-way tube) 2017-04-12 16:15:39 -04:00
0c0e6a6b66 make sure there's something appropriate to inject an item into
(fixes #123)
2017-04-12 16:03:41 -04:00
9d6881deca fix scale of on/off switch in teleport tube 2017-04-12 14:36:50 -04:00
f44993cd84 allow external devices to connect to pipes
and use that feature to handle most of the existing devices)
also, fix the "xray" glitch in the grating
2017-04-12 07:10:48 -04:00
acc2b6802e fix scale on autocrafter's on/off switch 2017-04-12 07:09:35 -04:00
d78364570c use "base" field in a couple more places 2017-04-11 20:05:58 -04:00
1b2e94f199 remove some debug prints 2017-04-11 19:45:59 -04:00
15fe8e068f cache button "base" field since it's also standard 2017-04-11 19:16:21 -04:00
5e26aa5f91 cache on/off button image refs and commonly-used label for same 2017-04-11 18:52:39 -04:00
a7c3908b61 remove old compat file (obsolete) 2017-04-11 09:02:04 -04:00
698c83d626 chests/furnaces: cache tube overlay images 2017-04-11 09:01:12 -04:00
fcd9b0fbf4 adjust sorting tube formspec
to account for re-sized button on/off/interm images
2017-04-11 01:34:12 -04:00
8f3d8cc586 allow stack per-chest/per-furnace stack splitting
defaults to disabled, whether the node has a new formspec or not
note that furnace fuel stacks can't be split.
2017-04-11 01:33:06 -04:00
cf97f02434 only reject part of itemtack from chest, if possible
(e.g. if there's room for 50 of some item, and you send a stack of 99,
50 are added to the chest and a stack of 49 is rejected and sent
on to the next destination)
2017-04-09 20:27:32 -04:00
8d50c191c8 cap luaentities table entries to valid coords on load
(in case the file gets corrupted on write?)
2017-04-09 03:18:56 -04:00
DS
c9c4b4cd15 make item drop by tubes nicer (#168)
* make item drop by tubes nicer
2017-04-09 01:19:40 -04:00
c2a288303f Merge pull request #169 from DS-Minetest/tube_blast_break
break tubes on blast
2017-04-09 01:19:21 -04:00
9ee97e1ed1 break tubes on blast 2017-04-08 16:47:42 +02:00
2c02d792bf allow repairing a broken tube
by striking it with cottages:hammer, or castles modpack anvil:hammer,
or with any glooptest hammer except wood or stone.
2017-04-07 19:51:54 -04:00
bea570555a remove "reversed" warning message
(not needed now that tube breaking is reliable)
2017-04-07 03:35:24 -04:00
f3a74bb618 default breaking code to "enabled" and lower the default limit to 30. 2017-04-06 00:15:16 -04:00
2aa9556748 tonumber() the config'd items limit 2017-04-06 00:02:31 -04:00
ef68e058ec Don't lose extra movement when entering new tube or turning around. 2017-04-06 05:13:40 +02:00
7680820d3e Make item counting more reliable and more efficient. 2017-04-06 03:46:23 +02:00
33c4c9d552 let tubes break if they're "over-pressure"
that is, if there are more than X number of items in a tube.  Default is
40 in a tube, but breaking is also disabled by default.

(original framework by Novatux, with changes by VanessaE)
2017-04-05 11:43:41 -04:00
eab59bfe19 always set item start pos on reverse. 2017-04-05 11:43:41 -04:00
0056116148 Namespace pollution cleanup (Used list at #154) 2017-04-04 05:27:37 -03:00
0639bb9706 allow pipeworks to skip server steps when moving entities around. 2017-03-31 18:27:44 -04:00
3a77d1dd8e if an item should reverse dir (e.g. full destination),
and it's not going back into a tube, reject it and pop out as an item
2017-03-29 16:54:38 -04:00
0e8a82fdba add a warning if a tubed item turns around
(too many means that something is wrong with that tube circuit)
2017-03-29 15:25:05 -04:00
b46231f543 Merge pull request #165 from cheapie/master
Tweak listring behavior of autocrafter
2017-03-28 19:06:21 -04:00
c15023a5d1 Tweak listring behavior of autocrafter
Now goes player->source->player and destination->player
2017-03-28 18:02:10 -05:00
64b2611d8a prevent being able to place "loaded" and "on" items
(forces them to "empty" and "off")
2017-03-17 11:04:59 -04:00
1bfc2d4e5b increase length of signal tube pulse 2017-03-17 10:15:09 -04:00
e5ee0dee90 add turn-to-vertical handling to valve, flow sensor
reuse the code from entry panel
2017-03-17 10:07:34 -04:00
88ad79163d add screwdriver rotation handling on most pipes-related nodes
caveats:  in order to cleanly handle the entry panel, valve, and sensor
I had to rotate the valve and sensor models 90 degrees
so that their in-/outlet pipes point the same direction as the
entry panel.

This also enables proper handling of a valve or sensor turned vertically.

Some objects have rotation disabled entirely (as flipping them over/around makes
no sense)

When a valve is rotated, it is turned off automatically, to work around a glitch in
the rotation code.
2017-03-17 10:07:34 -04:00
bd4a27d172 make valve and pump turn on/off via on_rightclick
(instead of on_punch)
2017-03-17 10:07:34 -04:00
3d845a3f28 Make filter-injector work with latest chest versions 2017-03-17 10:07:34 -04:00
a858145098 Add missing table entries 2017-03-17 10:07:34 -04:00
7d872c05ee Merge pull request #160 from cheapie/master
Special-case technic machines
2017-03-01 01:01:02 -05:00
acf7ee4a80 Special-case technic machines
This makes them work correctly with filters.
2017-02-28 23:52:10 -06:00
cdbe93cdd8 Allow reversing direction if there's nowhere to go 2017-03-01 01:40:06 -03:00
f7fe95231d Merge pull request #158 from cheapie/master
Add digilines support to autocrafter
2017-02-26 16:44:22 -05:00
1a15a8b453 Add digilines support to autocrafter
"on" and "off" messages turn it on or off, "single" crafts one item, and sending nested tables in the shape of the crafting grid sets the craft. Example message:
{
{"default:wood","default:wood","default:wood"},
{"default:wood","","default:wood"},
{"default:wood","default:wood","default:wood"}
}
2017-02-26 15:35:51 -06:00
9ade40ac65 update description a bit (typo, outdated a little) 2017-02-07 16:04:02 -05:00
62768d243d Use node texture colorization
for priority tube, instead of [colorize
(except for inv image).  Saves a tiny bit of RAM.
2017-01-25 04:33:27 -05:00
a3d2e69a42 Allow Digiline Filter-Injector to match wear, metadata, and group
You can now make reqyests like `{group="stick"}`, `"default:pick_wood 1
30000"`, and `"mod:block <count> <exact wear> <meta>"` to match
items precisely.

If you don't specify a field, that field won't be checked.  If you
specify a field in an invalid way, that rule will match nothing.

You can also specify wear as a table `wear={min, max}` to specify
a range `[min, max)` of acceptable wear values.  For example,
`{name="default:pick_wood", wear={0, 32768}}` matches only wooden
pickaxes that have at least half of their life left.

You can even do things like `{count=2, metadata="whatever")}`, which
will match any item at all, as long as its metadata matches, and will
retrieve at most two of those items.
2016-10-10 14:15:44 -07:00
36d9e1fc08 Digiline Filter-Injector tweaks
* Made digiline filter-injectors not pull a whole stack if the count is exactly 1
* Made digiline filter-injectors pull a whole stack if no count specified
  * `default:dirt` still has a count of 1, but `{name="name"}` has no count
2016-10-10 14:15:44 -07:00
6e0e7c47d0 Merge pull request #150 from t4im/master
Add list rings and enable sorting tube reordering
2016-08-30 14:13:01 -04:00
Tim
4fdf73fbcd add list rings to pipework inventories 2016-08-29 18:28:43 +02:00
Tim
aba1ce5b36 allow reordering of itemstacks in sorting tube 2016-08-29 18:28:24 +02:00
Tim
a65eaa7cf2 update .gitignore 2016-08-29 18:25:40 +02:00
42 changed files with 2831 additions and 1385 deletions

21
.gitignore vendored
View File

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

505
LICENSE
View File

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

View File

@ -102,6 +102,7 @@ local function after_recipe_change(pos, inventory)
minetest.get_node_timer(pos):stop()
autocrafterCache[minetest.hash_node_position(pos)] = nil
meta:set_string("infotext", "unconfigured Autocrafter")
inventory:set_stack("output", 1, "")
return
end
local recipe_changed = false
@ -171,19 +172,28 @@ end
local function update_meta(meta, enabled)
local state = enabled and "on" or "off"
meta:set_int("enabled", enabled and 1 or 0)
meta:set_string("formspec",
"size[8,11]"..
local fs = "size[8,12]"..
"list[context;recipe;0,0;3,3;]"..
"image[3,1;1,1;gui_hb_bg.png^[colorize:#141318:255]"..
"list[context;output;3,1;1,1;]"..
"image_button[3,2;1,1;pipeworks_button_" .. state .. ".png;" .. state .. ";;;false;pipeworks_button_interm.png]" ..
"list[context;src;0,3.5;8,3;]"..
"image_button[3,2;1,0.6;pipeworks_button_" .. state .. ".png;" .. state .. ";;;false;pipeworks_button_interm.png]" ..
"list[context;src;0,4.5;8,3;]"..
"list[context;dst;4,0;4,3;]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
default.get_hotbar_bg(0,7) ..
"list[current_player;main;0,7;8,4;]")
default.get_hotbar_bg(0,8) ..
"list[current_player;main;0,8;8,4;]" ..
"listring[current_player;main]"..
"listring[context;src]" ..
"listring[current_player;main]"..
"listring[context;dst]" ..
"listring[current_player;main]"
if minetest.get_modpath("digilines") then
fs = fs.."field[1,3.5;4,1;channel;Channel;${channel}]"
fs = fs.."button_exit[5,3.2;2,1;save;Save]"
end
meta:set_string("formspec",fs)
-- toggling the button doesn't quite call for running a recipe change check
-- so instead we run a minimal version for infotext setting only
@ -275,6 +285,8 @@ minetest.register_node("pipeworks:autocrafter", {
if update_meta(meta, true) then
start_crafter(pos)
end
elseif fields.save then
meta:set_string("channel",fields.channel)
end
end,
can_dig = function(pos, player)
@ -355,7 +367,40 @@ minetest.register_node("pipeworks:autocrafter", {
after_inventory_change(pos)
return count
end,
on_timer = run_autocrafter
on_timer = run_autocrafter,
digiline = {
receptor = {},
effector = {
action = function(pos,node,channel,msg)
local meta = minetest.get_meta(pos)
if channel ~= meta:get_string("channel") then return end
if type(msg) == "table" then
if #msg < 3 then return end
local inv = meta:get_inventory()
for y=0,2,1 do
for x=1,3,1 do
local slot = y*3+x
if minetest.registered_items[msg[y+1][x]] then
inv:set_stack("recipe",slot,ItemStack(msg[y+1][x]))
else
inv:set_stack("recipe",slot,ItemStack(""))
end
end
end
after_recipe_change(pos,inv)
elseif msg == "off" then
update_meta(meta, false)
minetest.get_node_timer(pos):stop()
elseif msg == "on" then
if update_meta(meta, true) then
start_crafter(pos)
end
elseif msg == "single" then
run_autocrafter(pos,1)
end
end,
},
},
})
minetest.register_craft( {

View File

@ -1,6 +1,71 @@
-- autorouting for pipes
--[[
autorouting for pipes
To connect pipes to some node, include this in the node def...
pipe_connections = {
pattern = <string>, -- if supplied, search for this pattern instead of the exact node name
left = <bool>, -- true (or 1) if the left side of the node needs to connect to a pipe
right = <bool>, -- or from the right side, etc.
top = <bool>,
bottom = <bool>,
front = <bool>,
back = <bool>,
left_param2 = <num>, -- the node must have this param2 to connect from the left
right_param2 = <num>, -- or right, etc.
top_param2 = <num>, -- Omit some or all of these to skip checking param2 for those sides
bottom_param2 = <num>,
front_param2 = <num>,
back_param2 = <num>,
},
...then add, pipeworks.scan_for_pipe_objects(pos)
to your node's after_dig_node and after_place_node callbacks.
]]--
-- get the axis dir (just 6 faces) of target node, assumes the pipe is the axis
function pipeworks.get_axis_dir(nodetable, pattern)
local pxm,pxp,pym,pyp,pzm,pzp
if string.find(nodetable.nxm.name, pattern)
and minetest.facedir_to_dir(nodetable.nxm.param2).x ~= 0 then
pxm=1
end
if string.find(nodetable.nxp.name, pattern)
and minetest.facedir_to_dir(nodetable.nxp.param2).x ~= 0 then
pxp=1
end
if string.find(nodetable.nzm.name, pattern)
and minetest.facedir_to_dir(nodetable.nzm.param2).z ~= 0 then
pzm=1
end
if string.find(nodetable.nzp.name, pattern)
and minetest.facedir_to_dir(nodetable.nzp.param2).z ~= 0 then
pzp=1
end
if string.find(nodetable.nym.name, pattern)
and minetest.facedir_to_dir(nodetable.nym.param2).y ~= 0 then
pym=1
end
if string.find(nodetable.nyp.name, pattern)
and minetest.facedir_to_dir(nodetable.nyp.param2).y ~= 0 then
pyp=1
end
local match = pxm or pxp or pym or pyp or pzm or pzp
return match,pxm,pxp,pym,pyp,pzm,pzp
end
local tube_table = {[0] = 1, 2, 2, 4, 2, 4, 4, 5, 2, 3, 4, 6, 4, 6, 5, 7, 2, 4, 3, 6, 4, 5, 6, 7, 4, 6, 6, 8, 5, 7, 7, 9, 2, 4, 4, 5, 3, 6, 6, 7, 4, 6, 5, 7, 6, 8, 7, 9, 4, 5, 6, 7, 6, 7, 8, 9, 5, 7, 7, 9, 7, 9, 9, 10}
local tube_table_facedirs = {[0] = 0, 0, 5, 0, 3, 4, 3, 0, 2, 0, 2, 0, 6, 4, 3, 0, 7, 12, 5, 12, 7, 4, 5, 5, 18, 20, 16, 0, 7, 4, 7, 0, 1, 8, 1, 1, 1, 13, 1, 1, 10, 8, 2, 2, 17, 4, 3, 6, 9, 9, 9, 9, 21, 13, 1, 1, 10, 10, 11, 2, 19, 4, 3, 0}
local function autoroute_pipes(pos)
local nctr = minetest.get_node(pos)
local state = "_empty"
@ -23,7 +88,7 @@ function pipeworks.scan_for_pipe_objects(pos)
autoroute_pipes(pos)
end
-- auto-rotation code for various devices the tubes attach to
-- auto-rotation code for various devices the pipes attach to
function pipeworks.scan_pipe_surroundings(pos)
local pxm=0
@ -40,152 +105,102 @@ function pipeworks.scan_pipe_surroundings(pos)
local nzm = minetest.get_node({ x=pos.x , y=pos.y , z=pos.z-1 })
local nzp = minetest.get_node({ x=pos.x , y=pos.y , z=pos.z+1 })
if (string.find(nxm.name, "pipeworks:pipe_") ~= nil) then pxm=1 end
if (string.find(nxp.name, "pipeworks:pipe_") ~= nil) then pxp=1 end
if (string.find(nym.name, "pipeworks:pipe_") ~= nil) then pym=1 end
if (string.find(nyp.name, "pipeworks:pipe_") ~= nil) then pyp=1 end
if (string.find(nzm.name, "pipeworks:pipe_") ~= nil) then pzm=1 end
if (string.find(nzp.name, "pipeworks:pipe_") ~= nil) then pzp=1 end
local nodetable = {
nxm = nxm,
nxp = nxp,
nym = nym,
nyp = nyp,
nzm = nzm,
nzp = nzp
}
-- standard handling for pipes...
if string.find(nxm.name, "pipeworks:pipe_") then pxm=1 end
if string.find(nxp.name, "pipeworks:pipe_") then pxp=1 end
if string.find(nym.name, "pipeworks:pipe_") then pym=1 end
if string.find(nyp.name, "pipeworks:pipe_") then pyp=1 end
if string.find(nzm.name, "pipeworks:pipe_") then pzm=1 end
if string.find(nzp.name, "pipeworks:pipe_") then pzp=1 end
-- Special handling for valves...
if (string.find(nxm.name, "pipeworks:valve") ~= nil)
and (nxm.param2 == 0 or nxm.param2 == 2) then
pxm=1
end
if (string.find(nxp.name, "pipeworks:valve") ~= nil)
and (nxp.param2 == 0 or nxp.param2 == 2) then
pxp=1
end
if (string.find(nzm.name, "pipeworks:valve") ~= nil)
and (nzm.param2 == 1 or nzm.param2 == 3) then
pzm=1
end
if (string.find(nzp.name, "pipeworks:valve") ~= nil)
and (nzp.param2 == 1 or nzp.param2 == 3) then
pzp=1
local match,a,b,c,d,e,f = pipeworks.get_axis_dir(nodetable, "pipeworks:valve")
if match then
pxm = a or pxm
pxp = b or pxp
pym = c or pym
pyp = d or pyp
pzm = e or pzm
pzp = f or pzp
end
-- ...flow sensors...
if (string.find(nxm.name, "pipeworks:flow_sensor") ~= nil)
and (nxm.param2 == 0 or nxm.param2 == 2) then
pxm=1
end
if (string.find(nxp.name, "pipeworks:flow_sensor") ~= nil)
and (nxp.param2 == 0 or nxp.param2 == 2) then
pxp=1
end
if (string.find(nzm.name, "pipeworks:flow_sensor") ~= nil)
and (nzm.param2 == 1 or nzm.param2 == 3) then
pzm=1
end
if (string.find(nzp.name, "pipeworks:flow_sensor") ~= nil)
and (nzp.param2 == 1 or nzp.param2 == 3) then
pzp=1
end
-- ...spigots...
if (string.find(nxm.name, "pipeworks:spigot") ~= nil)
and nxm.param2 == 1 then
pxm=1
end
if (string.find(nxp.name, "pipeworks:spigot") ~= nil)
and nxp.param2 == 3 then
pxp=1
end
if (string.find(nzm.name, "pipeworks:spigot") ~= nil)
and nzm.param2 == 0 then
pzm=1
end
if (string.find(nzp.name, "pipeworks:spigot") ~= nil)
and nzp.param2 == 2 then
pzp=1
local match,a,b,c,d,e,f = pipeworks.get_axis_dir(nodetable, "pipeworks:flow_sensor")
if match then
pxm = a or pxm
pxp = b or pxp
pym = c or pym
pyp = d or pyp
pzm = e or pzm
pzp = f or pzp
end
-- ...sealed pipe entry/exit...
if (string.find(nxm.name, "pipeworks:entry_panel") ~= nil)
and (nxm.param2 == 1 or nxm.param2 == 3) then
pxm=1
local match,a,b,c,d,e,f = pipeworks.get_axis_dir(nodetable, "pipeworks:entry_panel")
if match then
pxm = a or pxm
pxp = b or pxp
pym = c or pym
pyp = d or pyp
pzm = e or pzm
pzp = f or pzp
end
if (string.find(nxp.name, "pipeworks:entry_panel") ~= nil)
and (nxp.param2 == 1 or nxp.param2 == 3) then
pxp=1
-- ... other nodes
local def_left = minetest.registered_nodes[nxp.name] -- the node that {pos} is to the left of (not the
local def_right = minetest.registered_nodes[nxm.name] -- ...note that is AT the left!), etc.
local def_bottom = minetest.registered_nodes[nyp.name]
local def_top = minetest.registered_nodes[nym.name]
local def_front = minetest.registered_nodes[nzp.name]
local def_back = minetest.registered_nodes[nzm.name]
if def_left and def_left.pipe_connections and def_left.pipe_connections.left
and (not def_left.pipe_connections.pattern or string.find(nxp.name, def_left.pipe_connections.pattern))
and (not def_left.pipe_connections.left_param2 or (nxp.param2 == def_left.pipe_connections.left_param2)) then
pxp = 1
end
if def_right and def_right.pipe_connections and def_right.pipe_connections.right
and (not def_right.pipe_connections.pattern or string.find(nxm.name, def_right.pipe_connections.pattern))
and (not def_right.pipe_connections.right_param2 or (nxm.param2 == def_right.pipe_connections.right_param2)) then
pxm = 1
end
if def_top and def_top.pipe_connections and def_top.pipe_connections.top
and (not def_top.pipe_connections.pattern or string.find(nym.name, def_top.pipe_connections.pattern))
and (not def_top.pipe_connections.top_param2 or (nym.param2 == def_top.pipe_connections.top_param2)) then
pym = 1
end
if def_bottom and def_bottom.pipe_connections and def_bottom.pipe_connections.bottom
and (not def_bottom.pipe_connections.pattern or string.find(nyp.name, def_bottom.pipe_connections.pattern))
and (not def_bottom.pipe_connections.bottom_param2 or (nyp.param2 == def_bottom.pipe_connections.bottom_param2)) then
pyp = 1
end
if def_front and def_front.pipe_connections and def_front.pipe_connections.front
and (not def_front.pipe_connections.pattern or string.find(nzp.name, def_front.pipe_connections.pattern))
and (not def_front.pipe_connections.front_param2 or (nzp.param2 == def_front.pipe_connections.front_param2)) then
pzp = 1
end
if def_back and def_back.pipe_connections and def_back.pipe_connections.back
and (not def_back.pipe_connections.pattern or string.find(nzm.name, def_back.pipe_connections.pattern))
and (not def_back.pipe_connections.back_param2 or (nzm.param2 == def_back.pipe_connections.back_param2)) then
pzm = 1
end
if (string.find(nzm.name, "pipeworks:entry_panel") ~= nil)
and (nzm.param2 == 0 or nzm.param2 == 2) then
pzm=1
end
if (string.find(nzp.name, "pipeworks:entry_panel") ~= nil)
and (nzp.param2 == 0 or nzp.param2 == 2) then
pzp=1
end
if (string.find(nym.name, "pipeworks:entry_panel") ~= nil)
and nym.param2 == 13 then
pym=1
end
if (string.find(nyp.name, "pipeworks:entry_panel") ~= nil)
and nyp.param2 == 13 then
pyp=1
end
-- ...pumps, grates...
if (string.find(nym.name, "pipeworks:grating") ~= nil) or
(string.find(nym.name, "pipeworks:pump") ~= nil) then
pym=1
end
-- ...fountainheads...
if (string.find(nyp.name, "pipeworks:fountainhead") ~= nil) then
pyp=1
end
-- ... and storage tanks.
if (string.find(nym.name, "pipeworks:storage_tank_") ~= nil) then
pym=1
end
if (string.find(nyp.name, "pipeworks:storage_tank_") ~= nil) then
pyp=1
end
-- ...extra devices specified via the function's parameters
-- ...except that this part is not implemented yet
--
-- xxx = nxm, nxp, nym, nyp, nzm, or nzp depending on the direction to check
-- yyy = pxm, pxp, pym, pyp, pzm, or pzp accordingly.
--
-- if string.find(xxx.name, "modname:nodename") ~= nil then
-- yyy = 1
-- end
--
-- for example:
--
-- if string.find(nym.name, "aero:outlet") ~= nil then
-- pym = 1
-- end
--
print("stage 2 returns "..pxm+8*pxp+2*pym+16*pyp+4*pzm+32*pzp..
" for nodes surrounding "..minetest.get_node(pos).name.." at "..minetest.pos_to_string(pos))
return pxm+8*pxp+2*pym+16*pyp+4*pzm+32*pzp
end
@ -197,4 +212,3 @@ function pipeworks.look_for_stackable_tanks(pos)
minetest.add_node(pos, { name = "pipeworks:expansion_tank_0", param2 = tym.param2})
end
end

View File

@ -1,7 +1,7 @@
-- autorouting for pneumatic tubes
local function is_tube(nodename)
return table.contains(pipeworks.tubenodes, nodename)
return pipeworks.table_contains(pipeworks.tubenodes, nodename)
end
--a function for determining which side of the node we are on
@ -11,23 +11,23 @@ local function nodeside(node, tubedir)
end
local backdir = minetest.facedir_to_dir(node.param2)
local back = vector.dot(backdir, tubedir)
local back = pipeworks.vector_dot(backdir, tubedir)
if back == 1 then
return "back"
elseif back == -1 then
return "front"
end
local topdir = minetest.facedir_to_top_dir(node.param2)
local top = vector.dot(topdir, tubedir)
local topdir = pipeworks.facedir_to_top_dir(node.param2)
local top = pipeworks.vector_dot(topdir, tubedir)
if top == 1 then
return "top"
elseif top == -1 then
return "bottom"
end
local rightdir = minetest.facedir_to_right_dir(node.param2)
local right = vector.dot(rightdir, tubedir)
local rightdir = pipeworks.facedir_to_right_dir(node.param2)
local right = pipeworks.vector_dot(rightdir, tubedir)
if right == 1 then
return "right"
else
@ -99,7 +99,7 @@ end
function pipeworks.scan_for_tube_objects(pos)
for side = 0, 6 do
tube_autoroute(vector.add(pos, directions.side_to_dir(side)))
tube_autoroute(vector.add(pos, pipeworks.directions.side_to_dir(side)))
end
end

View File

@ -2,7 +2,7 @@
-- Vector functions --
----------------------
function vector.cross(a, b)
function pipeworks.vector_cross(a, b)
return {
x = a.y * b.z - a.z * b.y,
y = a.z * b.x - a.x * b.z,
@ -10,7 +10,7 @@ function vector.cross(a, b)
}
end
function vector.dot(a, b)
function pipeworks.vector_dot(a, b)
return a.x * b.x + a.y * b.y + a.z * b.z
end
@ -18,7 +18,7 @@ end
-- Facedir functions --
-----------------------
function minetest.facedir_to_top_dir(facedir)
function pipeworks.facedir_to_top_dir(facedir)
return ({[0] = {x = 0, y = 1, z = 0},
{x = 0, y = 0, z = 1},
{x = 0, y = 0, z = -1},
@ -28,14 +28,15 @@ function minetest.facedir_to_top_dir(facedir)
[math.floor(facedir / 4)]
end
function minetest.facedir_to_right_dir(facedir)
return vector.cross(
minetest.facedir_to_top_dir(facedir),
function pipeworks.facedir_to_right_dir(facedir)
return pipeworks.vector_cross(
pipeworks.facedir_to_top_dir(facedir),
minetest.facedir_to_dir(facedir)
)
end
directions = {}
local directions = {}
pipeworks.directions = directions
function directions.side_to_dir(side)
return ({[0] = vector.new(),
vector.new( 0, 1, 0),
@ -48,7 +49,7 @@ function directions.side_to_dir(side)
end
function directions.dir_to_side(dir)
local c = vector.dot(dir, vector.new(1, 2, 3)) + 4
local c = pipeworks.vector_dot(dir, vector.new(1, 2, 3)) + 4
return ({6, 2, 4, 0, 3, 1, 5})[c]
end
@ -56,7 +57,7 @@ end
-- String functions --
----------------------
--[[function string.split(str, sep)
--[[function pipeworks.string_split(str, sep)
local fields = {}
local index = 1
local expr = "([^"..sep.."])+"
@ -67,7 +68,7 @@ end
return fields
end]]
function string.startswith(str, substr)
function pipeworks.string_startswith(str, substr)
return str:sub(1, substr:len()) == substr
end
@ -75,7 +76,7 @@ end
-- Table functions --
---------------------
function table.contains(tbl, element)
function pipeworks.table_contains(tbl, element)
for _, elt in pairs(tbl) do
if elt == element then
return true
@ -84,7 +85,7 @@ function table.contains(tbl, element)
return false
end
function table.extend(tbl, tbl2)
function pipeworks.table_extend(tbl, tbl2)
local index = #tbl + 1
for _, elt in ipairs(tbl2) do
tbl[index] = elt
@ -92,11 +93,11 @@ function table.extend(tbl, tbl2)
end
end
function table.recursive_replace(tbl, pattern, replace_with)
function pipeworks.table_recursive_replace(tbl, pattern, replace_with)
if type(tbl) == "table" then
local tbl2 = {}
for key, value in pairs(tbl) do
tbl2[key] = table.recursive_replace(value, pattern, replace_with)
tbl2[key] = pipeworks.table_recursive_replace(value, pattern, replace_with)
end
return tbl2
elseif type(tbl) == "string" then
@ -110,11 +111,12 @@ end
-- Formspec functions --
------------------------
fs_helpers = {}
local fs_helpers = {}
pipeworks.fs_helpers = fs_helpers
function fs_helpers.on_receive_fields(pos, fields)
local meta = minetest.get_meta(pos)
for field, value in pairs(fields) do
if field:startswith("fs_helpers_cycling:") then
if pipeworks.string_startswith(field, "fs_helpers_cycling:") then
local l = field:split(":")
local new_value = tonumber(l[2])
local meta_name = l[3]
@ -146,7 +148,7 @@ end
-- Env --
---------
function minetest.load_position(pos)
function pipeworks.load_position(pos)
if pos.x < -30912 or pos.y < -30912 or pos.z < -30912 or
pos.x > 30927 or pos.y > 30927 or pos.z > 30927 then return end
if minetest.get_node_or_nil(pos) then

241
compat-chests.lua Normal file
View File

@ -0,0 +1,241 @@
-- this bit of code modifies the default chests and furnaces to be compatible
-- with pipeworks.
--
-- the formspecs found here are basically copies of the ones from minetest_game
-- plus bits from pipeworks' sorting tubes
-- Pipeworks Specific
local fs_helpers = pipeworks.fs_helpers
local tube_entry = "^pipeworks_tube_connection_wooden.png"
-- Chest Locals
local open_chests = {}
local function get_chest_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," .. pos.z
local formspec =
"size[8,9]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
"list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
"list[current_player;main;0,4.85;8,1;]" ..
"list[current_player;main;0,6.08;8,3;8]" ..
"listring[nodemeta:" .. spos .. ";main]" ..
"listring[current_player;main]" ..
default.get_hotbar_bg(0,4.85)
-- Pipeworks Switch
formspec = formspec ..
fs_helpers.cycling_button(
minetest.get_meta(pos),
pipeworks.button_base,
"splitstacks",
{
pipeworks.button_off,
pipeworks.button_on
}
)..pipeworks.button_label
return formspec
end
local function chest_lid_obstructed(pos)
local above = { x = pos.x, y = pos.y + 1, z = pos.z }
local def = minetest.registered_nodes[minetest.get_node(above).name]
-- allow ladders, signs, wallmounted things and torches to not obstruct
if def.drawtype == "airlike" or
def.drawtype == "signlike" or
def.drawtype == "torchlike" or
(def.drawtype == "nodebox" and def.paramtype2 == "wallmounted") then
return false
end
return true
end
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname == "pipeworks:chest_formspec" and player then
local pn = player:get_player_name()
if open_chests[pn] then
local pos = open_chests[pn].pos
if fields.quit then
local sound = open_chests[pn].sound
local swap = open_chests[pn].swap
local node = minetest.get_node(pos)
open_chests[pn] = nil
for k, v in pairs(open_chests) do
if v.pos.x == pos.x and v.pos.y == pos.y and v.pos.z == pos.z then
return true
end
end
minetest.after(0.2, function()
minetest.swap_node(pos, { name = "default:" .. swap, param2 = node.param2 })
-- Pipeworks notification
pipeworks.after_place(pos)
end)
minetest.sound_play(sound, {gain = 0.3, pos = pos, max_hear_distance = 10})
end
-- Pipeworks Switch
if pipeworks.may_configure(pos, player) and not fields.quit then
fs_helpers.on_receive_fields(pos, fields)
minetest.show_formspec(player:get_player_name(), "pipeworks:chest_formspec", get_chest_formspec(pos))
end
return true
end
end
end)
-- Original Definitions
local old_chest_def = table.copy(minetest.registered_items["default:chest"])
local old_chest_open_def = table.copy(minetest.registered_items["default:chest_open"])
local old_chest_locked_def = table.copy(minetest.registered_items["default:chest_locked"])
local old_chest_locked_open_def = table.copy(minetest.registered_items["default:chest_locked_open"])
-- Override Construction
local override_protected, override, override_open, override_protected_open
override_protected = {
tiles = {
"default_chest_top.png"..tube_entry,
"default_chest_top.png"..tube_entry,
"default_chest_side.png"..tube_entry,
"default_chest_side.png"..tube_entry,
"default_chest_lock.png",
"default_chest_inside.png"
},
after_place_node = function(pos, placer)
old_chest_locked_def.after_place_node(pos, placer)
pipeworks.after_place(pos)
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if not default.can_interact_with_node(clicker, pos) then
return itemstack
end
minetest.sound_play(old_chest_locked_def.sound_open, {gain = 0.3,
pos = pos, max_hear_distance = 10})
if not chest_lid_obstructed(pos) then
minetest.swap_node(pos,
{ name = "default:" .. "chest_locked" .. "_open",
param2 = node.param2 })
end
minetest.after(0.2, minetest.show_formspec,
clicker:get_player_name(),
"pipeworks:chest_formspec", get_chest_formspec(pos))
open_chests[clicker:get_player_name()] = { pos = pos,
sound = old_chest_locked_def.sound_close, swap = "chest_locked" }
end,
groups = table.copy(old_chest_locked_def.groups),
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("main", stack)
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if meta:get_int("splitstacks") == 1 then
stack = stack:peek_item(1)
end
return inv:room_for_item("main", stack)
end,
connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
},
after_dig_node = pipeworks.after_dig
}
override = {
tiles = {
"default_chest_top.png"..tube_entry,
"default_chest_top.png"..tube_entry,
"default_chest_side.png"..tube_entry,
"default_chest_side.png"..tube_entry,
"default_chest_front.png",
"default_chest_inside.png"
},
on_rightclick = function(pos, node, clicker)
minetest.sound_play(old_chest_def.sound_open, {gain = 0.3, pos = pos,
max_hear_distance = 10})
if not chest_lid_obstructed(pos) then
minetest.swap_node(pos, {
name = "default:" .. "chest" .. "_open",
param2 = node.param2 })
end
minetest.after(0.2, minetest.show_formspec,
clicker:get_player_name(),
"pipeworks:chest_formspec", get_chest_formspec(pos))
open_chests[clicker:get_player_name()] = { pos = pos,
sound = old_chest_def.sound_close, swap = "chest" }
end,
groups = table.copy(old_chest_def.groups),
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("main", stack)
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if meta:get_int("splitstacks") == 1 then
stack = stack:peek_item(1)
end
return inv:room_for_item("main", stack)
end,
input_inventory = "main",
connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
},
after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig
}
--[[local override_common = {
}
for k,v in pairs(override_common) do
override_protected[k] = v
override[k] = v
end]]
override_open = table.copy(override)
override_open.groups = table.copy(old_chest_open_def.groups)
override_open.tube = table.copy(override.tube)
override_open.tube.connect_sides = table.copy(override.tube.connect_sides)
override_open.tube.connect_sides.top = nil
override_protected_open = table.copy(override_protected)
override_protected_open.groups = table.copy(old_chest_locked_open_def.groups)
override_protected_open.tube = table.copy(override_protected.tube)
override_protected_open.tube.connect_sides = table.copy(override_protected.tube.connect_sides)
override_protected_open.tube.connect_sides.top = nil
override_protected.tiles = { -- Rearranged according to the chest registration in Minetest_Game.
"default_chest_top.png"..tube_entry,
"default_chest_top.png"..tube_entry,
"default_chest_side.png"..tube_entry.."^[transformFX",
"default_chest_side.png"..tube_entry,
"default_chest_side.png"..tube_entry,
"default_chest_lock.png",
}
override.tiles = {
"default_chest_top.png"..tube_entry,
"default_chest_top.png"..tube_entry,
"default_chest_side.png"..tube_entry.."^[transformFX",
"default_chest_side.png"..tube_entry,
"default_chest_side.png"..tube_entry,
"default_chest_front.png",
}
-- Add the extra groups
for i,v in ipairs({override_protected, override, override_open, override_protected_open}) do
v.groups.tubedevice = 1
v.groups.tubedevice_receiver = 1
end
-- Override with the new modifications.
minetest.override_item("default:chest", override)
minetest.override_item("default:chest_open", override_open)
minetest.override_item("default:chest_locked", override_protected)
minetest.override_item("default:chest_locked_open", override_protected_open)

433
compat-furnaces.lua Normal file
View File

@ -0,0 +1,433 @@
-- this file is basically a modified copy of
-- minetest_game/mods/default/furnaces.lua
local fs_helpers = pipeworks.fs_helpers
tube_entry = "^pipeworks_tube_connection_stony.png"
local function active_formspec(fuel_percent, item_percent, pos, meta)
local formspec =
"size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_name;src;2.75,0.5;1,1;]"..
"list[current_name;fuel;2.75,2.5;1,1;]"..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-fuel_percent)..":default_furnace_fire_fg.png]"..
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:"..
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]"..
"list[current_name;dst;4.75,0.96;2,2;]"..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
"listring[current_name;fuel]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0, 4.25) ..
fs_helpers.cycling_button(
meta,
"image_button[0,3.5;1,0.6",
"split_material_stacks",
{
pipeworks.button_off,
pipeworks.button_on
}
).."label[0.9,3.51;Allow splitting incoming material (not fuel) stacks from tubes]"
return formspec
end
local function inactive_formspec(pos, meta)
local formspec = "size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_name;src;2.75,0.5;1,1;]"..
"list[current_name;fuel;2.75,2.5;1,1;]"..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"list[current_name;dst;4.75,0.96;2,2;]"..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
"listring[current_name;fuel]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0, 4.25) ..
fs_helpers.cycling_button(
meta,
"image_button[0,3.5;1,0.6",
"split_material_stacks",
{
pipeworks.button_off,
pipeworks.button_on
}
).."label[0.9,3.51;Allow splitting incoming material (not fuel) stacks from tubes]"
return formspec
end
--
-- Node callback functions that are the same for active and inactive furnace
--
local function can_dig(pos, player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("fuel") and inv:is_empty("dst") and inv:is_empty("src")
end
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if listname == "fuel" then
if minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then
if inv:is_empty("src") then
meta:set_string("infotext", "Furnace is empty")
end
return stack:get_count()
else
return 0
end
elseif listname == "src" then
return stack:get_count()
elseif listname == "dst" then
return 0
end
end
local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local stack = inv:get_stack(from_list, from_index)
return allow_metadata_inventory_put(pos, to_list, to_index, stack, player)
end
local function allow_metadata_inventory_take(pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
return stack:get_count()
end
local function swap_node(pos, name)
local node = minetest.get_node(pos)
if node.name == name then
return
end
node.name = name
minetest.swap_node(pos, node)
end
local function furnace_node_timer(pos, elapsed)
--
-- Inizialize metadata
--
local meta = minetest.get_meta(pos)
local fuel_time = meta:get_float("fuel_time") or 0
local src_time = meta:get_float("src_time") or 0
local fuel_totaltime = meta:get_float("fuel_totaltime") or 0
local inv = meta:get_inventory()
local srclist, fuellist
local cookable, cooked
local fuel
local update = true
while update do
update = false
srclist = inv:get_list("src")
fuellist = inv:get_list("fuel")
--
-- Cooking
--
-- Check if we have cookable content
local aftercooked
cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
cookable = cooked.time ~= 0
-- Check if we have enough fuel to burn
if fuel_time < fuel_totaltime then
-- The furnace is currently active and has enough fuel
fuel_time = fuel_time + elapsed
-- If there is a cookable item then check if it is ready yet
if cookable then
src_time = src_time + elapsed
if src_time >= cooked.time then
-- Place result in dst list if possible
if inv:room_for_item("dst", cooked.item) then
inv:add_item("dst", cooked.item)
inv:set_stack("src", 1, aftercooked.items[1])
src_time = src_time - cooked.time
update = true
end
end
end
else
-- Furnace ran out of fuel
if cookable then
-- We need to get new fuel
local afterfuel
fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
if fuel.time == 0 then
-- No valid fuel in fuel list
fuel_totaltime = 0
src_time = 0
else
-- Take fuel from fuel list
inv:set_stack("fuel", 1, afterfuel.items[1])
update = true
fuel_totaltime = fuel.time + (fuel_time - fuel_totaltime)
src_time = src_time + elapsed
end
else
-- We don't need to get new fuel since there is no cookable item
fuel_totaltime = 0
src_time = 0
end
fuel_time = 0
end
elapsed = 0
end
if fuel and fuel_totaltime > fuel.time then
fuel_totaltime = fuel.time
end
if srclist[1]:is_empty() then
src_time = 0
end
--
-- Update formspec, infotext and node
--
local formspec = inactive_formspec(pos, meta)
local item_state
local item_percent = 0
if cookable then
item_percent = math.floor(src_time / cooked.time * 100)
if item_percent > 100 then
item_state = "100% (output full)"
else
item_state = item_percent .. "%"
end
else
if srclist[1]:is_empty() then
item_state = "Empty"
else
item_state = "Not cookable"
end
end
local fuel_state = "Empty"
local active = "inactive "
local result = false
if fuel_totaltime ~= 0 then
active = "active "
local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100)
fuel_state = fuel_percent .. "%"
formspec = active_formspec(fuel_percent, item_percent, pos, meta)
swap_node(pos, "default:furnace_active")
-- make sure timer restarts automatically
result = true
else
if not fuellist[1]:is_empty() then
fuel_state = "0%"
end
swap_node(pos, "default:furnace")
-- stop timer on the inactive furnace
minetest.get_node_timer(pos):stop()
end
local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")"
--
-- Set meta values
--
meta:set_float("fuel_totaltime", fuel_totaltime)
meta:set_float("fuel_time", fuel_time)
meta:set_float("src_time", src_time)
meta:set_string("formspec", formspec)
meta:set_string("infotext", infotext)
return result
end
--
-- Node definitions
--
minetest.register_node(":default:furnace", {
description = "Furnace",
tiles = {
"default_furnace_top.png"..tube_entry,
"default_furnace_bottom.png"..tube_entry,
"default_furnace_side.png"..tube_entry,
"default_furnace_side.png"..tube_entry,
"default_furnace_side.png"..tube_entry,
"default_furnace_front.png"
},
groups = {cracky = 2, tubedevice = 1, tubedevice_receiver = 1},
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
timer:start(1.0)
end
if direction.y == 1 then
return inv:add_item("fuel", stack)
else
return inv:add_item("src", stack)
end
end,
can_insert = function(pos,node,stack,direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if direction.y == 1 then
return inv:room_for_item("fuel", stack)
else
if meta:get_int("split_material_stacks") == 1 then
stack = stack:peek_item(1)
end
return inv:room_for_item("src", stack)
end
end,
input_inventory = "dst",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
paramtype2 = "facedir",
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
can_dig = can_dig,
on_timer = furnace_node_timer,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", inactive_formspec(pos, meta))
local inv = meta:get_inventory()
inv:set_size('src', 1)
inv:set_size('fuel', 1)
inv:set_size('dst', 4)
end,
on_metadata_inventory_move = function(pos)
minetest.get_node_timer(pos):start(1.0)
end,
on_metadata_inventory_put = function(pos)
-- start timer function, it will sort out whether furnace can burn or not.
minetest.get_node_timer(pos):start(1.0)
end,
on_blast = function(pos)
local drops = {}
default.get_inventory_drops(pos, "src", drops)
default.get_inventory_drops(pos, "fuel", drops)
default.get_inventory_drops(pos, "dst", drops)
drops[#drops+1] = "default:furnace"
minetest.remove_node(pos)
return drops
end,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
on_receive_fields = function(pos, formname, fields, sender)
if not pipeworks.may_configure(pos, sender) then return end
fs_helpers.on_receive_fields(pos, fields)
local meta = minetest.get_meta(pos)
local formspec = inactive_formspec(pos, meta)
meta:set_string("formspec", formspec)
end,
after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig
})
minetest.register_node(":default:furnace_active", {
description = "Furnace",
tiles = {
"default_furnace_top.png"..tube_entry,
"default_furnace_bottom.png"..tube_entry,
"default_furnace_side.png"..tube_entry,
"default_furnace_side.png"..tube_entry,
"default_furnace_side.png"..tube_entry,
{
image = "default_furnace_front_active.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}
},
groups = {cracky = 2, tubedevice = 1, tubedevice_receiver = 1, not_in_creative_inventory = 1},
tube = {
insert_object = function(pos,node,stack,direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
timer:start(1.0)
end
if direction.y == 1 then
return inv:add_item("fuel", stack)
else
return inv:add_item("src", stack)
end
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if direction.y == 1 then
return inv:room_for_item("fuel", stack)
else
if meta:get_int("split_material_stacks") == 1 then
stack = stack:peek_item(1)
end
return inv:room_for_item("src", stack)
end
end,
input_inventory = "dst",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
paramtype2 = "facedir",
light_source = 8,
drop = "default:furnace",
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
on_timer = furnace_node_timer,
can_dig = can_dig,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
on_receive_fields = function(pos, formname, fields, sender)
if not pipeworks.may_configure(pos, sender) then return end
fs_helpers.on_receive_fields(pos, fields)
local meta = minetest.get_meta(pos)
local formspec = active_formspec(0, 0, pos, meta)
meta:set_string("formspec", formspec)
end,
after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig
})

View File

@ -1,153 +0,0 @@
-- this bit of code modifies the default chests and furnaces to be compatible
-- with pipeworks.
minetest.override_item("default:furnace", {
tiles = {
"default_furnace_top.png^pipeworks_tube_connection_stony.png",
"default_furnace_bottom.png^pipeworks_tube_connection_stony.png",
"default_furnace_side.png^pipeworks_tube_connection_stony.png",
"default_furnace_side.png^pipeworks_tube_connection_stony.png",
"default_furnace_side.png^pipeworks_tube_connection_stony.png",
"default_furnace_front.png"
},
groups = {cracky = 2, tubedevice = 1, tubedevice_receiver = 1},
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
timer:start(1.0)
end
if direction.y == 1 then
return inv:add_item("fuel",stack)
else
return inv:add_item("src",stack)
end
end,
can_insert = function(pos,node,stack,direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if direction.y == 1 then
return inv:room_for_item("fuel", stack)
else
return inv:room_for_item("src", stack)
end
end,
input_inventory = "dst",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig
})
minetest.override_item("default:furnace_active", {
tiles = {
"default_furnace_top.png^pipeworks_tube_connection_stony.png",
"default_furnace_bottom.png^pipeworks_tube_connection_stony.png",
"default_furnace_side.png^pipeworks_tube_connection_stony.png",
"default_furnace_side.png^pipeworks_tube_connection_stony.png",
"default_furnace_side.png^pipeworks_tube_connection_stony.png",
{
image = "default_furnace_front_active.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}
},
groups = {cracky = 2, tubedevice = 1, tubedevice_receiver = 1, not_in_creative_inventory = 1},
tube = {
insert_object = function(pos,node,stack,direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
timer:start(1.0)
end
if direction.y == 1 then
return inv:add_item("fuel", stack)
else
return inv:add_item("src", stack)
end
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if direction.y == 1 then
return inv:room_for_item("fuel", stack)
else
return inv:room_for_item("src", stack)
end
end,
input_inventory = "dst",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig
})
minetest.override_item("default:chest", {
tiles = {
"default_chest_top.png^pipeworks_tube_connection_wooden.png",
"default_chest_top.png^pipeworks_tube_connection_wooden.png",
"default_chest_side.png^pipeworks_tube_connection_wooden.png",
"default_chest_side.png^pipeworks_tube_connection_wooden.png",
"default_chest_side.png^pipeworks_tube_connection_wooden.png",
"default_chest_front.png"
},
groups = {choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, tubedevice_receiver = 1},
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("main", stack)
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:room_for_item("main", stack)
end,
input_inventory = "main",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig
})
minetest.override_item("default:chest_locked", {
tiles = {
"default_chest_top.png^pipeworks_tube_connection_wooden.png",
"default_chest_top.png^pipeworks_tube_connection_wooden.png",
"default_chest_side.png^pipeworks_tube_connection_wooden.png",
"default_chest_side.png^pipeworks_tube_connection_wooden.png",
"default_chest_side.png^pipeworks_tube_connection_wooden.png",
"default_chest_lock.png"
},
groups = {choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, tubedevice_receiver = 1},
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("main", stack)
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:room_for_item("main", stack)
end,
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
after_place_node = function (pos, placer)
local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", "Locked Chest (owned by "..
meta:get_string("owner")..")")
pipeworks.after_place(pos)
end,
after_dig_node = pipeworks.after_dig
})

40
default_settings.lua Normal file
View File

@ -0,0 +1,40 @@
-- Various settings
local prefix = "pipeworks_"
local settings = {
enable_pipes = true,
enable_autocrafter = true,
enable_deployer = true,
enable_dispenser = true,
enable_node_breaker = true,
enable_teleport_tube = true,
enable_pipe_devices = true,
enable_redefines = true,
enable_mese_tube = true,
enable_detector_tube = true,
enable_digiline_detector_tube = true,
enable_conductor_tube = true,
enable_accelerator_tube = true,
enable_crossing_tube = true,
enable_sand_tube = true,
enable_mese_sand_tube = true,
enable_one_way_tube = true,
enable_priority_tube = true,
enable_cyclic_mode = true,
drop_on_routing_fail = false,
delete_item_on_clearobject = true,
}
for name, value in pairs(settings) do
local setting_type = type(value)
if setting_type == "boolean" then
pipeworks[name] = minetest.settings:get_bool(prefix..name)
if pipeworks[name] == nil then
pipeworks[name] = value
end
else
pipeworks[name] = value
end
end

View File

@ -1,23 +0,0 @@
-- Various settings
pipeworks.enable_pipes = true
pipeworks.enable_autocrafter = true
pipeworks.enable_deployer = true
pipeworks.enable_dispenser = true
pipeworks.enable_node_breaker = true
pipeworks.enable_teleport_tube = true
pipeworks.enable_pipe_devices = true
pipeworks.enable_redefines = true
pipeworks.enable_mese_tube = true
pipeworks.enable_detector_tube = true
pipeworks.enable_digiline_detector_tube = true
pipeworks.enable_conductor_tube = true
pipeworks.enable_accelerator_tube = true
pipeworks.enable_crossing_tube = true
pipeworks.enable_sand_tube = true
pipeworks.enable_mese_sand_tube = true
pipeworks.enable_one_way_tube = true
pipeworks.enable_priority_tube = true
pipeworks.enable_cyclic_mode = true
pipeworks.delete_item_on_clearobject = true

View File

@ -1 +1 @@
This mod uses nodeboxes to supply a complete set of 3D pipes and tubes, along devices that work with them.
This mod uses mesh nodes and nodeboxes to supply a complete set of 3D pipes and tubes, along with devices that work with them.

View File

@ -1,3 +1,84 @@
-- rotation handlers
function pipeworks.fix_after_rotation(pos, node, user, mode, new_param2)
if string.find(node.name, "spigot") then new_param2 = new_param2 % 4 end
newnode = string.gsub(node.name, "_on", "_off")
minetest.swap_node(pos, { name = newnode, param2 = new_param2 })
pipeworks.scan_for_pipe_objects(pos)
return true
end
function pipeworks.rotate_on_place(itemstack, placer, pointed_thing)
local playername = placer:get_player_name()
if not minetest.is_protected(pointed_thing.under, playername)
and not minetest.is_protected(pointed_thing.above, playername) then
local node = minetest.get_node(pointed_thing.under)
if (not placer:get_player_control().sneak)
and minetest.registered_nodes[node.name]
and minetest.registered_nodes[node.name].on_rightclick then
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack)
else
local pitch = placer:get_look_pitch()
local above = pointed_thing.above
local under = pointed_thing.under
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
local undernode = minetest.get_node(under)
local abovenode = minetest.get_node(above)
local uname = undernode.name
local aname = abovenode.name
local isabove = (above.x == under.x) and (above.z == under.z) and (pitch > 0)
local pos1 = above
-- check if the object should be turned vertically
if above.x == under.x
and above.z == under.z
and (
string.find(uname, "pipeworks:pipe_")
or string.find(uname, "pipeworks:storage_")
or string.find(uname, "pipeworks:expansion_")
or ( string.find(uname, "pipeworks:grating") and not isabove )
or ( string.find(uname, "pipeworks:pump_") and not isabove )
or (
( string.find(uname, "pipeworks:valve")
or string.find(uname, "pipeworks:entry_panel")
or string.find(uname, "pipeworks:flow_sensor") )
and minetest.facedir_to_dir(undernode.param2).y ~= 0 )
)
then
fdir = 17
end
if minetest.registered_nodes[uname]
and minetest.registered_nodes[uname]["buildable_to"] then
pos1 = under
end
if minetest.registered_nodes[minetest.get_node(pos1).name]
and not minetest.registered_nodes[minetest.get_node(pos1).name]["buildable_to"] then return end
local placednode = string.gsub(itemstack:get_name(), "_loaded", "_empty")
placednode = string.gsub(placednode, "_on", "_off")
minetest.add_node(pos1, {name = placednode, param2 = fdir })
pipeworks.scan_for_pipe_objects(pos1)
if not pipeworks.expect_infinite_stacks then
itemstack:take_item()
end
end
end
return itemstack
end
-- List of devices that should participate in the autoplace algorithm
local pipereceptor_on = nil
@ -58,6 +139,7 @@ for s in ipairs(states) do
groups = dgroups,
sounds = default.node_sound_wood_defaults(),
walkable = true,
pipe_connections = { top = 1 },
after_place_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
@ -73,10 +155,11 @@ for s in ipairs(states) do
minetest.add_node(pos,{name="pipeworks:pump_off", param2 = node.param2})
end
}},
on_punch = function(pos, node, puncher)
local fdir = minetest.get_node(pos).param2
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local fdir = node.param2
minetest.add_node(pos, { name = "pipeworks:pump_"..states[3-s], param2 = fdir })
end
end,
on_rotate = screwdriver.rotate_simple
})
minetest.register_node("pipeworks:valve_"..states[s].."_empty", {
@ -89,22 +172,20 @@ for s in ipairs(states) do
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -8/16, -4/16, -5/16, 8/16, 5/16, 5/16 }
fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 }
},
collision_box = {
type = "fixed",
fixed = { -8/16, -4/16, -5/16, 8/16, 5/16, 5/16 }
fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 }
},
groups = dgroups,
sounds = default.node_sound_wood_defaults(),
walkable = true,
after_place_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
drop = "pipeworks:valve_off_empty",
drop = "pipeworks:valve_off_empty",
mesecons = {effector = {
action_on = function (pos, node)
minetest.add_node(pos,{name="pipeworks:valve_on_empty", param2 = node.param2})
@ -113,10 +194,11 @@ for s in ipairs(states) do
minetest.add_node(pos,{name="pipeworks:valve_off_empty", param2 = node.param2})
end
}},
on_punch = function(pos, node, puncher)
local fdir = minetest.get_node(pos).param2
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local fdir = node.param2
minetest.add_node(pos, { name = "pipeworks:valve_"..states[3-s].."_empty", param2 = fdir })
end
end,
on_rotate = pipeworks.fix_after_rotation
})
end
@ -130,18 +212,16 @@ minetest.register_node("pipeworks:valve_on_loaded", {
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -8/16, -4/16, -5/16, 8/16, 5/16, 5/16 }
fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 }
},
collision_box = {
type = "fixed",
fixed = { -8/16, -4/16, -5/16, 8/16, 5/16, 5/16 }
fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 }
},
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
after_place_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
@ -154,10 +234,11 @@ minetest.register_node("pipeworks:valve_on_loaded", {
minetest.add_node(pos,{name="pipeworks:valve_off_empty", param2 = node.param2})
end
}},
on_punch = function(pos, node, puncher)
local fdir = minetest.get_node(pos).param2
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local fdir = node.param2
minetest.add_node(pos, { name = "pipeworks:valve_off_empty", param2 = fdir })
end
end,
on_rotate = pipeworks.fix_after_rotation
})
-- grating
@ -172,17 +253,24 @@ minetest.register_node("pipeworks:grating", {
"pipeworks_grating_sides.png",
"pipeworks_grating_sides.png"
},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = { -0.49, -0.49, -0.49, 0.49, 0.5, 0.49 }
},
sunlight_propagates = true,
paramtype = "light",
groups = {snappy=3, pipe=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
pipe_connections = { top = 1 },
after_place_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
after_dig_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
on_rotate = false
})
-- outlet spigot
@ -198,6 +286,8 @@ minetest.register_node("pipeworks:spigot", {
groups = {snappy=3, pipe=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
pipe_connections = { left=1, right=1, front=1, back=1,
left_param2 = 3, right_param2 = 1, front_param2 = 2, back_param2 = 0 },
after_place_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
@ -211,7 +301,8 @@ minetest.register_node("pipeworks:spigot", {
collision_box = {
type = "fixed",
fixed = { -2/16, -6/16, -2/16, 2/16, 2/16, 8/16 }
}
},
on_rotate = pipeworks.fix_after_rotation
})
minetest.register_node("pipeworks:spigot_pouring", {
@ -236,7 +327,10 @@ minetest.register_node("pipeworks:spigot_pouring", {
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
pipe_connections = { left=1, right=1, front=1, back=1,
left_param2 = 3, right_param2 = 1, front_param2 = 2, back_param2 = 0 },
after_place_node = function(pos)
minetest.set_node(pos, { name = "pipeworks:spigot", param2 = minetest.get_node(pos).param2 })
pipeworks.scan_for_pipe_objects(pos)
end,
after_dig_node = function(pos)
@ -251,6 +345,7 @@ minetest.register_node("pipeworks:spigot_pouring", {
fixed = { -2/16, -6/16, -2/16, 2/16, 2/16, 8/16 }
},
drop = "pipeworks:spigot",
on_rotate = pipeworks.fix_after_rotation
})
-- sealed pipe entry/exit (horizontal pipe passing through a metal
@ -274,66 +369,13 @@ minetest.register_node("pipeworks:entry_panel_empty", {
groups = {snappy=3, pipe=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
after_place_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
selection_box = panel_cbox,
collision_box = panel_cbox,
on_place = function(itemstack, placer, pointed_thing)
local playername = placer:get_player_name()
if not minetest.is_protected(pointed_thing.under, playername)
and not minetest.is_protected(pointed_thing.above, playername) then
local node = minetest.get_node(pointed_thing.under)
if not minetest.registered_nodes[node.name]
or not minetest.registered_nodes[node.name].on_rightclick then
local pitch = placer:get_look_pitch()
local above = pointed_thing.above
local under = pointed_thing.under
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
local undernode = minetest.get_node(under)
local abovenode = minetest.get_node(above)
local uname = undernode.name
local aname = abovenode.name
local isabove = (above.x == under.x) and (above.z == under.z) and (pitch > 0)
local pos1 = above
if above.x == under.x
and above.z == under.z
and ( string.find(uname, "pipeworks:pipe_")
or string.find(uname, "pipeworks:storage_")
or string.find(uname, "pipeworks:expansion_")
or ( string.find(uname, "pipeworks:grating") and not isabove )
or ( string.find(uname, "pipeworks:pump_") and not isabove )
or ( string.find(uname, "pipeworks:entry_panel")
and undernode.param2 == 13 )
)
then
fdir = 13
end
if minetest.registered_nodes[uname]["buildable_to"] then
pos1 = under
end
if not minetest.registered_nodes[minetest.get_node(pos1).name]["buildable_to"] then return end
minetest.add_node(pos1, {name = "pipeworks:entry_panel_empty", param2 = fdir })
pipeworks.scan_for_pipe_objects(pos1)
if not pipeworks.expect_infinite_stacks then
itemstack:take_item()
end
else
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack)
end
end
return itemstack
end
on_rotate = pipeworks.fix_after_rotation
})
minetest.register_node("pipeworks:entry_panel_loaded", {
@ -346,15 +388,14 @@ minetest.register_node("pipeworks:entry_panel_loaded", {
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
after_place_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
selection_box = panel_cbox,
collision_box = panel_cbox,
drop = "pipeworks:entry_panel_empty"
drop = "pipeworks:entry_panel_empty",
on_rotate = pipeworks.fix_after_rotation
})
minetest.register_node("pipeworks:flow_sensor_empty", {
@ -368,9 +409,7 @@ minetest.register_node("pipeworks:flow_sensor_empty", {
groups = {snappy=3, pipe=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
after_place_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
@ -382,18 +421,19 @@ minetest.register_node("pipeworks:flow_sensor_empty", {
selection_box = {
type = "fixed",
fixed = {
{ -8/16, -2/16, -2/16, 8/16, 2/16, 2/16 },
{ -4/16, -3/16, -3/16, 4/16, 3/16, 3/16 },
{ -2/16, -2/16, -8/16, 2/16, 2/16, 8/16 },
{ -3/16, -3/16, -4/16, 3/16, 3/16, 4/16 },
}
},
collision_box = {
type = "fixed",
fixed = {
{ -8/16, -2/16, -2/16, 8/16, 2/16, 2/16 },
{ -4/16, -3/16, -3/16, 4/16, 3/16, 3/16 },
{ -2/16, -2/16, -8/16, 2/16, 2/16, 8/16 },
{ -3/16, -3/16, -4/16, 3/16, 3/16, 4/16 },
}
},
mesecons = pipereceptor_off
mesecons = pipereceptor_off,
on_rotate = pipeworks.fix_after_rotation
})
minetest.register_node("pipeworks:flow_sensor_loaded", {
@ -407,9 +447,7 @@ minetest.register_node("pipeworks:flow_sensor_loaded", {
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
after_place_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
on_place = pipeworks.rotate_on_place,
after_dig_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
@ -421,19 +459,20 @@ minetest.register_node("pipeworks:flow_sensor_loaded", {
selection_box = {
type = "fixed",
fixed = {
{ -8/16, -2/16, -2/16, 8/16, 2/16, 2/16 },
{ -4/16, -3/16, -3/16, 4/16, 3/16, 3/16 },
{ -2/16, -2/16, -8/16, 2/16, 2/16, 8/16 },
{ -3/16, -3/16, -4/16, 3/16, 3/16, 4/16 },
}
},
collision_box = {
type = "fixed",
fixed = {
{ -8/16, -2/16, -2/16, 8/16, 2/16, 2/16 },
{ -4/16, -3/16, -3/16, 4/16, 3/16, 3/16 },
{ -2/16, -2/16, -8/16, 2/16, 2/16, 8/16 },
{ -3/16, -3/16, -4/16, 3/16, 3/16, 4/16 },
}
},
drop = "pipeworks:flow_sensor_empty",
mesecons = pipereceptor_on
mesecons = pipereceptor_on,
on_rotate = pipeworks.fix_after_rotation
})
-- tanks
@ -466,6 +505,7 @@ for fill = 0, 10 do
sounds = default.node_sound_wood_defaults(),
walkable = true,
drop = "pipeworks:storage_tank_0",
pipe_connections = { top = 1, bottom = 1},
after_place_node = function(pos)
pipeworks.look_for_stackable_tanks(pos)
pipeworks.scan_for_pipe_objects(pos)
@ -473,6 +513,7 @@ for fill = 0, 10 do
after_dig_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
on_rotate = false
})
minetest.register_node("pipeworks:storage_tank_"..fill, {
@ -492,6 +533,7 @@ for fill = 0, 10 do
sounds = default.node_sound_wood_defaults(),
walkable = true,
drop = "pipeworks:storage_tank_0",
pipe_connections = { top = 1, bottom = 1},
after_place_node = function(pos)
pipeworks.look_for_stackable_tanks(pos)
pipeworks.scan_for_pipe_objects(pos)
@ -499,6 +541,7 @@ for fill = 0, 10 do
after_dig_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
on_rotate = false
})
end
@ -514,6 +557,7 @@ minetest.register_node("pipeworks:fountainhead", {
groups = {snappy=3, pipe=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
pipe_connections = { bottom = 1 },
after_place_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
@ -533,6 +577,7 @@ minetest.register_node("pipeworks:fountainhead", {
type = "fixed",
fixed = { -2/16, -8/16, -2/16, 2/16, 8/16, 2/16 }
},
on_rotate = false
})
minetest.register_node("pipeworks:fountainhead_pouring", {
@ -545,7 +590,9 @@ minetest.register_node("pipeworks:fountainhead_pouring", {
groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
pipe_connections = { bottom = 1 },
after_place_node = function(pos)
minetest.set_node(pos, { name = "pipeworks:fountainhead", param2 = minetest.get_node(pos).param2 })
pipeworks.scan_for_pipe_objects(pos)
end,
after_dig_node = function(pos)
@ -564,9 +611,28 @@ minetest.register_node("pipeworks:fountainhead_pouring", {
type = "fixed",
fixed = { -2/16, -8/16, -2/16, 2/16, 8/16, 2/16 }
},
drop = "pipeworks:fountainhead"
drop = "pipeworks:fountainhead",
on_rotate = false
})
minetest.register_alias("pipeworks:valve_off_loaded", "pipeworks:valve_off_empty")
minetest.register_alias("pipeworks:entry_panel", "pipeworks:entry_panel_empty")
minetest.register_lbm({
name = "pipeworks:rotate_valves_flowsensors",
label = "Flip pipeworks valves and flow sensors around X/Z",
run_at_every_load = false,
nodenames = {
"pipeworks:flow_sensor_empty",
"pipeworks:flow_sensor_loaded",
"pipeworks:valve_off_empty",
"pipeworks:valve_on_empty",
"pipeworks:valve_off_loaded",
},
action = function(pos, node)
local dir = minetest.facedir_to_dir(node.param2)
local newdir = { x=dir.z, y=dir.y, z=dir.x }
local newfdir = minetest.dir_to_facedir(newdir)
minetest.swap_node(pos, { name = node.name, param2 = newfdir })
end
})

View File

@ -1,3 +1,5 @@
local fs_helpers = pipeworks.fs_helpers
local function delay(x)
return (function() return x end)
end
@ -45,20 +47,48 @@ local function set_filter_formspec(data, meta)
"Sequence slots Randomly",
"Sequence slots by Rotation"})..
exmatch_button..
"list[current_player;main;0,4.5;8,4;]"
"list[current_player;main;0,4.5;8,4;]" ..
"listring[]"
end
meta:set_string("formspec", formspec)
end
-- todo SOON: this function has *way too many* parameters
local function grabAndFire(data,slotseq_mode,exmatch_mode,filtmeta,frominv,frominvname,frompos,fromnode,filterfor,fromtube,fromdef,dir,fakePlayer,all)
local function grabAndFire(data,slotseq_mode,exmatch_mode,filtmeta,frominv,frominvname,frompos,fromnode,filterfor,fromtube,fromdef,dir,fakePlayer,all,digiline)
local sposes = {}
if not frominvname or not frominv:get_list(frominvname) then return end
for spos,stack in ipairs(frominv:get_list(frominvname)) do
local matches
if filterfor == "" then
matches = stack:get_name() ~= ""
else
matches = stack:get_name() == filterfor.name
local fname = filterfor.name
local fgroup = filterfor.group
local fwear = filterfor.wear
local fmetadata = filterfor.metadata
matches = (not fname -- If there's a name filter,
or stack:get_name() == fname) -- it must match.
and (not fgroup -- If there's a group filter,
or (type(fgroup) == "string" -- it must be a string
and minetest.get_item_group( -- and it must match.
stack:get_name(), fgroup) ~= 0))
and (not fwear -- If there's a wear filter:
or (type(fwear) == "number" -- If it's a number,
and stack:get_wear() == fwear) -- it must match.
or (type(fwear) == "table" -- If it's a table:
and (not fwear[1] -- If there's a lower bound,
or (type(fwear[1]) == "number" -- it must be a number
and fwear[1] <= stack:get_wear())) -- and it must be <= the actual wear.
and (not fwear[2] -- If there's an upper bound
or (type(fwear[2]) == "number" -- it must be a number
and stack:get_wear() < fwear[2])))) -- and it must be > the actual wear.
-- If the wear filter is of any other type, fail.
--
and (not fmetadata -- If there's a matadata filter,
or (type(fmetadata) == "string" -- it must be a string
and stack:get_metadata() == fmetadata)) -- and it must match.
end
if matches then table.insert(sposes, spos) end
end
@ -103,10 +133,11 @@ local function grabAndFire(data,slotseq_mode,exmatch_mode,filtmeta,frominv,fromi
local count
if all then
count = math.min(stack:get_count(), doRemove)
if filterfor.count and filterfor.count > 1 then
if filterfor.count and (filterfor.count > 1 or digiline) then
if exmatch_mode ~= 0 and filterfor.count > count then
return false
return false -- not enough, fail
else
-- limit quantity to filter amount
count = math.min(filterfor.count, count)
end
end
@ -139,14 +170,47 @@ local function punch_filter(data, filtpos, filtnode, msg)
local fakePlayer = {
get_player_name = delay(owner),
is_fake_player = ":pipeworks",
get_wielded_item = delay(ItemStack(nil))
} -- TODO: use a mechanism as the wielder one
local dir = minetest.facedir_to_right_dir(filtnode.param2)
local dir = pipeworks.facedir_to_right_dir(filtnode.param2)
local frompos = vector.subtract(filtpos, dir)
local fromnode = minetest.get_node(frompos)
if not fromnode then return end
local fromdef = minetest.registered_nodes[fromnode.name]
if not fromdef then return end
local fromtube = fromdef.tube
local input_special_cases = {
["technic:mv_furnace"] = "dst",
["technic:mv_furnace_active"] = "dst",
["technic:mv_electric_furnace"] = "dst",
["technic:mv_electric_furnace_active"] = "dst",
["technic:mv_alloy_furnace"] = "dst",
["technic:mv_alloy_furnace_active"] = "dst",
["technic:mv_centrifuge"] = "dst",
["technic:mv_centrifuge_active"] = "dst",
["technic:mv_compressor"] = "dst",
["technic:mv_compressor_active"] = "dst",
["technic:mv_extractor"] = "dst",
["technic:mv_extractor_active"] = "dst",
["technic:mv_grinder"] = "dst",
["technic:mv_grinder_active"] = "dst",
["technic:tool_workshop"] = "src",
}
-- make sure there's something appropriate to inject the item into
local todir = pipeworks.facedir_to_right_dir(filtnode.param2)
local topos = vector.add(filtpos, todir)
local tonode = minetest.get_node(topos)
local todef = minetest.registered_nodes[tonode.name]
if not todef
or not (minetest.get_item_group(tonode.name, "tube") == 1
or minetest.get_item_group(tonode.name, "tubedevice") == 1
or minetest.get_item_group(tonode.name, "tubedevice_receiver") == 1) then
return
end
if fromtube then fromtube.input_inventory = input_special_cases[fromnode.name] or fromtube.input_inventory end
if not (fromtube and fromtube.input_inventory) then return end
local slotseq_mode
@ -154,6 +218,20 @@ local function punch_filter(data, filtpos, filtnode, msg)
local filters = {}
if data.digiline then
local function add_filter(name, group, count, wear, metadata)
table.insert(filters, {name = name, group = group, count = count, wear = wear, metadata = metadata})
end
local function add_itemstring_filter(filter)
local filterstack = ItemStack(filter)
local filtername = filterstack:get_name()
local filtercount = filterstack:get_count()
local filterwear = string.match(filter, "%S*:%S*%s%d%s(%d)") and filterstack:get_wear()
local filtermetadata = string.match(filter, "%S*:%S*%s%d%s%d(%s.*)") and filterstack:get_metadata()
add_filter(filtername, nil, filtercount, filterwear, filtermetadata)
end
local t_msg = type(msg)
if t_msg == "table" then
local slotseq = msg.slotseq
@ -205,28 +283,22 @@ local function punch_filter(data, filtpos, filtnode, msg)
return
end
if type(msg.name) == "string" then
table.insert(filters, {name = msg.name, count = tonumber(msg.count) or 1})
if msg.name or msg.group or msg.count or msg.wear or msg.metadata then
add_filter(msg.name, msg.group, msg.count, msg.wear, msg.metadata)
else
for _, filter in ipairs(msg) do
local t_filter = type(filter)
if t_filter == "table" then
if type(filter.name) == "string" then
table.insert(filters, {name = filter.name, count = tonumber(filter.count) or 1})
if filter.name or filter.group or filter.count or filter.wear or filter.metadata then
add_filter(filter.name, filter.group, filter.count, filter.wear, filter.metadata)
end
elseif t_filter == "string" then
local filterstack = ItemStack(filter)
local filtername = filterstack:get_name()
local filtercount = filterstack:get_count()
if filtername ~= "" then table.insert(filters, {name = filtername, count = filtercount}) end
add_itemstring_filter(filter)
end
end
end
elseif t_msg == "string" then
local filterstack = ItemStack(msg)
local filtername = filterstack:get_name()
local filtercount = filterstack:get_count()
if filtername ~= "" then table.insert(filters, {name = filtername, count = filtercount}) end
add_itemstring_filter(msg)
end
else
for _, filterstack in ipairs(filtinv:get_list("main")) do
@ -251,7 +323,7 @@ local function punch_filter(data, filtpos, filtnode, msg)
for _, frominvname in ipairs(type(fromtube.input_inventory) == "table" and fromtube.input_inventory or {fromtube.input_inventory}) do
local done = false
for _, filterfor in ipairs(filters) do
if grabAndFire(data, slotseq_mode, exact_match, filtmeta, frominv, frominvname, frompos, fromnode, filterfor, fromtube, fromdef, dir, fakePlayer, data.stackwise) then
if grabAndFire(data, slotseq_mode, exact_match, filtmeta, frominv, frominvname, frompos, fromnode, filterfor, fromtube, fromdef, dir, fakePlayer, data.stackwise, data.digiline) then
done = true
break
end

View File

@ -4,7 +4,7 @@
-- Contributed by mauvebic, 2013-01-03, rewritten a bit by Vanessa Ezekowitz
--
local finitewater = minetest.setting_getbool("liquid_finite")
local finitewater = minetest.settings:get_bool("liquid_finite")
pipeworks.check_for_liquids = function(pos)
local coords = {
@ -31,19 +31,32 @@ pipeworks.check_for_inflows = function(pos,node)
{x=pos.x-1,y=pos.y,z=pos.z},
{x=pos.x+1,y=pos.y,z=pos.z},
{x=pos.x,y=pos.y,z=pos.z-1},
{x=pos.x,y=pos.y,z=pos.z+1}, }
{x=pos.x,y=pos.y,z=pos.z+1},
}
local newnode = false
local source = false
for i =1,6 do
for i = 1, 6 do
if newnode then break end
local name = minetest.get_node(coords[i]).name
local testnode = minetest.get_node(coords[i])
local name = testnode.name
if name and (name == "pipeworks:pump_on" and pipeworks.check_for_liquids(coords[i])) or string.find(name,"_loaded") then
if string.find(name,"_loaded") then
source = minetest.get_meta(coords[i]):get_string("source")
if source == minetest.pos_to_string(pos) then break end
end
newnode = string.gsub(node.name,"empty","loaded")
source = {x=coords[i].x,y=coords[i].y,z=coords[i].z}
if string.find(name, "valve") or string.find(name, "sensor") then
if ((i == 3 or i == 4) and minetest.facedir_to_dir(testnode.param2).x ~= 0)
or ((i == 5 or i == 6) and minetest.facedir_to_dir(testnode.param2).z ~= 0)
or ((i == 1 or i == 2) and minetest.facedir_to_dir(testnode.param2).y ~= 0) then
newnode = string.gsub(node.name,"empty","loaded")
source = {x=coords[i].x,y=coords[i].y,z=coords[i].z}
end
else
newnode = string.gsub(node.name,"empty","loaded")
source = {x=coords[i].x,y=coords[i].y,z=coords[i].z}
end
end
end
if newnode then

View File

@ -13,7 +13,7 @@ local DEBUG = false
pipeworks.worldpath = minetest.get_worldpath()
pipeworks.modpath = minetest.get_modpath("pipeworks")
dofile(pipeworks.modpath.."/default_settings.txt")
dofile(pipeworks.modpath.."/default_settings.lua")
-- Read the external config file if it exists.
local worldsettingspath = pipeworks.worldpath.."/pipeworks_settings.txt"
@ -26,7 +26,7 @@ end
-- Random variables
pipeworks.expect_infinite_stacks = true
if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then
if minetest.get_modpath("unified_inventory") or not minetest.settings:get_bool("creative_mode") then
pipeworks.expect_infinite_stacks = false
end
@ -41,6 +41,11 @@ pipeworks.mesecons_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z
pipeworks.liquid_texture = "default_water.png"
pipeworks.button_off = {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"}
pipeworks.button_on = {text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
pipeworks.button_base = "image_button[0,4.3;1,0.6"
pipeworks.button_label = "label[0.9,4.31;Allow splitting incoming stacks from tubes]"
-- Helper functions
function pipeworks.fix_image_names(table, replacement)
@ -108,7 +113,10 @@ dofile(pipeworks.modpath.."/wielder.lua")
if pipeworks.enable_pipes then dofile(pipeworks.modpath.."/pipes.lua") end
if pipeworks.enable_teleport_tube then dofile(pipeworks.modpath.."/teleport_tube.lua") end
if pipeworks.enable_pipe_devices then dofile(pipeworks.modpath.."/devices.lua") end
if pipeworks.enable_redefines then dofile(pipeworks.modpath.."/compat.lua") end
if pipeworks.enable_redefines then
dofile(pipeworks.modpath.."/compat-chests.lua")
dofile(pipeworks.modpath.."/compat-furnaces.lua")
end
if pipeworks.enable_autocrafter then dofile(pipeworks.modpath.."/autocrafter.lua") end
minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")

View File

@ -1,3 +1,8 @@
local luaentity = pipeworks.luaentity
local enable_max_limit = minetest.settings:get("pipeworks_enable_items_per_tube_limit")
local max_tube_limit = tonumber(minetest.settings:get("pipeworks_max_items_per_tube")) or 30
if enable_max_limit == nil then enable_max_limit = true end
function pipeworks.tube_item(pos, item)
error("obsolete pipeworks.tube_item() called; change caller to use pipeworks.tube_inject_item() instead")
end
@ -29,6 +34,21 @@ function pipeworks.notvel(tbl, vel)
return tbl2
end
local tube_item_count = {}
minetest.register_globalstep(function(dtime)
if not luaentity.entities then
return
end
tube_item_count = {}
for id, entity in pairs(luaentity.entities) do
if entity.name == "pipeworks:tubed_item" then
local h = minetest.hash_node_position(vector.round(entity._pos))
tube_item_count[h] = (tube_item_count[h] or 0) + 1
end
end
end)
local function go_next(pos, velocity, stack)
local next_positions = {}
local max_priority = 0
@ -55,7 +75,7 @@ local function go_next(pos, velocity, stack)
end
for _, vect in ipairs(can_go) do
local npos = vector.add(pos, vect)
minetest.load_position(npos)
pipeworks.load_position(npos)
local node = minetest.get_node(npos)
local reg_node = minetest.registered_nodes[node.name]
if reg_node then
@ -75,6 +95,17 @@ local function go_next(pos, velocity, stack)
end
end
if enable_max_limit then
local h = minetest.hash_node_position(pos)
local itemcount = tube_item_count[h] or 0
if itemcount > max_tube_limit then
cmeta:set_string("the_tube_was", minetest.serialize(cnode))
print("[Pipeworks] Warning - a tube at "..minetest.pos_to_string(pos).." broke due to too many items ("..itemcount..")")
minetest.swap_node(pos, {name = "pipeworks:broken_tube_1"})
pipeworks.scan_for_tube_objects(pos)
end
end
if not next_positions[1] then
return false, nil
end
@ -200,15 +231,13 @@ luaentity.register_entity("pipeworks:tubed_item", {
end,
on_step = function(self, dtime)
local pos = self:getpos()
if self.start_pos == nil then
local pos = self:getpos()
self.start_pos = vector.round(pos)
self:setpos(pos)
end
local pos = self:getpos()
local stack = ItemStack(self.itemstring)
local drop_pos
local velocity = self:getvelocity()
@ -219,13 +248,14 @@ luaentity.register_entity("pipeworks:tubed_item", {
moved = true
end
local vel = {x = velocity.x / speed, y = velocity.y / speed, z = velocity.z / speed, speed = speed}
local moved_by = vector.distance(pos, self.start_pos)
if vector.distance(pos, self.start_pos) >= 1 then
if moved_by >= 1 then
self.start_pos = vector.add(self.start_pos, vel)
moved = true
end
minetest.load_position(self.start_pos)
pipeworks.load_position(self.start_pos)
local node = minetest.get_node(self.start_pos)
if moved and minetest.get_item_group(node.name, "tubedevice_receiver") == 1 then
local leftover
@ -239,6 +269,7 @@ luaentity.register_entity("pipeworks:tubed_item", {
return
end
velocity = vector.multiply(velocity, -1)
self:setpos(vector.subtract(self.start_pos, vector.multiply(vel, moved_by - 1)))
self:setvelocity(velocity)
self:set_item(leftover:to_string())
return
@ -246,20 +277,30 @@ luaentity.register_entity("pipeworks:tubed_item", {
if moved then
local found_next, new_velocity = go_next(self.start_pos, velocity, stack) -- todo: color
local rev_vel = vector.multiply(velocity, -1)
local rev_dir = vector.direction(self.start_pos,vector.add(self.start_pos,rev_vel))
local rev_node = minetest.get_node(vector.round(vector.add(self.start_pos,rev_dir)))
local tube_present = minetest.get_item_group(rev_node.name,"tubedevice") == 1
if not found_next then
drop_pos = minetest.find_node_near(vector.add(self.start_pos, velocity), 1, "air")
if drop_pos then
if pipeworks.drop_on_routing_fail or not tube_present or
minetest.get_item_group(rev_node.name,"tube") ~= 1 then
-- Using add_item instead of item_drop since this makes pipeworks backward
-- compatible with Minetest 0.4.13.
-- Using item_drop here makes Minetest 0.4.13 crash.
minetest.add_item(drop_pos, stack)
local dropped_item = minetest.add_item(self.start_pos, stack)
dropped_item:setvelocity(vector.multiply(velocity, 5))
self:remove()
return
else
velocity = vector.multiply(velocity, -1)
self:setpos(vector.subtract(self.start_pos, vector.multiply(vel, moved_by - 1)))
self:setvelocity(velocity)
end
end
if new_velocity and not vector.equals(velocity, new_velocity) then
self:setpos(self.start_pos)
local nvelr = math.abs(new_velocity.x + new_velocity.y + new_velocity.z)
self:setpos(vector.add(self.start_pos, vector.multiply(new_velocity, (moved_by - 1) / nvelr)))
self:setvelocity(new_velocity)
end
end

View File

@ -1,6 +1,7 @@
local max_entity_id = 1000000000000 -- If you need more, there's a problem with your code
luaentity = {}
local luaentity = {}
pipeworks.luaentity = luaentity
luaentity.registered_entities = {}
@ -23,6 +24,22 @@ end
local function read_entities()
local t = read_file()
for _, entity in pairs(t) do
local x=entity.start_pos.x
local y=entity.start_pos.y
local z=entity.start_pos.z
x=math.max(-30912,x)
y=math.max(-30912,y)
z=math.max(-30912,z)
x=math.min(30927,x)
y=math.min(30927,y)
z=math.min(30927,z)
entity.start_pos.x = x
entity.start_pos.y = y
entity.start_pos.z = z
setmetatable(entity, luaentity.registered_entities[entity.name])
end
return t
@ -52,32 +69,27 @@ local function get_blockpos(pos)
end
local active_blocks = {} -- These only contain active blocks near players (i.e., not forceloaded ones)
local handle_active_blocks_step = 2
local handle_active_blocks_timer = 0
minetest.register_globalstep(function(dtime)
handle_active_blocks_timer = handle_active_blocks_timer + dtime
if handle_active_blocks_timer >= handle_active_blocks_step then
handle_active_blocks_timer = handle_active_blocks_timer - handle_active_blocks_step
local active_block_range = tonumber(minetest.setting_get("active_block_range")) or 2
local new_active_blocks = {}
for _, player in ipairs(minetest.get_connected_players()) do
local blockpos = get_blockpos(player:getpos())
local minp = vector.subtract(blockpos, active_block_range)
local maxp = vector.add(blockpos, active_block_range)
for x = minp.x, maxp.x do
for y = minp.y, maxp.y do
for z = minp.z, maxp.z do
local pos = {x = x, y = y, z = z}
new_active_blocks[minetest.hash_node_position(pos)] = pos
end
end
end
local move_entities_globalstep_part1 = function(dtime)
local active_block_range = tonumber(minetest.settings:get("active_block_range")) or 2
local new_active_blocks = {}
for _, player in ipairs(minetest.get_connected_players()) do
local blockpos = get_blockpos(player:getpos())
local minp = vector.subtract(blockpos, active_block_range)
local maxp = vector.add(blockpos, active_block_range)
for x = minp.x, maxp.x do
for y = minp.y, maxp.y do
for z = minp.z, maxp.z do
local pos = {x = x, y = y, z = z}
new_active_blocks[minetest.hash_node_position(pos)] = pos
end
end
end
active_blocks = new_active_blocks
-- todo: callbacks on block load/unload
end
end)
active_blocks = new_active_blocks
-- todo: callbacks on block load/unload
end
local function is_active(pos)
return active_blocks[minetest.hash_node_position(get_blockpos(pos))] ~= nil
@ -309,7 +321,7 @@ function luaentity.get_objects_inside_radius(pos, radius)
end
end
minetest.register_globalstep(function(dtime)
local move_entities_globalstep_part2 = function(dtime)
if not luaentity.entities then
luaentity.entities = read_entities()
end
@ -348,4 +360,15 @@ minetest.register_globalstep(function(dtime)
end
end
end
end
local handle_active_blocks_timer = 0.1
minetest.register_globalstep(function(dtime)
handle_active_blocks_timer = handle_active_blocks_timer + dtime
if dtime < 0.2 or handle_active_blocks_timer >= (dtime * 3) then
handle_active_blocks_timer = 0.1
move_entities_globalstep_part1(dtime)
move_entities_globalstep_part2(dtime)
end
end)

View File

@ -1,114 +1,114 @@
# Blender v2.69 (sub 0) OBJ File: 'pipe-flow-sensor.blend'
# Blender v2.72 (sub 0) OBJ File: 'pipe-flow-sensor.blend'
# www.blender.org
o Cube.001
v -0.468750 -0.153248 -0.030483
v -0.500000 -0.153248 -0.030483
v -0.468750 -0.153248 0.030483
v -0.500000 -0.153248 0.030483
v -0.468750 -0.129917 0.086808
v -0.500000 -0.129917 0.086808
v -0.468750 -0.086808 0.129917
v -0.500000 -0.086808 0.129917
v -0.468750 -0.030483 0.153248
v -0.500000 -0.030483 0.153248
v -0.468750 0.030483 0.153248
v -0.500000 0.030483 0.153248
v -0.468750 0.086808 0.129917
v -0.500000 0.086808 0.129917
v -0.468750 0.129917 0.086808
v -0.500000 0.129917 0.086808
v -0.468750 0.153248 0.030483
v -0.500000 0.153247 0.030483
v -0.468750 0.153248 -0.030483
v -0.500000 0.153248 -0.030483
v -0.468750 0.129917 -0.086808
v -0.500000 0.129917 -0.086808
v -0.468750 0.086808 -0.129917
v -0.500000 0.086808 -0.129917
v -0.468750 0.030483 -0.153248
v -0.500000 0.030483 -0.153248
v -0.468750 -0.030483 -0.153248
v -0.500000 -0.030483 -0.153248
v -0.468750 -0.086808 -0.129917
v -0.500000 -0.086808 -0.129917
v -0.468750 -0.129917 -0.086808
v -0.500000 -0.129917 -0.086808
v -0.468750 -0.122598 -0.024386
v -0.468750 -0.122598 0.024386
v -0.468750 -0.103934 0.069446
v -0.468750 -0.069446 0.103934
v -0.468750 -0.024386 0.122598
v -0.468750 0.024386 0.122598
v -0.468750 0.069446 0.103934
v -0.468750 0.103934 0.069446
v -0.468750 0.122598 0.024386
v -0.468750 0.122598 -0.024386
v -0.468750 0.103934 -0.069446
v -0.468750 0.069446 -0.103934
v -0.468750 0.024386 -0.122598
v -0.468750 -0.024387 -0.122598
v -0.468750 -0.069447 -0.103934
v -0.468750 -0.103934 -0.069446
v -0.468750 -0.000000 -0.000000
v -0.500000 -0.000000 -0.000000
v 0.468750 -0.069446 0.103934
v 0.468750 -0.103933 0.069447
v 0.468750 -0.122598 0.024387
v 0.468750 -0.122598 -0.024386
v 0.500000 -0.129917 -0.086807
v 0.468750 -0.129917 -0.086807
v 0.500000 -0.086808 -0.129917
v 0.468750 -0.086808 -0.129917
v 0.500000 -0.030483 -0.153247
v 0.468750 -0.030483 -0.153247
v 0.500000 0.030483 -0.153247
v 0.468750 0.030483 -0.153247
v 0.500000 0.086808 -0.129917
v 0.468750 0.086808 -0.129917
v 0.500000 0.129917 -0.086808
v 0.468750 0.129917 -0.086808
v 0.500000 0.153248 -0.030483
v 0.468750 0.153248 -0.030483
v 0.500000 0.153248 0.030483
v 0.468750 0.153248 0.030483
v 0.500000 0.129917 0.086808
v 0.468750 0.129917 0.086808
v 0.500000 0.086808 0.129917
v 0.468750 0.086808 0.129917
v 0.500000 0.030483 0.153248
v 0.468750 0.030483 0.153248
v 0.500000 -0.030483 0.153248
v 0.468750 -0.030483 0.153248
v 0.500000 -0.086808 0.129917
v 0.468750 -0.086808 0.129917
v 0.500000 -0.129917 0.086808
v 0.468750 -0.129917 0.086808
v 0.500000 -0.153247 0.030483
v 0.468750 -0.153247 0.030483
v 0.500000 -0.153247 -0.030483
v 0.468750 -0.153247 -0.030483
v 0.468750 -0.024386 0.122598
v 0.468750 0.024387 0.122598
v 0.468750 0.069447 0.103934
v 0.468750 0.103934 0.069447
v 0.468750 0.122598 0.024387
v 0.468750 0.122598 -0.024386
v 0.468750 0.103934 -0.069446
v 0.468750 0.069447 -0.103933
v 0.468750 0.024387 -0.122598
v 0.468750 -0.024386 -0.122598
v 0.468750 -0.069446 -0.103933
v 0.468750 -0.103933 -0.069446
v 0.468750 0.000000 0.000000
v 0.500000 0.000000 0.000000
v 0.250000 -0.187500 0.187500
v -0.250000 -0.187500 0.187500
v -0.250000 -0.187500 -0.187500
v 0.250000 -0.187500 -0.187500
v 0.250000 0.187500 0.187500
v -0.250000 0.187500 0.187500
v -0.250000 0.187500 -0.187500
v 0.250000 0.187500 -0.187500
v -0.030483 -0.153248 0.468750
v -0.030483 -0.153248 0.500000
v 0.030483 -0.153248 0.468750
v 0.030483 -0.153248 0.500000
v 0.086808 -0.129917 0.468750
v 0.086808 -0.129917 0.500000
v 0.129917 -0.086808 0.468750
v 0.129917 -0.086808 0.500000
v 0.153248 -0.030483 0.468750
v 0.153248 -0.030483 0.500000
v 0.153248 0.030483 0.468750
v 0.153248 0.030483 0.500000
v 0.129917 0.086808 0.468750
v 0.129917 0.086808 0.500000
v 0.086808 0.129917 0.468750
v 0.086808 0.129917 0.500000
v 0.030483 0.153248 0.468750
v 0.030483 0.153247 0.500000
v -0.030483 0.153248 0.468750
v -0.030483 0.153248 0.500000
v -0.086808 0.129917 0.468750
v -0.086808 0.129917 0.500000
v -0.129917 0.086808 0.468750
v -0.129917 0.086808 0.500000
v -0.153248 0.030483 0.468750
v -0.153248 0.030483 0.500000
v -0.153248 -0.030483 0.468750
v -0.153248 -0.030483 0.500000
v -0.129917 -0.086808 0.468750
v -0.129917 -0.086808 0.500000
v -0.086808 -0.129917 0.468750
v -0.086808 -0.129917 0.500000
v -0.024386 -0.122598 0.468750
v 0.024386 -0.122598 0.468750
v 0.069446 -0.103934 0.468750
v 0.103934 -0.069446 0.468750
v 0.122598 -0.024386 0.468750
v 0.122598 0.024386 0.468750
v 0.103934 0.069446 0.468750
v 0.069446 0.103934 0.468750
v 0.024386 0.122598 0.468750
v -0.024386 0.122598 0.468750
v -0.069446 0.103934 0.468750
v -0.103934 0.069446 0.468750
v -0.122598 0.024386 0.468750
v -0.122598 -0.024387 0.468750
v -0.103934 -0.069447 0.468750
v -0.069446 -0.103934 0.468750
v -0.000000 -0.000000 0.468750
v -0.000000 -0.000000 0.500000
v 0.103934 -0.069446 -0.468750
v 0.069446 -0.103933 -0.468750
v 0.024386 -0.122598 -0.468750
v -0.024386 -0.122598 -0.468750
v -0.086808 -0.129917 -0.500000
v -0.086808 -0.129917 -0.468750
v -0.129917 -0.086808 -0.500000
v -0.129917 -0.086808 -0.468750
v -0.153248 -0.030483 -0.500000
v -0.153248 -0.030483 -0.468750
v -0.153248 0.030483 -0.500000
v -0.153248 0.030483 -0.468750
v -0.129917 0.086808 -0.500000
v -0.129917 0.086808 -0.468750
v -0.086808 0.129917 -0.500000
v -0.086808 0.129917 -0.468750
v -0.030483 0.153248 -0.500000
v -0.030483 0.153248 -0.468750
v 0.030483 0.153248 -0.500000
v 0.030483 0.153248 -0.468750
v 0.086808 0.129917 -0.500000
v 0.086808 0.129917 -0.468750
v 0.129917 0.086808 -0.500000
v 0.129917 0.086808 -0.468750
v 0.153248 0.030483 -0.500000
v 0.153248 0.030483 -0.468750
v 0.153248 -0.030483 -0.500000
v 0.153248 -0.030483 -0.468750
v 0.129917 -0.086808 -0.500000
v 0.129917 -0.086808 -0.468750
v 0.086808 -0.129917 -0.500000
v 0.086808 -0.129917 -0.468750
v 0.030483 -0.153247 -0.500000
v 0.030483 -0.153247 -0.468750
v -0.030483 -0.153247 -0.500000
v -0.030483 -0.153247 -0.468750
v 0.122598 -0.024386 -0.468750
v 0.122598 0.024387 -0.468750
v 0.103934 0.069447 -0.468750
v 0.069446 0.103934 -0.468750
v 0.024386 0.122598 -0.468750
v -0.024386 0.122598 -0.468750
v -0.069446 0.103934 -0.468750
v -0.103934 0.069447 -0.468750
v -0.122598 0.024387 -0.468750
v -0.122598 -0.024386 -0.468750
v -0.103934 -0.069446 -0.468750
v -0.069446 -0.103933 -0.468750
v 0.000000 0.000000 -0.468750
v 0.000000 0.000000 -0.500000
v 0.187500 -0.187500 -0.250000
v 0.187500 -0.187500 0.250000
v -0.187500 -0.187500 0.250000
v -0.187500 -0.187500 -0.250000
v 0.187500 0.187500 -0.250000
v 0.187500 0.187500 0.250000
v -0.187500 0.187500 0.250000
v -0.187500 0.187500 -0.250000
vt 0.813725 0.460784
vt 0.774510 0.460784
vt 0.774510 0.500000
@ -181,40 +181,11 @@ vt 0.460784 0.441176
vt 0.460784 0.127451
vt 0.500000 0.127451
vt 0.500000 0.441176
vt 0.402558 0.546671
vt 0.440212 0.531167
vt 0.460591 0.633009
vt 0.373738 0.575320
vt 0.358141 0.612752
vt 0.358141 0.653267
vt 0.373738 0.690699
vt 0.402558 0.719348
vt 0.440212 0.734852
vt 0.480969 0.734852
vt 0.518623 0.719348
vt 0.547443 0.690699
vt 0.563040 0.653267
vt 0.563040 0.612752
vt 0.547443 0.575320
vt 0.518623 0.546671
vt 0.480969 0.531167
vt 0.639882 0.546671
vt 0.677537 0.531167
vt 0.697915 0.633009
vt 0.611063 0.575320
vt 0.595466 0.612752
vt 0.595466 0.653267
vt 0.611063 0.690699
vt 0.639882 0.719347
vt 0.677537 0.734852
vt 0.718293 0.734852
vt 0.755947 0.719347
vt 0.784767 0.690699
vt 0.800364 0.653267
vt 0.800364 0.612752
vt 0.784767 0.575320
vt 0.755948 0.546671
vt 0.718293 0.531167
vt 0.892157 0.441176
vt 0.892157 0.127451
vt 0.931373 0.127451
@ -269,122 +240,141 @@ vt 0.009804 0.254902
vt 0.323529 0.254902
vt 0.323529 0.490196
vt 0.009804 0.490196
vn 0.000000 -1.000000 -0.000000
vn 0.382700 -0.923900 -0.000000
vn 0.707100 -0.707100 -0.000000
vn 0.923900 -0.382700 -0.000000
vn 1.000000 0.000000 0.000000
vn 0.923900 0.382700 0.000000
vn 0.707100 0.707100 0.000000
vn 0.382700 0.923900 0.000000
vn 0.000000 1.000000 0.000000
vn -0.382700 0.923900 0.000000
vn -0.707100 0.707100 0.000000
vn -0.923900 0.382700 0.000000
vn -1.000000 -0.000000 0.000000
vn -0.923900 -0.382700 -0.000000
vn -0.382700 -0.923900 -0.000000
vn -0.707100 -0.707100 -0.000000
vn 0.000000 -0.000000 1.000000
vn 0.000000 0.000000 -1.000000
g Cube.001_Cube.001_None
s off
f 1/1 3/2 4/3 2/4
f 3/2 5/5 6/6 4/3
f 5/5 7/7 8/8 6/6
f 7/7 9/9 10/10 8/8
f 9/9 11/11 12/12 10/10
f 11/11 13/13 14/14 12/12
f 13/13 15/15 16/16 14/14
f 15/15 17/17 18/18 16/16
f 17/17 19/19 20/20 18/18
f 19/19 21/21 22/22 20/20
f 21/21 23/23 24/24 22/22
f 23/23 25/25 26/26 24/24
f 25/27 27/28 28/29 26/30
f 27/28 29/31 30/32 28/29
f 31/33 1/1 2/4 32/34
f 29/31 31/33 32/34 30/32
f 4/35 50/36 2/37
f 1/38 49/39 3/40
f 3/40 49/39 5/41
f 5/41 49/39 7/42
f 7/42 49/39 9/43
f 9/43 49/39 11/44
f 11/44 49/39 13/45
f 13/45 49/39 15/46
f 15/46 49/39 17/47
f 17/47 49/39 19/48
f 19/48 49/39 21/49
f 21/49 49/39 23/50
f 23/50 49/39 25/51
f 25/51 49/39 27/52
f 27/52 49/39 29/53
f 29/53 49/39 31/54
f 31/54 49/39 1/38
f 2/37 50/36 32/55
f 32/55 50/36 30/56
f 30/56 50/36 28/57
f 28/57 50/36 26/58
f 26/58 50/36 24/59
f 24/59 50/36 22/60
f 22/60 50/36 20/61
f 20/61 50/36 18/62
f 18/62 50/36 16/63
f 16/63 50/36 14/64
f 14/64 50/36 12/65
f 12/65 50/36 10/66
f 10/66 50/36 8/67
f 8/67 50/36 6/68
f 6/68 50/36 4/35
f 41/69 91/70 92/71 42/72
f 81/73 83/74 100/75
f 79/76 81/73 100/75
f 77/77 79/76 100/75
f 75/78 77/77 100/75
f 73/79 75/78 100/75
f 71/80 73/79 100/75
f 69/81 71/80 100/75
f 67/82 69/81 100/75
f 65/83 67/82 100/75
f 63/84 65/83 100/75
f 61/85 63/84 100/75
f 59/86 61/85 100/75
f 57/87 59/86 100/75
f 55/88 57/87 100/75
f 85/89 55/88 100/75
f 56/90 86/91 99/92
f 58/93 56/90 99/92
f 60/94 58/93 99/92
f 62/95 60/94 99/92
f 64/96 62/95 99/92
f 66/97 64/96 99/92
f 68/98 66/97 99/92
f 70/99 68/98 99/92
f 72/100 70/99 99/92
f 74/101 72/100 99/92
f 76/102 74/101 99/92
f 78/103 76/102 99/92
f 80/104 78/103 99/92
f 82/105 80/104 99/92
f 84/106 82/105 99/92
f 86/91 84/106 99/92
f 83/74 85/89 100/75
f 58/22 57/21 55/19 56/20
f 56/20 55/19 85/17 86/18
f 60/24 59/23 57/21 58/22
f 62/26 61/25 59/23 60/24
f 64/29 63/28 61/27 62/30
f 66/32 65/31 63/28 64/29
f 68/34 67/33 65/31 66/32
f 70/4 69/1 67/33 68/34
f 72/3 71/2 69/1 70/4
f 74/6 73/5 71/2 72/3
f 76/8 75/7 73/5 74/6
f 78/10 77/9 75/7 76/8
f 80/12 79/11 77/9 78/10
f 82/14 81/13 79/11 80/12
f 84/16 83/15 81/13 82/14
f 86/18 85/17 83/15 84/16
f 36/107 51/108 87/109 37/110
f 34/111 53/112 52/113 35/114
f 47/115 97/116 98/117 48/118
f 33/119 54/120 53/112 34/111
f 35/114 52/113 51/108 36/107
f 48/118 98/117 54/120 33/119
f 46/121 96/122 97/116 47/115
f 45/123 95/124 96/122 46/121
f 44/125 94/126 95/124 45/123
f 43/127 93/128 94/126 44/125
f 42/72 92/71 93/128 43/127
f 40/129 90/130 91/70 41/69
f 39/131 89/132 90/130 40/129
f 38/133 88/134 89/132 39/131
f 37/110 87/109 88/135 38/136
f 105/137 106/138 102/139 101/140
f 106/141 107/142 103/143 102/144
f 107/145 108/146 104/147 103/148
f 108/149 105/150 101/151 104/152
f 101/153 102/154 103/155 104/156
f 108/157 107/158 106/159 105/160
f 1/1/1 3/2/1 4/3/1 2/4/1
f 3/2/2 5/5/2 6/6/2 4/3/2
f 5/5/3 7/7/3 8/8/3 6/6/3
f 7/7/4 9/9/4 10/10/4 8/8/4
f 9/9/5 11/11/5 12/12/5 10/10/5
f 11/11/6 13/13/6 14/14/6 12/12/6
f 13/13/7 15/15/7 16/16/7 14/14/7
f 15/15/8 17/17/8 18/18/8 16/16/8
f 17/17/9 19/19/9 20/20/9 18/18/9
f 19/19/10 21/21/10 22/22/10 20/20/10
f 21/21/11 23/23/11 24/24/11 22/22/11
f 23/23/12 25/25/12 26/26/12 24/24/12
f 25/27/13 27/28/13 28/29/13 26/30/13
f 27/28/14 29/31/14 30/32/14 28/29/14
f 31/33/15 1/1/15 2/4/15 32/34/15
f 29/31/16 31/33/16 32/34/16 30/32/16
f 4/35/17 50/36/17 2/37/17
f 1/38/18 49/39/18 3/40/18
f 3/40/18 49/39/18 5/41/18
f 5/41/18 49/39/18 7/42/18
f 7/42/18 49/39/18 9/43/18
f 9/43/18 49/39/18 11/44/18
f 11/44/18 49/39/18 13/45/18
f 13/45/18 49/39/18 15/46/18
f 15/46/18 49/39/18 17/47/18
f 17/47/18 49/39/18 19/48/18
f 19/48/18 49/39/18 21/49/18
f 21/49/18 49/39/18 23/50/18
f 23/50/18 49/39/18 25/51/18
f 25/51/18 49/39/18 27/52/18
f 27/52/18 49/39/18 29/53/18
f 29/53/18 49/39/18 31/54/18
f 31/54/18 49/39/18 1/38/18
f 2/37/17 50/36/17 32/55/17
f 32/55/17 50/36/17 30/56/17
f 30/56/17 50/36/17 28/57/17
f 28/57/17 50/36/17 26/58/17
f 26/58/17 50/36/17 24/59/17
f 24/59/17 50/36/17 22/60/17
f 22/60/17 50/36/17 20/61/17
f 20/61/17 50/36/17 18/62/17
f 18/62/17 50/36/17 16/63/17
f 16/63/17 50/36/17 14/64/17
f 14/64/17 50/36/17 12/65/17
f 12/65/17 50/36/17 10/66/17
f 10/66/17 50/36/17 8/67/17
f 8/67/17 50/36/17 6/68/17
f 6/68/17 50/36/17 4/35/17
f 41/69/9 91/70/9 92/71/9 42/72/9
f 81/55/18 83/37/18 100/36/18
f 79/56/18 81/55/18 100/36/18
f 77/57/18 79/56/18 100/36/18
f 75/58/18 77/57/18 100/36/18
f 73/59/18 75/58/18 100/36/18
f 71/73/18 73/59/18 100/36/18
f 69/61/18 71/73/18 100/36/18
f 67/62/18 69/61/18 100/36/18
f 65/74/18 67/62/18 100/36/18
f 63/64/18 65/74/18 100/36/18
f 61/65/18 63/64/18 100/36/18
f 59/66/18 61/65/18 100/36/18
f 57/67/18 59/66/18 100/36/18
f 55/68/18 57/67/18 100/36/18
f 85/35/18 55/68/18 100/36/18
f 56/54/17 86/38/17 99/39/17
f 58/53/17 56/54/17 99/39/17
f 60/52/17 58/53/17 99/39/17
f 62/51/17 60/52/17 99/39/17
f 64/50/17 62/51/17 99/39/17
f 66/75/17 64/50/17 99/39/17
f 68/48/17 66/75/17 99/39/17
f 70/47/17 68/48/17 99/39/17
f 72/76/17 70/47/17 99/39/17
f 74/45/17 72/76/17 99/39/17
f 76/44/17 74/45/17 99/39/17
f 78/43/17 76/44/17 99/39/17
f 80/42/17 78/43/17 99/39/17
f 82/77/17 80/42/17 99/39/17
f 84/40/17 82/77/17 99/39/17
f 86/38/17 84/40/17 99/39/17
f 83/37/18 85/35/18 100/36/18
f 58/22/16 57/21/16 55/19/16 56/20/16
f 56/20/15 55/19/15 85/17/15 86/18/15
f 60/24/14 59/23/14 57/21/14 58/22/14
f 62/26/13 61/25/13 59/23/13 60/24/13
f 64/29/12 63/28/12 61/27/12 62/30/12
f 66/32/11 65/31/11 63/28/11 64/29/11
f 68/34/10 67/33/10 65/31/10 66/32/10
f 70/4/9 69/1/9 67/33/9 68/34/9
f 72/3/8 71/2/8 69/1/8 70/4/8
f 74/6/7 73/5/7 71/2/7 72/3/7
f 76/8/6 75/7/6 73/5/6 74/6/6
f 78/10/5 77/9/5 75/7/5 76/8/5
f 80/12/4 79/11/4 77/9/4 78/10/4
f 82/14/3 81/13/3 79/11/3 80/12/3
f 84/16/2 83/15/2 81/13/2 82/14/2
f 86/18/1 85/17/1 83/15/1 84/16/1
f 36/78/4 51/79/4 87/80/4 37/81/4
f 34/82/2 53/83/2 52/84/2 35/85/2
f 47/86/16 97/87/16 98/88/16 48/89/16
f 33/90/1 54/91/1 53/83/1 34/82/1
f 35/85/3 52/84/3 51/79/3 36/78/3
f 48/89/15 98/88/15 54/91/15 33/90/15
f 46/92/14 96/93/14 97/87/14 47/86/14
f 45/94/13 95/95/13 96/93/13 46/92/13
f 44/96/12 94/97/12 95/95/12 45/94/12
f 43/98/11 93/99/11 94/97/11 44/96/11
f 42/72/10 92/71/10 93/99/10 43/98/10
f 40/100/8 90/101/8 91/70/8 41/69/8
f 39/102/7 89/103/7 90/101/7 40/100/7
f 38/104/6 88/105/6 89/103/6 39/102/6
f 37/81/5 87/80/5 88/106/5 38/107/5
f 105/108/5 106/109/5 102/110/5 101/111/5
f 106/112/17 107/113/17 103/114/17 102/115/17
f 107/116/13 108/117/13 104/118/13 103/119/13
f 108/120/18 105/121/18 101/122/18 104/123/18
f 101/124/1 102/125/1 103/126/1 104/127/1
f 108/128/9 107/129/9 106/130/9 105/131/9

View File

@ -1,131 +1,130 @@
# Blender v2.69 (sub 0) OBJ File: 'pipe-valve-off.blend'
# Blender v2.72 (sub 0) OBJ File: 'pipe-valve-off.blend'
# www.blender.org
mtllib pipeworks_valve_off.mtl
o Cube.003
v 0.062500 0.281250 -0.312500
v 0.062500 0.281250 0.093750
v -0.062500 0.281250 0.093750
v -0.062500 0.281250 -0.312500
v 0.062500 0.343750 -0.312500
v 0.062500 0.343750 0.093750
v -0.062500 0.343750 0.093750
v -0.062500 0.343750 -0.312500
v -0.312500 0.281250 -0.062500
v 0.093750 0.281250 -0.062500
v 0.093750 0.281250 0.062500
v -0.312500 0.281250 0.062500
v -0.312500 0.343750 -0.062500
v 0.093750 0.343750 -0.062500
v 0.093750 0.343750 0.062500
v -0.312500 0.343750 0.062500
v -0.031250 0.250000 -0.031250
v 0.031250 0.250000 -0.031250
v 0.031250 0.250000 0.031250
v -0.031250 0.250000 0.031250
v -0.031250 0.250000 -0.031250
v -0.031250 0.281250 -0.031250
v 0.031250 0.281250 -0.031250
v 0.031250 0.281250 0.031250
v -0.031250 0.281250 0.031250
v -0.031250 0.281250 -0.031250
v -0.250000 -0.250000 -0.250000
v 0.250000 -0.250000 -0.250000
v 0.250000 -0.250000 0.250000
v -0.250000 -0.250000 0.250000
v -0.250000 -0.250000 -0.250000
v -0.250000 0.250000 -0.250000
v 0.250000 0.250000 -0.250000
v 0.250000 0.250000 0.250000
v -0.250000 0.250000 0.250000
v -0.250000 0.250000 -0.250000
v -0.468750 -0.153248 -0.030483
v -0.500000 -0.153248 -0.030483
v -0.468750 -0.153248 0.030483
v -0.500000 -0.153248 0.030483
v -0.468750 -0.129917 0.086808
v -0.500000 -0.129917 0.086808
v -0.468750 -0.086808 0.129917
v -0.500000 -0.086808 0.129917
v -0.468750 -0.030483 0.153248
v -0.500000 -0.030483 0.153248
v -0.468750 0.030483 0.153248
v -0.500000 0.030483 0.153248
v -0.468750 0.086808 0.129917
v -0.500000 0.086808 0.129917
v -0.468750 0.129917 0.086808
v -0.500000 0.129917 0.086808
v -0.468750 0.153248 0.030483
v -0.500000 0.153247 0.030483
v -0.468750 0.153248 -0.030483
v -0.500000 0.153248 -0.030483
v -0.468750 0.129917 -0.086808
v -0.500000 0.129917 -0.086808
v -0.468750 0.086808 -0.129917
v -0.500000 0.086808 -0.129917
v -0.468750 0.030483 -0.153248
v -0.500000 0.030483 -0.153248
v -0.468750 -0.030483 -0.153248
v -0.500000 -0.030483 -0.153248
v -0.468750 -0.086808 -0.129917
v -0.500000 -0.086808 -0.129917
v -0.468750 -0.129917 -0.086808
v -0.500000 -0.129917 -0.086808
v -0.468750 -0.122598 -0.024386
v -0.468750 -0.122598 0.024386
v -0.468750 -0.103934 0.069446
v -0.468750 -0.069446 0.103934
v -0.468750 -0.024386 0.122598
v -0.468750 0.024386 0.122598
v -0.468750 0.069446 0.103934
v -0.468750 0.103934 0.069446
v -0.468750 0.122598 0.024386
v -0.468750 0.122598 -0.024386
v -0.468750 0.103934 -0.069446
v -0.468750 0.069446 -0.103934
v -0.468750 0.024386 -0.122598
v -0.468750 -0.024387 -0.122598
v -0.468750 -0.069447 -0.103934
v -0.468750 -0.103934 -0.069446
v -0.468750 -0.000000 -0.000000
v -0.500000 -0.000000 -0.000000
v 0.468750 -0.069446 0.103934
v 0.468750 -0.103933 0.069447
v 0.468750 -0.122598 0.024387
v 0.468750 -0.122598 -0.024386
v 0.500000 -0.129917 -0.086807
v 0.468750 -0.129917 -0.086807
v 0.500000 -0.086808 -0.129917
v 0.468750 -0.086808 -0.129917
v 0.500000 -0.030483 -0.153247
v 0.468750 -0.030483 -0.153247
v 0.500000 0.030483 -0.153247
v 0.468750 0.030483 -0.153247
v 0.500000 0.086808 -0.129917
v 0.468750 0.086808 -0.129917
v 0.500000 0.129917 -0.086808
v 0.468750 0.129917 -0.086808
v 0.500000 0.153248 -0.030483
v 0.468750 0.153248 -0.030483
v 0.500000 0.153248 0.030483
v 0.468750 0.153248 0.030483
v 0.500000 0.129917 0.086808
v 0.468750 0.129917 0.086808
v 0.500000 0.086808 0.129917
v 0.468750 0.086808 0.129917
v 0.500000 0.030483 0.153248
v 0.468750 0.030483 0.153248
v 0.500000 -0.030483 0.153248
v 0.468750 -0.030483 0.153248
v 0.500000 -0.086807 0.129917
v 0.468750 -0.086808 0.129917
v 0.500000 -0.129917 0.086808
v 0.468750 -0.129917 0.086808
v 0.500000 -0.153247 0.030483
v 0.468750 -0.153247 0.030483
v 0.500000 -0.153247 -0.030483
v 0.468750 -0.153247 -0.030483
v 0.468750 -0.024386 0.122598
v 0.468750 0.024387 0.122598
v 0.468750 0.069447 0.103934
v 0.468750 0.103934 0.069447
v 0.468750 0.122598 0.024387
v 0.468750 0.122598 -0.024386
v 0.468750 0.103934 -0.069446
v 0.468750 0.069447 -0.103933
v 0.468750 0.024387 -0.122598
v 0.468750 -0.024386 -0.122598
v 0.468750 -0.069446 -0.103933
v 0.468750 -0.103933 -0.069446
v 0.468750 0.000000 0.000000
v 0.500000 0.000000 0.000000
v -0.030483 -0.153248 0.468750
v -0.030483 -0.153248 0.500000
v 0.030483 -0.153248 0.468750
v 0.030483 -0.153248 0.500000
v 0.086808 -0.129917 0.468750
v 0.086808 -0.129917 0.500000
v 0.129917 -0.086808 0.468750
v 0.129917 -0.086808 0.500000
v 0.153248 -0.030483 0.468750
v 0.153248 -0.030483 0.500000
v 0.153248 0.030483 0.468750
v 0.153248 0.030483 0.500000
v 0.129917 0.086808 0.468750
v 0.129917 0.086808 0.500000
v 0.086808 0.129917 0.468750
v 0.086808 0.129917 0.500000
v 0.030483 0.153248 0.468750
v 0.030483 0.153247 0.500000
v -0.030483 0.153248 0.468750
v -0.030483 0.153248 0.500000
v -0.086808 0.129917 0.468750
v -0.086808 0.129917 0.500000
v -0.129917 0.086808 0.468750
v -0.129917 0.086808 0.500000
v -0.153248 0.030483 0.468750
v -0.153248 0.030483 0.500000
v -0.153248 -0.030483 0.468750
v -0.153248 -0.030483 0.500000
v -0.129917 -0.086808 0.468750
v -0.129917 -0.086808 0.500000
v -0.086808 -0.129917 0.468750
v -0.086808 -0.129917 0.500000
v -0.024386 -0.122598 0.468750
v 0.024386 -0.122598 0.468750
v 0.069446 -0.103934 0.468750
v 0.103934 -0.069446 0.468750
v 0.122598 -0.024386 0.468750
v 0.122598 0.024386 0.468750
v 0.103934 0.069446 0.468750
v 0.069446 0.103934 0.468750
v 0.024386 0.122598 0.468750
v -0.024386 0.122598 0.468750
v -0.069446 0.103934 0.468750
v -0.103934 0.069446 0.468750
v -0.122598 0.024386 0.468750
v -0.122598 -0.024387 0.468750
v -0.103934 -0.069447 0.468750
v -0.069446 -0.103934 0.468750
v -0.000000 -0.000000 0.468750
v -0.000000 -0.000000 0.500000
v 0.103934 -0.069446 -0.468750
v 0.069447 -0.103933 -0.468750
v 0.024387 -0.122598 -0.468750
v -0.024386 -0.122598 -0.468750
v -0.086808 -0.129917 -0.500000
v -0.086808 -0.129917 -0.468750
v -0.129917 -0.086808 -0.500000
v -0.129917 -0.086808 -0.468750
v -0.153247 -0.030483 -0.500000
v -0.153247 -0.030483 -0.468750
v -0.153247 0.030483 -0.500000
v -0.153247 0.030483 -0.468750
v -0.129917 0.086808 -0.500000
v -0.129917 0.086808 -0.468750
v -0.086808 0.129917 -0.500000
v -0.086808 0.129917 -0.468750
v -0.030483 0.153248 -0.500000
v -0.030483 0.153248 -0.468750
v 0.030483 0.153248 -0.500000
v 0.030483 0.153248 -0.468750
v 0.086808 0.129917 -0.500000
v 0.086808 0.129917 -0.468750
v 0.129917 0.086808 -0.500000
v 0.129917 0.086808 -0.468750
v 0.153248 0.030483 -0.500000
v 0.153248 0.030483 -0.468750
v 0.153248 -0.030483 -0.500000
v 0.153248 -0.030483 -0.468750
v 0.129917 -0.086807 -0.500000
v 0.129917 -0.086808 -0.468750
v 0.086808 -0.129917 -0.500000
v 0.086808 -0.129917 -0.468750
v 0.030483 -0.153247 -0.500000
v 0.030483 -0.153247 -0.468750
v -0.030483 -0.153247 -0.500000
v -0.030483 -0.153247 -0.468750
v 0.122598 -0.024386 -0.468750
v 0.122598 0.024387 -0.468750
v 0.103934 0.069447 -0.468750
v 0.069447 0.103934 -0.468750
v 0.024387 0.122598 -0.468750
v -0.024386 0.122598 -0.468750
v -0.069446 0.103934 -0.468750
v -0.103933 0.069447 -0.468750
v -0.122598 0.024387 -0.468750
v -0.122598 -0.024386 -0.468750
v -0.103933 -0.069446 -0.468750
v -0.069446 -0.103933 -0.468750
v 0.000000 0.000000 -0.468750
v 0.000000 0.000000 -0.500000
vt 0.265625 0.234375
vt 0.468750 0.234375
vt 0.468750 0.265625
@ -262,40 +261,6 @@ vt 0.585938 0.257812
vt 0.585938 0.007812
vt 0.617188 0.007812
vt 0.617188 0.257812
vt 0.538433 0.340928
vt 0.568449 0.328495
vt 0.584693 0.410160
vt 0.515460 0.363901
vt 0.503028 0.393916
vt 0.503028 0.426405
vt 0.515460 0.456420
vt 0.538433 0.479393
vt 0.568449 0.491826
vt 0.600937 0.491826
vt 0.630952 0.479393
vt 0.653925 0.456420
vt 0.666358 0.426405
vt 0.666358 0.393916
vt 0.653925 0.363901
vt 0.630952 0.340928
vt 0.600937 0.328495
vt 0.727611 0.340928
vt 0.757626 0.328495
vt 0.773870 0.410160
vt 0.704638 0.363901
vt 0.692205 0.393916
vt 0.692205 0.426405
vt 0.704638 0.456420
vt 0.727611 0.479393
vt 0.757626 0.491826
vt 0.790115 0.491826
vt 0.820130 0.479393
vt 0.843103 0.456420
vt 0.855535 0.426405
vt 0.855535 0.393916
vt 0.843103 0.363901
vt 0.820130 0.340928
vt 0.790115 0.328495
vt 0.929688 0.257812
vt 0.929688 0.007812
vt 0.960938 0.007812
@ -326,133 +291,151 @@ vt 0.492188 0.257812
vt 0.492188 0.007812
vt 0.992188 0.007812
vt 0.992188 0.257812
usemtl None
vn 0.000000 0.000000 -1.000000
vn 1.000000 0.000000 0.000000
vn -0.000000 0.000000 1.000000
vn -1.000000 0.000000 -0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.382700 -0.923900 -0.000000
vn 0.707100 -0.707100 -0.000000
vn 0.923900 -0.382700 0.000000
vn 0.923900 0.382700 0.000000
vn 0.707100 0.707100 0.000000
vn 0.382700 0.923900 0.000000
vn -0.382700 0.923900 0.000000
vn -0.707100 0.707100 0.000000
vn -0.923900 0.382700 -0.000000
vn -0.923900 -0.382700 -0.000000
vn -0.382700 -0.923900 -0.000000
vn -0.707100 -0.707100 -0.000000
g Cube.003_Cube.003_None
s off
f 5/1 6/2 2/3 1/4
f 6/5 7/6 3/7 2/8
f 7/9 8/10 4/11 3/12
f 8/13 5/14 1/15 4/16
f 1/17 2/18 3/19 4/20
f 8/21 7/22 6/23 5/24
f 13/25 14/26 10/27 9/28
f 14/29 15/30 11/31 10/32
f 15/33 16/34 12/35 11/36
f 16/37 13/38 9/39 12/40
f 21/41 22/42 18/43 17/44
f 22/45 23/46 19/47 18/48
f 23/49 24/50 20/51 19/52
f 24/53 21/54 17/55 20/56
f 17/57 18/58 19/59 20/60
f 24/61 23/62 22/63 21/64
f 25/65 27/66 28/67 26/68
f 27/66 29/69 30/70 28/67
f 29/69 31/71 32/72 30/70
f 31/71 33/73 34/74 32/72
f 33/73 35/75 36/76 34/74
f 35/75 37/77 38/78 36/76
f 37/77 39/79 40/80 38/78
f 39/79 41/81 42/82 40/80
f 41/81 43/83 44/84 42/82
f 43/83 45/85 46/86 44/84
f 45/85 47/87 48/88 46/86
f 47/87 49/89 50/90 48/88
f 49/91 51/92 52/93 50/94
f 51/92 53/95 54/96 52/93
f 55/97 25/65 26/68 56/98
f 53/95 55/97 56/98 54/96
f 28/99 74/100 26/101
f 25/102 73/103 27/104
f 27/104 73/103 29/105
f 29/105 73/103 31/106
f 31/106 73/103 33/107
f 33/107 73/103 35/108
f 35/108 73/103 37/109
f 37/109 73/103 39/110
f 39/110 73/103 41/111
f 41/111 73/103 43/112
f 43/112 73/103 45/113
f 45/113 73/103 47/114
f 47/114 73/103 49/115
f 49/115 73/103 51/116
f 51/116 73/103 53/117
f 53/117 73/103 55/118
f 55/118 73/103 25/102
f 26/101 74/100 56/119
f 56/119 74/100 54/120
f 54/120 74/100 52/121
f 52/121 74/100 50/122
f 50/122 74/100 48/123
f 48/123 74/100 46/124
f 46/124 74/100 44/125
f 44/125 74/100 42/126
f 42/126 74/100 40/127
f 40/127 74/100 38/128
f 38/128 74/100 36/129
f 36/129 74/100 34/130
f 34/130 74/100 32/131
f 32/131 74/100 30/132
f 30/132 74/100 28/99
f 65/133 115/134 116/135 66/136
f 105/137 107/138 124/139
f 103/140 105/137 124/139
f 101/141 103/140 124/139
f 99/142 101/141 124/139
f 97/143 99/142 124/139
f 95/144 97/143 124/139
f 93/145 95/144 124/139
f 91/146 93/145 124/139
f 89/147 91/146 124/139
f 87/148 89/147 124/139
f 85/149 87/148 124/139
f 83/150 85/149 124/139
f 81/151 83/150 124/139
f 79/152 81/151 124/139
f 109/153 79/152 124/139
f 80/154 110/155 123/156
f 82/157 80/154 123/156
f 84/158 82/157 123/156
f 86/159 84/158 123/156
f 88/160 86/159 123/156
f 90/161 88/160 123/156
f 92/162 90/161 123/156
f 94/163 92/162 123/156
f 96/164 94/163 123/156
f 98/165 96/164 123/156
f 100/166 98/165 123/156
f 102/167 100/166 123/156
f 104/168 102/167 123/156
f 106/169 104/168 123/156
f 108/170 106/169 123/156
f 110/155 108/170 123/156
f 107/138 109/153 124/139
f 82/86 81/85 79/83 80/84
f 80/84 79/83 109/81 110/82
f 84/88 83/87 81/85 82/86
f 86/90 85/89 83/87 84/88
f 88/93 87/92 85/91 86/94
f 90/96 89/95 87/92 88/93
f 92/98 91/97 89/95 90/96
f 94/68 93/65 91/97 92/98
f 96/67 95/66 93/65 94/68
f 98/70 97/69 95/66 96/67
f 100/72 99/71 97/69 98/70
f 102/74 101/73 99/71 100/72
f 104/76 103/75 101/73 102/74
f 106/78 105/77 103/75 104/76
f 108/80 107/79 105/77 106/78
f 110/82 109/81 107/79 108/80
f 60/171 75/172 111/173 61/174
f 58/175 77/176 76/177 59/178
f 71/179 121/180 122/181 72/182
f 57/183 78/184 77/176 58/175
f 59/178 76/177 75/172 60/171
f 72/182 122/181 78/184 57/183
f 70/185 120/186 121/180 71/179
f 69/187 119/188 120/186 70/185
f 68/189 118/190 119/188 69/187
f 67/191 117/192 118/190 68/189
f 66/136 116/135 117/192 67/191
f 64/193 114/194 115/134 65/133
f 63/195 113/196 114/194 64/193
f 62/197 112/198 113/196 63/195
f 61/174 111/173 112/199 62/200
f 5/1/1 6/2/1 2/3/1 1/4/1
f 6/5/2 7/6/2 3/7/2 2/8/2
f 7/9/3 8/10/3 4/11/3 3/12/3
f 8/13/4 5/14/4 1/15/4 4/16/4
f 1/17/5 2/18/5 3/19/5 4/20/5
f 8/21/6 7/22/6 6/23/6 5/24/6
f 13/25/1 14/26/1 10/27/1 9/28/1
f 14/29/2 15/30/2 11/31/2 10/32/2
f 15/33/3 16/34/3 12/35/3 11/36/3
f 16/37/4 13/38/4 9/39/4 12/40/4
f 21/41/1 22/42/1 18/43/1 17/44/1
f 22/45/2 23/46/2 19/47/2 18/48/2
f 23/49/3 24/50/3 20/51/3 19/52/3
f 24/53/4 21/54/4 17/55/4 20/56/4
f 17/57/5 18/58/5 19/59/5 20/60/5
f 24/61/6 23/62/6 22/63/6 21/64/6
f 25/65/5 27/66/5 28/67/5 26/68/5
f 27/66/7 29/69/7 30/70/7 28/67/7
f 29/69/8 31/71/8 32/72/8 30/70/8
f 31/71/9 33/73/9 34/74/9 32/72/9
f 33/73/2 35/75/2 36/76/2 34/74/2
f 35/75/10 37/77/10 38/78/10 36/76/10
f 37/77/11 39/79/11 40/80/11 38/78/11
f 39/79/12 41/81/12 42/82/12 40/80/12
f 41/81/6 43/83/6 44/84/6 42/82/6
f 43/83/13 45/85/13 46/86/13 44/84/13
f 45/85/14 47/87/14 48/88/14 46/86/14
f 47/87/15 49/89/15 50/90/15 48/88/15
f 49/91/4 51/92/4 52/93/4 50/94/4
f 51/92/16 53/95/16 54/96/16 52/93/16
f 55/97/17 25/65/17 26/68/17 56/98/17
f 53/95/18 55/97/18 56/98/18 54/96/18
f 28/99/3 74/100/3 26/101/3
f 25/102/1 73/103/1 27/104/1
f 27/104/1 73/103/1 29/105/1
f 29/105/1 73/103/1 31/106/1
f 31/106/1 73/103/1 33/107/1
f 33/107/1 73/103/1 35/108/1
f 35/108/1 73/103/1 37/109/1
f 37/109/1 73/103/1 39/110/1
f 39/110/1 73/103/1 41/111/1
f 41/111/1 73/103/1 43/112/1
f 43/112/1 73/103/1 45/113/1
f 45/113/1 73/103/1 47/114/1
f 47/114/1 73/103/1 49/115/1
f 49/115/1 73/103/1 51/116/1
f 51/116/1 73/103/1 53/117/1
f 53/117/1 73/103/1 55/118/1
f 55/118/1 73/103/1 25/102/1
f 26/101/3 74/100/3 56/119/3
f 56/119/3 74/100/3 54/120/3
f 54/120/3 74/100/3 52/121/3
f 52/121/3 74/100/3 50/122/3
f 50/122/3 74/100/3 48/123/3
f 48/123/3 74/100/3 46/124/3
f 46/124/3 74/100/3 44/125/3
f 44/125/3 74/100/3 42/126/3
f 42/126/3 74/100/3 40/127/3
f 40/127/3 74/100/3 38/128/3
f 38/128/3 74/100/3 36/129/3
f 36/129/3 74/100/3 34/130/3
f 34/130/3 74/100/3 32/131/3
f 32/131/3 74/100/3 30/132/3
f 30/132/3 74/100/3 28/99/3
f 65/133/6 115/134/6 116/135/6 66/136/6
f 105/119/1 107/101/1 124/100/1
f 103/120/1 105/119/1 124/100/1
f 101/121/1 103/120/1 124/100/1
f 99/122/1 101/121/1 124/100/1
f 97/123/1 99/122/1 124/100/1
f 95/124/1 97/123/1 124/100/1
f 93/125/1 95/124/1 124/100/1
f 91/126/1 93/125/1 124/100/1
f 89/127/1 91/126/1 124/100/1
f 87/128/1 89/127/1 124/100/1
f 85/129/1 87/128/1 124/100/1
f 83/130/1 85/129/1 124/100/1
f 81/131/1 83/130/1 124/100/1
f 79/132/1 81/131/1 124/100/1
f 109/99/1 79/132/1 124/100/1
f 80/118/3 110/102/3 123/103/3
f 82/117/3 80/118/3 123/103/3
f 84/116/3 82/117/3 123/103/3
f 86/115/3 84/116/3 123/103/3
f 88/114/3 86/115/3 123/103/3
f 90/113/3 88/114/3 123/103/3
f 92/112/3 90/113/3 123/103/3
f 94/111/3 92/112/3 123/103/3
f 96/110/3 94/111/3 123/103/3
f 98/109/3 96/110/3 123/103/3
f 100/108/3 98/109/3 123/103/3
f 102/107/3 100/108/3 123/103/3
f 104/106/3 102/107/3 123/103/3
f 106/105/3 104/106/3 123/103/3
f 108/104/3 106/105/3 123/103/3
f 110/102/3 108/104/3 123/103/3
f 107/101/1 109/99/1 124/100/1
f 82/86/18 81/85/18 79/83/18 80/84/18
f 80/84/17 79/83/17 109/81/17 110/82/17
f 84/88/16 83/87/16 81/85/16 82/86/16
f 86/90/4 85/89/4 83/87/4 84/88/4
f 88/93/15 87/92/15 85/91/15 86/94/15
f 90/96/14 89/95/14 87/92/14 88/93/14
f 92/98/13 91/97/13 89/95/13 90/96/13
f 94/68/6 93/65/6 91/97/6 92/98/6
f 96/67/12 95/66/12 93/65/12 94/68/12
f 98/70/11 97/69/11 95/66/11 96/67/11
f 100/72/10 99/71/10 97/69/10 98/70/10
f 102/74/2 101/73/2 99/71/2 100/72/2
f 104/76/9 103/75/9 101/73/9 102/74/9
f 106/78/8 105/77/8 103/75/8 104/76/8
f 108/80/7 107/79/7 105/77/7 106/78/7
f 110/82/5 109/81/5 107/79/5 108/80/5
f 60/137/9 75/138/9 111/139/9 61/140/9
f 58/141/7 77/142/7 76/143/7 59/144/7
f 71/145/18 121/146/18 122/147/18 72/148/18
f 57/149/5 78/150/5 77/142/5 58/141/5
f 59/144/8 76/143/8 75/138/8 60/137/8
f 72/148/17 122/147/17 78/150/17 57/149/17
f 70/151/16 120/152/16 121/146/16 71/145/16
f 69/153/4 119/154/4 120/152/4 70/151/4
f 68/155/15 118/156/15 119/154/15 69/153/15
f 67/157/14 117/158/14 118/156/14 68/155/14
f 66/136/13 116/135/13 117/158/13 67/157/13
f 64/159/12 114/160/12 115/134/12 65/133/12
f 63/161/11 113/162/11 114/160/11 64/159/11
f 62/163/10 112/164/10 113/162/10 63/161/10
f 61/140/2 111/139/2 112/165/2 62/166/2

View File

@ -1,131 +1,130 @@
# Blender v2.69 (sub 0) OBJ File: 'pipe-valve-on.blend'
# Blender v2.72 (sub 0) OBJ File: 'pipe-valve-on.blend'
# www.blender.org
mtllib pipeworks_valve_on.mtl
o Cube.003
v 0.312500 0.281250 0.062500
v -0.093750 0.281250 0.062500
v -0.093750 0.281250 -0.062500
v 0.312500 0.281250 -0.062500
v 0.312500 0.343750 0.062500
v -0.093750 0.343750 0.062500
v -0.093750 0.343750 -0.062500
v 0.312500 0.343750 -0.062500
v 0.062500 0.281250 -0.312500
v 0.062500 0.281250 0.093750
v -0.062500 0.281250 0.093750
v -0.062500 0.281250 -0.312500
v 0.062500 0.343750 -0.312500
v 0.062500 0.343750 0.093750
v -0.062500 0.343750 0.093750
v -0.062500 0.343750 -0.312500
v -0.031250 0.250000 -0.031250
v 0.031250 0.250000 -0.031250
v 0.031250 0.250000 0.031250
v -0.031250 0.250000 0.031250
v -0.031250 0.250000 -0.031250
v -0.031250 0.281250 -0.031250
v 0.031250 0.281250 -0.031250
v 0.031250 0.281250 0.031250
v -0.031250 0.281250 0.031250
v -0.031250 0.281250 -0.031250
v -0.250000 -0.250000 -0.250000
v 0.250000 -0.250000 -0.250000
v 0.250000 -0.250000 0.250000
v -0.250000 -0.250000 0.250000
v -0.250000 -0.250000 -0.250000
v -0.250000 0.250000 -0.250000
v 0.250000 0.250000 -0.250000
v 0.250000 0.250000 0.250000
v -0.250000 0.250000 0.250000
v -0.250000 0.250000 -0.250000
v -0.468750 -0.153248 -0.030483
v -0.500000 -0.153248 -0.030483
v -0.468750 -0.153248 0.030483
v -0.500000 -0.153248 0.030483
v -0.468750 -0.129917 0.086808
v -0.500000 -0.129917 0.086808
v -0.468750 -0.086808 0.129917
v -0.500000 -0.086808 0.129917
v -0.468750 -0.030483 0.153248
v -0.500000 -0.030483 0.153248
v -0.468750 0.030483 0.153248
v -0.500000 0.030483 0.153248
v -0.468750 0.086808 0.129917
v -0.500000 0.086808 0.129917
v -0.468750 0.129917 0.086808
v -0.500000 0.129917 0.086808
v -0.468750 0.153248 0.030483
v -0.500000 0.153247 0.030483
v -0.468750 0.153248 -0.030483
v -0.500000 0.153248 -0.030483
v -0.468750 0.129917 -0.086808
v -0.500000 0.129917 -0.086808
v -0.468750 0.086808 -0.129917
v -0.500000 0.086808 -0.129917
v -0.468750 0.030483 -0.153248
v -0.500000 0.030483 -0.153248
v -0.468750 -0.030483 -0.153248
v -0.500000 -0.030483 -0.153248
v -0.468750 -0.086808 -0.129917
v -0.500000 -0.086808 -0.129917
v -0.468750 -0.129917 -0.086808
v -0.500000 -0.129917 -0.086808
v -0.468750 -0.122598 -0.024386
v -0.468750 -0.122598 0.024386
v -0.468750 -0.103934 0.069446
v -0.468750 -0.069446 0.103934
v -0.468750 -0.024386 0.122598
v -0.468750 0.024386 0.122598
v -0.468750 0.069446 0.103934
v -0.468750 0.103934 0.069446
v -0.468750 0.122598 0.024386
v -0.468750 0.122598 -0.024386
v -0.468750 0.103934 -0.069446
v -0.468750 0.069446 -0.103934
v -0.468750 0.024386 -0.122598
v -0.468750 -0.024387 -0.122598
v -0.468750 -0.069447 -0.103934
v -0.468750 -0.103934 -0.069446
v -0.468750 -0.000000 -0.000000
v -0.500000 -0.000000 -0.000000
v 0.468750 -0.069446 0.103934
v 0.468750 -0.103933 0.069447
v 0.468750 -0.122598 0.024387
v 0.468750 -0.122598 -0.024386
v 0.500000 -0.129917 -0.086807
v 0.468750 -0.129917 -0.086807
v 0.500000 -0.086808 -0.129917
v 0.468750 -0.086808 -0.129917
v 0.500000 -0.030483 -0.153247
v 0.468750 -0.030483 -0.153247
v 0.500000 0.030483 -0.153247
v 0.468750 0.030483 -0.153247
v 0.500000 0.086808 -0.129917
v 0.468750 0.086808 -0.129917
v 0.500000 0.129917 -0.086808
v 0.468750 0.129917 -0.086808
v 0.500000 0.153248 -0.030483
v 0.468750 0.153248 -0.030483
v 0.500000 0.153248 0.030483
v 0.468750 0.153248 0.030483
v 0.500000 0.129917 0.086808
v 0.468750 0.129917 0.086808
v 0.500000 0.086808 0.129917
v 0.468750 0.086808 0.129917
v 0.500000 0.030483 0.153248
v 0.468750 0.030483 0.153248
v 0.500000 -0.030483 0.153248
v 0.468750 -0.030483 0.153248
v 0.500000 -0.086807 0.129917
v 0.468750 -0.086808 0.129917
v 0.500000 -0.129917 0.086808
v 0.468750 -0.129917 0.086808
v 0.500000 -0.153247 0.030483
v 0.468750 -0.153247 0.030483
v 0.500000 -0.153247 -0.030483
v 0.468750 -0.153247 -0.030483
v 0.468750 -0.024386 0.122598
v 0.468750 0.024387 0.122598
v 0.468750 0.069447 0.103934
v 0.468750 0.103934 0.069447
v 0.468750 0.122598 0.024387
v 0.468750 0.122598 -0.024386
v 0.468750 0.103934 -0.069446
v 0.468750 0.069447 -0.103933
v 0.468750 0.024387 -0.122598
v 0.468750 -0.024386 -0.122598
v 0.468750 -0.069446 -0.103933
v 0.468750 -0.103933 -0.069446
v 0.468750 0.000000 0.000000
v 0.500000 0.000000 0.000000
v -0.030483 -0.153248 0.468750
v -0.030483 -0.153248 0.500000
v 0.030483 -0.153248 0.468750
v 0.030483 -0.153248 0.500000
v 0.086808 -0.129917 0.468750
v 0.086808 -0.129917 0.500000
v 0.129917 -0.086808 0.468750
v 0.129917 -0.086808 0.500000
v 0.153248 -0.030483 0.468750
v 0.153248 -0.030483 0.500000
v 0.153248 0.030483 0.468750
v 0.153248 0.030483 0.500000
v 0.129917 0.086808 0.468750
v 0.129917 0.086808 0.500000
v 0.086808 0.129917 0.468750
v 0.086808 0.129917 0.500000
v 0.030483 0.153248 0.468750
v 0.030483 0.153247 0.500000
v -0.030483 0.153248 0.468750
v -0.030483 0.153248 0.500000
v -0.086808 0.129917 0.468750
v -0.086808 0.129917 0.500000
v -0.129917 0.086808 0.468750
v -0.129917 0.086808 0.500000
v -0.153248 0.030483 0.468750
v -0.153248 0.030483 0.500000
v -0.153248 -0.030483 0.468750
v -0.153248 -0.030483 0.500000
v -0.129917 -0.086808 0.468750
v -0.129917 -0.086808 0.500000
v -0.086808 -0.129917 0.468750
v -0.086808 -0.129917 0.500000
v -0.024386 -0.122598 0.468750
v 0.024386 -0.122598 0.468750
v 0.069446 -0.103934 0.468750
v 0.103934 -0.069446 0.468750
v 0.122598 -0.024386 0.468750
v 0.122598 0.024386 0.468750
v 0.103934 0.069446 0.468750
v 0.069446 0.103934 0.468750
v 0.024386 0.122598 0.468750
v -0.024386 0.122598 0.468750
v -0.069446 0.103934 0.468750
v -0.103934 0.069446 0.468750
v -0.122598 0.024386 0.468750
v -0.122598 -0.024387 0.468750
v -0.103934 -0.069447 0.468750
v -0.069446 -0.103934 0.468750
v -0.000000 -0.000000 0.468750
v -0.000000 -0.000000 0.500000
v 0.103934 -0.069446 -0.468750
v 0.069447 -0.103933 -0.468750
v 0.024387 -0.122598 -0.468750
v -0.024386 -0.122598 -0.468750
v -0.086808 -0.129917 -0.500000
v -0.086808 -0.129917 -0.468750
v -0.129917 -0.086808 -0.500000
v -0.129917 -0.086808 -0.468750
v -0.153247 -0.030483 -0.500000
v -0.153247 -0.030483 -0.468750
v -0.153247 0.030483 -0.500000
v -0.153247 0.030483 -0.468750
v -0.129917 0.086808 -0.500000
v -0.129917 0.086808 -0.468750
v -0.086808 0.129917 -0.500000
v -0.086808 0.129917 -0.468750
v -0.030483 0.153248 -0.500000
v -0.030483 0.153248 -0.468750
v 0.030483 0.153248 -0.500000
v 0.030483 0.153248 -0.468750
v 0.086808 0.129917 -0.500000
v 0.086808 0.129917 -0.468750
v 0.129917 0.086808 -0.500000
v 0.129917 0.086808 -0.468750
v 0.153248 0.030483 -0.500000
v 0.153248 0.030483 -0.468750
v 0.153248 -0.030483 -0.500000
v 0.153248 -0.030483 -0.468750
v 0.129917 -0.086807 -0.500000
v 0.129917 -0.086808 -0.468750
v 0.086808 -0.129917 -0.500000
v 0.086808 -0.129917 -0.468750
v 0.030483 -0.153247 -0.500000
v 0.030483 -0.153247 -0.468750
v -0.030483 -0.153247 -0.500000
v -0.030483 -0.153247 -0.468750
v 0.122598 -0.024386 -0.468750
v 0.122598 0.024387 -0.468750
v 0.103934 0.069447 -0.468750
v 0.069447 0.103934 -0.468750
v 0.024387 0.122598 -0.468750
v -0.024386 0.122598 -0.468750
v -0.069446 0.103934 -0.468750
v -0.103933 0.069447 -0.468750
v -0.122598 0.024387 -0.468750
v -0.122598 -0.024386 -0.468750
v -0.103933 -0.069446 -0.468750
v -0.069446 -0.103933 -0.468750
v 0.000000 0.000000 -0.468750
v 0.000000 0.000000 -0.500000
vt 0.265625 0.234375
vt 0.468750 0.234375
vt 0.468750 0.265625
@ -262,40 +261,6 @@ vt 0.585938 0.257812
vt 0.585938 0.007812
vt 0.617188 0.007812
vt 0.617188 0.257812
vt 0.538433 0.340928
vt 0.568449 0.328495
vt 0.584693 0.410160
vt 0.515460 0.363901
vt 0.503028 0.393916
vt 0.503028 0.426405
vt 0.515460 0.456420
vt 0.538433 0.479393
vt 0.568449 0.491826
vt 0.600937 0.491826
vt 0.630952 0.479393
vt 0.653925 0.456420
vt 0.666358 0.426405
vt 0.666358 0.393916
vt 0.653925 0.363901
vt 0.630952 0.340928
vt 0.600937 0.328495
vt 0.727611 0.340928
vt 0.757626 0.328495
vt 0.773870 0.410160
vt 0.704638 0.363901
vt 0.692205 0.393916
vt 0.692205 0.426405
vt 0.704638 0.456420
vt 0.727611 0.479393
vt 0.757626 0.491826
vt 0.790115 0.491826
vt 0.820130 0.479393
vt 0.843103 0.456420
vt 0.855535 0.426405
vt 0.855535 0.393916
vt 0.843103 0.363901
vt 0.820130 0.340928
vt 0.790115 0.328495
vt 0.929688 0.257812
vt 0.929688 0.007812
vt 0.960938 0.007812
@ -326,133 +291,151 @@ vt 0.492188 0.257812
vt 0.492188 0.007812
vt 0.992188 0.007812
vt 0.992188 0.257812
usemtl None
vn 1.000000 0.000000 0.000000
vn -0.000000 0.000000 1.000000
vn -1.000000 0.000000 -0.000000
vn 0.000000 0.000000 -1.000000
vn 0.000000 -1.000000 -0.000000
vn 0.000000 1.000000 -0.000000
vn 0.382700 -0.923900 -0.000000
vn 0.707100 -0.707100 -0.000000
vn 0.923900 -0.382700 0.000000
vn 0.923900 0.382700 0.000000
vn 0.707100 0.707100 0.000000
vn 0.382700 0.923900 0.000000
vn -0.382700 0.923900 0.000000
vn -0.707100 0.707100 0.000000
vn -0.923900 0.382700 -0.000000
vn -0.923900 -0.382700 -0.000000
vn -0.382700 -0.923900 -0.000000
vn -0.707100 -0.707100 -0.000000
g Cube.003_Cube.003_None
s off
f 5/1 6/2 2/3 1/4
f 6/5 7/6 3/7 2/8
f 7/9 8/10 4/11 3/12
f 8/13 5/14 1/15 4/16
f 1/17 2/18 3/19 4/20
f 8/21 7/22 6/23 5/24
f 13/25 14/26 10/27 9/28
f 14/29 15/30 11/31 10/32
f 15/33 16/34 12/35 11/36
f 16/37 13/38 9/39 12/40
f 21/41 22/42 18/43 17/44
f 22/45 23/46 19/47 18/48
f 23/49 24/50 20/51 19/52
f 24/53 21/54 17/55 20/56
f 17/57 18/58 19/59 20/60
f 24/61 23/62 22/63 21/64
f 25/65 27/66 28/67 26/68
f 27/66 29/69 30/70 28/67
f 29/69 31/71 32/72 30/70
f 31/71 33/73 34/74 32/72
f 33/73 35/75 36/76 34/74
f 35/75 37/77 38/78 36/76
f 37/77 39/79 40/80 38/78
f 39/79 41/81 42/82 40/80
f 41/81 43/83 44/84 42/82
f 43/83 45/85 46/86 44/84
f 45/85 47/87 48/88 46/86
f 47/87 49/89 50/90 48/88
f 49/91 51/92 52/93 50/94
f 51/92 53/95 54/96 52/93
f 55/97 25/65 26/68 56/98
f 53/95 55/97 56/98 54/96
f 28/99 74/100 26/101
f 25/102 73/103 27/104
f 27/104 73/103 29/105
f 29/105 73/103 31/106
f 31/106 73/103 33/107
f 33/107 73/103 35/108
f 35/108 73/103 37/109
f 37/109 73/103 39/110
f 39/110 73/103 41/111
f 41/111 73/103 43/112
f 43/112 73/103 45/113
f 45/113 73/103 47/114
f 47/114 73/103 49/115
f 49/115 73/103 51/116
f 51/116 73/103 53/117
f 53/117 73/103 55/118
f 55/118 73/103 25/102
f 26/101 74/100 56/119
f 56/119 74/100 54/120
f 54/120 74/100 52/121
f 52/121 74/100 50/122
f 50/122 74/100 48/123
f 48/123 74/100 46/124
f 46/124 74/100 44/125
f 44/125 74/100 42/126
f 42/126 74/100 40/127
f 40/127 74/100 38/128
f 38/128 74/100 36/129
f 36/129 74/100 34/130
f 34/130 74/100 32/131
f 32/131 74/100 30/132
f 30/132 74/100 28/99
f 65/133 115/134 116/135 66/136
f 105/137 107/138 124/139
f 103/140 105/137 124/139
f 101/141 103/140 124/139
f 99/142 101/141 124/139
f 97/143 99/142 124/139
f 95/144 97/143 124/139
f 93/145 95/144 124/139
f 91/146 93/145 124/139
f 89/147 91/146 124/139
f 87/148 89/147 124/139
f 85/149 87/148 124/139
f 83/150 85/149 124/139
f 81/151 83/150 124/139
f 79/152 81/151 124/139
f 109/153 79/152 124/139
f 80/154 110/155 123/156
f 82/157 80/154 123/156
f 84/158 82/157 123/156
f 86/159 84/158 123/156
f 88/160 86/159 123/156
f 90/161 88/160 123/156
f 92/162 90/161 123/156
f 94/163 92/162 123/156
f 96/164 94/163 123/156
f 98/165 96/164 123/156
f 100/166 98/165 123/156
f 102/167 100/166 123/156
f 104/168 102/167 123/156
f 106/169 104/168 123/156
f 108/170 106/169 123/156
f 110/155 108/170 123/156
f 107/138 109/153 124/139
f 82/86 81/85 79/83 80/84
f 80/84 79/83 109/81 110/82
f 84/88 83/87 81/85 82/86
f 86/90 85/89 83/87 84/88
f 88/93 87/92 85/91 86/94
f 90/96 89/95 87/92 88/93
f 92/98 91/97 89/95 90/96
f 94/68 93/65 91/97 92/98
f 96/67 95/66 93/65 94/68
f 98/70 97/69 95/66 96/67
f 100/72 99/71 97/69 98/70
f 102/74 101/73 99/71 100/72
f 104/76 103/75 101/73 102/74
f 106/78 105/77 103/75 104/76
f 108/80 107/79 105/77 106/78
f 110/82 109/81 107/79 108/80
f 60/171 75/172 111/173 61/174
f 58/175 77/176 76/177 59/178
f 71/179 121/180 122/181 72/182
f 57/183 78/184 77/176 58/175
f 59/178 76/177 75/172 60/171
f 72/182 122/181 78/184 57/183
f 70/185 120/186 121/180 71/179
f 69/187 119/188 120/186 70/185
f 68/189 118/190 119/188 69/187
f 67/191 117/192 118/190 68/189
f 66/136 116/135 117/192 67/191
f 64/193 114/194 115/134 65/133
f 63/195 113/196 114/194 64/193
f 62/197 112/198 113/196 63/195
f 61/174 111/173 112/199 62/200
f 5/1/1 6/2/1 2/3/1 1/4/1
f 6/5/2 7/6/2 3/7/2 2/8/2
f 7/9/3 8/10/3 4/11/3 3/12/3
f 8/13/4 5/14/4 1/15/4 4/16/4
f 1/17/5 2/18/5 3/19/5 4/20/5
f 8/21/6 7/22/6 6/23/6 5/24/6
f 13/25/4 14/26/4 10/27/4 9/28/4
f 14/29/1 15/30/1 11/31/1 10/32/1
f 15/33/2 16/34/2 12/35/2 11/36/2
f 16/37/3 13/38/3 9/39/3 12/40/3
f 21/41/4 22/42/4 18/43/4 17/44/4
f 22/45/1 23/46/1 19/47/1 18/48/1
f 23/49/2 24/50/2 20/51/2 19/52/2
f 24/53/3 21/54/3 17/55/3 20/56/3
f 17/57/5 18/58/5 19/59/5 20/60/5
f 24/61/6 23/62/6 22/63/6 21/64/6
f 25/65/5 27/66/5 28/67/5 26/68/5
f 27/66/7 29/69/7 30/70/7 28/67/7
f 29/69/8 31/71/8 32/72/8 30/70/8
f 31/71/9 33/73/9 34/74/9 32/72/9
f 33/73/1 35/75/1 36/76/1 34/74/1
f 35/75/10 37/77/10 38/78/10 36/76/10
f 37/77/11 39/79/11 40/80/11 38/78/11
f 39/79/12 41/81/12 42/82/12 40/80/12
f 41/81/6 43/83/6 44/84/6 42/82/6
f 43/83/13 45/85/13 46/86/13 44/84/13
f 45/85/14 47/87/14 48/88/14 46/86/14
f 47/87/15 49/89/15 50/90/15 48/88/15
f 49/91/3 51/92/3 52/93/3 50/94/3
f 51/92/16 53/95/16 54/96/16 52/93/16
f 55/97/17 25/65/17 26/68/17 56/98/17
f 53/95/18 55/97/18 56/98/18 54/96/18
f 28/99/2 74/100/2 26/101/2
f 25/102/4 73/103/4 27/104/4
f 27/104/4 73/103/4 29/105/4
f 29/105/4 73/103/4 31/106/4
f 31/106/4 73/103/4 33/107/4
f 33/107/4 73/103/4 35/108/4
f 35/108/4 73/103/4 37/109/4
f 37/109/4 73/103/4 39/110/4
f 39/110/4 73/103/4 41/111/4
f 41/111/4 73/103/4 43/112/4
f 43/112/4 73/103/4 45/113/4
f 45/113/4 73/103/4 47/114/4
f 47/114/4 73/103/4 49/115/4
f 49/115/4 73/103/4 51/116/4
f 51/116/4 73/103/4 53/117/4
f 53/117/4 73/103/4 55/118/4
f 55/118/4 73/103/4 25/102/4
f 26/101/2 74/100/2 56/119/2
f 56/119/2 74/100/2 54/120/2
f 54/120/2 74/100/2 52/121/2
f 52/121/2 74/100/2 50/122/2
f 50/122/2 74/100/2 48/123/2
f 48/123/2 74/100/2 46/124/2
f 46/124/2 74/100/2 44/125/2
f 44/125/2 74/100/2 42/126/2
f 42/126/2 74/100/2 40/127/2
f 40/127/2 74/100/2 38/128/2
f 38/128/2 74/100/2 36/129/2
f 36/129/2 74/100/2 34/130/2
f 34/130/2 74/100/2 32/131/2
f 32/131/2 74/100/2 30/132/2
f 30/132/2 74/100/2 28/99/2
f 65/133/6 115/134/6 116/135/6 66/136/6
f 105/119/4 107/101/4 124/100/4
f 103/120/4 105/119/4 124/100/4
f 101/121/4 103/120/4 124/100/4
f 99/122/4 101/121/4 124/100/4
f 97/123/4 99/122/4 124/100/4
f 95/124/4 97/123/4 124/100/4
f 93/125/4 95/124/4 124/100/4
f 91/126/4 93/125/4 124/100/4
f 89/127/4 91/126/4 124/100/4
f 87/128/4 89/127/4 124/100/4
f 85/129/4 87/128/4 124/100/4
f 83/130/4 85/129/4 124/100/4
f 81/131/4 83/130/4 124/100/4
f 79/132/4 81/131/4 124/100/4
f 109/99/4 79/132/4 124/100/4
f 80/118/2 110/102/2 123/103/2
f 82/117/2 80/118/2 123/103/2
f 84/116/2 82/117/2 123/103/2
f 86/115/2 84/116/2 123/103/2
f 88/114/2 86/115/2 123/103/2
f 90/113/2 88/114/2 123/103/2
f 92/112/2 90/113/2 123/103/2
f 94/111/2 92/112/2 123/103/2
f 96/110/2 94/111/2 123/103/2
f 98/109/2 96/110/2 123/103/2
f 100/108/2 98/109/2 123/103/2
f 102/107/2 100/108/2 123/103/2
f 104/106/2 102/107/2 123/103/2
f 106/105/2 104/106/2 123/103/2
f 108/104/2 106/105/2 123/103/2
f 110/102/2 108/104/2 123/103/2
f 107/101/4 109/99/4 124/100/4
f 82/86/18 81/85/18 79/83/18 80/84/18
f 80/84/17 79/83/17 109/81/17 110/82/17
f 84/88/16 83/87/16 81/85/16 82/86/16
f 86/90/3 85/89/3 83/87/3 84/88/3
f 88/93/15 87/92/15 85/91/15 86/94/15
f 90/96/14 89/95/14 87/92/14 88/93/14
f 92/98/13 91/97/13 89/95/13 90/96/13
f 94/68/6 93/65/6 91/97/6 92/98/6
f 96/67/12 95/66/12 93/65/12 94/68/12
f 98/70/11 97/69/11 95/66/11 96/67/11
f 100/72/10 99/71/10 97/69/10 98/70/10
f 102/74/1 101/73/1 99/71/1 100/72/1
f 104/76/9 103/75/9 101/73/9 102/74/9
f 106/78/8 105/77/8 103/75/8 104/76/8
f 108/80/7 107/79/7 105/77/7 106/78/7
f 110/82/5 109/81/5 107/79/5 108/80/5
f 60/137/9 75/138/9 111/139/9 61/140/9
f 58/141/7 77/142/7 76/143/7 59/144/7
f 71/145/18 121/146/18 122/147/18 72/148/18
f 57/149/5 78/150/5 77/142/5 58/141/5
f 59/144/8 76/143/8 75/138/8 60/137/8
f 72/148/17 122/147/17 78/150/17 57/149/17
f 70/151/16 120/152/16 121/146/16 71/145/16
f 69/153/3 119/154/3 120/152/3 70/151/3
f 68/155/15 118/156/15 119/154/15 69/153/15
f 67/157/14 117/158/14 118/156/14 68/155/14
f 66/136/13 116/135/13 117/158/13 67/157/13
f 64/159/12 114/160/12 115/134/12 65/133/12
f 63/161/11 113/162/11 114/160/11 64/159/11
f 62/163/10 112/164/10 113/162/10 63/161/10
f 61/140/1 111/139/1 112/165/1 62/166/1

View File

@ -80,7 +80,8 @@ for index, connects in ipairs(cconnects) do
end,
after_dig_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end
end,
on_rotate = false
})
local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1}
@ -106,11 +107,13 @@ for index, connects in ipairs(cconnects) do
walkable = true,
drop = "pipeworks:pipe_1_empty",
after_place_node = function(pos)
minetest.set_node(pos, { name = "pipeworks:pipe_"..index.."_empty" })
pipeworks.scan_for_pipe_objects(pos)
end,
after_dig_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end
end,
on_rotate = false
})
table.insert(pipes_empty_nodenames, "pipeworks:pipe_"..index.."_empty")
@ -134,6 +137,8 @@ if REGISTER_COMPATIBILITY then
after_place_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
on_rotate = false
})
minetest.register_node(cloaded, {
drawtype = "airlike",
@ -145,6 +150,8 @@ if REGISTER_COMPATIBILITY then
after_place_node = function(pos)
pipeworks.scan_for_pipe_objects(pos)
end,
on_rotate = false
})
for xm = 0, 1 do
for xp = 0, 1 do

View File

@ -1,3 +1,4 @@
-- the default tube and default textures
pipeworks.register_tube("pipeworks:tube", "Pneumatic tube segment")
minetest.register_craft( {
@ -9,6 +10,59 @@ minetest.register_craft( {
},
})
local nodecolor = 0xffff3030
pipeworks.register_tube("pipeworks:broken_tube", {
description = "Broken Tube (you hacker you)",
plain = { { name = "pipeworks_broken_tube_plain.png", backface_culling = false, color = nodecolor } },
noctr = { { name = "pipeworks_broken_tube_plain.png", backface_culling = false, color = nodecolor } },
ends = { { name = "pipeworks_broken_tube_end.png", color = nodecolor } },
short = { name = "pipeworks_broken_tube_short.png", color = nodecolor },
node_def = {
drop = "pipeworks:tube_1",
groups = {not_in_creative_inventory = 1, tubedevice_receiver = 1},
tube = {
insert_object = function(pos, node, stack, direction)
minetest.item_drop(stack, nil, pos)
return ItemStack("")
end,
can_insert = function(pos,node,stack,direction)
return true
end,
priority = 50,
},
on_punch = function(pos, node, puncher, pointed_thing)
local itemstack = puncher:get_wielded_item()
local wieldname = itemstack:get_name()
local playername = puncher:get_player_name()
print("[Pipeworks] "..playername.." struck a broken tube at "..minetest.pos_to_string(pos))
if wieldname == "anvil:hammer"
or wieldname == "cottages:hammer"
or wieldname == "glooptest:hammer_steel"
or wieldname == "glooptest:hammer_bronze"
or wieldname == "glooptest:hammer_diamond"
or wieldname == "glooptest:hammer_mese"
or wieldname == "glooptest:hammer_alatro"
or wieldname == "glooptest:hammer_arol" then
local meta = minetest.get_meta(pos)
local was_node = minetest.deserialize(meta:get_string("the_tube_was"))
if was_node and was_node ~= "" then
print(" with "..wieldname.." to repair it.")
minetest.swap_node(pos, { name = was_node.name, param2 = was_node.param2 })
pipeworks.scan_for_tube_objects(pos)
itemstack:add_wear(1000)
puncher:set_wielded_item(itemstack)
return itemstack
else
print(" but it can't be repaired.")
end
else
print(" with "..wieldname.." but that tool is too weak.")
end
end
}
})
-- the high priority tube is a low-cpu replacement for sorting tubes in situations
-- where players would use them for simple routing (turning off paths)
-- without doing actual sorting, like at outputs of tubedevices that might both accept and eject items
@ -17,10 +71,10 @@ if pipeworks.enable_priority_tube then
pipeworks.register_tube("pipeworks:priority_tube", {
description = "High Priority Tube Segment",
inventory_image = "pipeworks_tube_inv.png^[colorize:" .. color,
plain = { "pipeworks_tube_plain.png^[colorize:" .. color },
noctr = { "pipeworks_tube_noctr.png^[colorize:" .. color },
ends = { "pipeworks_tube_end.png^[colorize:" .. color },
short = "pipeworks_tube_short.png^[colorize:" .. color,
plain = { { name = "pipeworks_tube_plain.png", color = nodecolor } },
noctr = { { name = "pipeworks_tube_noctr.png", color = nodecolor } },
ends = { { name = "pipeworks_tube_end.png", color = nodecolor } },
short = { name = "pipeworks_tube_short.png", color = nodecolor },
node_def = {
tube = { priority = 150 } -- higher than tubedevices (100)
},
@ -100,7 +154,7 @@ if pipeworks.enable_one_way_tube then
return {velocity}
end,
can_insert = function(pos, node, stack, direction)
local dir = minetest.facedir_to_right_dir(node.param2)
local dir = pipeworks.facedir_to_right_dir(node.param2)
return vector.equals(dir, direction)
end,
priority = 75 -- Higher than normal tubes, but lower than receivers

70
settingtypes.txt Normal file
View File

@ -0,0 +1,70 @@
#Enable pipes.
pipeworks_enable_pipes (Enable Pipes) bool true
#Enable autocrafter.
pipeworks_enable_autocrafter (Enable Autocrafter) bool true
#Enable deployer.
pipeworks_enable_deployer (Enable Deployer) bool true
#Enable dispenser.
pipeworks_enable_dispenser (Enable Dispenser) bool true
#Enable node breaker.
pipeworks_enable_node_breaker (Enable Node Breaker) bool true
#Enable teleport tube.
pipeworks_enable_teleport_tube (Enable Teleport Tube) bool true
#Enable pipe devices.
pipeworks_enable_pipe_devices (Enable Pipe Devices) bool true
#Enable redefines.
pipeworks_enable_redefines (Enable Node Redefines) bool true
#Enable sorting tube.
pipeworks_enable_mese_tube (Enable Sorting Tube) bool true
#Enable detector tube.
pipeworks_enable_detector_tube (Enable Detector Tube) bool true
#Enable digiline detector tube.
pipeworks_enable_digiline_detector_tube (Enable Digiline Detector Tube) bool true
#Enable mesecon signal conducting tube.
pipeworks_enable_conductor_tube (Enable Conductor Tube) bool true
#Enable accelerator tube.
pipeworks_enable_accelerator_tube (Enable Accelerator Tube) bool true
#Enable crossing tube.
#It sends all incoming items to the other side, or if there is no other tube, it sends them back.
pipeworks_enable_crossing_tube (Enable Crossing Tube) bool true
#Enable vacuum tube.
#It picks up all items that lay around next to it.
pipeworks_enable_sand_tube (Enable Vacuum Tube) bool true
#Enable mese vacuum tube.
#It's like the normal vacuum tube with the
#differance that you can set the radius up to 8 nodes.
pipeworks_enable_mese_sand_tube (Enable Mese Vacuum Tube) bool true
#Enable one way tube.
#It sends items only in one direction.
#Use it to drop items out of tubes.
pipeworks_enable_one_way_tube (Enable One Way Tube) bool true
#Enable high priority tube.
#It has a very high priority and so, on crossings, the items will
#always go to it if there are multible ways.
pipeworks_enable_priority_tube (Enable High Priority Tube) bool true
#Enable cyclic mode.
pipeworks_enable_cyclic_mode (Enable Cyclic Mode) bool true
#Drop on routing fail.
pipeworks_drop_on_routing_fail (Drop On Routing Fail) bool false
#Delete item on clearobject.
pipeworks_delete_item_on_clearobject (Delete Item On Clearobject) bool true

View File

@ -1,5 +1,5 @@
if pipeworks.enable_detector_tube then
local detector_tube_step = 2 * tonumber(minetest.setting_get("dedicated_server_step"))
local detector_tube_step = 5 * tonumber(minetest.settings:get("dedicated_server_step"))
pipeworks.register_tube("pipeworks:detector_tube_on", {
description = "Detecting Pneumatic Tube Segment on (you hacker you)",
inventory_image = "pipeworks_detector_tube_inv.png",

View File

@ -1,3 +1,5 @@
local fs_helpers = pipeworks.fs_helpers
if pipeworks.enable_mese_tube then
local function update_formspec(pos)
local meta = minetest.get_meta(pos)
@ -13,8 +15,12 @@ if pipeworks.enable_mese_tube then
local buttons_formspec = ""
for i = 0, 5 do
buttons_formspec = buttons_formspec .. fs_helpers.cycling_button(meta,
"image_button[7,"..(i)..";1,1", "l"..(i+1).."s",
{{text="",texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"}, {text="",texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}})
"image_button[7,"..(i+0.2)..";1,0.6", "l"..(i+1).."s",
{
pipeworks.button_off,
pipeworks.button_on
}
)
end
meta:set_string("formspec",
"size[8,11]"..
@ -31,7 +37,21 @@ if pipeworks.enable_mese_tube then
"image[0,4;1,1;pipeworks_blue.png]"..
"image[0,5;1,1;pipeworks_red.png]"..
buttons_formspec..
"list[current_player;main;0,7;8,4;]")
"list[current_player;main;0,7;8,4;]" ..
"listring[current_player;main]" ..
"listring[current_player;main]" ..
"listring[context;line1]" ..
"listring[current_player;main]" ..
"listring[context;line2]" ..
"listring[current_player;main]" ..
"listring[context;line3]" ..
"listring[current_player;main]" ..
"listring[context;line4]" ..
"listring[current_player;main]" ..
"listring[context;line5]" ..
"listring[current_player;main]" ..
"listring[context;line6]"
)
end
pipeworks.register_tube("pipeworks:mese_tube", {
@ -119,8 +139,13 @@ if pipeworks.enable_mese_tube then
if not pipeworks.may_configure(pos, player) then return 0 end
update_formspec(pos) -- For old tubes
local inv = minetest.get_meta(pos):get_inventory()
inv:set_stack(from_list, from_index, ItemStack(""))
return 0
if from_list:match("line%d") and to_list:match("line%d") then
return count
else
inv:set_stack(from_list, from_index, ItemStack(""))
return 0
end
end,
},
})

View File

@ -111,7 +111,7 @@ local function update_meta(meta, can_receive)
meta:set_string("formspec","size[8.6,2.2]"..
"field[0.6,0.6;7,1;channel;Channel:;${channel}]"..
"label[7.3,0;Receive]"..
"image_button[7.3,0.3;1,1;pipeworks_button_" .. cr_state .. ".png;cr" .. (can_receive and 0 or 1) .. ";;;false;pipeworks_button_interm.png]"..
"image_button[7.3,0.3;1,0.6;pipeworks_button_" .. cr_state .. ".png;cr" .. (can_receive and 0 or 1) .. ";;;false;pipeworks_button_interm.png]"..
"image[0.3,1.3;1,1;pipeworks_teleport_tube_inv.png]"..
"label[1.6,1.2;channels are public by default]" ..
"label[1.6,1.5;use <player>:<channel> for fully private channels]" ..

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 475 B

View File

@ -28,7 +28,8 @@ minetest.register_node("pipeworks:trashcan", {
default.gui_bg_img..
default.gui_slots..
default.get_hotbar_bg(0,3) ..
"list[current_player;main;0,3;8,4;]")
"list[current_player;main;0,3;8,4;]" ..
"listring[]")
meta:set_string("infotext", "Trash Can")
meta:get_inventory():set_size("trash", 1)
end,

View File

@ -38,13 +38,13 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
local outboxes = {}
local outsel = {}
local outimgs = {}
for i = 1, 6 do
outimgs[vti[i]] = plain[i]
end
for _, v in ipairs(connects) do
table.extend(outboxes, pipeworks.tube_boxes[v])
pipeworks.table_extend(outboxes, pipeworks.tube_boxes[v])
table.insert(outsel, pipeworks.tube_selectboxes[v])
outimgs[vti[v]] = noctrs[v]
end
@ -73,10 +73,10 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
outsel = { -24/64, -10/64, -10/64, 24/64, 10/64, 10/64 }
wscale = {x = 1, y = 1, z = 0.01}
end
local rname = string.format("%s_%s", name, tname)
table.insert(tubenodes, rname)
local nodedef = {
description = tubedesc,
drawtype = "nodebox",
@ -107,12 +107,20 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
priority = 50
},
after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig
after_dig_node = pipeworks.after_dig,
on_blast = function(pos, intensity)
if not intensity or intensity > 1 + 3^0.5 then
minetest.remove_node(pos)
return {string.format("%s_%s", name, dropname)}
end
minetest.swap_node(pos, {name = "pipeworks:broken_tube_1"})
pipeworks.scan_for_tube_objects(pos)
end
}
if style == "6d" then
nodedef.paramtype2 = "facedir"
end
if special == nil then special = {} end
for key, value in pairs(special) do
@ -127,7 +135,7 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
nodedef.tube[key] = val
end
else
nodedef[key] = table.recursive_replace(value, "#id", tname)
nodedef[key] = pipeworks.table_recursive_replace(value, "#id", tname)
end
end

View File

@ -1,27 +1,27 @@
if pipeworks.enable_sand_tube then
pipeworks.register_tube("pipeworks:sand_tube", {
description = "Vacuuming Pneumatic Tube Segment",
inventory_image = "pipeworks_sand_tube_inv.png",
short = "pipeworks_sand_tube_short.png",
noctr = { "pipeworks_sand_tube_noctr.png" },
plain = { "pipeworks_sand_tube_plain.png" },
ends = { "pipeworks_sand_tube_end.png" },
node_def = { groups = {vacuum_tube = 1}},
description = "Vacuuming Pneumatic Tube Segment",
inventory_image = "pipeworks_sand_tube_inv.png",
short = "pipeworks_sand_tube_short.png",
noctr = {"pipeworks_sand_tube_noctr.png"},
plain = {"pipeworks_sand_tube_plain.png"},
ends = {"pipeworks_sand_tube_end.png"},
node_def = {groups = {vacuum_tube = 1}},
})
minetest.register_craft( {
output = "pipeworks:sand_tube_1 2",
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
{ "group:sand", "group:sand", "group:sand" },
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"},
{"group:sand", "group:sand", "group:sand"},
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"}
},
})
minetest.register_craft( {
output = "pipeworks:sand_tube_1",
recipe = {
{ "group:sand", "pipeworks:tube_1", "group:sand" },
{"group:sand", "pipeworks:tube_1", "group:sand"},
},
})
end
@ -31,9 +31,9 @@ if pipeworks.enable_mese_sand_tube then
description = "Adjustable Vacuuming Pneumatic Tube Segment",
inventory_image = "pipeworks_mese_sand_tube_inv.png",
short = "pipeworks_mese_sand_tube_short.png",
noctr = { "pipeworks_mese_sand_tube_noctr.png" },
plain = { "pipeworks_mese_sand_tube_plain.png" },
ends = { "pipeworks_mese_sand_tube_end.png" },
noctr = {"pipeworks_mese_sand_tube_noctr.png"},
plain = {"pipeworks_mese_sand_tube_plain.png"},
ends = {"pipeworks_mese_sand_tube_end.png"},
node_def = {
groups = {vacuum_tube = 1},
on_construct = function(pos)
@ -63,9 +63,9 @@ if pipeworks.enable_mese_sand_tube then
minetest.register_craft( {
output = "pipeworks:mese_sand_tube_1 2",
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
{ "group:sand", "default:mese_crystal", "group:sand" },
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" },
{"group:sand", "default:mese_crystal", "group:sand" },
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }
},
})
@ -82,23 +82,19 @@ if pipeworks.enable_mese_sand_tube then
})
end
local sqrt_3 = math.sqrt(3)
local tube_inject_item = pipeworks.tube_inject_item
local get_objects_inside_radius = minetest.get_objects_inside_radius
local function vacuum(pos, radius)
radius = radius + 0.5
for _, object in pairs(get_objects_inside_radius(pos, sqrt_3 * radius)) do
for _, object in pairs(minetest.get_objects_inside_radius(pos, math.sqrt(3) * radius)) do
local lua_entity = object:get_luaentity()
if not object:is_player() and lua_entity and lua_entity.name == "__builtin:item" then
local obj_pos = object:getpos()
local x1, y1, z1 = pos.x, pos.y, pos.z
local x2, y2, z2 = obj_pos.x, obj_pos.y, obj_pos.z
if x1 - radius <= x2 and x2 <= x1 + radius
and y1 - radius <= y2 and y2 <= y1 + radius
and z1 - radius <= z2 and z2 <= z1 + radius then
local minpos = vector.subtract(pos, radius)
local maxpos = vector.add(pos, radius)
if obj_pos.x >= minpos.x and obj_pos.x <= maxpos.x
and obj_pos.y >= minpos.y and obj_pos.y <= maxpos.y
and obj_pos.z >= minpos.z and obj_pos.z <= maxpos.z then
if lua_entity.itemstring ~= "" then
tube_inject_item(pos, pos, vector.new(0, 0, 0), lua_entity.itemstring)
pipeworks.tube_inject_item(pos, pos, vector.new(0, 0, 0), lua_entity.itemstring)
lua_entity.itemstring = ""
end
object:remove()
@ -108,15 +104,15 @@ local function vacuum(pos, radius)
end
minetest.register_abm({nodenames = {"group:vacuum_tube"},
interval = 1,
chance = 1,
label = "Vacuum tubes",
action = function(pos, node, active_object_count, active_object_count_wider)
if node.name:find("pipeworks:sand_tube") then
vacuum(pos, 2)
else
local radius = minetest.get_meta(pos):get_int("dist")
vacuum(pos, radius)
end
end
interval = 1,
chance = 1,
label = "Vacuum tubes",
action = function(pos, node, active_object_count, active_object_count_wider)
if node.name:find("pipeworks:sand_tube") then
vacuum(pos, 2)
else
local radius = minetest.get_meta(pos):get_int("dist")
vacuum(pos, radius)
end
end
})

View File

@ -14,7 +14,8 @@ local function set_wielder_formspec(data, meta)
"item_image[0,0;1,1;"..data.name_base.."_off]"..
"label[1,0;"..minetest.formspec_escape(data.description).."]"..
"list[current_name;"..minetest.formspec_escape(data.wield_inv_name)..";"..((8-data.wield_inv_width)*0.5)..",1;"..data.wield_inv_width..","..data.wield_inv_height..";]"..
"list[current_player;main;0,"..(2+data.wield_inv_height)..";8,4;]")
"list[current_player;main;0,"..(2+data.wield_inv_height)..";8,4;]" ..
"listring[]")
meta:set_string("infotext", data.description)
end