Immersive Geology

Immersive Geology

14.6k Downloads

[1.16.5] BlockColors.getColor throws NPE

mysticdrew opened this issue ยท 4 comments

commented

Hello,
I had a user report an issue with Journeymap and your mod. Seems some of your blocks do not properly set colors and when I try to get the color an NPE is thrown.
I am no longer developing for 1.16.5 and I see that you are still maintaining it. So this might be better fixed on your end.

If I were still developing for 1.16.5, I'd just make it skip the block, but it would not be mapped correctly. Future versions of Journeymap, I will handle this null color case.

image

Exception from logs

[00:34:21] [JM-task-2/WARN] [SurfaceRenderer] Error rendering surface: java.lang.NullPointerException
	at igteam.immersive_geology.common.block.IGGenericBlock.getColourForIGBlock(IGGenericBlock.java:64)
	at igteam.immersive_geology.client.render.IGColorHandler.getColor(IGColorHandler.java:22)
	at net.minecraft.client.renderer.color.BlockColors.func_228054_a_(BlockColors.java:92)
	at journeymap.client.mod.vanilla.VanillaBlockColorProxy.getColorMultiplier(VanillaBlockColorProxy.java:132)
	at journeymap.client.mod.vanilla.VanillaBlockColorProxy.getBlockColor(VanillaBlockColorProxy.java:98)
	at journeymap.client.model.BlockMD.getBlockColor(BlockMD.java:494)
	at journeymap.client.cartography.render.BaseRenderer.setStratumColors(BaseRenderer.java:281)
	at journeymap.client.cartography.Strata.nextUp(Strata.java:211)
	at journeymap.client.cartography.render.SurfaceRenderer.paintStrata(SurfaceRenderer.java:460)
	at journeymap.client.cartography.render.SurfaceRenderer.renderSurface(SurfaceRenderer.java:222)
	at journeymap.client.cartography.render.SurfaceRenderer.render(SurfaceRenderer.java:123)
	at journeymap.client.cartography.render.SurfaceRenderer.render(SurfaceRenderer.java:93)
	at journeymap.client.cartography.ChunkRenderController.renderChunk(ChunkRenderController.java:156)
	at journeymap.client.task.multi.BaseMapTask.performTask(BaseMapTask.java:131)
	at journeymap.client.task.multi.TaskBatch.performTask(TaskBatch.java:72)
	at journeymap.client.task.multi.MapPlayerTask$MapPlayerTaskBatch.performTask(MapPlayerTask.java:424)
	at journeymap.client.thread.RunnableTask$Inner.run(RunnableTask.java:77)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
commented

Thanks for the report, I'll try and get this fixed as soon as possible.

commented

Thanks, let me know if you need anything from me.

commented

Fixed in 58427f8

Hotfix gonna be published in 24 hrs at most.

commented

Wonderful, thank you very much.