Commit Graph

54 Commits

Author SHA1 Message Date
Vanessa Ezekowitz
28cef5e82f update to use current mesecons API
requires mesecons commit 5be179bf110b44bdc06df6dbfde4e61487cf0635 or newer.
2014-11-22 13:55:54 -05:00
Novatux
b49428721a Make filters behave correctly with protected areas (fixes #74) 2014-11-16 13:14:17 +01:00
Vanessa Ezekowitz
bbc530a067 fix undefined node crash 2014-08-24 11:51:43 -04:00
Zefram
7915e7f51e Rename tube_item() to tube_inject_item()
The new function has no API compatibility with the old one, so give it
a different name to avoid confusion among caller mods, which need to
change their usage.  Have a function under the old name that outputs a
helpful error message.
2014-08-15 13:24:52 +02:00
Novatux
bf6fe237de Fix typo 2014-08-14 22:02:36 +02:00
Novatux
d4e14bc891 Add legacy code for items in tubes 2014-08-14 21:18:48 +02:00
Novatux
d5480f5ff0 Major rewrite of items in tubes 2014-08-14 16:22:03 +02:00
Zefram
b832c0ad06 Slot sequencing modes for filter-injectors
The filter-injectors used to always prefer to take items from the
beginning of the source inventory.  Because items also tend to get placed
at the beginning of an inventory, this could lead to a chest+injector
buffer only passing through a trickle of one type of item, where other
item types are flowing in and getting later inventory slots.  So now,
the sequencing of source inventory slots is configurable, per-injector,
by form.  In addition to the old priority mode, there's now a random
mode and a rotation mode.

Incidentally refactor the filter-injector code, to avoid duplication
between the itemwise and stackwise variants.
2014-07-21 19:03:56 -04:00
Zefram
1c3fb6b1c5 rename "filter" to "filter-injector"
"Injector" better describes the nodes' main purpose.
2014-07-21 14:47:50 -04:00
Zefram
87d87c91fa Name tube items for function rather than material
Previously, some tube types were named based on their function, and others
based on some arbitrarily-chosen material used in their construction,
with no meaningful system governing which was in each category.  With this
change they are consistently named according to function.  Naming style
is also made consistent in the wording that identifies tubes as such,
and in capitalisation.
2014-07-05 12:55:33 -04:00
Zefram
65baf218be Make non-node items in tubes look more solid
Use the "wielditem" visual type for non-node items, with a fixed 45
degree yaw.  This matches the recent change of dropped-item entities from
"sprite" visual to "wielditem".
2014-07-02 21:39:28 -04:00
Novatux
df1c9d0874 Fix bug with multiple input inventories with the filters 2014-07-02 12:42:33 +02:00
Novatux
99a902a8b8 Try to fix some bugs that happen on server restart 2014-07-01 18:42:52 +02:00
Novatux
9a63a16140 Filter inventory fix 2014-06-14 15:35:39 +02:00
Novatux
fd3c88eb86 Accept multiple input inventories, fix bug with mesecons_mvps 2014-05-23 19:49:35 +02:00
Novatux
8efcd39e39 Bugfix 2014-05-18 16:41:37 +02:00
Novatux
274d7fb048 Deployer fixes 2014-04-13 09:25:31 +02:00
Ciaran Gultnieks
7bac96c588 Add optional before/after filter callbacks
These allow nodes that manage inventory in a non-standard manner (e.g. a
barrel) to still be able to work with pipeworks filters.
2014-02-10 19:19:57 +00:00
Novatux
9f66fd40ad allow_metadata_inventory_take returns a number, not a bool 2014-01-11 08:04:11 +01:00
Novatux
466d8af41d Prevent items from leaving below filters 2014-01-10 21:26:14 +01:00
Novatux
d33eb89dcb Support for the mesecons mvps callback 2014-01-03 21:36:10 +01:00
Novatux
b040fc585b fix filters and mese filters not working correctly 2013-12-24 08:36:19 -05:00
Novatux
75db2c5307 Fix item transport code 2013-12-21 10:17:12 +01:00
Novatux
61d7bde79a A few fixes 2013-12-21 08:54:33 +01:00
Vanessa Ezekowitz
41ce9be8f3 notvel function can't be local - made global and confined to pipeworks.{} 2013-12-15 16:05:35 -05:00
Vanessa Ezekowitz
a4a74413c0 tube_item has to be global. confined it to pipeworks.{} table. 2013-12-15 14:41:03 -05:00
Vanessa Ezekowitz
030ae3283d local-ize a few more variables 2013-12-15 06:10:03 -05:00
Vanessa Ezekowitz
c0ce62dacf local-ize a few more variables and functions 2013-12-15 05:53:11 -05:00
Vanessa Ezekowitz
53f6e67399 local-ize a few more functions 2013-12-15 05:40:26 -05:00
Vanessa Ezekowitz
eabced6976 default settings have to be global or pipeworks can't see them
(duh!)  confined them to pipeworks.{} table.
2013-12-15 04:43:13 -05:00
Vanessa Ezekowitz
bd80f18cfc local-ize pretty muchg everything that was previously global except where
stuff needs to be globally-visible.  Also, fix a bad drop on valve.
2013-12-15 02:53:10 -05:00
Vanessa Ezekowitz
bd1d8bbd86 Make the tube_connects={} method work properly for technic devices.
Also phase out "old new" API, leaving only the "tube_connects={}" method,
as nothing in technic or pipeworks uses it.

Fix a few more places where minetest.facedir_to_dir() was duplicated, since
that code is part of Minetest 0.4.8.
2013-11-26 00:26:38 -05:00
Vanessa Ezekowitz
7887d28e08 make worldpath and modpath pipeworks-namespace-specific and global 2013-10-29 14:08:23 -04:00
Novatux
12eb772d18 Fix crossing tube and one way tube. 2013-10-21 11:34:10 +02:00
Cy
ce1acebf6d Check for on_metadata_inventory_take 2013-10-15 18:37:45 -04:00
Cy
28328d975c Multiple updates:
1)  Refactor autoplace,

There was a lot of redundant code and like a dozen unneccessary string
scans for every node next to every tube placed! I put it all into
indexed tables and loops instead of bizarre and unexplainable variable
names and copy and pasted code. There was also no support for notifying
a chest when an item has been taken from it by a filter, so I added
something for that.

I also thought it prudent to fall back on the
allow_metadata_inventory_take function should a special can_remove not
exist. In fact if can_insert doesn't exist, it calls
allow_metadata_inventory_put instead.

I also added a thing for allowing pipes to attach to nodes of other
modules, without having to hard code type all those node names into
autoplace.lua.  Basically node.tube.collects(i,param2) and i is the
direction from the pipe and param2 is the param2 of what it's pointing
at.

I also abstracted the inscrutable correlation between i and
param2 by trial and error (and the paramwand mod) into understandable
functions. There was no pipeworks namespace so I created it, and put
these functions into pipeworks.collects (as distinguished from a
        node.tube.collects function, which uses those functions)

And now it's too late to cart my old clothes to the thrift store,
dangit.

2)  My "node.tube.collects" idea might be redundant with the
node.tube.connect_sides thing, though possibly more versatile so I'll
leave it in.

3) I was using node.tube.connects and fancy functions for checking if it's
the sides or top or whatnot, and this connect_side thing came in. This
should make both my way and the way using connect_side work.

Also removed some debugging cruft
2013-10-14 23:45:07 -04:00
hdastwb
ec416df794 added support for 6d facedir for all tube components, changed autoplace.lua to follow tubes.connect_sides rather than having each component coded individually, and added support for placing deployers and node breakers facing vertically 2013-07-19 19:16:26 -04:00
Vanessa Ezekowitz
26bcbd8d6f fixed a nil reference (filter code didn't check for unknown nodes) 2013-07-15 18:50:28 -04:00
Vanessa Ezekowitz
17ee4f6aab Phased out all deprecated minetest.env:* uses in favor of minetest.* 2013-06-30 23:55:07 -04:00
Novatux
89be094a1e Add option to disable cyclic behaviour 2013-06-28 15:16:28 +02:00
Vanessa Ezekowitz
3a0fd39bf6 rewrote autoplacement code to make it more aware of filters,
autocrafter, nodebreaker, deployer, and made sure each item will only
initiate a connection to those sides which can accept such.  Fixed
various autorouting bugs as I ran across them.  Autorouting for various
devices is now:

filters: left and right sides only
nodebreaker, deployer:  back only
autocrafter:  all six sides
chests:  top, bottom, left, right, back (not front)
furnace: bottom, left, right, back (not the top or front)
2013-06-23 21:36:13 -04:00
Vanessa Ezekowitz
9a42a5f18b workaround for transported items sometimes just appearing out of nowhere
but not being diggable.  Made them have a really tiny collision box so
they can be pointed at if carefully done
2013-06-21 02:56:21 -04:00
Novatux
14adc2fd9b Fix crash sometimes with tubes 2013-06-05 15:55:56 +02:00
bas080
e271dc0818 retouched the formspec of the filter and mese-filter 2013-04-03 12:16:33 +02:00
Anthony
d784213a94 Fix tube connection to filters
Tubes did not previously connect to filters when the filters were placed after the tube.
2013-04-01 14:21:39 -03:00
Novatux
615157923f Added mese filter (takes full stack). 2013-01-28 18:41:14 +01:00
Novatux
fe0fd68601 Changed the name of some textures for naming conventions. Added deployer and node breaker (most of the code is from Technic, the textures too). 2013-01-20 17:53:17 +01:00
Novatux
4759791034 Added chests and furnaces autoconnect to tubes.
Fixed a bug where autocrafter could bbe used to clone items.
Removed test code.
2013-01-20 07:57:58 +01:00
Novatux
5edb7a61a3 Changed mese tubes: you can now choose if items should not go in a direction. 2013-01-19 19:11:28 +01:00
Novatux
a77095ebe6 Fixed a bug where items were not moved after teleport tube when they went to the same direction. 2013-01-19 17:13:47 +01:00