2xsaiko / HCTM

2xsaiko's tech mod
12 stars 4 forks source link

U-bends of wire in a single block space behave poorly, cause crashes #11

Closed nihiltres closed 4 years ago

nihiltres commented 6 years ago

All right, I haven't quite nailed this bug down, but I think I've got enough to report it.

Placing down a U-bend of any wire in a single block space (i.e. placed on two opposite inner faces of the block space, and any single other inner face) can cause crashes directly (but not every time). The crash is caused by an "IllegalStateException: No QBlock at BlockPos". Here's a sample from my crash log:

java.lang.IllegalStateException: No QBlock at BlockPos{x=-84, y=5, z=-49}.
    at therealfarfetchd.quacklib.common.api.qblock.QBContainer.noqb(QBContainer.kt:64)
    at therealfarfetchd.quacklib.common.api.qblock.QBContainer.func_180647_a(QBContainer.kt:110)
    at net.minecraft.block.state.BlockStateContainer$StateImplementation.func_185903_a(BlockStateContainer.java:408)
    at mcmultipart.api.multipart.IMultipart.getPlayerRelativePartHardness(IMultipart.java:196)
    at mcmultipart.block.BlockMultipartContainer.lambda$getPlayerRelativeBlockHardness$39(BlockMultipartContainer.java:397)
[...]

If a U-bend is successfully placed without crashing, or reloaded after a crash (the completed U-bend is present on reloading), breaking any one of the support blocks for the U-bend leaves behind a "ghost" piece of wire, with glitchy behaviour across all segments of the multipart (e.g. not successfully breaking in creative mode). This doesn't cause crashes, but is probably related.

2xsaiko commented 6 years ago

Both of these are definitely MCMP bugs, I'll try to fix the first one at least in QuackLib since that will probably just be replacing the crash with returning a default value or similar... The second one I've tried to fix (on MCMP's side) already, but it was being a giant pain and only a visual bug so I just gave up on it.

2xsaiko commented 6 years ago

Hmm, func_180647_a is getPlayerRelativeBlockHardness... Does the crash happen immediately after placing or when destroying the block/doing anything with it? If the latter is true, that might prove more difficult to solve

nihiltres commented 6 years ago

The crash happens immediately after placing.

2xsaiko commented 6 years ago

Okay, thanks.