mojira.dev
MC-173067

NullPointerException when a structure containing a campfire is placed during world generation

When a structure:

  1. Contains a campfire

  2. The campfire is placed where a fluid was previously

  3. During world generation (does NOT occur by placing the structure with a structure block)

Then the following crash occurs:

 

java.lang.NullPointerException: Feature placement
	at bwo.f(SourceFile:201)
	at bpr.a(SourceFile:181)
	at cms.a(SourceFile:280)
	at clx.a(SourceFile:62)
	at clq$a.a(SourceFile:139)
	at clv.a(SourceFile:63)
	at cfl.a(SourceFile:78)
	at cdc.a(SourceFile:53)
	at cka.a(SourceFile:91)
	at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:419)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647)
	at cka.a(SourceFile:90)
	at cjj.a(SourceFile:36)
	at cdi.a(SourceFile:21)
	at cdi.a(SourceFile:14)
	at cdc.a(SourceFile:53)
	at bkt.a(SourceFile:417)
	at caa.a(SourceFile:125)
	at cae.c(SourceFile:84)
	at cae.a(SourceFile:214)
	at wp.a(SourceFile:549)
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
	at wp.a(SourceFile:543)
	at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:966)
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:940)
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456)
	at wr.b(SourceFile:58)
	at aiv.e(SourceFile:83)
	at aiv.a(SourceFile:123)
	at aiv.run(SourceFile:91)
	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

 

Steps to reproduce:

  1. Create a new world with default world generation settings

  2. Install the attached datapack, which adds some campfires to the "minecraft:shipwreck/with_mast" structure. Don't forget to /reload.

  3. Search for shipwrecks. Note that it may take a few attempts as not all shipwrecks use the with_mast template, and not all shipwrecks generate underwater.

Attachments

Comments 5

Affects 20w13b. Reproduced with the exact same data pack.

Happens when a campfire is placed in water during world generation:

  1. The campfire is placed in water

  2. The campfire tries to drop the items that it was baking

  3. The tile entity is referenced to drop the items

  4. As this happens during world generation, no world was assigned to the tile entity yet, the world being null

  5. The tile entity checks if the world it is in is the server world by accessing a field on that null world

  6. An NPE shows up, crashing the game

Earthcomputer

coschevi

Community Consensus

(Unassigned)

campfire, structure, world-generation

1.15.2, 20w13b, 20w15a, 20w16a, 20w17a

20w18a

Retrieved