Commit Graph

24 Commits

Author SHA1 Message Date
Christopher Head
15bb7b129c
Enhance params to can_remove and remove_item
By passing the list name and the slot index, these functions now receive
all data related to removal of an item from an inventory: the side on
which the removal is taking place, as well as which stack is being
pulled from. This means it’s no longer necessary to choose between
implementing `on_metadata_inventory_take` (which tells you which item
stack was pulled from but not from which side of the node) or
`remove_item` (which tells you which side the filter is on but not which
item stack it wants to take).
2017-10-15 22:59:20 -07:00
DS
b2bb4c5280 make the filters use ghostitems (#197) 2017-09-25 23:22:25 -04:00
DS
736d67784c fix digiline_filter crashing when getting a string as count (#196)
* fix digiline_filter crashing when getting a string as count

* move it to somewhere else

* 🐈
2017-09-25 23:21:49 -04:00
DS
a5e1bfa0e8 give more possibilities to mods (#194)
* add owner to tubed items

* allow custom inventories
2017-08-20 18:05:08 -04:00
Vanessa Ezekowitz
3c20e91029 prevent crash if node being taken from has no inv 2017-06-23 14:11:19 -04:00
Vanessa Ezekowitz
3679943620 also check for group "tubedevice" (fixes injecting into one-way tube) 2017-04-12 16:15:39 -04:00
Vanessa Ezekowitz
0c0e6a6b66 make sure there's something appropriate to inject an item into
(fixes #123)
2017-04-12 16:03:41 -04:00
ForbiddenJ
0056116148 Namespace pollution cleanup (Used list at #154) 2017-04-04 05:27:37 -03:00
Thomas--S
3d845a3f28 Make filter-injector work with latest chest versions 2017-03-17 10:07:34 -04:00
Carter Kolwey
a858145098 Add missing table entries 2017-03-17 10:07:34 -04:00
Carter Kolwey
acf7ee4a80 Special-case technic machines
This makes them work correctly with filters.
2017-02-28 23:52:10 -06:00
electrodude
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
electrodude
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
Tim
4fdf73fbcd add list rings to pipework inventories 2016-08-29 18:28:43 +02:00
electrodude
649c7d79f6 Add Digiline Filter-Injector
This adds a new type of Filter-Injector that waits for a digiline
message on its channel and then pulls the items described by the
message out of the inventory. It is basically a Stackwise Injector
that, on receiving a digiline message, sets its filter to the contents
of the digiline message and then activates itself.

Sending the message {name="default:brick", count=2} should do the
same thing as setting the filter of a Stackwise Filter-Injector to
two Brick Blocks and then punching it.

If no count is specified, it defaults to 1. Since this is based off
of the Stackwise Injector, it might make more sense if the default
were an entire stack. I can change this trivially.

You can also send requests like {{name="default:brick", count=1},
{name="default:dirt", count=1}}, which acts the same as setting the
filter to one Brick Block and one Dirt Block and then punching it.

If you send a string "default:dirt" instead of a table
{name="default:dirt"}, the string is passed to ItemStack and the
name and count are extracted from the resulting ItemStack. You can
also send a list of strings instead of tables: {"default:dirt",
"default:brick"}, and the first item found will be pulled.

Punching this or activating it with Mesecons currently does
nothing. I'm not really sure what would be the right thing to do in
either of those two cases, so I made it do nothing. I guess I could
make it use the previously-used filter, but I can't really see any
usefulness in that.

The recipe is probably too cheap. The darker of the two blue texture
colors could probably be better.
2016-05-10 16:13:41 -07:00
Prot EuPhobos
82c03466d7 add exact mode to the filter 2016-04-14 22:18:05 -07:00
Sokomine
fca10f613d added is_fake_player entry to the fake player table passed on to allow_metadata_* functions 2015-10-10 05:44:42 +02:00
Tim
d167aacf4d add ownership/protection handling for device configuration
take any available ownership into account before deciding on area protection
2015-03-11 19:36:41 +01:00
Vanessa Ezekowitz
ce12c83306 fix filters also 2015-02-07 02:51:06 -05:00
est31
50bc351804 Fix injector crash when dug or punched when its empty 2015-02-04 03:08:16 +01:00
est31
3041ebb81b Enable to specify size for stacks a stackwise filter takes 2015-02-03 09:04:56 +01:00
Tim
fcba05fd78 move autocrafter, tp-tube and filter-injector crafts to their respective code files 2015-01-29 20:31:08 +01:00
Tim
c9d18f74e4 update all formspecs "current_name" to "context" to reflect current api 2015-01-29 20:08:58 +01:00
Tim
009b9e9276 split the filter-injector specific code out of the generic item_transport 2015-01-29 19:57:23 +01:00