Disallow pushing into invalid faces#73
Conversation
|
We could move this code into the function And it will also prevent also any pulls from invalid faces. I have to think of another case: https://github.com/joe7575/techpack/blob/master/tubelib_addons1/detector.lua#L136 |
|
I definitely think there are more use-cases for this, but I am happy to try and simplify / speed up. One use case is the liquid sampler, and perhaps the quarry too, it doesn't make sense to me that you would be able to push in from the active side (front in these cases) Technically this is fine (existing functionality, not this PR) as pushing into a teleporter does not cause it to get redirected and confused, however it currently causes the "spooky connection" bug (when removing the source teleporter you are pushing into) simply because we only update the back & front of the teleporter when we remove it, if we updated all sides of the teleporter it would also fix the "spooky connection" bug by triggering the pusher to update no mater what side it's on. However, I would like to come up with a solution that 100% disallows us to pass items in/out of these new "invalid faces", as I do think there are good use cases (as mentioned). I do however keep coming up with ways to circumvent this, I think this is why flux keeps saying this needs a re-write, just so complex :P I actually gave I definitely think you have a point though, will take another look at this later. |
|
Yo are right, this teleporter feature is much to complex. First it is a secondary node, but then it becomes part of the tube connection and therefore, completely "invisible". One solution would be to implement the teleporters as real secondary node, like ender chests. Each pusher/teleporter pair is one tube connection. The teleporters are real nodes with a pairing feature. This can be implemented independent on the existing teleporters. They can then be switched off. |
Yes, this connection management is the main part of tubelib2. The tubes are only needed once, to find the path to the destination. The positions then are stored in the cache. This is the difference to other tube/pipe/cable implementations and the main reason, why tubelib2/TechPack/Techage is that lean and efficient (server friendly) |
I have considered that, though I decided against it just because I found another solution that didn't require a re-write - as far as I knew at the time! It certainly is confusing having teleporters act as both though, lets see if we can't sort this out, and if not, we may end up removing the valid faces feature and just making teleporters less tubey. Diving into the |
|
I think that did the trick, merging with with #74 as I have effectively re-written the whole valid-face feature at this point @joe7575 FYI just remembered another really important use case: currently tubes will automatically try to connect to the sides of pushers even though that's clearly invalid. Expect a PR for this project... tomorrow maybe... with this feature implemented for all the secondary nodes I think need it |
Fixes #72
This is actually independent of ongoing discussions, as this uses
get_secondary_nodeto determine validity, which will be modified by any alternate solution to the valid faces problem.i.e. This fix should work with current and future code