FramedBlocks

FramedBlocks

45M Downloads

TileEntity creation race condition.

RogueLogix opened this issue ยท 5 comments

commented

related: BiggerSeries/BiggerReactors#24

This line can cause a tile entity to be created when it probably shouldn't be, and a ConcurrentModification exception gets thrown in some cases as a result.
https://github.com/XFactHD/FramedBlocks/blob/1.16.x/src/main/java/xfacthd/framedblocks/client/util/mixin/MixinBlock.java#28

commented

I will look into it when I am home.
In theory this should be preventable by first checking if the BlockState at that position is mine but that might still crash if someone builds a structure with a lot of Framed Blocks. Using the getTileEntity overload (in World if it exists or else in Chunk) that takes a "TileEntity creation type" and passing CHECK might be my best bet.
If you have any feedback in regard to this solution or any other hints, that would be greatly appreciated.

commented

looks like you have a check there that disregards the TE check if its your blockstate, that may be a typo. setting to to CHECK was the immediate solution i thought of before even seeing your mixin.

commented

The existing BlockState check is for the Block that is checked. The TileEntity after that is the neighbor to that block.

commented

oic, definitely read that code super thoroughly

commented

Fixed in 2bb44a0