Yeah. I overrode
collisionRayTrace
and synchronized it with
setBlockBoundsBasedOnState
in my block that I had the problem with. Haven't run into the issue since, but since it's a threading issue I'll keep an eye on it for it a bit longer...
Some context: I have a block that "moves", interpolating its bounding box while in transit. I'll not get into the details, to keep this short, but I don't want raytraces that originate in that block to hit it. That check looks like so:
override def collisionRayTrace(world: World, x: Int, y: Int, z: Int, origin: Vec3, direction: Vec3) = {
// Set interpolated bounds for server/client.
setBlockBoundsBasedOnState(world, x, y, z)
// Get interpolated bounds, should be server/client, could be the other.
val bounds = getCollisionBoundingBoxFromPool(world, x, y, z)
if (bounds.isVecInside(origin)) null
else super.collisionRayTrace(world, x, y, z, origin, direction)
}
Before synchronizing it sometimes incorrectly got hit, because the animation on the client was a bit behind the server (the movement gets triggered by a network packet).
Sounds confusing? Yep. This was quite the pain to track down...