Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add support for pipeworks injectors #31

Open
cplir-c opened this issue May 3, 2019 · 11 comments
Open

Please add support for pipeworks injectors #31

cplir-c opened this issue May 3, 2019 · 11 comments

Comments

@cplir-c
Copy link

cplir-c commented May 3, 2019

The only way I can think of to automatically retrieve items from drawers is by breaking the drawer and having all the items fall out.
This is too hard on the server for drawers with tens of thousands of items, and would almost certainly break the vacuum pipes.

I'd like to be able to use injectors on drawers directly, and if possible on a drawer controller too.

Alternatively, and maybe this would be harder, but if a node breaker is trying to break a drawer from the front it could act like a player punching it?

This would be very useful for automatic storage systems so I don't need to use 12 technic gold chests to store my items instead of 1 diamond upgraded drawer.

Thank you!

EDIT: On the to-do checklist you said that pipeworks support was added, and injectors are part of pipeworks. That is why I expected them to work with drawers.

@thomasrudin
Copy link
Contributor

This won't be a problem with the 1x1 drawers as it is clear which item you want to extract with the injector.
But what about the 2x2 or 4x4 drawers: which item do you want to get?
The simplest solution here would be a round-robin over the 2 or 4 drawer items...

@cplir-c
Copy link
Author

cplir-c commented Jan 6, 2020

You could extract an item based on the side you're pulling from (e.g. left side might be upper left item, down might be lower left ...)

@6r1d
Copy link

6r1d commented Feb 27, 2020

You could extract an item based on the side you're pulling from (e.g. left side might be upper left item, down might be lower left ...)

Yes, but then, items will need to be injected the same way you add them, right?

@S-S-X
Copy link
Contributor

S-S-X commented Jun 24, 2020

It would be enough if drawer provided inventory that pipeworks can check, then you could use pipeworks filter injector's filter part to get item that you want to get. That would also work with digiline injector and would work from any side. And that would also provide configurable rotation through normal filter injector interface.

It is just that pipeworks want to look at inventory unless you're gonna build special compatibility layer for injectors.

But I think that would be best option, there 1x1 drawer would have 1 slot inventory (replenished automatically until drawer is empty) and 2x2 would 4 slot inventory, any size goes just add slots as needed and keep 1 itemstack in each slot as long as there's items left in drawer.

Inventory would of course actually be hidden and not directly accessible via formspec, just for injectors to look at.

@6r1d
Copy link

6r1d commented Jun 25, 2020

replenished automatically until drawer is empty

If injector / any related way to get item by pipeworks has a callback and timers are not required, this is perfect!

@S-S-X
Copy link
Contributor

S-S-X commented Jun 25, 2020

If injector / any related way to get item by pipeworks has a callback

Injectors do have enough callbacks for this (both before and after filter action)

So it could, for example, do it this way:

  • tube.before_filter
    • add items to inventory slots, max stack size that is available and fits in (fill partial stacks if possible)
  • tube.after_filter
    • restore stack to drawer storage (taking it away from inventory) if nothing was taken

There's other options too, just need to find best way/moment to take items from drawer storage and to put items into inventory.

Then stack should be restored to drawer storage if filter does not find itemstack it wants and takes nothing, like if you have ice blocks in filter and drawer only has cobble left then inventory is empty and injector cant take anything but as drawer does not know about the fact that filter injector want ice it had to replenish cobble stack in inventory and remove it from drawer storage.

So there's these situations that need some good solutions, preferably with minimal inventory transfers if possible. One option is to keep stuff in inventory until someone punches drawer and then check if inventory slot has anything left, move items from inventory to drawer. But that approach would also need another update: when drawer is digged and items drop it should also drop items from inventory.

@6r1d
Copy link

6r1d commented Jun 25, 2020

Cool, so it's perfectly possible to implement

@SwissalpS
Copy link
Contributor

Has this become irrelevant with digiline support having been added? Are mesecon injectors really needed?

@S-S-X
Copy link
Contributor

S-S-X commented Oct 7, 2020

Has this become irrelevant with digiline support having been added? Are mesecon injectors really needed?

Not completely irrelevant but most probably not needed. Digilines is optional dependency for drawers and pipeworks and it is possible to have pipeworks and drawers without digilines.
For setup like that it could be useful to allow using injectors to take items out by punching without digilines but not sure if all required extra code and complexity is worth it.

@The4codeblocks
Copy link

Digilines?
That makes it require no injector, at all.

@S-S-X
Copy link
Contributor

S-S-X commented Nov 3, 2022

Digilines?
That makes it require no injector, at all.

There is already drawer controller that works with digilines.
Last comment was about situation where server does not have digilines mod installed at all so no digilines available. That is unlikely situation and I wouldn't support it unless explicitly requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants