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

Wrench support extend #2

Merged
merged 130 commits into from
Mar 15, 2022
Merged

Wrench support extend #2

merged 130 commits into from
Mar 15, 2022

Conversation

nixnoxus
Copy link
Collaborator

@nixnoxus nixnoxus commented Dec 1, 2021

Adds wrench support for bones, connected_chests and some nodes from pipeworks and xdecor.

For more information see: https://github.com/mt-mods/wrench/tree/wrench_support_extend#supported-mods-and-nodes

Related to mt-mods/technic#251

nodes/xdecor.lua Outdated Show resolved Hide resolved
@OgelGames
Copy link
Contributor

I made some changes and added support for more_chests, I hope you don't mind, I thought it would be easier to work on the same branch so we can both work on support for different mods :)

functions.lua Outdated Show resolved Hide resolved
@nixnoxus

This comment has been minimized.

@OgelGames

This comment has been minimized.

functions.lua Outdated Show resolved Hide resolved
@nixnoxus
Copy link
Collaborator Author

I think that unit tests can only ensure a stable and consistent API.

The interaction with other mods we can only ensure with integration tests (with loading other mods).

@S-S-X
Copy link
Member

S-S-X commented Jan 17, 2022

Could possibly try separate integration tests with actual player interaction by actually loading mods and writing simple test loop where player picks up and places whitelisted nodes.
Similar to node placement test for Technic mod https://github.com/mt-mods/technic/blob/7e466e9b41215306b220d83b932b754294f32e1d/technic/spec/nodes_spec.lua#L44-L46
And placement_test function: https://github.com/mt-mods/technic/blob/7e466e9b41215306b220d83b932b754294f32e1d/technic/spec/nodes_spec.lua#L15-L20

Probably need to implement some missing functionality for Mineunit and allow disabling test failures that happen because of deprecated Minetest Lua API use, many mods are using deprecated functions and currently Mineunit throws errors for some if deprecated version is used.

@nixnoxus
Copy link
Collaborator Author

nixnoxus commented Jan 18, 2022

@OgelGames i found some issues with your changes:

digistuff:detector
29a4857#diff-0de17c9b8ddfd83bc350c98c87ecc8490af2647c2c963e15d08ec519fac173c9L84-R77
=> config loss after replace

digistuff:eeprom
29a4857#diff-0de17c9b8ddfd83bc350c98c87ecc8490af2647c2c963e15d08ec519fac173c9L107-R102
=> right click dosn't work after replace

digistuff:piezo
29a4857#diff-0de17c9b8ddfd83bc350c98c87ecc8490af2647c2c963e15d08ec519fac173c9L216
=> can't pickup after digiline_send("beep", "longbeep")

@OgelGames
Copy link
Contributor

OgelGames commented Jan 18, 2022

digistuff:detector => config loss after replace

It works fine for me...

digistuff:eeprom => right click dosn't work after replace

Ah... that doesn't set it's formspec the same was as digistuff:ram does...

Fixed here: mt-mods/digistuff@b60d9b3

@nixnoxus
Copy link
Collaborator Author

nixnoxus commented Jan 18, 2022

digistuff:detector => config loss after replace

It works fine for me...

My test setup:
1. place digistuff:detector
2. set channel = c_ob, radius = 1
3. pickup digistuff:detector
4. (re)place digistuff:detector
5. right click digistuff:detector ~~
~~ => channel is now 0

same effect also with mt-mods/digistuff@b60d9b3

Sorry, my mistake

@nixnoxus
Copy link
Collaborator Author

Looks good to me so far.

I think it would be good if we include support for digistuff:advtouchscreen again since it is still included in the upstream digistuff mod. 🤔
(support remove here 29a4857#diff-0de17c9b8ddfd83bc350c98c87ecc8490af2647c2c963e15d08ec519fac173c9L276-L282)

@nixnoxus nixnoxus requested a review from OgelGames January 21, 2022 07:22
@OgelGames
Copy link
Contributor

I think it would be good if we include support for digistuff:advtouchscreen again since it is still included in the upstream digistuff mod.

IMO we should only support the versions stated in the readme, the API can be used for adding support for other versions/nodes. While it would be good to support more, I think in the long run it will be a lot easier to manage if we only support specific versions.

Copy link
Contributor

@OgelGames OgelGames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still stuff I want to add, but I don't have time for that at the moment, and it's better to make another PR anyway.

I think everything is good enough to merge 👍

@OgelGames OgelGames requested a review from S-S-X January 27, 2022 11:48
@nixnoxus
Copy link
Collaborator Author

@S-S-X please review.

@S-S-X
Copy link
Member

S-S-X commented Feb 16, 2022

Picking up bones: functions.lua:150: bad argument #1 to 'pairs' (table expected, got nil)
Because placed bones do not have inventory, same situation can happen with any other node placed by other mods or direct commands, should be checked.

So no for blacklisting or whitelisting certain names but checking if that specific node has inventory and prevent pickup if it does not have, I would also recommend against digging said node because that can increase complexity and not exactly what wrench should be doing.

Simply do not do anything, maybe chat message telling that node cannot be picked up with wrench because it does not have inventory.

@nixnoxus
Copy link
Collaborator Author

Picking up bones: functions.lua:150: bad argument #1 to 'pairs' (table expected, got nil)

Fixed.

Simply do not do anything, maybe chat message telling that node cannot be picked up with wrench because it does not have inventory.

A chat message 'Cannot pickup node. Node has no inventory.' is written.

@nixnoxus
Copy link
Collaborator Author

if no objections come, I will merge this weekend and create a new branch / merge request for further customization.

Copy link
Member

@S-S-X S-S-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems "mostly" fine... mostly because I've actually only read at most half of it, you know it is huge PR with over 2200 LoC added...

@OgelGames
Copy link
Contributor

It's been two months since I approved this, I think we should just merge this now.

@OgelGames OgelGames merged commit 79496a3 into master Mar 15, 2022
@OgelGames OgelGames deleted the wrench_support_extend branch March 15, 2022 04:00
@OgelGames OgelGames restored the wrench_support_extend branch March 15, 2022 04:02
@OgelGames
Copy link
Contributor

I don't know why github deleted the branch automatically, but I'm gonna leave it to exist for a little bit... :)

@OgelGames OgelGames deleted the wrench_support_extend branch August 6, 2023 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Legacy compat
5 participants