Jump to content

Recommended Posts

Posted

Hello! I am trying to genereate carves with my own fluid, bui i confused.

    
@SubscribeEvent
    public static void generate(final BiomeLoadingEvent event) {
        for(LakeType type : LakeType.values()) {
            LiquidsConfig liquidsConfig = new LiquidsConfig(type.getBlock().get().defaultFluidState(), true, 4, 1, ImmutableSet.of(Blocks.STONE));
            ConfiguredPlacement<TopSolidRangeConfig> configuredPlacement = Placement.RANGE_BIASED.configured(new TopSolidRangeConfig(type.getMinHeight(), type.getMaxHeight(), type.getMaxHeight()));
            configuredPlacement.squared();
            configuredPlacement.count(60);
            //lakes provided blockstateconfig
            ConfiguredFeature<?, ?> fluidFeature = registerLakeFeature(type, liquidsConfig, configuredPlacement);
        }
  }

private static ConfiguredFeature<?, ?> registerLakeFeature(LakeType ore, BlockStateFeatureConfig blockStateFeatureConfig,
                                                              ConfiguredPlacement configuredPlacement) {
        return Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, ore.getBlock().get().getRegistryName(),
                Feature.LAKE.configured(blockStateFeatureConfig).decorated(configuredPlacement)
                        .squared().count(ore.getMaxVeinSize()));
    }

Can you help me, how can i generate caves with my own fluid?

Posted

Hi!

I have no Idea about Terrain gen, but these underground lake caves are called aquifers and I think they have nothing to do with lakes. I don't know much about Terrain gen so could be wrong but I'm pretty sure.

Hope this helps :) 

  • Like 1

Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can :D

Also: PLEASE use SPOILERS for logs!

Posted

But i have an error:

public static void generate(final BiomeLoadingEvent event) {
        for(LakeType type : LakeType.values()) {
            LiquidsConfig liquidsConfig = new LiquidsConfig(type.getBlock().get().defaultFluidState(), true, 4, 1, ImmutableSet.of(Blocks.STONE));
            ConfiguredPlacement<TopSolidRangeConfig> configuredPlacement = Placement.RANGE_BIASED.configured(new TopSolidRangeConfig(type.getMinHeight(), type.getMaxHeight(), type.getMaxHeight()));
            configuredPlacement.squared();
            configuredPlacement.count(60);
            //lakes provided blockstateconfig
            ConfiguredFeature<?, ?> fluidFeature = registerLakeFeature(type, liquidsConfig, configuredPlacement);
            event.getGeneration().addFeature(GenerationStage.Decoration.LAKES, fluidFeature);
        }
        for (OreType ore : OreType.values()) {
            OreFeatureConfig oreFeatureConfig = new OreFeatureConfig(
                    OreFeatureConfig.FillerBlockType.NATURAL_STONE,
                    ore.getBlock().get().defaultBlockState(), ore.getMaxVeinSize());

            ConfiguredPlacement<TopSolidRangeConfig> configuredPlacement = Placement.RANGE.configured(
                    new TopSolidRangeConfig(ore.getMinHeight(), ore.getMinHeight(), ore.getMaxHeight()));

            ConfiguredFeature<?, ?> oreFeature = registerOreFeature(ore, oreFeatureConfig, configuredPlacement);
            event.getGeneration().addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, oreFeature);
        }
        List<Supplier<ConfiguredFeature<?, ?>>> features = event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION);

        features.add(() -> ModFeatures.Configured.BLUE_MUSHROOM);

    }


    private static ConfiguredFeature<?, ?> registerOreFeature(OreType ore, OreFeatureConfig oreFeatureConfig,
                                                              ConfiguredPlacement configuredPlacement) {
        return Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, ore.getBlock().get().getRegistryName(),
                Feature.ORE.configured(oreFeatureConfig).decorated(configuredPlacement)
                        .squared().count(ore.getMaxVeinSize()));
    }

    private static ConfiguredFeature<?, ?> registerLakeFeature(LakeType ore, LiquidsConfig liquidsConfig,
                                                              ConfiguredPlacement configuredPlacement) {
        return Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, ore.getBlock().get().getRegistryName(),
                Feature.SPRING.configured(liquidsConfig).decorated(configuredPlacement)
                        .squared().count(ore.getMaxVeinSize()));
    }
    PLASMA(Lazy.of(ModFluids.PLASMA), 8, 3, 40);

    private final Lazy<FlowingFluid> block;
    private final int maxVeinSize;
    private final int minHeight;
    private final int maxHeight;

    LakeType(Lazy<FlowingFluid> block, int maxVeinSize, int minHeight, int maxHeight) {
        this.block = block;
        this.maxVeinSize = maxVeinSize;
        this.minHeight = minHeight;
        this.maxHeight = maxHeight;
    }

    public Lazy<FlowingFluid> getBlock() {
        return block;
    }

    public int getMaxVeinSize() {
        return maxVeinSize;
    }

    public int getMinHeight() {
        return minHeight;
    }

    public int getMaxHeight() {
        return maxHeight;
    }

    public static LakeType get(Fluid block) {
        for (LakeType fluid : values()) {
            if(block == fluid.block) {
                return fluid;
            }
        }
        return null;
    }
    URAN(Lazy.of(ModBlocks.URAN), 8, 3, 40);

    private final Lazy<Block> block;
    private final int maxVeinSize;
    private final int minHeight;
    private final int maxHeight;

    OreType(Lazy<Block> block, int maxVeinSize, int minHeight, int maxHeight) {
        this.block = block;
        this.maxVeinSize = maxVeinSize;
        this.minHeight = minHeight;
        this.maxHeight = maxHeight;
    }

    public Lazy<Block> getBlock() {
        return block;
    }

    public int getMaxVeinSize() {
        return maxVeinSize;
    }

    public int getMinHeight() {
        return minHeight;
    }

    public int getMaxHeight() {
        return maxHeight;
    }

    public static OreType get(Block block) {
        for (OreType ore : values()) {
            if(block == ore.block) {
                return ore;
            }
        }
        return null;
    }

And i have this error:

[16:01:14 ERROR]: Exception caught during firing event: net.minecraft.crash.ReportedException: Feature placement
        Index: 7
        Listeners:
                0: HIGH
                1: ASM: class me.shedaniel.architectury.event.forge.EventHandlerImplCommon event(Lnet/minecraftforge/event/TickEvent$PlayerTickEvent;)V
                2: NORMAL
                3: net.minecraftforge.eventbus.EventBus$$Lambda$2904/0x000000080157e298@36b86623
                4: net.minecraftforge.eventbus.EventBus$$Lambda$2904/0x000000080157e298@53bf9fd7
                5: net.minecraftforge.eventbus.EventBus$$Lambda$2904/0x000000080157e298@7b0f8db8
                6: net.minecraftforge.eventbus.EventBus$$Lambda$2904/0x000000080157e298@67c7818a
                7: ASM: class ru.hollowhorizon.metacraft.core.events.ModEventsFactory playerTicketEvent(Lnet/minecraftforge/event/TickEvent$PlayerTickEvent;)V
                8: ASM: com.thelivan.wm.worldmanager.RegionHookEventHandler@25dbb4bf onTick(Lnet/minecraftforge/event/TickEvent;)V
java.util.concurrent.CompletionException: net.minecraft.crash.ReportedException: Feature placement
        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
        at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1159)
        at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
        at net.minecraft.world.chunk.ChunkTaskPriorityQueueSorter.func_219083_b(SourceFile:58)
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.func_213148_e(DelegatedTaskExecutor.java:89)
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.func_213145_a(DelegatedTaskExecutor.java:133)
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.run(DelegatedTaskExecutor.java:101)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: net.minecraft.crash.ReportedException: Feature placement
        at net.minecraft.world.server.ChunkManager.lambda$scheduleChunkGeneration$18(ChunkManager.java:541)
        at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
        at net.minecraft.world.server.ChunkManager.lambda$scheduleChunkGeneration$20(ChunkManager.java:528)
        at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150)
        ... 11 more
Caused by: java.lang.IllegalArgumentException: bound must be positive
        at java.base/java.util.Random.nextInt(Random.java:322)
        at net.minecraft.world.gen.placement.RangeBiasedPlacement.func_212852_a_(SourceFile:19)
        at net.minecraft.world.gen.placement.RangeBiasedPlacement.func_212852_a_(SourceFile:10)
        at net.minecraft.world.gen.placement.SimplePlacement.func_241857_a(SourceFile:17)
        at net.minecraft.world.gen.placement.ConfiguredPlacement.func_242876_a(SourceFile:24)
        at net.minecraft.world.gen.feature.DecoratedFeature.func_241855_a(SourceFile:22)
        at net.minecraft.world.gen.feature.DecoratedFeature.func_241855_a(SourceFile:14)
        at net.minecraft.world.gen.feature.ConfiguredFeature.func_242765_a(SourceFile:55)
        at net.minecraft.world.gen.feature.DecoratedFeature.func_242772_a(SourceFile:23)
        at java.base/java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
        at net.minecraft.world.gen.feature.DecoratedFeature.func_241855_a(SourceFile:22)
        at net.minecraft.world.gen.feature.DecoratedFeature.func_241855_a(SourceFile:14)
        at net.minecraft.world.gen.feature.ConfiguredFeature.func_242765_a(SourceFile:55)
        at net.minecraft.world.gen.feature.DecoratedFeature.func_242772_a(SourceFile:23)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180)
        at java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104)
        at java.base/java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:711)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at net.minecraft.world.gen.feature.DecoratedFeature.func_241855_a(SourceFile:22)
        at net.minecraft.world.gen.feature.DecoratedFeature.func_241855_a(SourceFile:14)
        at net.minecraft.world.gen.feature.ConfiguredFeature.func_242765_a(SourceFile:55)
        at net.minecraft.world.biome.Biome.func_242427_a(Biome.java:254)
        at net.minecraft.world.gen.ChunkGenerator.func_230351_a_(ChunkGenerator.java:220)
        at net.minecraft.world.chunk.ChunkStatus.func_222605_b(ChunkStatus.java:77)
        at net.minecraft.world.chunk.ChunkStatus.func_223198_a(ChunkStatus.java:198)
        at net.minecraft.world.server.ChunkManager.lambda$scheduleChunkGeneration$18(ChunkManager.java:530)

 

Posted

Hi!

This is the error: 

5 minutes ago, JacobeTerminator said:
bound must be positive

You have somewhere a negative bound that doesn't let minecraft generate the aquifier.
Hope this helps xD

Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can :D

Also: PLEASE use SPOILERS for logs!

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.