Jump to content

Help with an Error


Luis_ST

Recommended Posts

i had creat an mod in 1.16.1 and when i creat a new world i get the following stactrace:

 

java.util.concurrent.CompletionException: net.minecraft.crash.ReportedException: Feature placement
    at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) ~[?:?] {}
    at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319) ~[?:?] {}
    at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1155) ~[?:?] {}
    at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) ~[?:?] {}
    at net.minecraft.world.chunk.ChunkTaskPriorityQueueSorter.lambda$func_219069_a$1(ChunkTaskPriorityQueueSorter.java:44) ~[?:?] {re:classloading}
    at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveOne(DelegatedTaskExecutor.java:95) ~[?:?] {re:classloading}
    at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveWhile(DelegatedTaskExecutor.java:139) ~[?:?] {re:classloading}
    at net.minecraft.util.concurrent.DelegatedTaskExecutor.run(DelegatedTaskExecutor.java:107) ~[?:?] {re:classloading}
    at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1429) ~[?:?] {}
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[?:?] {}
    at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016) ~[?:?] {}
    at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665) ~[?:?] {}
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598) ~[?:?] {}
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) ~[?:?] {}
Caused by: net.minecraft.crash.ReportedException: Feature placement
    at net.minecraft.world.server.ChunkManager.lambda$func_223156_b$18(ChunkManager.java:558) ~[?:?] {re:classloading}
    at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-3.0.25.jar:?] {re:classloading}
    at net.minecraft.world.server.ChunkManager.lambda$func_223156_b$20(ChunkManager.java:545) ~[?:?] {re:classloading}
    at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1146) ~[?:?] {}
    ... 11 more
Caused by: java.lang.IllegalArgumentException: bound must be positive
    at java.util.Random.nextInt(Random.java:388) ~[?:?] {}
    at net.minecraft.world.gen.placement.CountRange.lambda$getPositions$0(CountRange.java:18) ~[?:?] {re:classloading}
    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:699) ~[?:?] {}
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?] {}
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?] {}
    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:497) ~[?:?] {}
    at net.minecraft.world.gen.placement.Placement.func_236963_a_(Placement.java:80) ~[?:?] {re:classloading}
    at net.minecraft.world.gen.placement.ConfiguredPlacement.func_236953_a_(ConfiguredPlacement.java:27) ~[?:?] {re:classloading}
    at net.minecraft.world.gen.feature.DecoratedFeature.func_230362_a_(DecoratedFeature.java:17) ~[?:?] {re:classloading}
    at net.minecraft.world.gen.feature.DecoratedFeature.func_230362_a_(DecoratedFeature.java:11) ~[?:?] {re:classloading}
    at net.minecraft.world.gen.feature.ConfiguredFeature.func_236265_a_(ConfiguredFeature.java:38) ~[?:?] {re:classloading}
    at net.minecraft.world.biome.Biome.func_235061_a_(Biome.java:409) ~[?:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.world.gen.ChunkGenerator.func_230351_a_(ChunkGenerator.java:186) ~[?:?] {re:classloading}
    at net.minecraft.world.chunk.ChunkStatus.lambda$static$9(ChunkStatus.java:77) ~[?:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.world.chunk.ChunkStatus.doGenerationWork(ChunkStatus.java:198) ~[?:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.world.server.ChunkManager.lambda$func_223156_b$18(ChunkManager.java:547) ~[?:?] {re:classloading}
    at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-3.0.25.jar:?] {re:classloading}
    at net.minecraft.world.server.ChunkManager.lambda$func_223156_b$20(ChunkManager.java:545) ~[?:?] {re:classloading}
    at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1146) ~[?:?] {}
    ... 11 more

Link to comment
Share on other sites

this is the code where i think weher is the error

 

package net.luis.cave.world.gen;

import net.luis.cave.Cave;
import net.luis.cave.init.CaveBlocks;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.pattern.BlockMatcher;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStage;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.placement.ConfiguredPlacement;
import net.minecraft.world.gen.placement.CountRangeConfig;
import net.minecraft.world.gen.placement.Placement;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
import net.minecraftforge.registries.ForgeRegistries;

@Mod.EventBusSubscriber(modid = Cave.Mod_Id, bus = Mod.EventBusSubscriber.Bus.MOD)
public class OreGen {
	
	@SubscribeEvent
	public static void generateOres(FMLLoadCompleteEvent event) {
		
		for (Biome biome : ForgeRegistries.BIOMES) {
			
			if (biome.getCategory() == Biome.Category.THEEND) {
			
				genOre(biome, 1, 12, 256, 10, OreFeatureConfig.FillerBlockType.create("ENDSTONE", "end_stone", new BlockMatcher(Blocks.END_STONE)), CaveBlocks.ENDERITE_ORE.get().getDefaultState(), 3);
				
			} else if (biome.getCategory() == Biome.Category.NETHER) {
				
				
				
			} else {
				
				genOre(biome, 15, 8, 50, 5, OreFeatureConfig.FillerBlockType.NATURAL_STONE, CaveBlocks.JADE_ORE.get().getDefaultState(), 6);
				
				genOre(biome, 7, 1, 25, 1, OreFeatureConfig.FillerBlockType.NATURAL_STONE, CaveBlocks.LIMONITE_ORE.get().getDefaultState(), 10);
			
				genOre(biome, 2, 1, 65, 1, OreFeatureConfig.FillerBlockType.NATURAL_STONE, CaveBlocks.ROSITE_ORE.get().getDefaultState(), 1);
				
				genOre(biome, 5, 4, 9, 1, OreFeatureConfig.FillerBlockType.NATURAL_STONE, CaveBlocks.SAPHIRE_ORE.get().getDefaultState(), 2);
				
			}
			
		}
		
	}

	private static void genOre(Biome biome, int count, int bottomOffset, int topOffset, int max, OreFeatureConfig.FillerBlockType filler, BlockState defaultBlockstate, int size) {
		
		CountRangeConfig range = new CountRangeConfig(count, bottomOffset, topOffset, max);
		OreFeatureConfig feature = new OreFeatureConfig(filler, defaultBlockstate, size);
		ConfiguredPlacement config = Placement.COUNT_RANGE.configure(range);
		biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(feature).withPlacement(config));
		
	}

}

 

Link to comment
Share on other sites

1 hour ago, Luis_ST said:

Yes i know but where is negativ number 

If I remember correctly (has been a while since I had math though) 5 - 50 is a negative number. If you check out the getPositions() method in the CountRange class you will see that maximum - topOffset is used at the bound to a nextInt() call, and therefore has to be positive.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.