mt-mods / pipeworks

Pipeworks is a mod for Minetest allowing the crafting and usage of pipes and tubes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hammer tube repair issue with TP tubes

S-S-X opened this issue · comments

commented

TP tubes refusing to continue sending when broken and then repaired again.

Tubes should have optional repair method to allow overriding default minetest.swap_node repair behavior with additional stuff.
That makes fixing simple while keeping full compatibility and allowing any behavior node requires for repair.

Just call new def.on_repair or def.pipeworks_on_repair or whatever here if it is defined or use old behavior as fallback:

pipeworks.logger(log_msg.." with "..wieldname.." to repair it.")
minetest.swap_node(pos, { name = was_node.name, param2 = was_node.param2 })
pipeworks.scan_for_tube_objects(pos)

commented

Also does anyone have idea why there's empty space in messages like this?

log_msg.."            with "..wieldnam

Also does anyone have idea why there's empty space in messages like this?

Not sure, maybe to align it with other messages, but it's not even a "tab" character 🤔

probably to show that these additional lines belong to line started at line 67 and that they are not individual messages

probably to show that these additional lines belong to line started at line 67 and that they are not individual messages

Yep, I just noticed it when testing, it makes them line up:

[pipeworks] singleplayer struck a broken tube at (-217,9,171)
            with anvil:hammer to repair it.

I don't know why they are on separate lines though, it's not like line length matters with log messages...

I think it's just to make them stand out more and easier to read. I sometimes do that when debugging but mostly remove it for deployment.