mojira.dev
MC-273228

Crash when generating water lakes using a custom worldgen datapack

When using the minecraft:lake feature type and placing water as a fluid, the chunk generation thread crashes because of a call to WorldGenLevel.getBiome.

To reproduce

  1. Setup a single biome world with Plains as the selected biome

  2. Use either the

[media]
  1. or

[media]
  1. datapack

The only difference between lake_crash and lake_no_crash is that lake_no_crash uses lava instead of water in the lake configured feature.

Expected results

The game allows you to use the minecraft:lake feature with water.

Observed results

When using lake_crash, sometimes it says "Server closed" and other times it hangs on the loading screen.

Stack trace (1.21-rc1) from [^latest.log]

[21:45:30] [Render thread/INFO]: Preparing spawn area: 18%
[21:45:31] [Server thread/ERROR]: Error executing task on Chunk source main thread executor for minecraft:overworld
z: Exception generating new chunk
	at aqb.a(SourceFile:647) ~[1.21-rc1.jar:?]
	at bph.d(SourceFile:162) ~[1.21-rc1.jar:?]
	at aqs$b.d(SourceFile:552) ~[1.21-rc1.jar:?]
	at bph.B(SourceFile:136) ~[1.21-rc1.jar:?]
	at aqs$b.B(SourceFile:561) ~[1.21-rc1.jar:?]
	at aqs.d(SourceFile:263) ~[1.21-rc1.jar:?]
	at net.minecraft.server.MinecraftServer.bv(SourceFile:852) ~[1.21-rc1.jar:?]
	at net.minecraft.server.MinecraftServer.B(SourceFile:840) ~[1.21-rc1.jar:?]
	at bph.b(SourceFile:145) ~[1.21-rc1.jar:?]
	at net.minecraft.server.MinecraftServer.b(SourceFile:810) ~[1.21-rc1.jar:?]
	at net.minecraft.server.MinecraftServer.v_(SourceFile:815) ~[1.21-rc1.jar:?]
	at net.minecraft.server.MinecraftServer.b(SourceFile:508) ~[1.21-rc1.jar:?]
	at net.minecraft.server.MinecraftServer.t_(SourceFile:345) ~[1.21-rc1.jar:?]
	at guo.e(SourceFile:73) ~[1.21-rc1.jar:?]
	at net.minecraft.server.MinecraftServer.y(SourceFile:664) ~[1.21-rc1.jar:?]
	at net.minecraft.server.MinecraftServer.a(SourceFile:281) ~[1.21-rc1.jar:?]
	at java.base/java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.IllegalStateException: Requested chunk unavailable during world generation
	at arb.a(SourceFile:131) ~[1.21-rc1.jar:?]
	at dcz.getNoiseBiome(SourceFile:68) ~[1.21-rc1.jar:?]
	at ddy.a(SourceFile:79) ~[1.21-rc1.jar:?]
	at dcz.t(SourceFile:44) ~[1.21-rc1.jar:?]
	at ect.a(SourceFile:153) ~[1.21-rc1.jar:?]
	at ece.a(SourceFile:168) ~[1.21-rc1.jar:?]
	at ebq.a(SourceFile:28) ~[1.21-rc1.jar:?]
	at eiv.a(SourceFile:54) ~[1.21-rc1.jar:?]
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[?:?]
	at java.base/java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source) ~[?:?]
	at java.base/java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source) ~[?:?]
	at java.base/java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source) ~[?:?]
	at java.base/java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source) ~[?:?]
	at java.base/java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[?:?]
	at java.base/java.util.stream.IntPipeline$1$1.accept(Unknown Source) ~[?:?]
	at java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Unknown Source) ~[?:?]
	at java.base/java.util.Spliterator$OfInt.forEachRemaining(Unknown Source) ~[?:?]
	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:?]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) ~[?:?]
	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source) ~[?:?]
	at java.base/java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Unknown Source) ~[?:?]
	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:?]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) ~[?:?]
	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[?:?]
	at eiv.a(SourceFile:53) ~[1.21-rc1.jar:?]
	at eiv.b(SourceFile:42) ~[1.21-rc1.jar:?]
	at duz.a(SourceFile:361) ~[1.21-rc1.jar:?]
	at dwb.i(SourceFile:103) ~[1.21-rc1.jar:?]
	at dwc.a(SourceFile:33) ~[1.21-rc1.jar:?]
	at aqb.a(SourceFile:632) ~[1.21-rc1.jar:?]
	at aqn.a(SourceFile:96) ~[1.21-rc1.jar:?]
	at apy.a(SourceFile:143) ~[1.21-rc1.jar:?]
	at apy.a(SourceFile:121) ~[1.21-rc1.jar:?]
	at apy.d(SourceFile:74) ~[1.21-rc1.jar:?]
	at apy.a(SourceFile:59) ~[1.21-rc1.jar:?]
	at aqb.b(SourceFile:665) ~[1.21-rc1.jar:?]
	at aqe.b(SourceFile:62) ~[1.21-rc1.jar:?]
	at bpk.h(SourceFile:91) ~[1.21-rc1.jar:?]
	at bpk.a(SourceFile:146) ~[1.21-rc1.jar:?]
	at bpk.run(SourceFile:102) ~[1.21-rc1.jar:?]
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[?:?]

Linked issues

Attachments

Comments 6

It should be noted that the top_layer_freeze feature takes care of water freezing anyway (the reason this issue occurs is due to water placement checking the biome to see if it should freeze or not,) so it’s optimal to just remove that altogether from the Lake feature.

Although it may not have Ice across chunk borders, it is a much better solution than just crashing.

Another solution is freezing all water if the feature’s origin pos would freeze, though this will result in inconsistent behavior with other Water-Ice generation in the game.

Can confirm, this issue is causing LOTS of crashes specifically when generating lakes (big worldgen datapack). This wasn't the case in 1.20.6.

Can confirm too:

[media]

This issue seems to be MC-272370 but both are triaged so I doubt they will get resolved as duplicates

This seems to still be around in 1.21.4 on my Windows laptop 

Seems to be a duplicate of MC-272370 but I don’t think the cause was narrowed down as much it seems to be here

Treetrain1

(Unassigned)

Community Consensus

Platform

Normal

Crash, Custom Worlds, Data Packs, World generation

crash, world-generation

1.21, 1.21 Release Candidate 1, 1.21.1

Retrieved