mojira.dev
MC-309184

Specifying multiple features of type `no_op` in a data pack prevents the world from loading

When removing vanilla features by replacing them with type “no_op”, the world cannot load anymore. This was not an issue in 26.2 and is likely a side-effect of the config changes in 26.3. This might also happen in other cases when multiple features of other types have the exact same configuration (see likely cause).

Steps to Reproduce

  1. Download [mediaInline]

  2. Click create new world

  3. Go to More

  4. Click Data Packs

  5. drag the downloaded zip in

  6. Move it to Selected

I support both the 26.2 and the 26.3-snap1 formats, so you can also do the same in 26.2 and watch it work. The replaced feature types are diorite, andesite, and granite ore blobs.

Expected Result

The world loads and generates with no diorite, andesite, and granite blobs (granite can still appear as part of copper veins)

Observed Result

Datapack validation fails with exception (it works if only one feature of the type is present). You can also work around it by overriding placed features and make them reference a single custom no_op feature.

Exception pasted at the end of the report.

Likely cause

This is likely a sister-issue of MC-252369 and related to multiple features with the exact same configuration existing. Likely the refactorings in the snapshot introduced a similar structure using record, and the default equals methods for configured features as well now, like it is the case for placed features.

Exception

java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Adding duplicate value 'NoOpFeature[]' to registry
	at java.base/java.util.concurrent.CompletableFuture.wrapInExecutionException(CompletableFuture.java:345)
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:440)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2094)
	at net.minecraft.client.gui.screens.worldselection.WorldOpenFlows.loadWorldDataBlocking(WorldOpenFlows.java:212)
	at net.minecraft.client.gui.screens.worldselection.WorldOpenFlows.loadWorldStem(WorldOpenFlows.java:154)
	at net.minecraft.client.gui.screens.worldselection.WorldOpenFlows.openWorldLoadLevelStem(WorldOpenFlows.java:424)
	at net.minecraft.client.gui.screens.worldselection.WorldOpenFlows.lambda$upgradeAndOpenWorld$2(WorldOpenFlows.java:379)
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:173)
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23)
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:147)
	at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:127)
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1239)
	at net.minecraft.client.Minecraft.run(Minecraft.java:962)
	at net.minecraft.client.main.Main.main(Main.java:292)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:243)
	at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:278)
	at org.multimc.EntryPoint.listen(EntryPoint.java:143)
	at org.multimc.EntryPoint.main(EntryPoint.java:34)
Caused by: java.lang.IllegalStateException: Adding duplicate value 'NoOpFeature[]' to registry
	at net.minecraft.core.MappedRegistry.register(MappedRegistry.java:105)
	at net.minecraft.resources.RegistryLoadTask.lambda$registerElements$1(RegistryLoadTask.java:72)
	at com.mojang.datafixers.util.Either$Left.ifLeft(Either.java:43)
	at net.minecraft.resources.RegistryLoadTask.lambda$registerElements$0(RegistryLoadTask.java:72)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
	at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
	at net.minecraft.resources.RegistryLoadTask.registerElements(RegistryLoadTask.java:70)
	at net.minecraft.resources.ResourceManagerRegistryLoadTask.lambda$load$3(ResourceManagerRegistryLoadTask.java:51)
	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:739)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:504)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:511)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1450)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2019)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)

Linked issues

Attachments

Comments 0

No comments.

NeunEinser

(Unassigned)

Confirmed

Platform

Important

Custom Worlds, Data Packs, World generation

26.3 Snapshot 1

26.3 Snapshot 2

Retrieved