Create

Create

86M Downloads

Invalid Direction state on air block when dismantling Drill with iron pickaxe

noobanidus opened this issue ยท 6 comments

commented

I think the log might have more detail if you want it, but it was specifically when removing a (tile?) entity from the world, but here's the crash report. User isn't entirely sure what happened -- if they were breaking the drill or if they were breaking a shaft. I'm getting the impression that it was attempting to check the state of a block that was presumed to be a drill, but by this point it was already an air block.

commented

I haven't been able to reproduce it and I think server lag may have been a factor. Adding a check to make sure that the blockstate isn't air in that particular piece of code might be enough of a bandaid for the few times that the error will actually occur, imo.

commented

Thanks for the report, I'll try to reproduce it when I have time.

commented

To add to this, I also think latency between client and server is definitely a big contributing factor here in reproducing it - on my server, only one of our players has had Create related crashes, but he has had a dozen or so of them all relating to trying to cast from air to a Create class of one type or another (happens with multiple moving blocks - mechanical pistons, windmills, etc.). He is also the only regular player with high latency.

commented

Thank you two, that is good to know!
Looks like the safety checks will have to go basically everywhere then. While it won't really aid in trying to understand the issue, it will make fixing it pretty simple.

commented

Server lag was definitely a huge factor involved in this instance, as we had around 8-13 people on the server at the time (I think), but as my crash happened server-side I don't know if it is a result of latency.

This specific crash seemed to happen on this line. I don't have a 1.14 environment open to double-check what the conditions are for remove (i.e., whether it's occurring after blockstate has changed, whether this is what was previously called invalidate or not, I'm not sure).

In this specific instance, you may want to synchronise the facing and serialize it as part of the tile entity (as I don't believe there is a way to change facing post-facto? thus the information should never be stale) which allows you to do the block break progress update without needing to reference the blockstate that has potentially already been removed.

commented

This should be addressed in the new version that went live just now.
Thanks for the Issue and feel free to re-open if need be.