FramedBlocks

FramedBlocks

45M Downloads

Crash with create's schematic system

shBLOCK opened this issue ยท 3 comments

commented

When using create's schematic to copy any "Full" framed block, it causes an crash when placing it.
I think it's caused by waterlogging, the AbstractFramedBlock implements SimpleWaterloggedBlock, which means all the framed blocks implements it, but the full blocks don't have waterlogged block state, which causes the crash.

public abstract class AbstractFramedBlock extends Block implements IFramedBlock, SimpleWaterloggedBlock

Crash Log:
crash-2021-12-19_09.30.58-client.txt

commented

Your assumption of the source of the crash is very much correct, though the way this is implemented is intentional as anything trying to waterlog a block should check wether the block actually can be waterlogged with the given fluid.

The problem is that the vanilla templating system that create uses for their schematics doesn't use that check and instead directly calls ILiquidContainer#receiveFluid(). This method then tries to set the non-existent state property, leading to the crash.

I have fixed the crash itself by overriding ILiquidContainer#receiveFluid() in FramedBlock to only actually do anything if the specific block supports waterlogging. Please try this build to see if it fixes your issue: https://www.dropbox.com/s/66olih1d0nsm29r/FramedBlocks-2.11.3-templatefix.jar?dl=0. Also make sure to check for any odd behaviour with this fix as vanilla still does some more stuff when a block appears to support waterlogging as it ignores the result of ILiquidContainer#receiveFluid(). If this leads to more issues, then a fix in Forge might be necessary.

commented

The crash fix itself is now included in the latest version of FramedBlocks (2.11.3 for 1.16.5 and 4.0.2 for 1.18.1).
It would still be great if you could confirm whether this introduces any weird behavior in the Create schematic system.

commented

Closing due to lack of feedback.
If you decide to provide the testing results at a later time, feel free to comment on this issue and I will reopen it if needed.