Quarry Frame Generation Event Spam!
thomas15v opened this issue · 18 comments
This piece of code gets executed every time the frame is consuming power trying to break the block (like for the block breaking animation). I think this only should called when the block actually gets broken.
Not easily fixable without a larger refactor, sorry, and this is out of the scope of my 1.7.10 maintenance.
if the code hasn't been changed then this would still be an issue, would you mind looking into this to confirm and fix if needed @afdw ?
To give you an idea this is what I do to fix the issue on my server:
https://gist.github.com/thomas15v/8abd5a63af3a79b28f547347f0710a35.
well that completely bypasses the check, it fixes the lag but also makes the quarry bypass anything that prevents the block from being broken (permission/protection mods for example)
it needs to be tested and if the code hasn't been fixed yet that check just has to be moved to the part where the block is actually broken instead of every time it makes progress (with refunding of wasted energy if canceled probably)
@AEnterprise Code is rewrote by my and @AlexIIL
yes but did that rewrite fix it? i don't know enough of the blueprint code to know for sure
yes but it might still do the same or the builder can have the problem, could you add a temp event listener for that event and have stuff build and removed in various ways to verify there is no more issue?
@AEnterprise OK, I done it. Event called only when block is actually going to break. So fixed.
Nope!
If you do it that way, you will still eat the energy if the block cannot be broken, which is silly and slows everything down.
You need to call it twice: on the first tick of the block breaking and on the last tick of the block breaking, which is not trivial.
@AEnterprise OK
@asiekierka Couldn't you do the same like the Ender Quarry from extra utils. It skips the block and continues to consume energy normally although no blocks are being broken. So if their is for example 1 chunk it cannot mine, it will just ignore that chunk.
Maybe you could remove the energy consuming part, but still if you would take a IRL drill made from iron and use it against a giant diamond, it will not break the diamond and still consume power. Here it is the same only an invisible force (the plugins/mods) are protecting the block which normally should be broken. Just the quarry trying it, should consume power I think.
i looked into this and firing the event multiple times is not fine to do for the same block. The purpose of the event is notifying others that a block is broken and with the option for others to cancel that. In the case that the event isn't canceled the block has to be broken as that is the entire purpose of the event.
there are mods that keep track of what block are broken when and where for example, firing non canceled events for blocks without breaking them will completely mess those up for example
so only checking when we are actually ready to break the block is the best option, maybe with re-adding energy to the buffer when the break is canceled?
Re-adding energy to the buffer sounds like a reasonable solution, as then it will only "stall" for the first such block - the constant feedback loop of re-adding and re-removing energy will cause the other ones to go quickly.
I'm OK with it.
@afdw can you add this then? other blocks with similar functionality like the filler and builder might need a similar treatment