Fabric API

Fabric API

112M Downloads

Crash on startup

CrypticVerse opened this issue ยท 6 comments

commented

I am making a mod with custom biomes, and it crashes upon joining a world.

Description: Starting integrated server

java.lang.IllegalStateException: Missing key in ResourceKey[minecraft:root / minecraft:worldgen/biome]: ResourceKey[minecraft:worldgen/biome / betterbiomes:maple_forest]

How would I fix this?

commented

Please attach the complete log and mod source code, so that we can determine whose code is buggy. Note, we only accept bug reports for Fabric API here.

commented

@apple502j Where would I post an issue like this?

commented

Note that this was previously posted as a discussion in #3572.

commented

crash-2024-02-03_14.50.02-client.txt
Says something about my OverworldRegion
src for that file:

package net.crypticverse.betterbiomes.world.biome;

import com.mojang.datafixers.util.Pair;
import terrablender.api.Region;
import terrablender.api.RegionType;

import java.util.function.Consumer;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.Biomes;
import net.minecraft.world.level.biome.Climate;

public class BetterBiomesOverworldRegion extends Region {
    public BetterBiomesOverworldRegion(ResourceLocation name, int weight) {
        super(name, RegionType.OVERWORLD, weight);
    }

    @Override
    public void addBiomes(Registry<Biome> registry, Consumer<Pair<Climate.ParameterPoint, ResourceKey<Biome>>> mapper) {
        this.addModifiedVanillaOverworldBiomes(mapper, builder -> {
            builder.replaceBiome(Biomes.FOREST, BetterBiomesBiomes.MAPLE_FOREST);
        });
    }
}
commented

The repo is here

commented

I switched from Kotlin DSL to Groovy DSL, that fixed the problem