SecretRoomsMod

SecretRoomsMod

10M Downloads

Connected texture mod interaction causes client crash

Joey736n opened this issue ยท 4 comments

commented

[secretrooms-1.16.5-1.1.2]
[Forge-36.1.32]
[1.16.5]

Placing a secret pressure plate on a block altered by CTM caused both players on the server to crash until it was removed with an external editing program. It is unknown whether this crash affects other secret rooms blocks.

crash-2021-07-11_19.36.24-client.txt

commented

Hi! This is an issue for me too. Same crash.

commented

I am getting this same issue. Thought it was optifine so I disabled it and still getting an error. Now it's saying CTM is the culprit

crash-2021-09-26_12.23.30-client.txt

commented

The stack trace shows both mods, but the NPE happens in secret rooms:

java.lang.NullPointerException: Tesselating block model
	at com.wynprice.secretrooms.client.world.DelegateWorld.lambda$getBlockState$2(DelegateWorld.java:75) ~[?:1.16.5-1.1.2] {re:classloading}
	at com.wynprice.secretrooms.client.world.DelegateWorld$$Lambda$22376/411382661.get(Unknown Source) ~[?:?] {}
	at java.util.Optional.orElseGet(Optional.java:267) ~[?:1.8.0_51] {}
	at com.wynprice.secretrooms.client.world.DelegateWorld.func_180495_p(DelegateWorld.java:75) ~[?:1.16.5-1.1.2] {re:classloading}
	at team.chisel.ctm.client.util.RegionCache.func_180495_p(RegionCache.java:80) ~[?:MC1.16.1-1.1.2.6] {re:classloading}
	at team.chisel.ctm.client.util.CTMLogic.getConnectionState(CTMLogic.java:398) ~[?:MC1.16.1-1.1.2.6] {re:classloading}
	at team.chisel.ctm.client.util.CTMLogic.buildConnectionMap(CTMLogic.java:212) ~[?:MC1.16.1-1.1.2.6] {re:classloading}
	at team.chisel.ctm.client.util.CTMLogic.createSubmapIndices(CTMLogic.java:161) ~[?:MC1.16.1-1.1.2.6] {re:classloading}
	at team.chisel.ctm.client.texture.ctx.TextureContextCTM.<init>(TextureContextCTM.java:28) ~[?:MC1.16.1-1.1.2.6] {re:classloading}
	at team.chisel.ctm.client.texture.type.TextureTypeCTM.getBlockRenderContext(TextureTypeCTM.java:25) ~[?:MC1.16.1-1.1.2.6] {re:classloading}
	at team.chisel.ctm.client.texture.type.TextureTypeCTM.getBlockRenderContext(TextureTypeCTM.java:15) ~[?:MC1.16.1-1.1.2.6] {re:classloading}
	at team.chisel.ctm.api.util.RenderContextList.<init>(RenderContextList.java:43) ~[?:MC1.16.1-1.1.2.6] {re:classloading}
	at team.chisel.ctm.client.state.CTMContext.getContextList(CTMContext.java:34) ~[?:MC1.16.1-1.1.2.6] {re:classloading}
	at team.chisel.ctm.client.model.AbstractCTMBakedModel.getQuads(AbstractCTMBakedModel.java:173) ~[?:MC1.16.1-1.1.2.6] {re:classloading}
	at com.wynprice.secretrooms.client.model.SecretBlockModel.render(SecretBlockModel.java:87) ~[?:1.16.5-1.1.2] {re:classloading}
	at com.wynprice.secretrooms.client.model.SecretBlockModel.lambda$getQuads$1(SecretBlockModel.java:52) ~[?:1.16.5-1.1.2] {re:classloading}
	at com.wynprice.secretrooms.client.model.SecretBlockModel$$Lambda$21762/822118816.get(Unknown Source) ~[?:?] {}
	at com.wynprice.secretrooms.client.model.SecretBlockModel.getQuads(SecretBlockModel.java:58) ~[?:1.16.5-1.1.2] {re:classloading}
	at net.minecraft.client.renderer.BlockModelRenderer.renderModelSmooth(BlockModelRenderer.java:143) ~[?:?] {re:classloading,pl:accesstransformer:B,xf:OptiFine:default}
	at net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer.renderModelSmooth(ForgeBlockModelRenderer.java:89) ~[?:?] {re:classloading}
	at net.minecraft.client.renderer.BlockModelRenderer.renderModel(BlockModelRenderer.java:101) ~[?:?] {re:classloading,pl:accesstransformer:B,xf:OptiFine:default}
	at net.minecraft.client.renderer.BlockRendererDispatcher.renderModel(BlockRendererDispatcher.java:83) ~[?:?] {re:classloading,xf:OptiFine:default}
	at net.minecraft.client.renderer.chunk.ChunkRenderDispatcher$ChunkRender$RebuildTask.func_228940_a_(ChunkRenderDispatcher.java:915) ~[?:?] {re:classloading,xf:OptiFine:default}
	at net.minecraft.client.renderer.chunk.ChunkRenderDispatcher$ChunkRender$RebuildTask.func_225618_a_(ChunkRenderDispatcher.java:735) ~[?:?] {re:classloading,xf:OptiFine:default}
	at net.minecraft.client.renderer.chunk.ChunkRenderDispatcher.lambda$runTask$1(ChunkRenderDispatcher.java:192) ~[?:?] {re:classloading,xf:OptiFine:default}
	at net.minecraft.client.renderer.chunk.ChunkRenderDispatcher$$Lambda$21398/338429590.apply(Unknown Source) ~[?:?] {}
	at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:952) ~[?:1.8.0_51] {}
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:926) ~[?:1.8.0_51] {}
	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) ~[?:1.8.0_51] {}
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1624) ~[?:1.8.0_51] {}
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1610) ~[?:1.8.0_51] {}
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_51] {}
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_51] {}
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1689) ~[?:1.8.0_51] {re:computing_frames}
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) ~[?:1.8.0_51] {}


commented

Looks like this is the lambda that's causing the NPE, though I didnt' see what the code looked like for version 1.1.2 of the mod. It may help to factor "this.world" into a local variable, and null check it before calling getMirrorState. That way the lambda would capture a local variable 'world' that's never null.

 @Override
    public BlockState getBlockState(BlockPos pos) {
        return SecretBaseBlock.getMirrorState(this.world, pos).orElseGet(() -> this.world.getBlockState(pos));
    }