Mekanism

Mekanism

111M Downloads

[Datapack] [WorldGen] [Config]

LKD-PIX opened this issue ยท 2 comments

commented

Issue description

Mekanism World Gen configs are clamped to -64 and +320

As of 1.18 Vanilla datapacks allow for worlds up to 2024 blocks tall, from -1024 to +1000.

If such a world is created using a datapack one can't configure the ores to generate in it correctly.

Steps to reproduce

Change a mekanism world.toml option to -256 or something.
Start Sever ( or client ).
Watch your config get reset do default values.

If one uses "above_bottom" to get around this issue mekanism errors hard upon world-generation and deadlocks with the following error in the console:

Error
Error executing task on Chunk source main thread executor for minecraft:overworld
net.minecraft.ReportedException: Feature placement
	at net.minecraft.server.level.ChunkMap.m_214912_(ChunkMap.java:634) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:157) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.server.level.ServerChunkCache$MainThreadExecutor.m_6367_(ServerChunkCache.java:535) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:131) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.server.level.ServerChunkCache$MainThreadExecutor.m_7245_(ServerChunkCache.java:543) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.server.level.ServerChunkCache.m_8466_(ServerChunkCache.java:267) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:751) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:740) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_18701_(BlockableEventLoop.java:140) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:726) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.server.MinecraftServer.m_129940_(MinecraftServer.java:447) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.server.MinecraftServer.m_130006_(MinecraftServer.java:302) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.server.dedicated.DedicatedServer.m_7038_(DedicatedServer.java:165) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:625) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at java.lang.Thread.run(Thread.java:1623) [?:?]
Caused by: java.lang.IllegalArgumentException: Bound must be positive
	at net.minecraft.world.level.levelgen.BitRandomSource.m_188503_(BitRandomSource.java:22) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.util.Mth.m_216287_(Mth.java:937) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at mekanism.common.world.ConfigurableUniformInt.m_214085_(ConfigurableUniformInt.java:22) ~[Mekanism-1.19.2-10.3.8.477.jar%23707!/:10.3.8]
	at mekanism.common.world.ResizableDiskReplaceFeature.m_142674_(ResizableDiskReplaceFeature.java:30) ~[Mekanism-1.19.2-10.3.8.477.jar%23707!/:10.3.8]
	at net.minecraft.world.level.levelgen.feature.Feature.m_225028_(Feature.java:154) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.world.level.levelgen.feature.ConfiguredFeature.m_224953_(ConfiguredFeature.java:27) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.world.level.levelgen.placement.PlacedFeature.m_226362_(PlacedFeature.java:56) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
	at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411) ~[?:?]
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) ~[?:?]
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276) ~[?:?]
	at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411) ~[?:?]
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) ~[?:?]
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276) ~[?:?]
	at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411) ~[?:?]
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) ~[?:?]
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
	at java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180) ~[?:?]
	at java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104) ~[?:?]
	at java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:711) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276) ~[?:?]
	at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411) ~[?:?]
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) ~[?:?]
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276) ~[?:?]
	at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
	at net.minecraft.world.level.levelgen.placement.PlacedFeature.m_226368_(PlacedFeature.java:55) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.world.level.levelgen.placement.PlacedFeature.m_226377_(PlacedFeature.java:44) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.world.level.chunk.ChunkGenerator.m_213609_(ChunkGenerator.java:466) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.world.level.chunk.ChunkStatus.m_223313_(ChunkStatus.java:145) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.world.level.chunk.ChunkStatus.m_223279_(ChunkStatus.java:292) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$25(ChunkMap.java:621) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-5.0.28.jar%2375!/:?]
	at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$27(ChunkMap.java:619) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
	at net.minecraft.server.level.ChunkTaskPriorityQueueSorter.m_143188_(ChunkTaskPriorityQueueSorter.java:62) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.util.thread.ProcessorMailbox.m_18759_(ProcessorMailbox.java:91) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.util.thread.ProcessorMailbox.m_18747_(ProcessorMailbox.java:146) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at net.minecraft.util.thread.ProcessorMailbox.run(ProcessorMailbox.java:102) ~[server-1.19.2-20220805.130853-srg.jar%23865!/:?]
	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1423) ~[?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) ~[?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) ~[?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) ~[?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) ~[?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[?:?]
The server always needs to be terminated when this happens.

Minecraft version

1.19.x or earlier (No longer being developed)

(Neo)Forge version

43.2.23

Mekanism version

10.4.0 (Latest)

Other relevant versions

I made a mod for 1.19.2 Forge
https://modrinth.com/mod/magmatic-exile
The "plus" version can easily be used to test this behaviour, source code is also available, it's fairly basic.

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

No response

commented

you somehow manage to get max - min + 1 to be negative. Sounds like you have an incorrectly configured setup

commented

specifically, the min and max radius of salt