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

Send messages from digiline chest when items are moved with tubelib #73

Merged
merged 8 commits into from
Jul 21, 2021

Conversation

oversword
Copy link
Contributor

@oversword oversword commented Jul 14, 2021

Fixes #61
Sends the same events from tubelib interaction as would be sent from pipeworks

  • Moved the tube_can_insert and tube_insert_object callbacks out of the node definition so they can be re-used in the tubelib registration
  • Optionally required tubelib and registered callbacks for pushing and pulling
  • Used "speculative pull" variable to only send a "take" event if tubelib's unpull is not called after a pull - this happens when it tries to take an item but there is no room, so it fails

@oversword
Copy link
Contributor Author

oversword commented Jul 14, 2021

Might take a look at the possibility of implementing terumet too, forgot I put that in the issue
That looks like a no, it just injects the items directly, no callbacks to hook into

@oversword oversword changed the title Send messages from digiline chest when itemsare moved with tubelib Send messages from digiline chest when items are moved with tubelib Jul 14, 2021
@oversword
Copy link
Contributor Author

@Panquesito7 @OgelGames can I get some eyes and thumbs?

inventory.lua Outdated Show resolved Hide resolved
@oversword oversword changed the title Send messages from digiline chest when items are moved with tubelib DRAFT: Send messages from digiline chest when items are moved with tubelib Jul 15, 2021
@oversword oversword marked this pull request as draft July 15, 2021 16:16
@oversword oversword changed the title DRAFT: Send messages from digiline chest when items are moved with tubelib Send messages from digiline chest when items are moved with tubelib Jul 15, 2021
@oversword
Copy link
Contributor Author

Just noticed this might be a bit more complex than expected, as I just remembered an unpull may effectively move the item, I also want this to work with whole stacks or it will be very difficult to make useful

@oversword
Copy link
Contributor Author

Okay I re-wrote the callbacks so they act a little more predictably, should be good now

@oversword oversword marked this pull request as ready for review July 16, 2021 20:41
@oversword
Copy link
Contributor Author

@SmallJoker can you accept the workflow and give this a review? (and maybe merge it :D)

inventory.lua Outdated Show resolved Hide resolved
mod.conf Show resolved Hide resolved
inventory.lua Outdated Show resolved Hide resolved
@SmallJoker
Copy link
Member

Thanks for the changes. I'll trust you on these changes because my knowledge about digilines is almost zero. The code looks good, and the parts that aren't quite nice were at least only moved, hence no problem.

Will merge in a few days unless there are objections.

README.inventory Outdated Show resolved Hide resolved
oversword and others added 2 commits July 19, 2021 22:53
Co-authored-by: David Leal <halfpacho@gmail.com>
@oversword
Copy link
Contributor Author

Thanks for the changes. I'll trust you on these changes because my knowledge about digilines is almost zero

Thanks, mine too TBH, but I'm using the existing API for that so not my problem :P I have been working on tubelib/tehpack quite a lot though and am pretty certain it is working well with all the weirdnesses of that mod

the parts that aren't quite nice were at least only moved

I agree haha, switching between inline / side-by-side view you can see I haven't changed anything there. Maybe if you're (un)lucky I'll get round to a digilines re-write at some point, the APIs are so inconsistent every node needs its own instruction book

@SmallJoker
Copy link
Member

I noticed that the pipeline was not run - this seems to happen for all first-time contributor's PRs now. Would you mind having a look at them?

@oversword
Copy link
Contributor Author

@SmallJoker Of course, probably just linting. I think they're disabled because people realised they could mine cryptocurrency for free using github's computers by submitting "checks" that actually trigger full programs

@oversword
Copy link
Contributor Author

@SmallJoker that should do it, run it again

@SmallJoker SmallJoker merged commit f03cd02 into minetest-mods:master Jul 21, 2021
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

Successfully merging this pull request may close these issues.

Add Support for Tubelib and/or Terumet to the Digilines Chest
4 participants