Storage Drawers

Storage Drawers

151M Downloads

NPE in BlockDrawers#removedByPlayer

yueh opened this issue ยท 4 comments

commented

BlockDrawers#removedByPlayer() can throw a NPE, which seems to be catched as it does not crash the server, but it is logged.

It appeared when removing a single layer from the middle of a 12x12x24 large cube of drawers.
In some case it failed with NPE, see attached stacktrace. Which caused a desync between the client and (integrated) server. Reloading the world would still result in some of them still existing. Also the usual glitched block behaviour in terms of collision boxes.

I have not compared the amount of dropped items/upgrades, which should be tested carefully, should it result in a dupe bug.

Each removed drawer also took a noticable time, are there any updates propagated to every connected drawers to reach the controller/slaves?

Storage Drawers: 3.4.0
Stacktrace: https://gist.github.com/yueh/1737acde80779c4a2e221c67d98d2f5e

commented

I'm not sure about server-notable time, but the client impact of changing blocks would be really big with all the chunk render updates. Drawers don't propagate any information through the network; the controller will rebuild its view of the world every 5 seconds.

The crash is coming from new code I just merged in, so I'm not too familiar with it. It looks like the ray test can fail to return an object, so I'll need to protect that a bit better.

commented

I'm assuming the removal was done by some automated process like a tool. Should be fixed in 3.4.0.

commented

In that case, based on where the NPE shows up, I think it's trying to destroy the block after the player's gaze has left the block, which would cause the raytest to return null.

commented

Oh. I should have mention destroyed by punching them in creative mode.
And in combination with the crashlog containing Future, I assumed some problems caused by the noticeable delay and not correctly validating that the future is done (which could also be a vanilla/forge issue)