Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layeredVeinGenerator requires at least 2 veins (crash: Bound must be positive) #2696

Open
2 tasks done
TheModMaker opened this issue Jan 5, 2025 · 0 comments
Open
2 tasks done
Labels
type: bug Something isn't working

Comments

@TheModMaker
Copy link

Checked for existing issues

  • I have checked for existing issues, and have found none.

Tested latest version

  • I have checked that this occurs on the latest version.

GregTech CEu Version

1.6.2

Minecraft Version

1.20.1 Forge

Recipe Viewer Installed

None

Environment

Singleplayer

Cross-Mod Interaction

Unsure

Other Installed Mods

KubeJS (+Rhino+Architectury API)

Expected Behavior

World gen should succeed with custom ore veins.

Actual Behavior

Crash during world generation.

java.util.concurrent.CompletionException: net.minecraft.ReportedException: Exception generating new chunk
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1159) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
	at net.minecraft.server.level.ChunkTaskPriorityQueueSorter.m_143188_(ChunkTaskPriorityQueueSorter.java:62) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.util.thread.ProcessorMailbox.m_18759_(ProcessorMailbox.java:91) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.util.thread.ProcessorMailbox.m_18747_(ProcessorMailbox.java:146) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.util.thread.ProcessorMailbox.run(ProcessorMailbox.java:102) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395) ~[?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
Caused by: net.minecraft.ReportedException: Exception generating new chunk
	at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$27(ChunkMap.java:660) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-6.0.8.jar%23114!/:?]
	at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$29(ChunkMap.java:634) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]
	... 11 more
Caused by: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalArgumentException: Bound must be positive
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2055) ~[guava-31.1-jre.jar%23109!/:?]
	at com.google.common.cache.LocalCache.get(LocalCache.java:3966) ~[guava-31.1-jre.jar%23109!/:?]
	at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4863) ~[guava-31.1-jre.jar%23109!/:?]
	at com.gregtechceu.gtceu.api.data.worldgen.ores.OreGenCache.lambda$consumeChunkVeins$2(OreGenCache.java:85) ~[gtceu-1.20.1-1.6.2.jar%23161!/:1.6.2]
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273) ~[?:?]
	at java.util.stream.WhileOps$1$1.accept(WhileOps.java:99) ~[?:?]
	at java.util.stream.StreamSpliterators$InfiniteSupplyingSpliterator$OfRef.tryAdvance(StreamSpliterators.java:1358) ~[?:?]
	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129) ~[?:?]
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[?:?]
	at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[?:?]
	at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) ~[?:?]
	at java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) ~[?:?]
	at com.gregtechceu.gtceu.api.data.worldgen.ores.OreGenCache.consumeChunkVeins(OreGenCache.java:93) ~[gtceu-1.20.1-1.6.2.jar%23161!/:1.6.2]
	at com.gregtechceu.gtceu.api.data.worldgen.ores.OrePlacer.placeOres(OrePlacer.java:52) ~[gtceu-1.20.1-1.6.2.jar%23161!/:1.6.2]
	at net.minecraft.world.level.chunk.ChunkGenerator.handler$zco000$gtceu$applyBiomeDecoration(ChunkGenerator.java:665) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.world.level.chunk.ChunkGenerator.m_213609_(ChunkGenerator.java:379) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.world.level.chunk.ChunkStatus.m_279978_(ChunkStatus.java:108) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.world.level.chunk.ChunkStatus$SimpleGenerationTask.m_214024_(ChunkStatus.java:309) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.world.level.chunk.ChunkStatus.m_280308_(ChunkStatus.java:252) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$27(ChunkMap.java:643) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-6.0.8.jar%23114!/:?]
	at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$29(ChunkMap.java:634) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]
	... 11 more
Caused by: java.lang.IllegalArgumentException: Bound must be positive
	at net.minecraft.world.level.levelgen.XoroshiroRandomSource.m_188503_(XoroshiroRandomSource.java:63) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at com.gregtechceu.gtceu.api.data.worldgen.GTLayerPattern.rollNext(GTLayerPattern.java:40) ~[gtceu-1.20.1-1.6.2.jar%23161!/:1.6.2]
	at com.gregtechceu.gtceu.api.data.worldgen.generator.veins.LayeredVeinGenerator.generate(LayeredVeinGenerator.java:134) ~[gtceu-1.20.1-1.6.2.jar%23161!/:1.6.2]
	at com.gregtechceu.gtceu.api.data.worldgen.ores.OreGenerator.generateOres(OreGenerator.java:108) ~[gtceu-1.20.1-1.6.2.jar%23161!/:1.6.2]
	at com.gregtechceu.gtceu.api.data.worldgen.ores.OreGenerator.lambda$generateOres$8(OreGenerator.java:101) ~[gtceu-1.20.1-1.6.2.jar%23161!/:1.6.2]
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273) ~[?:?]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
	at java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[?:?]
	at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[?:?]
	at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) ~[?:?]
	at java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) ~[?:?]
	at com.gregtechceu.gtceu.api.data.worldgen.ores.OreGenerator.generateOres(OreGenerator.java:102) ~[gtceu-1.20.1-1.6.2.jar%23161!/:1.6.2]
	at com.gregtechceu.gtceu.api.data.worldgen.ores.OreGenCache.lambda$consumeChunkVeins$1(OreGenCache.java:86) ~[gtceu-1.20.1-1.6.2.jar%23161!/:1.6.2]
	at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4868) ~[guava-31.1-jre.jar%23109!/:?]
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3533) ~[guava-31.1-jre.jar%23109!/:?]
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2282) ~[guava-31.1-jre.jar%23109!/:?]
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2159) ~[guava-31.1-jre.jar%23109!/:?]
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049) ~[guava-31.1-jre.jar%23109!/:?]
	at com.google.common.cache.LocalCache.get(LocalCache.java:3966) ~[guava-31.1-jre.jar%23109!/:?]
	at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4863) ~[guava-31.1-jre.jar%23109!/:?]
	at com.gregtechceu.gtceu.api.data.worldgen.ores.OreGenCache.lambda$consumeChunkVeins$2(OreGenCache.java:85) ~[gtceu-1.20.1-1.6.2.jar%23161!/:1.6.2]
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273) ~[?:?]
	at java.util.stream.WhileOps$1$1.accept(WhileOps.java:99) ~[?:?]
	at java.util.stream.StreamSpliterators$InfiniteSupplyingSpliterator$OfRef.tryAdvance(StreamSpliterators.java:1358) ~[?:?]
	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129) ~[?:?]
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[?:?]
	at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[?:?]
	at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) ~[?:?]
	at java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) ~[?:?]
	at com.gregtechceu.gtceu.api.data.worldgen.ores.OreGenCache.consumeChunkVeins(OreGenCache.java:93) ~[gtceu-1.20.1-1.6.2.jar%23161!/:1.6.2]
	at com.gregtechceu.gtceu.api.data.worldgen.ores.OrePlacer.placeOres(OrePlacer.java:52) ~[gtceu-1.20.1-1.6.2.jar%23161!/:1.6.2]
	at net.minecraft.world.level.chunk.ChunkGenerator.handler$zco000$gtceu$applyBiomeDecoration(ChunkGenerator.java:665) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.world.level.chunk.ChunkGenerator.m_213609_(ChunkGenerator.java:379) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.world.level.chunk.ChunkStatus.m_279978_(ChunkStatus.java:108) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.world.level.chunk.ChunkStatus$SimpleGenerationTask.m_214024_(ChunkStatus.java:309) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.world.level.chunk.ChunkStatus.m_280308_(ChunkStatus.java:252) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$27(ChunkMap.java:643) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-6.0.8.jar%23114!/:?]
	at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$29(ChunkMap.java:634) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?]
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]
	... 11 more

Steps to Reproduce

Add any new ore veins that uses the layeredVeinGenerator and only has one layer. If there are two layers the issue goes away. Add the following scrip:

GTCEuServerEvents.oreVeins(event => {
  event.add('kubejs:test_vein', vein => {
    vein.weight(40);
    vein.clusterSize(20);
    vein.density(0.65);
    vein.layer('deepslate');
    vein.heightRangeUniform(10, 50);
    vein.layeredVeinGenerator(gen => gen.buildLayerPattern(pattern => {
      pattern.layer(l => l.weight(1).mat(GTMaterials.Cassiterite).size(1, 1));
    }));
    vein.surfaceIndicatorGenerator(
        indicator => indicator.surfaceRock(GTMaterials.Cassiterite)
                          .placement('above')
                          .density(0.4)
                          .radius(5));
  });
});

Additional Information

No response

@TheModMaker TheModMaker added the type: bug Something isn't working label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant